Universidad San Francisco de Quito

February 10, 2014

Ronny Ramírez
Deber 2
3.1
1.

%%
%3.1
function [X k] = dtft(x,n,w)
k=w/pi;
W=exp(-1j*pi/500).^(n'*k); X=x*W;
end
w=-pi:pi/500:pi;
%1
n1=-10:10;
x1=0.6.^abs(n1);
[X1 k] = dtft(x1,n1,w);

1

El ángulo varía signicativamente cuando la frecuencia se incrementa de [0, π]
2.

%2

n2=0:20;
x2=n2.*0.9.^n2;
[X2 k] = dtft(x2,n2,w);

2

3.

%3

n3=0:50;
x3=cos(0.5*pi*n3)+1j*sin(0.5*pi*n3);
[X3 k] = dtft(x3,n3,w);

3

Se puede observar que la magnitud se incrementa mientras que la fase decrece cuando se varia la frecuencia.
4

%4

n4=0:7;
x4=[4 3 2 1 1 2 3 4];
[X4 k] = dtft(x4,n4,w);

4

5 %5 n5=0:7.n5.Se puede observar que el ángulo varía levemente cuando se incrementa la frecuencia. 5 . [X5 k] = dtft(x5.w). x5=[4 3 2 1 -1 -2 -3 -4].

*w)+1.*w)))./(1-exp(1j. k=w/pi.3 w=0:pi/500:pi. 3.Se puede observar que el ángulo da un salto cuando frecuencia es igual a cero. 6 . 1 %1 X1=0.*w)+exp(1j.25*(exp(1j*2.

6. 7 .*w)).6.*w)).2 %2 X2=(1-(0.^10)./(1-0.6.*w)).^10).*exp(1j.*exp(-1j./(1-0.*exp(-1j.6.*exp(1j.*w))-1+(1-(0.

*exp(1j*3.*w)).*w)).*w).*exp(-1j.3 %3 X3=1j*(1.9.*exp(-1j. 8 .*w)).^2-4.*exp(1j.12./(1-0.11.9./(1-0.

*w)).*exp(-1j.*exp(-1j*2.*w)./(1-0.4 %4 X4=1j*0.*exp(-1j.^2+4.512-exp(-1j./(1-0.8.*w).*w)).8. 9 .

10 .5 %5 X5=4./(1+(0.7.*exp(-1j.^2).*w)).

C1=0. M3=50.4 M1=10. 11 . n1=0:M1-1.n1. [Rf1 k] = dtft(R1. T1=1-abs(M1-1-2*n1)/(M1+1).5*(1-cos((2*pi*n1)/(M1-1))).46*cos((2*pi*n1)/(M1-1)).3.length(n1)).w). M4=101. w=-pi:pi/500:pi. R1=ones(1. H1=0. M2=25.54-0.

12 .[Cf1 k] = dtft(C1.n1.w).

w).[Tf1 k] = dtft(T1. 13 .n1.

n1.[Hf1 k] = dtft(H1. 14 .w).

length(n2)).46*cos((2*pi*n2)/(M2-1)).n2.w). R2=ones(1.n2=0:M2-1. H2=0.54-0. C2=0.5*(1-cos((2*pi*n2)/(M2-1))). 15 . T2=1-abs(M2-1-2*n2)/(M2+1). [Rf2 k] = dtft(R2.

n2.[Cf2 k] = dtft(C2. 16 .w).

[Tf2 k] = dtft(T2.n2. 17 .w).

n2. 18 .w).[Hf2 k] = dtft(H2.

n3.w). T3=1-abs(M3-1-2*n3)/(M3+1). H3=0.5*(1-cos((2*pi*n3)/(M3-1))). 19 .length(n3)).46*cos((2*pi*n3)/(M3-1)). C3=0. [Rf3 k] = dtft(R3. R3=ones(1.n3=0:M1-1.54-0.

w).[Cf3 k] = dtft(C3. 20 .n3.

[Tf3 k] = dtft(T3.w).n3. 21 .

22 .w).[Hf3 k] = dtft(H3.n3.

w).length(n4)).54-0.n4=0:M4-1. 23 .46*cos((2*pi*n4)/(M4-1)).5*(1-cos((2*pi*n4)/(M4-1))). H4=0. T4=1-abs(M4-1-2*n4)/(M4+1). [Rf4 k] = dtft(R4. C4=0.n4. R4=ones(1.

24 .w).n4.[Cf4 k] = dtft(C4.

25 .w).[Tf4 k] = dtft(T4.n4.

n4. 26 .[Hf4 k] = dtft(H4.w).

*n).n. xc=conj(x). subplot(2.8 n=0:19. w=-pi:pi/500:pi. [Xi k] = dtft(xi.3. [X k] = dtft(x. xi=imag(x). [Xc k] = dtft(xc. Xe=1/2*(X+Xc).6 Entregado a mano 3. Xo=1/2*(X-Xc).n.w).ylabel('Magnitud') subplot(2. x=exp(1j*0.n.abs(Xr-Xe)) t itle('DTFT'). xr=real(x).w).8 %3.xlabel('frecuencia (rad/s)') 27 .1. [Xr k] = dtft(xr.1) plot(k.2) plot(k.1.abs(1j*Xi-Xo)) ylabel('Magnitud').w).n.w).1*pi.

n. w=-pi:pi/500:pi. n=0:M-1. 28 .3.w). x=T10. 1 %1 X1=conj(X).10 %3.10 M=10. [X k] = dtft(x. T10=1-abs(M-1-2*n)/(M+1).

29 .*w*10).*exp(1j.2 %2 X2=X-X.

30 .*X1.3 %3 X3=X.

k.pi). 31 .4 %4 [X4 k4]=sigshift(X.

1*pi. k5=-1:1/1000:1.n.Xcos).*n).w). 32 . [Xcos k] = dtft(xcos. X5=conv(X.5 %5 xcos=cos(0.

wc=0. 3 %3 wd=-wc:pi/500:wc.length(wc:pi/500:pi)-1)]. w=-pi:pi/500:pi. a=20. [H k] = dtft(h.length(-pi:pi/500:-wc)-1)exp(-1j*a. h=wc/pi*sinc(wc. n=0:N-1. 2 %2 N=41.5*pi.*(n-a)/pi). 33 .14 1 Entregado a mano. Hd=[zeros(1.*wd)zeros(1.n.w).3.

wd2=wc:pi/500:pi.*wd2)]. 34 . h=sinc(n-a)-sin(wc.*(n-a)).15 1 Entregado a mano 2 %2 N=31./(pi.length(-wc:pi/500:wc)-2)exp(-1j*a. [H k] = dtft(h.3. Hd=[exp(-1j*a. n=0:N-1. 3 %3 wd1=-pi:pi/500:-wc.*wd1)zeros(1.*(n-a)). wc=0.n.5*pi. w=-pi:pi/500:pi.w). a=15.

a=[1 0 -0.18 n=0:200. for m=0:M S1=S1+b(m+1)./(1+S2).w) M=size(b)-1.3.a.*w*l).16 function [H] = freqresp(b. end 3.531].81 0 -0. S1=0. S2=0.18 %% %3. b=[1 0 1 0 1 0 1].*exp(-1j.656 0 -0. end for l=1:N S2=S2+a(l+1). 35 . end H=S1.*w*m). N=size(a)-1.*exp(-1j.

x1). 36 .a. y1=lter(b.^n.1 %1 x1=5+10*(-1). 2 %2 x2=1+cos(0.x2).5*pi.*n+pi/2).a. y2=lter(b.

*n/4)+3*cos(3*pi.3 %3 x3=2*sin(pi.a. y3=lter(b.x3).*n/4). 37 .

38 .a. x4=x4+(k+1)*cos(pi*k.4 %4 x4=0. end y4=lter(b. for k=0:5.x4).*n/4).

a.5 %5 x5=cos(pi.*n). y5=lter(b. 39 .x5).

*t2).3. x1=sin(1000*pi.001:0.1.*t1). x2=sin(1000*pi.1. 40 .0001:0.19 1 %1 t1=0:0. 2 %2 t2=0:0.

1. x3=sin(1000*pi.*t3). 41 .01:0.3 %3 t3=0:0.

Sign up to vote on this title
UsefulNot useful