>> w = [0:1:500]*pi/500; >> X = dtft(x,n,w); magX = abs(X); phaX = angle(X); >> % RESPUESTA DE MAGNITUD >> subplot(2,1,1); plot(w/pi,magX);grid; >> xlabel('frecuencia en pi unidades'); ylabel('|X|');title('Magnitude Response'); >> % RESPUESTA DE FASE >> subplot(2,1,2); plot(w/pi,phaX*180/pi);grid; >> xlabel('frecuencia en pi unidades'); ylabel('Grados');
>> n = 0:7; x = [4,3,2,1,1,2,3,4];
>> w = [0:1:500]*pi/500; >> X = dtft(x,n,w); magX = abs(X); phaX = angle(X); >> % Respuesta en magnitud >> subplot(2,1,1); plot(w/pi,magX);grid; >> xlabel('frecuencia en pi unidades); ylabel('|X|');title(Respuesta en magnitud'); >> % Respuesta en fase >> subplot(2,1,2); plot(w/pi,phaX*180/pi);grid; >> xlabel('frecuencia en pi unidades'); ylabel('Grados');title(Respuesta en fase');
4.3
% (a) x(n) = 3*(0.9)n*u(n)
>> w = [0:200]*pi/200; >> X = 3*(1-0.9*exp(-j*w)).^(-1); X_mag = abs(X); X_pha = angle(X); >> subplot(2,1,1); plot(w/pi,X_mag);grid; >> title('grafico de magnitudes'); ylabel('a.'); >> subplot(2,1,2); plot(w/pi,X_pha); >> title(Grafico de Angulo)