Frequency spectrum for a square pulse help?
조회 수: 18 (최근 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!