I need to change the frequency domain of a DFT
조회 수: 1 (최근 30일)
이전 댓글 표시
I have to change f from (-0.5, 0.5 ) to (-pi, pi).
n=64;
k = 0:n-1;
O1=(10*2*pi)/n;
O2=(14*2*pi)/n;
x = cos(O1*k) + 0.5*cos(O2*k);
hx=fft(x);
shx=fftshift(hx);
f=[-n/2:n/2-1]/n;
figure(1)
stem(f,abs(shx),'r')
xline(O1,':');
xline(O2,':');
xline(-O1,':');
xline(-O2,':');
xlabel('Frequency in [-\pi,\pi]')
ylabel('Magnitude of DFT(x)')
axis([-pi pi 0 inf]);
grid
Thank you very much
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!