Fourier series with MATLAB

1 visualización (últimos 30 días)
Luis Miguel López Santamaría
Luis Miguel López Santamaría el 21 de Mayo de 2017
Comentada: Akira Agata el 25 de Mayo de 2017
Hello everybody,
I have a little trouble here, I'm working with Fourier series, I already calcule Ao, An and Bn these is the following code:
Ao = 0;
for i=1:length(f)
Ao = Ao +int(f(i),'t', inter(i), inter(i+1));
end
Ao = simplify(Ao/T);
An = 0;
wo = 2*pi/T;
for i=1:length(f)
An = An +int(f(i)*cos(n*wo*t), inter(i), inter(i+1));
end
An = simplify(2*An/T);
Bn = 0;
for i=1:length(f)
Bn = Bn +int(f(i)*sin(n*wo*t), inter(i), inter(i+1));
end
Bn = simplify(2*Bn/T);
But now I want to express like this form:
This is the following formula:
Thank you for your help
  1 comentario
Akira Agata
Akira Agata el 25 de Mayo de 2017
I'm not sure what you want to do, but I guess you are trying to do the following. The following code calculates the first equation of your post up to Nterm th terms.
t = linspace(0, 4*pi, 1000);
Nterm = 5;
ft = zeros(size(t));
for kk = 1:Nterm
ft = ft + sin((2*kk-1)*t)/(2*kk-1);
end
ft = ft*(4/pi);
figure
plot(t,ft);

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by