i want to write matlab code that calculates fourier transform of following sequence and also plots its magnitude x(k)
2 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
Birdman
2017 年 11 月 6 日
N=100;%%you can change it
n=0:N-1;
x=3*cos(4*pi*n/N)+sin(6*pi*n/N);
FFT=fft(x);
plot(abs(FFT))
Also please check
help fft
4 件のコメント
Birdman
2017 年 11 月 6 日
編集済み: Birdman
2017 年 11 月 6 日
You can not plot imaginary parts. The purpose of fft is to see the signals behaviour in frequency domain and by taking abs command, you make the signal appropriate for fft. The magnitude as you say in your question is relevant and we need to find the magnitude of the signal.
その他の回答 (0 件)
参考
カテゴリ
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!