How to plot the frequency response of a discrete cosine function?
Mostrar comentarios más antiguos

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.
Respuestas (1)
Rick Rosson
el 14 de Nov. de 2015
Editada: Rick Rosson
el 14 de Nov. de 2015
L = 1000;
n = 0:L-1;
x1 = fftshift(fft(x))/L;
dw = 2*pi/L;
w = -pi:dw:pi-dw;
stem(w,mag);
5 comentarios
Daniel Ramirez
el 15 de Nov. de 2015
Editada: Daniel Ramirez
el 15 de Nov. de 2015
Rick Rosson
el 15 de Nov. de 2015
phase = angle(x1);
phase(mag<0.01) = nan;
figure;
plot(w,phase/pi);
ylabel('Phase Angle (pi-radians)');
Daniel Ramirez
el 16 de Nov. de 2015
Editada: Daniel Ramirez
el 16 de Nov. de 2015
Rick Rosson
el 16 de Nov. de 2015
Try using stem instead of plot:
stem(w,phase/pi);
Daniel Ramirez
el 17 de Nov. de 2015
Categorías
Más información sobre Digital Filter Analysis en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
