How to plot the frequency response of a discrete cosine function?
이전 댓글 표시

My attempt:


I tried doing it but I can't get the freq response to be plotted between pi and pi. Any help would be appreciated.
답변 (1개)
Rick Rosson
2015년 11월 14일
편집: Rick Rosson
2015년 11월 14일
L = 1000;
n = 0:L-1;
x1 = fftshift(fft(x))/L;
dw = 2*pi/L;
w = -pi:dw:pi-dw;
stem(w,mag);
댓글 수: 5
Daniel Ramirez
2015년 11월 15일
편집: Daniel Ramirez
2015년 11월 15일
Rick Rosson
2015년 11월 15일
phase = angle(x1);
phase(mag<0.01) = nan;
figure;
plot(w,phase/pi);
ylabel('Phase Angle (pi-radians)');
Daniel Ramirez
2015년 11월 16일
편집: Daniel Ramirez
2015년 11월 16일
Rick Rosson
2015년 11월 16일
Try using stem instead of plot:
stem(w,phase/pi);
Daniel Ramirez
2015년 11월 17일
카테고리
도움말 센터 및 File Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
