fft Amplitude Spectrum Stem Plot from Fourier Series

3 ビュー (過去 30 日間)
N/A
N/A 2015 年 2 月 14 日
回答済み: Geoff Hayes 2015 年 2 月 14 日
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 Center および File ExchangeFourier Analysis and Filtering についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by