Results 1 to 10 of 10

Thread: How to make this chart using Spectrogram ?

  1. #1
    Join Date
    Jul 2011
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to make this chart using Spectrogram ?


  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: How to make this chart using Spectrogram ?

    Which type of data/samples do you have and how are they related to this image.

    Uwe

  3. #3
    Join Date
    Jul 2011
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to make this chart using Spectrogram ?

    I'm currently developing a echo sounder, echogram. I just want to know how to display depth of the sea every seconds using this chart. I found it Spectrogram is the similar like echogram. But when i saw the example and do some modification, I can only make round object not like as displayed in the picture (this picture is an example of echo sounder) I attached. I'm just curious, do the Spectrogram can display like the picture I attached or I should try it with normal plot??

  4. #4
    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: How to make this chart using Spectrogram ?

    QwtPlotSpectrogram maps raster data ( a matrix of values ) into a QImage.

    Again: which type of data/samples do you have and how are they related to this image.

    Uwe

  5. #5
    Join Date
    Jul 2011
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to make this chart using Spectrogram ?

    Can a matrix make a plot like in the picture? I don't want to use picture, just normal plot with different color like in the picture

    Type of data for depth of water is double, and for the time is normal integer...
    The rest is like the example in Qwt for Spectrogram parts

  6. #6
    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: How to make this chart using Spectrogram ?

    Quote Originally Posted by micamica View Post
    Type of data for depth of water is double, and for the time is normal integer...
    Come on:

    • What is your x axis ( time, depth, ... ? ), what is your y axis and what is mapped to what colors.
    • Do you have an array, a matrix or whatever of what type of samples


    Uwe

  7. #7
    Join Date
    Jul 2011
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to make this chart using Spectrogram ?

    Quote Originally Posted by Uwe View Post
    Come on:

    • What is your x axis ( time, depth, ... ? ), what is your y axis and what is mapped to what colors.
    • Do you have an array, a matrix or whatever of what type of samples


    Uwe
    the x axis is time, the y axis is depth
    the color is what the echo received by sensor to describe sea bottom or fish
    the darker the color the better the echo received (brown/red->good while blue is bad one)
    I haven't make any matrix yet because I don't find any example and good explanation about matrix documentation

  8. #8
    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: How to make this chart using Spectrogram ?

    F.e. an image is a matrix ( 2 dimensional array ) of values ( colors ), where each value represents one pixel. The coordinates ( x1-x2, y1-y2) for each pixel can be calculated from the bounding rectangle of the image an the number of rows and columns. Of course there might be pixels, where you don't have any value, that are mapped to a transparent color.

    In opposite to raster data ( matrix ) you might have an unsorted array of 3D points ( x, y, color ). If this is your situation you have to define how these samples have to be mapped to which area on the plot.

    My guess is, that you want to derive from QwtRasterData and use a QwtPlotSpectrogram. In YourRasterData::value() you have to return the quality of your echo for a specific time and depth. You will have to do some sort of resampling here - maybe some sort of next neighbour. For coordinates, where you don't have any close quality value you will return something invalid, that is mapped to Qt::white or Qt::transparent from your color map.

    Uwe

  9. #9
    Join Date
    Jul 2011
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to make this chart using Spectrogram ?

    Quote Originally Posted by Uwe View Post
    F.e. an image is a matrix ( 2 dimensional array ) of values ( colors ), where each value represents one pixel. The coordinates ( x1-x2, y1-y2) for each pixel can be calculated from the bounding rectangle of the image an the number of rows and columns. Of course there might be pixels, where you don't have any value, that are mapped to a transparent color.

    In opposite to raster data ( matrix ) you might have an unsorted array of 3D points ( x, y, color ). If this is your situation you have to define how these samples have to be mapped to which area on the plot.

    My guess is, that you want to derive from QwtRasterData and use a QwtPlotSpectrogram. In YourRasterData::value() you have to return the quality of your echo for a specific time and depth. You will have to do some sort of resampling here - maybe some sort of next neighbour. For coordinates, where you don't have any close quality value you will return something invalid, that is mapped to Qt::white or Qt::transparent from your color map.

    Uwe
    I have tried using matrix now, and I can see it displays per pixel. Now I must try to put some variable and calculate them. Thanks for your advise Uwe

    One more question, Can I make the bottom x axiz to the top? I mean the ruler-like bar not the label.

  10. #10
    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: How to make this chart using Spectrogram ?

    Qt Code:
    1. plot->enableAxis( QwtPlot::xTop, true );
    2. plot->enableAxis( QwtPlot::xBottom, false );
    3. spectrogram->setAxes( QwtPlot::xTop, QwtPlot::yLeft );
    To copy to clipboard, switch view to plain text mode 

    Uwe

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

    micamica (8th September 2011)

Similar Threads

  1. How to use QWT spectrogram in QML
    By jg in forum Qt Quick
    Replies: 1
    Last Post: 20th May 2011, 09:07
  2. Spectrogram
    By Ronayn in forum Qwt
    Replies: 4
    Last Post: 25th April 2011, 20:14
  3. Replies: 1
    Last Post: 15th December 2010, 13:20
  4. Replies: 9
    Last Post: 16th March 2010, 09:30
  5. get min and max value from spectrogram
    By rambo83 in forum Qwt
    Replies: 1
    Last Post: 2nd December 2009, 14:25

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.