Two-side spectrum in Matlab
이전 댓글 표시
Dear my colleagues, I am a new user of Matlab. Now, I have a signal like x(t) = A1*sin(2*pi*f1*t) + A2*sin(-2*pi*f2*t), where f1, f2>0. Could anyone please show me whether I could obtain the spectrum of x in which frequency f2 is present only as a negative frequency of two-side spectrum (normally, f2 will appear in both sides of Matlab's FFT)?
Thank you very much.
Lomath.
채택된 답변
추가 답변 (1개)
Youssef Khmou
2013년 11월 3일
You can start by many tutorials, each offers a different approach to the DFT problem, in terms of resolution and amplitude estimation, i wrote a 2 sided example for you , verify it :
Fs=40;
Ts=1/Fs;
t=0:Ts:10-Ts;
f1=4;f2=15;
y=sin(2*pi*t*f1)+sin(2*pi*t*f2);
N=length(y);
F=fft(y);
fr=(-N/2:N/2-1)*Fs/(N);
figure, plot(fr,abs(F))
xlabel(' frequency Hz')
댓글 수: 4
Hoang
2013년 11월 3일
Youssef Khmou
2013년 11월 3일
Hoang, it is not possible to have f1 on the right and f2 on the left, the frequency is positive metric, fi{i=1,2,..} is >0 and the spectrum is two sided,
Unless you are talking about new concept of negative frequency, you have to provide some evidence .
Hoang
2013년 11월 3일
Renan Ribeiro
2018년 10월 15일
Sorry to revive the post, but the given code did not work with me (maybe I am messing something). The code given in this post worked just fine.
카테고리
도움말 센터 및 File Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!