Saturday, March 21, 2009

The Sinc





echo on
fnct='Normal';
a=-6;
b=6;
n=24;
tol=0.1;
xx=Fseries(fnct,a,b,n,tol,0,1);
xx1=xx(n+1:-1:2);
xx1=[conj(xx1),xx];
absxx1=abs(xx1);
pause
n1=[-n:n];
stem(n1,absxx1);
title('The Discrete Magnitude Spectrum')
phasexx1=angle(xx1);
pause



stem(n1,phasexx1)
title('The Discrete Phase Spectrum')



Lambda Function at Baseline=1



function y=lambda(x)
%        y=lambda(x) generates a triangular signal
y=(x+1).*(x>-1 & x<0)+(x==0)+(-x+1).*(x>0 & x<1);

Labels:


Discrete Magnitude and Phase Spectra



echo on
fnct='lambda';
a=-4;
b=4;
n=24;
tol=0.1;
xx=fseries(fnct,a,b,n,tol);
xx1=xx(n+1:-1:2);
xx1=[conj(xx1),xx];
absxx1=abs(xx1);
pause
n1=[-n:n];
stem(n1,absxx1);
title('The Discrete Magnitude Spectrum')
phasexx1=angle(xx1);
pause


stem(n1,phasexx1)
title('The Discrete Phase Spectrum')



******************************************************************************************************************************************************

echo on fnct='lambda'; a=-4; b=4; n=24; tol=0.1; xx=fseries(fnct,a,b,n,tol); xx1=xx(n+1:-1:2); xx1=[conj(xx1),xx]; absxx1=abs(xx1); pause n1=[-n:n]; stem(n1,absxx1); title('The Discrete Magnitude Spectrum') phasexx1=angle(xx1); pause



stem(n1,phasexx1) title('The Discrete Phase Spectrum')



******************************************************************************************************************************************************

Plot the Discrete Spectrum of the Signal





>> n=[-20:20];
>> x=abs(sinc(n/2)); 
>> stem(n,x)


Reference:

[1] J. Proakis and M. Salehi, "Contemporary Communication System using Matlab"

Labels:


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]