How to complete the fourier Analysis using Matlab ?
3 ビュー (過去 30 日間)
古いコメントを表示
Hello !!
I have tried using the Matlab tutorial for FFT and DFT but I'm having extreme difficulty understanding the code and how I can use it in my question. My experience with matlab is only in data manipulation and plotting, so I'm struggling with the concepts.
So here is the question...
To compute the Cn coefficient given by
- Cn = 1/T * ∫ f(t)*e^(-2*pi*n*t/T) dt,
in which T is the period, and then Amplitude is
- sqrt(Re(Cn)^2 + Im(Cn)^2)
- F = n/T
then... how can I plot Amplitude vs Frequency using matlab functions. So far I have this function and req as mentioned above.
- f(t) = e^-t from -3 to 3
- T = 6
- F = -10:1:10
I would like to plot using matlab, but so far I'm doing integral manually and then just iterating values, and plotting them in matlab, can I use fft function or any other function to speed up the process ??
Many thanks
Megh
1 件のコメント
dpb
2015 年 1 月 11 日
There's a complete example of computing/plotting the one-sided PSD at
doc fft
that should be pretty easy to follow what it's doing.
採用された回答
Rick Rosson
2015 年 1 月 11 日
編集済み: Rick Rosson
2015 年 1 月 11 日
doc fft
doc fftshift
doc abs
doc angle
doc plot
doc stem
doc xlabel
doc ylabel
doc grid
doc xlim
doc ylim
その他の回答 (2 件)
Youssef Khmou
2015 年 1 月 11 日
Try to study and alter this example :
Fs=10;
t=-3:1/Fs:3;
x=exp(-t);
plot(t,x)
N=1000; % N points for frequency computation
fx=fftshift(fft(x,N))/sqrt(N);
fx=fx.*conj(fx);
% frequency axis
f=(-N/2:N/2-1)*Fs/(2*N);
figure; plot(f,fx);
Megh
2015 年 1 月 13 日
編集済み: Megh
2015 年 1 月 13 日
1 件のコメント
Katherine Zheng
2022 年 3 月 18 日
I just really appreciate such poster who figure out their issue and give a detailed answer about it!!! Thanks!!
参考
カテゴリ
Help Center および File Exchange で Fourier Analysis and Filtering についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!