From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

STFT

 I would like to know  how to use the stft vi to display the spectrum. i have found one vi in the website by name "Moving stft pt.by pt". which calculates point by point  stft and displays the spectrum  but it gives incorrect readings for frequency level above 0.5 .Can somebody help me i am a new user in labview!!

0 Kudos
Message 1 of 5
(2,693 Views)

Well, LabVIEW has two different STFT, one plain and one pt-by-pt. Both have plenty of tuning paramters (sampling, windowing, etc.) that you might need to adjust for your particular situation.

 

It is difficult to understand what you mean by "incorrect readings for frequency level above 0.5", especially since you don't even give any units for that value.

 

Can you attach a VI containing some typical data, then tell us why you think the result is incorrect and what you think should be the correct result.

 

 

Message 2 of 5
(2,682 Views)

Thanks Kudos!

 

Please find the VI attached .Here if i change the frequency input to the ptbypt sinewave say to 2 or 3 or 10, the spectrum displayed at the output of the STFT is incorrect , even though i scale the spectrum display appropriately .

 

0 Kudos
Message 3 of 5
(2,672 Views)

Since your time increment is 1 (you tap into [i]), the niquist frequency is 0.5 and anything above will give you an alias frequency. Why don't you place a chart indicator on the output of the "sine ptbypt" and you will see that e.g. with a frequency of "1", you are getting a flat line. You are sampling only once per period.

 

You are running the loop at 10ms increments, so you should divide [i] by 100 before wiring it to the sine "time" input. You can open the sine VI and look at the code, it is trivially simple. Good luck! 🙂

0 Kudos
Message 4 of 5
(2,651 Views)

Thanks kudos!!

I think  i would be able to do it now.

Thanks again.

0 Kudos
Message 5 of 5
(2,619 Views)