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!