# frequencies in STFT spectrogram
The help file info for STFT Spectrogram says, in part:
STFT Spectrogram {X} is a 2D array that describes the time waveform energy
distribution in the joint time-frequency domain. The number of rows (time
axis) in STFT Spectrogram {X} is given by the following equation.
# rows = # elements in X / time increment, then rounded down
The number of columns (frequency axis) in STFT Spectrogram {X} is given by
the following equation.
# columns = (# elements in X / 2) + 1, then rounded down
By experimenting I have confirmed that the help file is correct, but I am
surprised that the number of columns (i.e. frequencies in the STFT) is what
it is. If the window size is N (I assume that means N time points are
used to compute each spectrum estimate), then the number of frequencies in the
spectrum should be N/2 + 1, even if the number of elements is much
larger. Can someone clarify?
Thank you.
Maybe all the points in X outside the N point window ARE used, but set to zero.
In essence this would amount to zero-padding an N point long signal to make
it as long as the original signal. Why would this be a good idea? It increases
the computational effort with no increase in actual information about the signal.
It also can make one think the spectrum has a much
higher frequency resolution than it really does have. The spectrum of a zero-padded
time series has no more "real" frequency resolution than the unpadded series -
it is just a resampling, with interpolation, of the spectrum of the unpadded signal.
That's an interesting question. If you open up the STFT Spectrogram Vi to look at the algorithm being employed, you can look at exactly what process is going on. It does appear as though a type of zero-padding is being used.
Zero-padding before the FFT to a power of 2 would actually decrease processing time due to the FFT algorithm used, but that doesn't seem to be the rationale here.
Jarrod S.
National Instruments
Similar Messages
-
TFA STFT Spectrogram (waveform) VI
Hello, Can you give me the formula for the calculation of the spectrogram in the TFA STFT Spectrogram (waveform) VI?Right Click->Help: There is no detailed information about the math used in this VI.Please, see attachment. Regards, asipers
elset191 wrote:
truplicate post
... sigh
Cory K -
TFA STFT Spectrogram: log scale on frequency axis
Hi,
I'm trying to get my spectrogram to display a logarithmic scale on the frequency axis, but whenever I go to the graph properties->y-axis, turn off autoscaling, check the log scale box, hit okay, and then run the vi, I still have a linear scale. I tried creating a property node for the spectrogram's y-axis and setting the scale to logarithmic, but this doesn't work either. Does anyone have any suggestions?
Thanks a lot,
Chris K.
Attachments:
Front Panel.png 267 KBlog (0), log (1), log (2), log(3), ... ?
The Intensity graph uses the array indices (0,1,2,3,...) for the axis, not the values of Y. If your frequencies are 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, ..., you would need an array with >=1001 elements to get the axis values where you wanted them and it would still plot the axis linearly. You can certainly put the Z-values for frequency 10 in the 4th column of the array. To get the labels to display the Y-axis frequencies might require overlaying an X-Y graph with logarithmic mapping of the Y-axis on the Intensity graph. By making the appropriate parts transparent, you should be able to get the Y-axis display you want. Tedious, but probably not too difficult.
Lynn -
Any example code for WVD spectrogram in labview ?
I heve been trying to implement the WVD spectrogram in my vi with no luck. Can't find any examples on how to do it.
Look at the Functions palette >> Analyze >> Signal Processing >> Frequency Domain >> WVD Spectrogram.vi.
This is in LV 7.1.1 Full.
The WVD uses a different kernel than the Fourier transform and works well with rapidly changing signals. The major disadvantage is the large amount of spurious signal that appears in the spectrogram.
Lynn -
How to connect read sound file from chart to Moving STFT PtByPt
Hi!
I got aHi sean1985,
The Sound File Read Simple.vi returns the data as an array of waveforms, while the STFT Spectrogram PtByPt.vi accepts a single waveform. In order to pass the data from Sound File Read Simple.vi to STFT Spectrogram PtByPt.vi, you will need to index into the array and pass each individual waveform to STFT Spectrogram PtByPt.vi from the array of waveforms that is generated by Sound File Read Simple.vi.
Thanks,
Jonathan C
Staff Application Engineering Specialist | CTD | CLA
National Instruments -
Darren's Occasional Nugget 07/17/2014
Today's nugget has to do with Intensity Graphs and Intensity Charts. By default, they have a blue color map for the Z scale:
If you want to reconfigure the colors, you can right-click any of the numbers in the Z scale and choose Marker Color. It is also possible to programmatically manipulate the scale with the Color Table property of the Intensity Graph/Chart.
I have attached a VI below called Intensity Color Tables.vi that allows you to select between several pre-defined color maps for your Intensity Graphs and Charts. The VI generates the Color Table array that can be wired to the Color Table property. I think my favorite color map is "fire":
Check out the demo VI (in LabVIEW 2009 or later) to see the Intensity Color Tables.vi in action.
Darren Nattinger, CLA
LabVIEW Artisan and Nugget Penman
Attachments:
Intensity Color Tables.vi 28 KB
demo_Intensity Color Tables.vi 26 KBAnd this shipping example shows an practical usage of this feature:
C:\Program Files (x86)\National Instruments\LabVIEW 2013\examples\Signal Processing\Transforms\STFT Spectrogram Demo.vi
Barp - Control and Simulation Group - LabVIEW R&D - National Instruments -
Short time fourier transform (STFT) frequency axis
Could someone please explain the frequency axis output of the short-time fourier transform spectrogram? The help menu indicates that the number of output columns will be equal to (# of input samples)/2. I would expect that the number of output frequency bins would be equal to half the size of the fft and that the bin width would be determined by the sample rate.
STFT is implemented using the windowed Fourier transform. Before applying the Fourier transform, the windowed signal can be zero-padded to get the same length as the input signal. So in this case, the FFT length is equal to the signal length. Such zero padding can get a smooth spectrogram for the detailed visual investigation of frequency contents.
NISH DSP
Medical ultrasound and signal processing -
STFT: Spettrogramma, frequency bins
Cari ragazzi, vorrei chiedere la seguente cosa. Vorrei capire il significato di due parametri della STFT: il frequency bins e il time steps che sono due parametri che bisogna impostare quando si opera con la STFT. Da come ho capito il frequency bins è legato alla frequenza di campionamento, corretto? Qualcuno è in grado di dirmi qualche altra cosa? Qualcuno di buona volontà mi potrebbe spiegare se c'è qualche relazione tra la frequenza del segnale a cui si opera e il frequency bins? C'è una relazione che ci permette di dire, per esempio: a tot frequenza (60khz per esempio) utilizza un frequency bins di questo tipo (il valore di default è 512, per esempio) e così via. Insomma vorrei maggiori dettagli per capire a fondo questo parametro e quindi, di conseguenza, saperlo anche modificare con esattezza quando occorre. Da quello che ho capito è che maggiore il frequency bins migliore è il campionamento del segnale e quindi più fedele è la STFT. Ma questo vale sempre? Anche a frequenze basse ha senso prendere un frequency bins molto elevato? In questo caso non potrebbe essere controproducente in quanto poi si diventa troppo sensibili anche a piccole oscillazioni? Insomma vorrei essere fatto, se possibile, un pò di chiarezza in merito.
Per quanto riguarda invece il time steps, da come ho capito, va a modificare il deltat temporale tra un punto ed un altro, nel campionamento, corretto? Insomma anche qui bisogna capire bene che valore prende e come fare in modo di mettere il valore corretto? Quali sono i parametri principali che influenzano la scelta di questi valori?
P.S Ma il multipleier, del blocco offset e multipleier, per esempio quello dell asse x di un grafico,è legato al deltax tra un punto e un altro corretto? In pratica mi fornisce l'incremento della variabile sull' asse x o y a seconda dei casi?
Grazie mille a chi mi può aiutare.Dear Pine,
I am very grateful for your help. You are wonderful.
Juan thanks to you as well.
I could make the VI work and got the same plot you attached.
My last questions,
I tried connecting an array but got some numbers I cannot understand. What I am seeing here?
Second I tried using this VI with my real data set and the plot looked little strange.
If you could try it one more time and tell me your opinion I will be very happy.
Scan rate for the attached file is 300 hz.
Thank you very much.
Attachments:
STFT example_2.vi 1084 KB
filtered velocity_cylinder2.txt 134 KB -
Stft, frequency extraction
Hi,
I am acquiring data which has varying frequency in it. I have 7500 points (scan rate is 300 Hz but will be higher like 10000 Hz later). I need to save the data divisions with the same frequency. I thought I should use some kind of STFT. I am new on this and I tried to work on an example vi but could not get anything. I could not get it work and I also do not know how to get frequencies and the data set it belongs to in STFT.vi.
Any help will greatly appreciated.
Thank you.
ilterDear Pine,
I am very grateful for your help. You are wonderful.
Juan thanks to you as well.
I could make the VI work and got the same plot you attached.
My last questions,
I tried connecting an array but got some numbers I cannot understand. What I am seeing here?
Second I tried using this VI with my real data set and the plot looked little strange.
If you could try it one more time and tell me your opinion I will be very happy.
Scan rate for the attached file is 300 hz.
Thank you very much.
Attachments:
STFT example_2.vi 1084 KB
filtered velocity_cylinder2.txt 134 KB -
Stft from sound input VI dat to plot spectrogra​m, whats wrong?
Hi everybody,
I listen continously
via a microphone and sound card to 25ms long pulses in the range of
9kHz to 12kHz. I get 10000 samples from my Sound Input VI and use the
STFT Spectogram to plot a spectrogram(frequency versus time). Using the
default settings or any other window lengths results into the error
message:"...possible reasons: invalid windows length".
What's wrong?
Thank you very much,
MartinHey Brian,
I would like to listen to 25ms long pulses in the range of
9kHz up to 14kHz
+by using a microphone and a standard PC sound card
+continuously up to 1.5 hours.
The VI should display a real-time spectrogram(frequency versus time) like in the example VI "Moving STFT PtByPt.vi". It is important that the spectrogram always shows the last 5 minutes and the current frequencies. It is not necessary that the spectrogram is very real-timed(up to 600ms delay is ok), BUT it has to be 100% CONTINUOUSLY to not miss any of the short 25ms long pulses.
In addition I also would like to determine the frequencies of the received pulses, which are somewhere between 9kHz and 14kHz and I need to count the amount of received pulses.
My issues are:
1. missing some 25ms pulses due to problems with continuous sampling of SI Read VI in a while loop(I guess there is a small break between the 1000 samplesets)
2. How connect SI Read VI output to STFT VI or STFT PtByPt VI to perfom moving spectrogram?
3. Why doesn't show my spectogram no frequenciues at all?
I hope this helps to understand what I try to achieve and in what problems I have run.
Here is a corrected and more use-friendlier version of my VI.
Thank you very much,
Martin
Attachments:
spectrogram_NI.vi 142 KB -
hi,
I am trying to use the STFT to plot the spectrogram of a signal. The signal was sampled at 50000. I am down sampling it to 3000 samples per second and feeding it to the STFT module. Here is what the vi looks like
signal -> resampler(to 3000 samples/s) ->STFT->intensity plot
What would be the optimum settings for the STFT as far as the following go,
Window:
Window Size:
Time Steps:
Frequency Bins:
I have the intensity graph set up to use auto scaling for now.
Thanks in advance.Your image links point to your C: drive and only you can see them. We don't have access to your drive.
You should attach images or host them on a public server.
LabVIEW Champion . Do more with less code and in less time . -
Analysis of the microphone signal-frequency band
Hi
I made a program to analyze the signal from the microphone (FFT, STFT) but I have one thing to do. I have a graph amplitude-time
I need to change the signal frequency for example 50 Hz for example by moving the slider that on the chart were waveforms amplitudes in certain frequency bands.
How to choose the frequency of the signal to change the band on the graph?
Thank for help.In your analysis results, what is the delta frequency between datapoints? Just increment through the array of amplitude values. For example, if your datapoints are 5Hz apart, simply index out every 10th value in the amplitudes. If the increment is a non-integer value, you will need to do some interpolation, but other than that the process is basically the same.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
Frequency Analysis on Adobe Audition CS5.5 for bioacoustics research
Hi everyone,
In need of some help.
I research whale/dolphin sounds, and have previously used Raven Pro for analysis. Ive found Adobe Audition produces a much better spectrogram (think it must be the FFT algorithm) and allows me to visualize a lot of whale calls that I may have missed previously by visual inspection on other software.
I need to measure these calls. Basically I need the duration (seconds), minimum frequency (kHz), maximum frequency (kHz) etc.
I have played around with the Frequency Analysis tool in Adobe Audition, and this cannot compute these figures for me at all. In Raven, it was extremely user friendly, and all you had to do was highlight the call by moving your cursor over and selecting the call, and in the left hand window, it would tell you the min F and max F and duration for that swatch that you had highlighted. Is there any way of doing this in Adobe? I know you can visually see on the right hand side the Frequency axis- but it doesn't give you the exact frequency i.e. I need it to be to 2 decimal places eg. 2.12 kHz minimum etc.
I have inserted a screen grab of what I mean when you "highlight the call".
Is there any way of doing this? I would be incredibly surprized if Adobe Audition does not have the ability to do so. But I have read through the manual and gone through a lot of threads and just can't find any information on it. Any help would be greatly appreciated!!!!!!!
Thankyou so much in advance
Bec.
p.s. Whilst Im asking, is there anyway to change the time format in the "Selection/View" box? Ive seen you can display it many many ways, but I need it in seconds, and the most sensible time format is mm:ss.ddd. Is there anyway I can change it to just ss:ss? There are a bunch of options for frame times, but nothing else for actual time.becbioacoustics wrote:
I need to measure these calls. Basically I need the duration (seconds), minimum frequency (kHz), maximum frequency (kHz) etc.
I have played around with the Frequency Analysis tool in Adobe Audition, and this cannot compute these figures for me at all. In Raven, it was extremely user friendly, and all you had to do was highlight the call by moving your cursor over and selecting the call, and in the left hand window, it would tell you the min F and max F and duration for that swatch that you had highlighted. Is there any way of doing this in Adobe? I know you can visually see on the right hand side the Frequency axis- but it doesn't give you the exact frequency i.e. I need it to be to 2 decimal places eg. 2.12 kHz minimum etc.
I have inserted a screen grab of what I mean when you "highlight the call".
Is there any way of doing this? I would be incredibly surprized if Adobe Audition does not have the ability to do so. But I have read through the manual and gone through a lot of threads and just can't find any information on it. Any help would be greatly appreciated!!!!!!!
When you highlight a section, in the bottom right corner of the screen you'll find the timing section, and in there the box marked 'duration' will show you exactly how much time you've highlighted. In Frequency Analysis, the way to note highest and lowest frequencies is, unfortunately, manual and involves finding them with the cursor and noting the cursor information (under the display). If you open the advanced window, you'll get more information, including the level of the frequency at the cursor position. Also there's a bug in the display (or more to the point, the way it's calculated) which means that if you highlight just one section in the spectral view, this isn't what the Frequency Analysis display shows - I'm reporting that one.
p.s. Whilst Im asking, is there anyway to change the time format in the "Selection/View" box? Ive seen you can display it many many ways, but I need it in seconds, and the most sensible time format is mm:ss.ddd. Is there anyway I can change it to just ss:ss? There are a bunch of options for frame times, but nothing else for actual time.
No I'm afraid there isn't. I did try a cheat to see if I could at least get the timeline to do this, but that won't work either. Yes I think it should be there as an option too... -
Is there any way to perform time-frequency analysis(spectrogram ) in DIAdem? Ideally, I got like to play the waveform in one section of the VIEWER and other section of the VIEWER would have the spectrogram of the data within the band cursor.
Does anyone think this is possible in DIAdem?Hi Neuropotential,
What you're asking for is possible, but it's not an out of the box feature. We have a posted example application for doing joint time frequency analysis in REPORT at
http://zone.ni.com/devzone/cda/tut/p/id/3549
You could set the same sort of thing up in VIEW with the new 3D Contour Area available in VIEW in DIAdem 11.1. I'm curious how you'd like the interactive part to work in VIEW and also how large your data sets are.
Brad Turping
DIAdem Product Support Engineer
National Instruments -
Need control component to draw spectrogram with Componentworks++
I'm a graduate student of University of Notre Dame.
Currently we are developing a software for signal processing. We are interested in the componentworks++ for its capability of processing and displaying. We need to do some time-frequency analysis and display the result real-time. First we do FFT analysis and display the result. The x-axis is time domain and y-axis frequency domain. The color of the line denote the strength of a frequency point. It's called Spectrogram. We want the graph can scrolling in time domain, So it's like the time is running. But we don't
know wether there are any component we can use draw this graph. The file attached is a Spectrogram plotted by Matlab. We want to use it t
o illustrate our purpose. Now we're evaluate your software. If you have such component, we may buy your software immediately.
Thanks a lot! Hope to receive your reply.
Attachments:
spectrogram.jpg 48 KBHello
You can obtain a similar intensity graph by using the 3dgraph surface plot. There is an example that demonstartes how to do this
Plotting Intensity Using a Measurement Studio 3D Graph Control
Its a VB example, but it uses the same 3dgraph activex control that is used in VC++, so the concept is the same.
I would recommend obtaining free evaluation version of Measurement Studio and trying it out to see whether it meets your specs. Try this link to obtain a demo version.
I hope this helps
Bilal Durrani
NI
Bilal Durrani
NI
Maybe you are looking for
-
Hi Frnds, This is my first time to work in PDF print forms. I am using standard interface and program to print my PDF forms. The PDF form alone is customised. I need to format my date as dd-mmm-yyyy. how can i do it? can i call a subroutine from a Zp
-
Access PSPAR in USER EXIT EXIT_SAPFP50M_001 - include ZXPADU01
Hi, Is it possible to access PSPAR in include ZXPADU01???? (PBAS0001 Enhancement) I want the variable ACTIO from PSPAR. In debugging mode when i tried ()PSPAR-ACTIO it s working, but when i tried it in report, showing error. ( '(' must follewed by a
-
How to get the system date as a session attribute?
Hi all, How can i get the system time and date to a session? This is my code: String startDate=<How will i get (system date) here?>; session.setAttribute("startDate",startDate); String startTime=<How will i get (system time + 1hr) here?>; session.set
-
It seems that Indesign does not handle blanks in a data source well. We are using xslt to break-up a large XRL file into localised versions. However we have to add a bit of junk to every blank field, which then needs to be removed in Indesign. Has an
-
Default Config Register for 4507 ?
what the Defult Config Register for 4507 ? this was Question and the answer was as below When supervisor cards are shipped out from the factory, the config-register is set to 0x2101. The value of 0x2101 means "ignore the boot variable string and b