Harmonics of Fourier series

조회 수: 27 (최근 30일)
Ben Hamill
Ben Hamill 2019년 11월 15일
댓글: Alex Walton 2020년 11월 23일
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.

답변 (1개)

Jyothis Gireesh
Jyothis Gireesh 2019년 11월 18일
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
Alex Walton
Alex Walton 2020년 11월 23일
Hi Jyothis, would it be the same for the first 5 harmics of the fourier cosin series for

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by