Reputation: 33
I am trying to use the librosa library to compute the MFCC of my time series. The time series is directly from data collected from a device at a sampling rate of 50 Hz.
Could someone help clarify on what values I could use for n_fft, hop_length, win_length and window? And their meaning?
Thanks in advance
Upvotes: 2
Views: 663
Reputation: 582
MFCC is based on short-time Fourier transform (STFT), n_fft
, hop_length
, win_length
and window
are the parameters for STFT.
STFT divide a longer time signal into shorter segments of equal length and then compute Fourier transform separately on each shorter segment. Fourier transform transforms the signal from time domain to frequency domain. The figure below demonstrates the steps to calculate STFT.
n_fft
is the number of bins of Fourier transform. Its value depends on the type of the signal and relates sampling rate, typically are the power of two. In your case, it's hard to say what is the appropriate value, since I don't know what the signal is. hop_length
is the overlap of two consecutive segments, typically chosen to be 1/2 or 1/4 of n_fft
. We typically apply a window on the segment. If you are not familiar with signal processing, you can leave this value to its default.
Upvotes: 2