fft Amplitude Spectrum Stem Plot from Fourier Series

3 vues (au cours des 30 derniers jours)
N/A
N/A le 14 Fév 2015
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!

Réponse acceptée

Geoff Hayes
Geoff Hayes le 14 Fév 2015
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.

Plus de réponses (0)

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by