function [dd,time,Fns] = SEF_true(x,wlen,Fs,FFTSIZE) % This function calculates the Spectral Energy Flux (SEF) % Usage : % [df,time,Fns] = SEF_true(x,wlen,Fs,FFTSIZE) % % output % df : detection function % time : time index associated to df % Fns : sampling frequency for the detection function % input % x : input signal % wlen : length of the analysis window in samples % Fs : sampling frequency of the input signal %FFTSIZE: real size is 2*FFTSIZE % For example, the attacks of a signal "x" sampled at 44100Hz and using % an analysis window of 10ms can be calculated as % [df,time,Fns] = SEF_true(x,441,44100,512); % Copyright Miguel ALONSO % Last modification : Mon Apr 18 12:18:08 CEST 2005 % This functions implements the article to be presented at ICME'05 % Method based on an exponential decay window for temporal % integration and an efficient interpolating polynomials differentiator. % NOTE: This implementation is inefficient for processing large signals (~>20s) % see function super_SEF for using a piecewise approach x=x(:); % input signal overlap = 2/3;%.75; ignore = .5; filter_order = 10; % must always be even %Nfen = round(wlen/1000*Fs); % temporal analysis window length Nfen = wlen; Nover = round(Nfen*overlap); % overlap in samples slen = 25e-3; % length in seconds for the widening mini = 0; minimo = 0.1; maxim = calculate_differentiator(filter_order+1); % calculate differentiator filter Nhop = Nfen-Nover; % hop size in time Fns = Fs/(Nfen-Nover); % design of the low-pass smoothing IIR filter alpha = 0.015; beta=0.075; d = 5; c = 1; beta = beta*Fns; alpha = alpha*Fns; num = [d+c -(c*exp(-1/beta)+d*exp(-1/alpha))]; den = [1 -(exp(-1/alpha)+exp(-1/beta)) exp(-(1/alpha+1/beta))]; [H,nu,temps]=specgram(x,FFTSIZE*2,Fs,hanning(Nfen),Nover); %spectral analysis G = abs(H); clear H; % free memory Gf = 20*log10(abs(filter(num,den,G,[],2))); % smoothing and log compression clear G; % free memory % * * * * MODIFICATION * * * * % Gf = [fliplr(Gf(:,1:2*length(maxim))) Gf]; % * * * * * * * * * * * * * * * dGf = filter(maxim,1,Gf,[],2); % derivative calculation dGf(dGf