06-27-2011 04:58 PM
Hello,
I have just recently begun to delve into LabView, and I have what I imagine to be a pretty basic question here. I am using LabVIEW 8.5.
I am using the Acquire Sound VI to get data from an external microphone, and I can convert the dynamic data to a waveform, display that waveform on a basic waveform chart, and also perform and display the FFT frequency spectrum.
What I cannot figure out, however, is how to feed this waveform data into the STFT Spectrogram VI (and then into an Intensity Graph) so that I can see the time/frequency amplitude behavior.
Ideally, I would like a real-time spectrogram that takes data over at least 5 seconds, but just as well would be a spectrogram that is created after the program is run and then stopped. Please help out a newbie here. I appreciate it.
I have attached the basic sound input VI that I'm trying to make the spectrogram from.
Solved! Go to Solution.
06-28-2011 01:54 PM
Hi Zed8,
The function that you will have to use is the Get Waveform Components and from there, you will be able to wire the Y component to the STFT Spectrogram VI and then into an intensity chart. Here is a screen shot with red squares around what I modified in your code and attached the modified code. I added timing since this is just a good programming practice. I hope this helps!
Kim W.
06-28-2011 05:22 PM
Thanks Kim. That is pretty close to what I wanted. I ended up finding a simpler way to get waht I wanted (an accurate spectrogram over a period of as many seconds as the program runs) without using the STFT at all.
05-14-2012 11:09 PM
Hi Zed8,
I am new to Labview and I am on a project to measure sound. I tried to practice on your last block diagram but I seems to stumbled on an issue. The vrms output is a single dimensional array whereas the intensity chart is expecting a double dimension array. I have attach the vi for clarification. Will appreciate if you could kindly show me where did I go wrong.
Thanks
Abu
05-15-2012 02:17 PM
Hi Crawling,
You need to enable auto-indexing on the output tunnel of your data to the spectrogram.
DylanC
05-16-2012 10:14 PM
Dear DylanC,
By having auto-indexing on which is set off at default in a while loop, each iteration will add the time dimension, converting the single dimension array (Vrms) into a two dimensional array (vrms, t). Now I can continue my crawl to my next stop.
Thanks DylanC.
Crawling.
02-19-2013 10:11 AM
Guys,
This was very supporting and efficient.
I am doing a range measurement in meters with the STFT. I would like to change the frequency axis of the STFT according to a certain frequency resolution.
For example each 100 Hz equals to 1 meter, so that the Frequency component is shifted accordingly and the values are in the Y-Axis.
How do I do that?
Is there a way to set markers on the Frequency plot as well as on the STFT plot and read them out as Indicators?
Many thanks in advance
Y3G
02-20-2013 06:18 PM
What is the specific VI that you're using when you refer to STFT? And how are you plotting it?
02-21-2013 08:43 AM
Hello to All,
I have continued and have added some STFT charts and some more questions, attached is my code and a picture.
1) How do I modify the X-Axis of the POwer spectrum according to my input Frequency. I am doing this with a Function Generator and getting wrong Results.
2) Why do you put the FFT PropertNode XScale.Multiplier the value 1.33?
3) The Time Waveform starts with an offset, How can I change it?
4) ...and as mentioned before I would like to use the STFT but have difficilties to get the correct values even when wanting to show the correct Frequency as in the FFT Power spectrum. Can anyone explain tome what I am doing wrong?
Many thanks in advance
Y3G
02-22-2013 05:03 PM
Hey Y3G,
Can't you just use a property node with the Xscale.maximum for the x axis?
Also here a link on how to change the offset of a waveform
Hope that helps