PDA

View Full Version : How to make this chart using Spectrogram ?



micamica
5th September 2011, 03:06
6820
Is that possible?

Uwe
5th September 2011, 06:20
Which type of data/samples do you have and how are they related to this image.

Uwe

micamica
5th September 2011, 06:43
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??

Uwe
5th September 2011, 07:08
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

micamica
5th September 2011, 07:40
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

Uwe
5th September 2011, 10:49
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

micamica
5th September 2011, 11:12
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

Uwe
5th September 2011, 12:04
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

micamica
6th September 2011, 03:57
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.

Uwe
6th September 2011, 06:14
plot->enableAxis( QwtPlot::xTop, true );
plot->enableAxis( QwtPlot::xBottom, false );
spectrogram->setAxes( QwtPlot::xTop, QwtPlot::yLeft );

Uwe