Results 1 to 5 of 5

Thread: Spectrogram

  1. #1
    Join Date
    May 2010
    Posts
    24
    Thanks
    14
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Spectrogram

    Hello,

    I am trying to understand the QwtPlotSpectrogram class, but I am having some trouble. I'd like to explain what I am trying to do, and then follow that with some questions.

    I have data in the form of a 2D array of byte. The X and Y dimensions of the array are variable, X can be anything between 1 and 700, and Y can be anything between 1 and 3000. The values of the array represent amplitude, and are in the range of 10 to 200.

    I'd am trying to use QwtPlotSpectrogram to display this data (see code attachments) and I am working from the example provided in the Qwt tarball. My questions revolve around the QwtRasterData; which as I understand it, I must subclass and fill in the virtual functions.

    My questions are:
    1) In the value() function, X and Y are the indicies I am to use into my 2D array. What determines their min/max values?
    2) What determines how many times value() is called? I have test data with 32 columns and 55 rows, but value() is called more than 1760 times for it.
    3) Does the range() function set the min/max values of the data or the data's dimensions?
    4) In the constructor I pass a QwtDoubleRect. What are the four arguments to the QwtDoubleRect supposed to be if my data is 32 columns by 55 rows?
    5) When trying to modify the example code, I produced a spectrogram that doesnt mesh to the plot its in. Is that fixable? (see plot image)

    Finally, I just want to say thanks to the author of Qwt. I think its an awesome toolbox, and I've been using it for years (finally upgrading from version 0.4.1 to 5.0.2!)
    Attached Images Attached Images
    Attached Files Attached Files

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

    Default Re: Spectrogram

    I recommend to try Qwt6 ( from SVN trunk ) and check QwtMatrixRasterData. The rasterview examples shows how to use it.

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    Ronayn (4th April 2011)

  4. #3
    Join Date
    May 2010
    Posts
    24
    Thanks
    14
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Spectrogram

    Thanks very much. I will download and examine the example. I am not sure though if I can use Qwt6 with my system (the version of QT I am using is set in stone), but I will figure something out.

  5. #4
    Join Date
    May 2010
    Posts
    24
    Thanks
    14
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Spectrogram

    I've download Qwt6 and have been working on understand QwtMatrixRasterData. While I can create a single spectrogram with it using preloaded data, I cant seem to update (change) it with new data. Do I have to delete the instance of QwtMatrixRasterData and create a new one each time I want to update my plot? Or do I delete the spectrogram and recreate that and then the QwtMatrixRasterData?


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

    Default Re: Spectrogram

    At least you have to invalidate the cached image, when you change your data behind the back of your spectrogram item.

    See http://qwt.sourceforge.net/class_qwt...6cfbd509ef65b5

    Uwe

Similar Threads

  1. Incremental Spectrogram...
    By uppu in forum Qwt
    Replies: 11
    Last Post: 13th April 2011, 13:47
  2. get min and max value from spectrogram
    By rambo83 in forum Qwt
    Replies: 1
    Last Post: 2nd December 2009, 14:25
  3. zoomer in spectrogram example
    By rambo83 in forum Qwt
    Replies: 0
    Last Post: 1st December 2009, 09:06
  4. scrolling spectrogram
    By mcarter in forum Qwt
    Replies: 2
    Last Post: 30th November 2009, 14:22
  5. qwt spectrogram example
    By rambo83 in forum Qwt
    Replies: 2
    Last Post: 17th November 2009, 21:13

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.