Anda di halaman 1dari 15

Lab #1

ECEN 720
High-Speed Links: Circuits and Systems







January.27.2014


Binod Adhikari (919-00-5213)










Transmission Lines:

Digital Filters:
a. Digital filters are broadly classified into FIR and IIR filters. Give an example of an FIR
filter and IIR filter (transfer function). Plot the transfer function in MATLAB. Identify the
poles and zeros on the plot.

A digital IIR filter is derived from its analog counterpart using some kind of transformation
techniques such as bilinear transformations. Its difficult to control its phase response, can be
unstable, can have limited cycles and the order of filter is limited. There is both feedback and
feed-forward paths to the output for digital filter which makes it unstable and is easily
represented using a differential equation.
Similarly the transfer function for the IIR filter follows the following equation:

(




A digital FIR filter is has linear phase, always stable, poly-phase implementation possible and
can be implemented for high order filters as well. In a sense its a true digital filter with no
analog background associated with it. The output of the filter does not depend on future
values and only provides a feed-forward path.

The general transfer function for the FIR filter follows the following equation:
(



FIR is the same as the IIR filter where all the poles are at the infinity.
The transfer function of the IIR filter is as follows:


The transfer function associated with FIR filter is as follows:



The functions were plotted in MATLAB and position of the pole zero plot were also
determined for each case:

FIR Filter
B = [1 1/2 1/3];
A = [1];
[H,W] = freqz(B,A);

% plot the frequency response H(w)
figure(1);
plot(W,abs(H));

figure(2);
plot(W,angle(H));

% pole zero plot of the FIR filter
figure(3);
zplane(B,A);
Now the plots for the FIR filter are as follows:

Magnitude response of the FIR Filter




Phase response of the FIR filter


Fig Pole zero plot of the FIR filter

IIR Filter:
B = [1];
A = [1 0.2 0.4 0.2];
[H,W] = freqz(B,A);

% plot the frequency response H(w)

figure(1);
plot(W,abs(H));

figure(2);
plot(W,angle(H));

%pole zero plot of the IIR Filter
figure(3);
zplane(B,A);



Fig Magnitude response of IIR filter


Fig Phase response of IIR filter


Fig Pole zero plot of the IIR Filter

Part 1.b
For the given set of transfer functions H(z) =

is a FIR filter and


is a IIR filter. The MATLAB plot of the filter functions are as follows:

FIR Filter:

Fig Magnitude response of the FIR Filter


Fig Phase response of the FIR Filter



Fig Pole zero plot of the FIR Filter

IIR Filter:

Fig Magnitude response of IIR Filter


Fig Phase response of IIR Filter


Fig Pole Zero plot of IIR filter

Part 1.C
The FIR filter are always stable since there is feedforward path only and it value does not
depend on future inputs. But in case of IIR filter its output may depend on past and future
inputs, i.e both feedback and feedforward paths are possible making it unstable. In the pole
zero plot, if the pole of the transfer function is outside the unit circle the system is unstable as
if its in right half plane in s domain. But the zero of the transfer function can still be outside
the unit circle and still be stable. Careful considerations should be made while designing the
IIR filter. Here is one example.

Matlab Code for the unstable IIR filter:

B = [1 1];
A = [1 1 -0.5];
[H,W] = freqz(B,A);

figure(3);
zplane(B,A);

% plot the frequency response H(w)

figure(1);
plot(W,abs(H));

figure(2);
plot(W,angle(H));

Here the pole zero plot shows that one of the pole is outside the unit circle making it unstable.

Fig Pole zero plot of the IIR filter where one of the pole is outside the unit circle making it
unstable


Sampling:
X1(t) = cos(2F1t) F1 = 300MHz
X2(t) = cos(2F2t) F2= 800MHz
Fs = 500MHz

Sampling frequency is less than twice the signal frequency in the first case (F1) and its less
than signal frequency in the second case, which means there will be aliasing in the frequency
domain. We will not be able to retrieve all the information in the sampled signal. To retain
most of the information the sampling frequency must be at least twice the signal frequency as
defined by the Nyquist theorem.


Sampled signal for F1 = 300MHz


Fig Sampled signal for the F2 = 800MHz

2B. Sampling at 500MHz we cannot recover the signals. So to fully recover the signals we
need to increase the sampling frequency atleast twice the signal frequency.

2C.
Reconstruction of the signal

clear; close all;
%
u = 1/80E9;
Fs = 800E6;
T = 1/Fs;
F1 = 300E6;
Ts = 1/1000*Fs;
%
t = 0:u:10/F1-Ts;
xa = cos(2*pi*F1*t);

x1 = cos(2*pi*300E6*t);
% (a) Plots of sequences

n1 = 0:Ts:10/F1-Ts;
xr = 0;

for t = 0:0.1/Fs:(10/F1-0.1/Fs)
xr = 0;
i = i+1;
for n = 1:length(xa);
m = i-1;
xr = xr + xa(n).*sinc(pi*(t-m.*Ts)/Ts);
end
tr1(i) = xr;
ds=ds+(xtr1(i)-x1(i))^2;
end

plot(t,xr);

I could not get my code to work properly so missing part d as well.

3. Discrete Fourier Transform:
3a. For signal X(t) = cos (2Ft) where F = 200MHz and Fs = 500MHz. Compute 50 point
DFT and plot the output.

Fig Normalized 50 point DFT of the sampled signal with sampling frequency of 500MHz

Matlab Code for the DFT:

F = 200E6; %Input frequency
Fs = 500E6; % sampling frequency
T = 1/F;
tmin = 0;
tmax = 20*T; % period
dts = 1/Fs;
t = tmin:dts:tmax;
x1 = cos(2*pi*F*t);
nfft= 50;
Z = fft(x1,nfft);
Z = Z(1:nfft/2); % considering the one sided spectrum only
mx = abs(Z);
f = (0:nfft/2-1)*Fs/nfft;

plot(f,2*mx/nfft);


3b. .For signal y(t) = cos (2F1t) + cos(2F2t) where F1 = 200MHz F2 = 400MHz and Fs =
1GHz. Compute 50 point DFT and plot the output.

Fig Normalized 50 Point DFT with input signal at 200 &400 MHz and sampling rate or
1GHz

3C. Repeat part b with Fs = 500MHz.

Fig Normalized 50 Point DFT with input signal at 200 &400 MHz and sampling rate of
500MHz

We can clearly see that the position of the signal has shifted from 200MHz and 400MHz to
100MHz and 200MHz respectively.

Anda mungkin juga menyukai