LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom X scale in spectrogram

Solved!
Go to solution

Hello,

 

What Im trying to do is calculate spectrogam of the signal that is aquiring. (right now I read data from the csv file in quasi -real -time )

I have created a spectrogram using STFT Spectrograms VI. Then I'm using Intensity Graph. The  x Scale depends on the window shift.

 

I would like x scale  of the spectrogram to be the same as the signal that I analyze. Is it posible? I was trying to use Property Node but it was unsuccessuful.

Please help 🙂

 

Thanks!

 

PS: I attached the icture of the piece that is responsible for creating the spectrogram.

0 Kudos
Message 1 of 6
(3,609 Views)

Can you attach that functional part of your code as a VI Snippet? This will allow us to open that block diagram ourselves.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 6
(3,594 Views)

This is the code.

 

I would like the x scale on the spectogram be the same as on waveform Graph.

 

  (Sorry for polish names. I hope this is not a problem. )

 

 

Thanks!

0 Kudos
Message 3 of 6
(3,582 Views)
Solution
Accepted by topic author ola.dysko

I got it to match the x scales by just setting "Parametr okna - beta dla okna Kaisera" to a value of 1. I don't know what any of that means, but you had it set as a value of NaN, so the scaling wasn't working.

 

I don't know if this is exactly how your main code works, but you probably want to wire an empty array in to the feedback node, so that it resets the graphs when the VI is run again.

 

Also, if you're running this VI for a lot of iterations, you're going to get a very large memory allocation at that feedback node over time, so keep an eye on that as well.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 6
(3,568 Views)

Thanks!

 

This parameter is for some kind of windows. Probably Ishouldn't always miltiply the scale by this parameter. Now I understand why it didn't work.

 

What do you mean by feedback node? Where exaclty should I connect it?

I'm quite new to LabView so there are many things that are totally new to me. Sorry for such basic questions

 

 

0 Kudos
Message 5 of 6
(3,555 Views)

Feedback nodes are essentially a memory space to store values from one iteration to the next. That's how you're able to generate the whole graph with new data each time, because you're adding the new data to the old and then storing the bigger array each time. You can see how this would eventually result in a very large array if left for long periods of time. I don't know how you can work around this necessarily because you probably need the whole array to run the spectogram analysis.

 

There's a terminal on Feedback Nodes for Initial Value. If you don't wire anything in there, it uses whatever memory was last in there, so you most likely want to wire an empty array as the initial value to remove any old data. A problem that you might run in to if you don't do this would be if you left the VI open after running a test, then came back later and ran a new test, but now all of your first test data and new test data is combined in the new test.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 6 of 6
(3,547 Views)