Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    ulab.fft.spectrogram performance drops for 8192 points and beyond

    Scheduled Pinned Locked Moved Firmware
    4 Posts 4 Posters 58 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      nteolane
      last edited by

      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-06 provided 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))
      3466
      

      One 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

      robert-hhR K 2 Replies Last reply Reply Quote 1
      • robert-hhR Offline
        robert-hh @nteolane
        last edited by

        @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.

        1 Reply Last reply Reply Quote 2
        • K Offline
          Kinnay21 @nteolane
          last edited by

          @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 ?

          1 Reply Last reply Reply Quote 0
          • rcolisteteR Offline
            rcolistete
            last edited by

            See the topic "Pycom firmwares with single/double precision and ulab module"

            My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

            1 Reply Last reply Reply Quote 1

            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
            • 1 / 1
            • First post
              Last post

            Pycom on Twitter

            Pycom