Uploaded by M UMAR ALI

PCS-LAB-REPORT 1 (FA19BEE-075)

advertisement
FA19BEE-075
LAB # 1
To Sketch Frequency Domain Representation of Signals for Analysis of
Communication Systems Using MATLAB
Objectives

To display magnitude and phase response of Fourier series coefficients using
MATLAB for visualization of signals in communication systems.
Required Equipments
Software

MATLAB
Procedure

Fourier series decomposed periodic functions or periodic signals into the sum of a
(possibly infinite) set of simple oscillating functions, namely sine’s and cosines (or
complex exponentials). The study of Fourier series is a branch of Fourier analysis.

In mathematics, the DFT is a specific kind of discrete transform, used in Fourier analysis.
It transforms one function into another, which is called the frequency domain
representation of the original function (which is often a function in the time domain).

The DFT requires an input function that is discrete. Such inputs are often created by
sampling a continuous function, such as a person’s voice. The discrete input function
must also have a limited (finite) duration, such as one period of a periodic sequence or a
windowed segment of a longer sequence.

Evaluate the Fourier series coefficients using:


Plot the magnitude |Dn| (in volts) and phase ∠Dn (in degrees0 of the first twenty-one
coefficients, Let {n = -10,……..0,…….10} versus frequency (in rad/sec).

Approximate g(t) using the first ten components of the Fourier series.

Plot two periods of g(t) directly i.e. by creating a vector of samples of g(t) and plotting
that vector.

Plot an approximation to g(t) using these first twenty-one terms of the exponential
Fourier series.
Tasks
functiony = sinc1(x)
k =length(x)
fori = 1:k
ifx(i) == 0
y(i) = 1
else
y(i) =sin(x(i))/x(i)
end
end
end
% sinc function implementation
Task
n = [-10:10];
z = n*(pi/4)
Dn = 0.25*exp(-1*z).*sinc 1(z);
magDn=abs(Dn);
argDn=angle(Dn) *(180/pi) ;
w= 0.5*n;
stem(w,magDn),xlabel(' Frequencyinrad/s ec (unitsofpi)')
grid
title('MagnitudeoftheExponentialFourierseriescoefficients')
stem(w,argDn),xlabel(' Frequencyinrad/s ec (unitsofpi)')
ylabel(' degrees' )
grid
title(' Phaseof theExponentialFourierseriescoefficients')
Task
n = [-10:10];
z = n*(pi/4)
Dn = 0.25*exp(-1*z).*sinc 1(z);
nwo=n*(pi/2);
t = [0: 0.01: 8]
BIG = nwo.*t;
g = Dn*exp(i*BIG)
w= 0.5*n;
plot(t, real(g)),
grid
xlabel(' second' )
title('Approximation to g(t) suing the first ten components of the Fourier series')
Task
function[y] = u(x)
y = 0.5+0.5*sign(x)
end
gt= (u(t)-u(t-1)) + (u(t-4) -u(t-5)) + u(t-8);
plot(t, gt),
grid
xlabel(' second' )
title(‘The real g(t)’)
axis ([0.8 -0.2 1.2])
Task
z=fft( g) ;
stem( t , z) ;
z1 =fftshift( z ) ;
n =[1 : 1 :1 2 8 ];
a=n-65;
f =0.5* a;
stem( f, abs ( z1 ) )
Task
t=-1: 1/142 : 1-(1/142);
g1=0:1/71:1-(1/71);
g2= -1:1/71:1-(1/71);
g3= -1 : 1/71: 0-(1/71);
g=[g1 g2 g3];
subplot(3,1,1)
plot(t,g);
title('g(t)')
%%axis([-1.5 1.5 -1.5 1.5])
subplot(3,1,2)
plot(t,abs(g))
title('magnitude of g(t)')
subplot(3,1,3)
plot(t,angle(g))
title('phase of g(t)')
Y=fft(g);
figure
stem(t,Y)
title('fft of g(t)')
y1=fftshift(Y);
n=[1:1:284];
a=n-65;
f=0.5*a;
stem(f,abs(y1))
title('magnitude of fftshift')
figure
stem(f,angle(y1))
title('phase of fftshift')
Results
Conclusion
Acknowledge the display of magnitude and phase response of Fourier series
coefficients using MATLAB for visualization of signals in communication systems.
Download