0
$\begingroup$

In the paper about speaker verification I can read that

Two quantities have to be set: the length of the window and the shift between two consecutive windows. For the length of the window, two values are most often used: 20 milliseconds and 30 milliseconds. [...] For the delay, the value is chosen in order to have an overlap between two consecutive windows; 10 milliseconds is very often used.

and later

Once an FFT algorithm has been chosen, the only parameter to fix for the FFT calculation is the number of points for the calculation itself. This number N is usually a power of 2 which is greater than the number of points in the window, classically 512.

However, in the matplotlib's specgram I can only see NFFT and noverlap parameters which, according to the documentation, correspond to the second quotation.

How can I then set the window's length or what is the default value of it?

$\endgroup$
1
$\begingroup$

You can set the window length either by setting NFFT = window_length_in_seconds * sample_rate, or, for shorter windows than this, by using a window function of length NFFT where a portion of that length is zero padded.

$\endgroup$
1
$\begingroup$

You'd generally do the FFT without zero padding, i.e. window size == FFT length.

Having an FFT larger than the window leads to an interpolation, but doesn't add any information to the signal, and that's only useful in certain cases – maybe the paper presents one such case.

$\endgroup$
  • $\begingroup$ So it means that by default the window's length is 256 ms in matplotlib's specgram? $\endgroup$ – Colonder Aug 26 '18 at 12:30
  • $\begingroup$ no. The default window length is in samples, not in seconds! $\endgroup$ – Marcus Müller Aug 26 '18 at 12:31
  • $\begingroup$ So 256 samples over the entire signal? Say, in 10 s signal it would roughly mean that a sample is collected each 40 ms? $\endgroup$ – Colonder Aug 26 '18 at 12:36
  • $\begingroup$ I don't know how your signal is sampled, so your question can't be answered. Stop thinking in times. Start thinking in samples :) $\endgroup$ – Marcus Müller Aug 26 '18 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.