Harmonics of Fourier series
11 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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
2020-11-23
Hi Jyothis, would it be the same for the first 5 harmics of the fourier cosi
n series for
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/424653/image.png)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!