LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

# 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.
0 Kudos
Message 1 of 3
(2,918 Views)

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
Message 2 of 3
(2,883 Views)

Good point about the computational advantage of doing the FFT of 2^m points, when m=integer.  But as you say that does not apply here, because even a signal with N=2^m gets zero padded.

Do you know how the WVD spectrogram differs from the STFT?  I have looked at the guts of WVD spectrogram.vi.  I can't follow it all.  I wonder how many points it uses for each spectrum and how the spectra differ from those of the much-easier-to-understand STFT.

0 Kudos
Message 3 of 3
(2,876 Views)