[Octave] feature_spectral_flux

function F = feature_spectral_flux(windowFFT, windowFFTPrev)

% function F = feature_spectral_flux(windowFFT, windowFFTPrev)
%
% Computes the spectral flux feature
% ARGUMENTS:
% - windowFFT:             the abs(FFT) of the current audio frame
%                          (computed by getDFT() function)
% - windowFFTPrev:         the abs(FFT) of the previous frame
%
% RETURNS:
% - F:                     the spectral flux value for the input frame
%

% normalize the two spectra:
windowFFT = windowFFT / sum(windowFFT);
windowFFTPrev = windowFFTPrev / sum(windowFFTPrev+eps);

% compute the spectral flux as the sum of square distances:
F = sum((windowFFT - windowFFTPrev).^2);

댓글

이 블로그의 인기 게시물

파이썬으로 Homomorphic Filtering 하기

파이썬으로 2D FFT/iFFT 하기: numpy 버전