You are on page 1of 11

Swinburne University of

Technology
Faculty of Engineering and Industrial
Sciences

EEE40003
DIGITAL SIGNAL
&
IMAGE
PROCESSING
Lab 3: Discrete LTI Systems
Group: 07 (Tuesday 12.30 pm)
Student Name

Student Number

WARNAKULASURIYA
PEIRIS

1729608

Signature

EEE40003 DSP |Lab Report Discrete LTI Systems

Part B: Simple FIR System


y ( n)

h( r ) x ( n r )

1)
y ( n)

(1)

x(n) x( n 1) x(n 2) x (n 3) x(n 4)

5
5
5
5
5

(3)

By analysing equation 3, we can say that the theoretical unit pulse


response of the system would results in 5 pulses with magnitude 0.2 for
each pulse. By comparing both equation we can see that the magnitude of
h(r) is zero for all n>4 and n< 0. For the values of n=0, 1,2,3,4 the
magnitude of h(r) will be 0.2. As it is obeying the h(r)= 0 for all n<0, the
system is said to be casual.

2) Writing a m-file function maverage:


function y =maverage(x)
N=length(x);
if N<5;
error('x array must have length at least 5')
end
y(1)=x(1)/5;
y(2)=(x(2)+x(1))/5;
y(3)=(x(3)+x(2)+x(1))/5;
y(4)=(x(4)+x(3)+x(2)+x(1))/5;
for n=(5:N);
y(n)=(x(n)+x(n-1)+x(n-2)+x(n-3)+x(n-4))/5;

EEE40003 DSP |Lab Report Discrete LTI Systems

end

Input

3) Unit impulse response using

0.5

maverage function
>> x=[1 zeros(1,31)];
>> stem(x)

10

15

25

30

35

25

30

35

Output

0.2

>> z=maverage(x);
>> stem(z)

20

0.15
0.1
0.05
0

0
5
10
15
20
From the figure we can
clearly prove the
statement we had put in part 1 i.e. for all the n=0, 1, 2, 3, 4 the
magnitude is 0.2 and for n<0 and n>4 the response is zero.

4) Unit step response of the

Input

system:
>> x=ones(1,32);
>> z=maverage(x);

0.5

In this figure, we can


observe that the magnitude
of the h(r) is increasing by
0.2 up to n=5. After
reaching n=5 the h(r) = 1
which will be a constant.

10

15

20

25

30

35

20

25

30

35

Output

0.5

10

15

5) Output of system with the input blood velocity trace:


>>bv;
EEE40003 DSP |Lab Report Discrete LTI Systems

>> z=maverage(x);
>> plot([1:length(x)], z, 'r', [1:length(x)], x, 'b');
300

Blue line
represents the
original signal
which is the
Input Blood
Velocity trace,
while the red line
represents the
output signal.

250

200

150

100

50

100

200

300

400

500

300

250

200

150

100

50

100

200

300

400

500

600

The output signal of the system is much smoother. Also it shows less noise compared to
the input blood velocity trace (input signal).
The system acts as a moving window average the takes the average of 5 signals when it
moves along the signal resulting in the noise being reduced.

6) Set a to the theoretical unit impulse response as in equation (3):


>> a=[1 1 1 1 1]./5;

7) Unit pulse convolved with finite response system:


>> b = [1 zeros(1,31)];
>> y = conv(a,b);
EEE40003 DSP |Lab Report Discrete LTI Systems

600

0.2
0.18
0.16
0.14
0.12
0.1
0.08
0.06
0.04
0.02
0

10

15

20

25

30

35

40

Convolution is simply multiplication. From the figure above we can see


that for the array a, n ranging from 1 to 5, we have magnitude for
h(r)=0.2. For the array b we can see that, the figure gives the magnitude
0.2 only for b (1). For all other values of array b it gives a zero
magnitude.
1

8) Unit Step
Response

0.9

