Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions DEPENDENCIES.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ micropython https://github.com/micropython/micropython b70ae1aca6
# is missing; in a workspace modules/<name> is a link to the sibling checkout
# and wins. castif is not here: it lives in modules/castif, tracked in this
# repository.
audiodsp https://github.com/PyDevices/audiodsp.git 8d5c4a0ca69f12425c39c811ae190682655e5805
audiodsp https://github.com/PyDevices/audiodsp.git c0ae8fba81946593698a51aae707cb54989f587e
pygraphics https://github.com/PyDevices/pygraphics.git f97fd2e20e73f23c2138ab52a630cf04b0a7aea1
ulab https://github.com/v923z/micropython-ulab.git 1d3ddd8f5228e2c7335dac71f4846e6abb0ec9f9
ulab https://github.com/v923z/micropython-ulab.git 15e999747079205b2415e71a6aa2840b8f85f9dc

# omnipython-lvgl is not a module directory: it is LVGL, its generated
# bindings and a port per interpreter. --modules names it lvgl ("all" takes it
# too), and a build fetches it at this commit into modules/.omnipython-lvgl (a
# sibling checkout is linked there instead) and compiles the port for its
# interpreter. Move the commit here to move every LVGL build, MicroPython's and
# CircuitPython's.
omnipython-lvgl https://github.com/PyDevices/omnipython-lvgl.git c34fbeeb0440e71acb62c92ddee1c3c65d089622
omnipython-lvgl https://github.com/PyDevices/omnipython-lvgl.git a13f5c75e25b8ba5133d7bf6b7a5b09971e3f5dc

# omnipython-lib is not a module either: it is the repository of our
# Python-only packages (pydevices, palettes, pdwidgets, audioinstruments,
Expand All @@ -39,7 +39,7 @@ omnipython-lvgl https://github.com/PyDevices/omnipython-lvgl.git c34fbeeb04
# repository until the rename. The packages the library builds from other
# repositories (audiocomponents' two) are pinned by tag in its lib-lock.json,
# not here.
omnipython-lib https://github.com/PyDevices/pydevices.git e691f190adf0fe880c67f0a93840895111e1701c
omnipython-lib https://github.com/PyDevices/pydevices.git 7f5069149778cc5214d7abd3f46a0b9f2eab0042

# esp-vision (espressif/esp-vision, Apache-2.0): the source of the tflite
# module and, later, its image stack. modules/.esp-vision/fetch.sh puts it at
Expand Down
8 changes: 7 additions & 1 deletion modules/tflite/examples/tflite_sounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ def log_mel(audio):
rows = np.zeros((count, BANDS))
for i in range(count):
frame[:WINDOW] = audio[i * HOP : i * HOP + WINDOW] * hann
real, imag = np.fft.fft(frame)
# ulab with complex numbers returns one complex array, as numpy
# does; without them it returns the real and imaginary parts.
spectrum = np.fft.fft(frame)
if isinstance(spectrum, tuple):
real, imag = spectrum
else:
real, imag = np.real(spectrum), np.imag(spectrum)
magnitude = np.sqrt(real[: FFT // 2 + 1] ** 2 + imag[: FFT // 2 + 1] ** 2)
rows[i, :] = np.log(np.dot(magnitude, weights) + 0.001)
return rows
Expand Down
4 changes: 4 additions & 0 deletions variants/stm32/ARDUINO_GIGA/DISPLAY_SHIELD/ulab_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
#define ULAB_FFT_HAS_FFT (0)
#define ULAB_FFT_HAS_IFFT (0)
#define ULAB_NUMPY_HAS_ARGSORT (0)
#define ULAB_NUMPY_HAS_BINCOUNT (0)
#define ULAB_NUMPY_HAS_COMPRESS (0)
#define ULAB_NUMPY_HAS_CONVOLVE (0)
#define ULAB_NUMPY_HAS_CROSS (0)
Expand All @@ -111,13 +112,15 @@
#define ULAB_NUMPY_HAS_LOAD (0)
#define ULAB_NUMPY_HAS_LOADTXT (0)
#define ULAB_NUMPY_HAS_MEDIAN (0)
#define ULAB_NUMPY_HAS_MESHGRID (0)
#define ULAB_NUMPY_HAS_POLYFIT (0)
#define ULAB_NUMPY_HAS_POLYVAL (0)
#define ULAB_NUMPY_HAS_ROLL (0)
#define ULAB_NUMPY_HAS_SAVE (0)
#define ULAB_NUMPY_HAS_SAVETXT (0)
#define ULAB_NUMPY_HAS_SIZE (0)
#define ULAB_NUMPY_HAS_SORT (0)
#define ULAB_NUMPY_HAS_TAKE (0)
#define ULAB_NUMPY_HAS_TRACE (0)
#define ULAB_NUMPY_HAS_TRAPZ (0)
#define ULAB_NUMPY_HAS_ACOSH (0)
Expand All @@ -132,6 +135,7 @@
#define ULAB_NUMPY_HAS_REAL (0)
#define ULAB_NUMPY_HAS_SORT_COMPLEX (0)
#define ULAB_NUMPY_RANDOM_HAS_NORMAL (0)
#define ULAB_SCIPY_HAS_INTEGRATE_MODULE (0)
#define ULAB_SCIPY_HAS_LINALG_MODULE (0)
#define ULAB_SCIPY_LINALG_HAS_CHO_SOLVE (0)
#define ULAB_SCIPY_LINALG_HAS_SOLVE_TRIANGULAR (0)
Expand Down
Loading