# calculate root mean square, ratio of power, constant false alarm, … of a signal

I am new to Digital Signal Processing, and am reading a paper. I don't know how they can extract some features from signal, like root mean square (RMS), Constant False Alarm Rate - CFAR, Mean Value Dispersion Statistic – MVD, Ratio of Power – ROP, and Autocorrelation from a signal, as shown in the following figure:

Could anyone please help explain to me how, and, if it is possible, could you please show me some code to get them?

I've tried to write some codes to calculate these parameters. Could you please take a look:

RMS:

for i= 1:floor(time(end)/tPeriod)
tBegin = (i-1)*tPeriod;
tEnd = i*tPeriod;
index = find((time>=tBegin)&(time<tEnd));
RMS(i) = sqrt(mean(data(index).^2));    %equation 1
tPlot = [tPlot tEnd];
end


CFRA:

for i= 1:floor(time(end)/tPeriod)
tBegin = (i-1)*tPeriod;
tEnd = i*tPeriod;
indexTime = find((time>=tBegin)&(time<tEnd));
y = fft(data(indexTime),M)/M;   % M is the number of fft points
y = 2*abs(y);
df = fMax/M;
f = [0:M-1]*df;
indexF = find((f>=n1)&(f<n2));
CFAR(i) = sum(y(1:M/2)).^v;
tPlot = [tPlot tEnd];
end


ROP:

for i= 1:floor(time(end)/tPeriod)
tBegin = (i-1)*tPeriod;
tEnd = i*tPeriod;
indexTime = find((time>=tBegin)&(time<tEnd));
y = fft(data(indexTime),M)/M;
y = 2*abs(y);
df = fMax/M;
f = [0:M-1]*df;
indexF = find((f>=n1)&(f<n2));
ROP(i) = sum(y(indexF).^2)/sum(y.^2);
tPlot = [tPlot tEnd];
end

• This question is unanswerable in its present form. There just isn't enough information given about the system (or the signal) – Dilip Sarwate Aug 30 '12 at 17:39
• @user1624637 Is this the paper you're reading? scielo.br/… – datageist Aug 30 '12 at 18:04
• @ Dilip: the input signal is raw acoustic signal. Is there any missing information? I'm so sorry but I'm new to DSP therefore I want to know how those features were calculated. The paper I'm reading is like the link from Datageist – user1624637 Aug 31 '12 at 8:16
• @ Datageist: you are defenitely right. I'm reading that paper but I don't understand. Could you please help me? – user1624637 Aug 31 '12 at 8:17
• @user1624637 but the equations are given on the page that is linked to. What's the question? – Henry Gomersall Aug 31 '12 at 10:06