ulab.fft.spectrogram performance drops for 8192 points and beyond
-
Re: Pycom firmwares with single/double precision and ulab module
Hello,
I am using the custom firmware
LoPy4_pybytes_ulab_sp_thread_v1.20.2.rc10-g87b47d16e_2020-08-06provided by user @rcolistete (thanks!).I have a question regarding the speed of the ulab.fft.spectrogram function.
import ulab as np import utime x=np.arange(2048) t1=utime.ticks_ms(); y=np.fft.spectrogram(x); t2=utime.ticks_ms(); print(utime.ticks_diff(t2,t1)) 12 x=np.arange(4096) t1=utime.ticks_ms(); y=np.fft.spectrogram(x); t2=utime.ticks_ms(); print(utime.ticks_diff(t2,t1)) 25 x=np.arange(8192) t1=utime.ticks_ms(); y=np.fft.spectrogram(x); t2=utime.ticks_ms(); print(utime.ticks_diff(t2,t1)) 866 x=np.arange(16384) t1=utime.ticks_ms(); y=np.fft.spectrogram(x); t2=utime.ticks_ms(); print(utime.ticks_diff(t2,t1)) 1995 x=np.arange(32768) t1=utime.ticks_ms(); y=np.fft.spectrogram(x); t2=utime.ticks_ms(); print(utime.ticks_diff(t2,t1)) 3466One can see that there is a large increase in computation time between 4096 and 8192 points long arrays.
I would have expected a delay of around 50 ms for a 8192 points array.Is there any explanation for this?
Anything I could do to get faster computation times for 8192 or even 16384 points long arrays?Thanks in advance for your support!
Nicolas -
@nteolane My explanation would be RAM cache misses. If the RAM usage exceeds a certain limit, then the RAM cache start to miss and the RAM pages have to be swapped in and out from the cache to the SPI RAM (RAM connected by a SPI bus) each swap takes a few 100 µs.
-
@nteolane
Hi,
Where do you find this "LoPy4_pybytes_ulab_sp_thread_v1.20.2.rc10-g87b47d16e_2020-08-06" ?
I would like to use ulab library but I don't find how ? -
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login