Frequency spectrum for a square pulse help?
11 ビュー (過去 30 日間)
古いコメントを表示
I need to plot the frequency spectrum for a square wave using MATLAB. The wave is HIGH (5mV) between 0 and -2 and LOW (omv) between 0 and 2. I have already obtained the fourier seires for this function and i have the first ten components of the series.
(5/2) + ((10/pi)*sin((pi*t)/2)) + ((10/(3*pi))*sin((3*pi*t)/2)) + ((10/(5*pi))*sin((5*pi*t)/2)) + ((10/(7*pi))*sin((7*pi*t)/2))+ ((10/(9*pi))*sin((9*pi*t)/2))+ ((10/(11*pi))*sin((11*pi*t)/2))+ ((10/(13*pi))*sin((13*pi*t)/2))+ ((10/(15*pi))*sin((15*pi*t)/2))+ ((10/(17*pi))*sin((17*pi*t)/2))+ ((10/(19*pi))*sin((19*pi*t)/2))
How do I plot the frequency spectrum for this wave using MATLAB? I have tried using FFTs, but I really don't know how it works to plot the graph. I end up with the frequencies peaks at the right points, but with wrong amplitudes. Please help
0 件のコメント
回答 (1 件)
Image Analyst
2013 年 11 月 27 日
Assuming your series is correct, then plotting the coefficients [5/2, (10/pi), (10/(3*pi)), etc.] should give you the same shape as if you plotted the magnitude of the spectrum you get from the fft() function. Did you do that? Do you want to attach your script for further help?
参考
カテゴリ
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!