Vous êtes sur la page 1sur 6

MUDDASSAR HUSSAIN

Student ID # 6597

ADSP LAB # 3
Submitted By :

MUDDASSAR HUSSAIN

Registration No. :

6597

Date: 05-10-2014

Qs #1. Brief insight of lab:


As systems are very important parts of digital signal processing & systems have a great impact
on the desired output in digital signal processing. To deal with systems effectively we must know
about their properties. This lab provides better understanding of testing of systems properties
like linearity, stability, causality & time invariance.
Second important thing is that how we get output from the systems, this is done by convolving
the input signal with impulse response of the system. Lab tasks also provide a great practice of
finding impulse responses.
There is also some information about methods of filtering of signals like moving average filter &
in DSP filtering play very important role. So, this lab also give some ideas about filtering &
implementation of filtering in Matlab.

Qs#2. What is moving average filter, its use and what happen if we increase
the number of filter taps?
The moving average filter operates by averaging a number of points from the input signal to
produce each point in the output signal.
This filter is used in reducing random noise while retaining a sharp step response. This makes it
the premier filter for time domain encoded signal. Moving averages are used to smooth out shortterm fluctuations. If we increase the number of filter taps then filtering quality will also increase.
But computation cost will increase.

Qs#3. Which is better approach to find output using command of impz or


filter, state clearly?
Length of output of both of these commands is different. Filter command is better approach
because filter command also deal easily with FIR & IIR systems.

Qs#4. Can we find output of non-causal system using filter command, State
the method?
Yes we can find output of non-causal system by using filter command. The procedure of using tis

MUDDASSAR HUSSAIN

Student ID # 6597

command is same as in causal systems. The output vector y returned by filter contains samples of y[n]
on the same interval as the samples in input. Both output & input contain same number of samples. As
filter command needs some prior values of input & some priors values of output in order to compute
the first output value. The function filter assumes that these samples are zero.

Qs#5. If the LTI system in question 1 is changed from y[n] =0.5(x[n] + x[n - 1])
to y[n] =0.5(x[n] - x[n - 1]), what would be its effect on the input x[n] = s[n] +
d[n]?
If the LTI system is changed from y[n] =0.5(x[n] + x[n - 1]) to y[n] =0.5(x[n] - x[n - 1]), then
our input x[n] signal will be diminished. We get zero at the output.

Qs#6. Why the output generated by impz and filter commands varies?
By using impz command we get impulse response of system & then we convolve it with the
input. So, the output length will be length(x)+length(y)-1. On the other hand length of output of
filter command is equal to length of input signal x. Due to this output of both commands varies.

Qs#7. State the method to find the BIBO stability of a IR system.(MATLAB


Approach)?
The impulse response of an LTI system is sufficient for its complete characterization. A system
is BIBO stable when its impulse response is absolutely summable.
First we find impulse response by using impz command & then by using a for loop we add the
magnitude of all the impulse responses. If it is summable then our system will be stable
otherwise unstable.

Qs#8. Find the Step Response of the following system using impz
command, N=20.
y[n]+0.71y[n1]0.46y[n2]0.62y[n3]=0.9x[n]0.45x[n1]+0.35x[n2]+0.002x[n3].
num = [0.9 -0.45 0.35 0.002];
den = [1 0.71 -0.46 -0.62];
m=impz(num,den,20);
for n=1:50
u(n)=1;
end
y=conv(m,u);
plot(y)

MUDDASSAR HUSSAIN

Student ID # 6597

Codes
Qs # 1:
(a)
s= [6 6 6 6 6 7 7 7 7 7
N=length(s);
d=0.8*(rand(1,N)-0.5);
n1=0:N-1;
n2=n1;
x=s+d;
subplot(1,3,1);
stem(n1,s);
subplot(1,3,2);
stem(n2,x);

8 8 8 8 8 ];

%%% Signal Shifting by using a function (made by myself) %%%%%


[y1,n3] = signalshift(x,n1,1);
[y2,n4] = signalshift(x,n1,-1);
[y3,n5] = signalshift(x,n1,0);
%%%% Signal Addition by using a function (made by myself) %%%%%
[y4,n6] = sigadd(y1,n3,y2,n4);
[y5,n7] = sigadd(y3,n5,y4,n6);
y=y5/3;
subplot(1,3,3)
stem(n7,y)

Fig. 1 Outputs of Qs # 1 (a)

MUDDASSAR HUSSAIN

Student ID # 6597

(b & c)
s= [6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 8];
N=length(s);
d=0.8*(rand(1,N)-0.5);
n1=0:N-1;
n2=n1;
x=s+d;
subplot(1,3,1);
stem(n2,x);
num = [1 1 1];
den = [3 0];
h=impz(num,den);
y=conv(h,x);
subplot(1,3,2)
stem(y)
h1=filter(num,den,x);
subplot(1,3,3)
stem(h1)

Fig. 2 Outputs of Qs # 1 (b & c)

MUDDASSAR HUSSAIN

Qs # 2:
n=0:40;
a=2; b=-3;
x1= cos(2*pi*0.1*n);
x2= cos(2*pi*0.4*n);
num = [2.2403 2.4908 2.2403];
den = [1 -0.4 0.75];
h=impz(num,den,20);
subplot(2,3,1);
stem(h)
y1=conv(h,x1);
subplot(2,3,2)
stem(y1)
y2=conv(h,x2);
subplot(2,3,3)
stem(y2)
x=a*x1+b*x2;
y=conv(h,x)
subplot(2,3,4)
stem(y)
y4=y1+y2;
subplot(2,3,5)
stem(y4)
y5=filter(num,den,x);
subplot(2,3,6)
stem(y5)
[z,p,k] = tf2zp(num,den)

z=
-0.5559 + 0.8312i
-0.5559 - 0.8312i
p=
0.2000 + 0.8426i
0.2000 - 0.8426i
k=
2.2403

Student ID # 6597

MUDDASSAR HUSSAIN

Student ID # 6597

Fig. 3 Outputs of Qs # 2

Vous aimerez peut-être aussi