Details and rationale are outlined in https://github.com/v923z/micropython-ulab/blob/spectrum/docs/ulab-utils.ipynb, but the gist is that spectrogram now allows for the re-use of allocated memory (through the out, and scratchpad keyword arguments), as well as direct calculation of the logarithm (through the log keyword argument).
from ulab import numpy as np
from ulab import utils as utils
n = 1024
t = np.linspace(0, 2 * np.pi, num=1024)
scratchpad = np.zeros(2 * n) # re-usable RAM for the calculation of the FFT
for _ in range(10):
signal = np.sin(t) # this simulates a measurement of some signal
utils.spectrogram(signal, out=signal, scratchpad=scratchpad, log=True)
@jepler, @dhalbert this might be relevant for circuitpython users.
Details and rationale are outlined in https://github.com/v923z/micropython-ulab/blob/spectrum/docs/ulab-utils.ipynb, but the gist is that
spectrogram
now allows for the re-use of allocated memory (through theout
, andscratchpad
keyword arguments), as well as direct calculation of the logarithm (through thelog
keyword argument).@jepler, @dhalbert this might be relevant for
circuitpython
users.