Re: spectrogram: Is 'nfft' used only to increase frequency resolution?

Fabrice Silva <[email protected]> Mon, 04 Oct 2021 21:03:13 +0200
Newsgroups gmane.comp.python.scientific.user
Message-ID <[email protected]>
Le lundi 04 octobre 2021, [email protected] a écrit :
> Hi,
> 
> Just needed a little clarifications for the spectrogram usage. What
> use would there be in defining 'nfft' when 'window' is defined?
> Assuming the windowing function of choice zeroed out the side values
> already. Is it only to increase frequency resolution? 

Hi,
window and/or nperseg define the number of samples in a segment
(usually called a frame in time-frequency analysis), i.e. the number of
samples that used in a single Fourier transform.
nfft is the number of spectral coefficients that are computed in this
single Fourier transform.

If nfft >len(window) (or nfft > nperseg if no sampled window is
provided),
you are performing the so-called zero-padding that increase the number
of spectral coefs, i.e., the frequency step (what you call frequency
resolution) but does not change the effect of winowing that transforms
a pure sine into a lobe+sidelobes (the bandwidth of the main lobe is
what I call the frequency resolution)...

Fabrice

_______________________________________________
SciPy-User mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/scipy-user.python.org/
Member address: [email protected]