>>
b=ones(1,32);
>>
stem(conv(a,b));

0.7

0.8

0.6
0.5
0.4
0.3
0.2
0.1
0

10

15

20

25

30

35

EEE40003 DSP |Lab Report Discrete LTI Systems

40

Blood Velocity Data


300

>> bv;
>> plot(conv(a,x));

250

200

150

The window acts as a filter and


takes an average as it moves
along the blood trace input.

100

50

100

9) Coefficient arrays for the system:

200

300

400

500

600

Impulse Response

0.2
0.18

>> a = [1 zeros(1,31)];
>> b = [0.2 0.2 0.2 0.2 0.2 zeros(1,27)];
>> dimpulse(b,a,32);

0.16
0.14
0.12

Amplitude

Comparing the above graph


with the result we got before,
we cannot see the pulses,
eventhough the two graphs are
the same. The invisibility of the
pulses is due to the function we
have used.

0.1
0.08
0.06
0.04
0.02
0

10

15

20

25

Time (sec)

10)

EEE40003 DSP |Lab Report Discrete LTI Systems

30

Impulse Response

0.2
0.18
0.16
0.14

Amplitude

0.12
0.1
0.08
0.06
0.04
0.02
0

10

15

20

25

30

Time (sec)

QUESTION 1: Explain why equation (6) produces the same output

as equation (3).
y ( n)

x (n) x ( n 1) x (n 2) x (n 3) x (n 4)

5
5
5
5
5

1
y (n) y (n 1) ( x(n) x(n 5))
5

The recursive system depends on the present input, past input and previous
output, while, the non-recursive system depends only on present input. In the
equation 3 and 6 above, we can see that the magnitude in each case is the same
thus giving the same output.
In other words, the coefficient array of equation 6 is the same as the equation 3, 0.2 from 0<n<6
and 0 elsewhere.

EEE40003 DSP |Lab Report Discrete LTI Systems

Part C: Simple IIR System


1)
y (n) y ( n 1) (1 ) x (n)

When =0.82, the equation will become


y ( n )=0.82 y ( n1 ) +0.18 x (n)

y(n) - 0.82y(n) = 0.18x(n)


Therefore, the coefficient arrays are:
a= [0.18 0]
b= [1 -0.82]

2)
>> a = [1, -0.82];
>> b = [0.18, 0];
>> dimpulse(b,a,32);

EEE40003 DSP |Lab Report Discrete LTI Systems

Impulse Response

0.18
0.16
0.14

Am plitude

0.12
0.1
0.08
0.06
0.04
0.02
0

10

15

20

25

20

25

30

Time (sec)

3)

Unit step response of the system


>> dstep(b,a,32);
Step Response

1
0.9
0.8

Am plitude

0.7
0.6
0.5
0.4
0.3
0.2
0.1

10

15

30

Time (sec)

4)

Output f the system when input blood velocity data


>> bv;
EEE40003 DSP |Lab Report Discrete LTI Systems

>>
y=filter(b,a,x);
>> plot(y);

300

250

200

150

100

50

100

200

300

400

500

600

Question 2: Show that the equation 6 does follow from the block diagram:

1-

x(n)(1-)

x(n)

x(n)(1-) + y(n-1)

y(n) = y(n-1) + (1-) x(n)

y(n-1)

y(n-1)

y(n) -y(n-1) = (1- ) x(n) follows from the block diagram

Question 3: What analogue system do the results in step 2 and 3 suggest this discrete
system approximates?
By analysing the graphs obtained in step 2 and step 3 we can see that,
the amplitude in graph 2 is decreasing with the time period and reaching
EEE40003 DSP |Lab Report Discrete LTI Systems

10

zero at some point. While in the graph 3 we can see that the amplitude is
increasing with the time and reaching a constant value. The system
represents the digital filter which is clearly non-casual and IIR.

EEE40003 DSP |Lab Report Discrete LTI Systems

11

You might also like