fft Amplitude Spectrum Stem Plot from Fourier Series

3 次查看(过去 30 天)
I want to make a stem plot (amplitude spectrum using stem()) from the fft function in MATLAB, given the Fourier Series function I derived. Is this possible using just the function or do I need to evaluate the function into a txt file and use those numbers to do it (aka read in the file)?
Here is the series I want to analyze:
y(t) = (-10/pi)*Sum_n=1->inf [cos(pi*n)/n * sin(pi*n*t/5]
I know that there are formulas for finding the amplitude spectrum based on coefficients of the series function, but I'm stuck in the interpretation to get them into MATLAB. Is stem() the equivalent of the amplitude spectrum? That's what my prof. used in his code, but, again, his code is based off reading in data from a file. I want to take the function and directly apply it without reading in a file of data.
Thanks in advance!

采纳的回答

Geoff Hayes
Geoff Hayes 2015-2-14
Quizmaster - you don't have to read data from a text file in order to use the stem function. It is a visual tool only that is used to plot a discrete sequence of data. I've used it to plot the discretized data that had been sampled from a continuous signal (prior to performing an FFT). A similar question was asked at http://www.mathworks.com/matlabcentral/answers/24116-stem-function-and-fft and includes some code for using stem with the output from an FFT.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by