Harmonics of Fourier series

40 visualizaciones (últimos 30 días)
Ben Hamill
Ben Hamill el 15 de Nov. de 2019
Comentada: Alex Walton el 23 de Nov. de 2020
How do I Plot the 1st, 3rd and 5th harmonic of the Fourier series,
z(t)= 3/2 + 6/pi sin(t) + 6/3pi sin(3t) + 6/5pi sin(5t) + ...
individually overlapped on one plot.

Respuestas (1)

Jyothis Gireesh
Jyothis Gireesh el 18 de Nov. de 2019
The following code may help you to plot the first, 3rd and fifth harmonics of the signal
t = 0:0.1:4*pi;
numTerms = 3;
fourierExpansion = zeros(numTerms, numel(t));
for i=1:numTerms
fourierExpansion(i,:) = (6/((2*i - 1)*pi))*sin((2*i - 1)*t);
end
z = sum(fourierExpansion) + 3/2;
plot(t,[z;fourierExpansion]);
legend('z','b1','b2','b3');
  1 comentario
Alex Walton
Alex Walton el 23 de Nov. de 2020
Hi Jyothis, would it be the same for the first 5 harmics of the fourier cosin series for

Iniciar sesión para comentar.

Categorías

Más información sobre Spectral Measurements 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