Digital signal processing: Lab 5 by bilalhasan

VIEWS: 32 PAGES: 2

									                          Lab no. 5
                                                  17-02-10
                                              2008-TE-065
clear
x=[1 0 0 1];
N=length(x)
for k=0:N-1
   for n=0:N-1
     y1(n+1)=x(n+1)*exp(-j*2*pi*k*n/N);
   end
   z1(k+1)=sum(y1)
end


x=[1 0 0 1];
N=length(x)
for k=0:N-1
  for n=0:N-1
     y2(n+1)=x(n+1)*exp(-j*2*pi*(k+N)*n/N);
  end
  z2(k+1)=sum(y2)
end

m=0:3;
a=abs(z1)
subplot(2,2,1)
stem(m,a)
title('magnitude of X (K)')

b=angle(z1)
subplot(2,2,2)
stem(m,b)
title('angle of X (K)')

c=abs(z2)
subplot(2,2,3)
stem(m,c)
title('magnitude of X (K + N)')


d=angle(z2)
subplot(2,2,4)
stem(m,d)
title('angle of X (K + N)')

								
To top