Borrar filtros
Borrar filtros

average value of a half wave rectified sine curve

9 visualizaciones (últimos 30 días)
priya
priya el 22 de Dic. de 2019
Comentada: Star Strider el 22 de Dic. de 2019
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))

Respuesta aceptada

Star Strider
Star Strider el 22 de Dic. de 2019
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 comentarios
priya
priya el 22 de Dic. de 2019
This is fine. Thank you.
Star Strider
Star Strider el 22 de Dic. de 2019
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by