average value of a half wave rectified sine curve

조회 수: 9 (최근 30일)
priya
priya 2019년 12월 22일
댓글: Star Strider 2019년 12월 22일
I have a half wave rectified sine wave. I want to calculate the average of this curve on matlab and plot it. Please help.
f = @(t) sin(t).*(sin(t)>=0) + 0*(sin(t)<0);
t = linspace(0, 4*pi);
plot(t, f(t))

채택된 답변

Star Strider
Star Strider 2019년 12월 22일
This is straightforward:
syms f t t0 t1
halfwave(f,t0,t1) = int(sin(2*pi*f*t), t, t0, t1/2)/(t1 - t0)
numericvpa = vpa(halfwave(1,0,1))
producing:
To do it numerically, use the mean function to calculate the mean.
Note that the Root-Mean-Square value:
RMS = sqrt(mean(f(t).^2))
is more meaningful, since that is the D-C equivalent.
  댓글 수: 2
priya
priya 2019년 12월 22일
This is fine. Thank you.
Star Strider
Star Strider 2019년 12월 22일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by