Results 1 to 7 of 7

Thread: Reduce number of plotted points in spectrogram plot

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2016
    Posts
    4
    Thanks
    1
    Qt products
    Qt5

    Default Reduce number of plotted points in spectrogram plot

    Hello,

    we are using the spectogram plot to display a 2D Matrix with about 13000x64 values and i would like to optimize the plot speed (currently about 10 fps). Because there are only 1920px pixel in width (display size), much time is wasted to try to plot pixels which physically can't be displayed.

    We are also using the magnifier, zoom and pan widget to zoom into an area of interest, therefore i can't modifiy the matrix size.

    I looked into the source code but i can't really find the place to change the behaivor of qwt_plot_spectrogram. My goal is to reduce the number of plotted points to the size of the displayed canvas.

    Does anybody how i can make this possible?

    Many thanks in advance.

    Best regards,
    Kevin

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Reduce number of plotted points in spectrogram plot

    Quote Originally Posted by hberg539 View Post
    we are using the spectogram plot to display a 2D Matrix with about 13000x64 values and i would like to optimize the plot speed (currently about 10 fps). Because there are only 1920px pixel in width (display size), much time is wasted to try to plot pixels which physically can't be displayed.
    No QwtPlotSpectrogram runs over the pixels ( in paint device resolution ! ) requesting a value for each pixel from the raster data object.

    The resolution of the data only matters if it is lower than the paint device resolution. To have this optimization you need to tell the spectrogram about the resolution by implementing QwtRasterData::pixelHint(). When using QwtMatrixRasterData this implementation is available out of the box. See http://qwt.sourceforge.net/class_qwt...a1e7efe97d39d6

    Having a valid QwtRasterData::pixelHint makes a lot of sense in your case as it limits the number of requests ( and color interpolations ) from 1920 x 1920 to 1920 x 64 !
    But keep in mind, that 1920 x 64 still means 122880 pixels that need to be calculated and then scaled to 1920 x 1920.

    I recommend to have a look at Qwt from SVN trunk, where the spectrogram has some performance improvements. In qwt_plot_spectrogram.cpp you can enable DEBUG_RENDER to get some performance debug printouts you can check with the spectrogram example. The performance of your plot should be better compared with the example as your data resolution is horizontally always less than the screen resolution. If it is worse you should have a closer look at your color map and/or raster data object.

    Uwe

Similar Threads

  1. Replies: 3
    Last Post: 16th December 2015, 19:39
  2. How do I reduce the size of the plot?
    By Helena in forum Qwt
    Replies: 1
    Last Post: 13th November 2013, 07:53
  3. Rendering a qwt plot spectrogram
    By moijhd in forum Qwt
    Replies: 4
    Last Post: 23rd July 2013, 11:06
  4. Replies: 5
    Last Post: 17th June 2011, 17:53
  5. Spectrogram Plot Hints
    By shargath in forum Qwt
    Replies: 2
    Last Post: 25th February 2009, 11:11

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.