Skip to content

Bug in FFT windowing #286

Description

@tom-huntington

You windowing for the fft when calculating the mfccs is incorrect, which will reduce performance a little (dtw seems very robust). The default runtime configuration results in frame_length = 1600 which is greater than fft_order = 512. However, this results in the last frame_length - fft_order = 1088 elements being chopped off the hamming window. You actual window is only the first third of the hamming window, which is a very bad choice of window.

frame_length_padded = max(frame_length, self.fft_order)

self.hamming_window = numpy.hamming(frame_length_padded)

besides the point, this should be

self.hamming_window = numpy.hamming(frame_length) 

Your padding is appended only after you do the windowing

fft = numpy.fft.rfft(frame, self.fft_order)

Same with the c code.

hamming_coefficients = _precompute_hamming(frame_length);

if (_apply_hamming(frame, frame_length, hamming_coefficients) != CMFCC_SUCCESS) {

#ifdef USE_FFTW
// fftw code
if (_compute_power_fftw(frame, power, fft_order, plan) != CMFCC_SUCCESS) {
return CMFCC_FAILURE;
}
#else
// own code
if (_compute_power(frame, power, fft_order, sin_table_full, sin_table_half) != CMFCC_SUCCESS) {
return CMFCC_FAILURE;
}
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions