how to find magnitude and phase of fft output signal?
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi How can I get the amplitude and phase of fft output signal for specific frequency? let say we have this signal: y=A*sin(w1t+phi1)+B*sin(w2t+phi2) using fast Fourier transform we will get the two frequencies (w1 and w2). How can I get those frequencies and phases?
댓글 수: 0
답변 (1개)
David Goodmanson
2016년 11월 29일
Hello Khaled, If you have t=0 as the first element of a uniform time array, then calculating y from that and taking the fft will give two peaks per frequency. For a given frequency w, assuming your normalization is correct, the left complex amplitude [C exp(i phi)] is the positive freq. contribution, to be multiplied by exp(iwt), and the right complex amplitude [C exp(-i phi)] is the negative freq. contribution, to be multiplied by exp(-iwt). Adding these you get the result 2C cos(wt + phi). It's most often stated in terms of cos but of course it is also 2C sin(wt + phi + pi/2).
This all assumes you have fft'd a real function as in your example.
댓글 수: 4
Walter Roberson
2016년 11월 29일
Small correction: the amplitudes of the pairs are complex conjugates iff and only if the inputs were real-valued. If the input signal was complex valued then the two halves are not complex conjugates.
David Goodmanson
2016년 11월 30일
편집: David Goodmanson
2016년 11월 30일
I had mentioned this in the answer at the top but in an rather offhand way, so thanks for emphasizing this important point.
참고 항목
카테고리
Help Center 및 File Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!