Team:Paris/Modeling/Critere

From 2008.igem.org

To go back to the previous page : Explanations for the score function


function[c,im] = critere(x)

function[c,im] = critere(x)

%%

% [c,im] = critere(x)

% x : input signal

% c : value of the criteria

% im : proportional to the main frequency detected

l=length(x);

%% Fourier transform of the signal

fftx=abs(fft(x));

%% detection of the main frequency

im=Maxlocaux(fftx);

%% Initial value of the criteria

c=0;

%% If no maximum is detected, then the criteria is zero

% else we will sum the value of the first 5 peaks

% Then, we normalize by the overall values of the coefficients

if im(1)==0 c=0;

else

for k=1:min(5,length(im))

c=c+fftx(im(k));

end

c=c/sum(fftx(2:end));

end