How to plot the frequency response of a discrete cosine function?

8 vues (au cours des 30 derniers jours)
Daniel Ramirez
Daniel Ramirez le 13 Nov 2015
Commenté : Daniel Ramirez le 17 Nov 2015
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.

Réponses (1)

Rick Rosson
Rick Rosson le 14 Nov 2015
Modifié(e) : Rick Rosson le 14 Nov 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 commentaires
Rick Rosson
Rick Rosson le 16 Nov 2015
Try using stem instead of plot:
stem(w,phase/pi);
Daniel Ramirez
Daniel Ramirez le 17 Nov 2015
Thank you so much Rick. It's working now.

Connectez-vous pour commenter.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by