필터 지우기
필터 지우기

Calculate-Electrolytes Average value

조회 수: 3 (최근 30일)
Robin Beene
Robin Beene 2012년 1월 16일
Hey all, I need to do next task:
Write a function which calculates a Electrolytes Average value.
Input data are:
1.sampled signal (vector)
2.sampling rate
3.frequency of first harmonic.
This is my solution, and I am not sure is it good.
My problem is cuz I dont use first harmonic's frequency at all, that's why I am not sure in mine solution
function Yavg=el_avg_val(y,f_s,f_o)
fmax=f_s/2;
max=1/fmax;
%I read that 10 points per max frequency's period is good enough to recognize a signal
delta=max/10;
t=0:delta:max;
N=length(t);
Yavg=sum(abs(y)/N)
end

답변 (1개)

Robin Beene
Robin Beene 2012년 1월 18일
or maybe like this?:
function Yavg=el_avg_val(y,f_s,f_o)
t=0:1/f_s:1/f_o;
N=length(t);
Yavg=sum(abs(y)/N)
end

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by