Nothing Special   »   [go: up one dir, main page]

Signal Processing Assignment: Donald Carr May 18, 2005

Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 39

Signal Assignment

Processing

Donald Carr May 18, 2005

Common facts

Question 1

My -3 dB frequency was : 2 kHz = 2 p 2000 c The circuits were taken from the Electronic Filter Design Handbook (Williams, 1981). Standard values were acquired for the respective configurations and denormalised accordingly using the FSF and Z adjustment.

CLC
Rs C1 L2 C3 Ro

= 600 = 0.132 F = 95.5 mL = 0.132 F = 600

Rs

L2

C1

C2

Ro

Figure 1: The

p CLC circuit

T LCL

R s = 600 L1 = 0.048 mL Standard values were acquired L3 = 0.048 R o mL = 600

C 2 = 0.265

Rs

L1

L3

C2

Ro

Figure 2: The T LCL circuit

Question 2 : The configuration Matrix loop equation


Rs

L1

L3

C2

Ro

Figure 3: The T LCL circuit For the sake of convenience I have dropped the explicit time dependence from the terms. Similarly, I have dropped the explicit s dependence of the terms following the Laplace transform.

Loop 1
v =0= 0= 0= = > 0= 0= U =( v Rs + vL 1 + vC i1 R s + L 1 di 1 dt R
s 2

-u
t

di 1

+1 dt C2 d 2 i1 dt

( i1 - i
0

) dt + v (0) - u

+ L1

+ 1 ( i1 - i C2 C2 (I1 I
2

) - du dt )sU (Laplace)

sI 1 R s + L 1 s 2 I 1 + 1 I 1 R s + L 1 sI R s + sL
1 1

+1 (I sC 2 1 I sC 2 ) I1 -

+1

)U

sC 2

I2

Loop 2
v =0= 0= 0= = > 0= 0= vRo + vL 3 - v i2 R o + L 3 di 2 di 2 dt d2 i2 dt C 2

1 C2
0

( i1 - i 1

) dt - v

(0)

( i - i 2 ) dt C2 1 1 sI 2 R o + L 3 s 2 I 2 (I ) dt (Laplace) C2 1 I 2 1 I 2 R o + L 3 sI 2 (I ) dt sC 2 1 I 2 dt R
o

+ L3

0=

- 1 sC 2

I1 + ( R o + sL

+1 )I sC 2 2

R s + sL 1 + I1 I2
- 1 s C

1 s C

Ro +
1

- 1 s sL 3 C

1 s C - 1 s sL 3 C

I1 I2 +

=
- 1 1

U 0 U 0

R s + sL
- 1 s C

1 s C

Ro +

s C

I2 But : y Y Y Since : y Y H H

= = = = = = = =

U sC 2 R s R o + s 2 CL 3 R s + s2 CL i2 R o I2 R o sC 2 R s R o + s 2 CL 3 R s + s2 CL h*u HU Y U Ro sC 2 R s R o + s 2 CL 3 R s + s2 CL Since L 1 = L 3 = L,
1 1 1

R o + s 3 CL

L 3 + sL 1 + sL 3 + R s + R o

UR

o 1

R o + s 3 CL

L 3 + sL 1 + sL 3 + R s + R o

R o + s 3 CL

L 3 + sL 1 + sL 3 + R s + R o

R s = R o = R, C
R2 L2

s3 +

2R L

s2 + (

R C L2 L C

)s +

2R L2 C c

After substituting in component values and reducing in terms of


3

H ( s) =

s3 + 2

s2 + 2 c

2 c

s +

3 c

state technique

variable
di 1 dt dv 2 dt di 3 dt y = = = = a 1 1 i1 + a1 2 v 2 + a 1 3 i3 + b1 1 u a 2 1 i1 + a2 2 v 2 + a 2 3 i3 + b2 1 u a 3 1 i1 + a3 2 v 2 + a 3 3 i3 + b3 1 u c1 1 i 1 + c1 2 v 2 + c1 3 i 3 + d1 1 u

dx dt sX ( s [I ] - [A ]) X X and y = [ Y Y But H = Y U H

=[ =[ =[ =( =[ =[ =[

A ]x + [ B ]u A ]X + [ B ]U B ]U s [I ] - [A ]) C ]x + [ D ]u C ]X + [ D ]U C ]adj ( s [I ] - [A ])T [B ]U det ( s [I ] - [A ]) + [ C ]adj ( s [I ] - [A ])T [B ] det ( s [I ] - [A ]) + [ D ]U D]


1

[B ]U

Where : s+ ( s[I ]- [A ]) =
- 1 C R L 1 L

0 s +
1 C

, [C ] = 0 0
R L

- 1 L

Ro

, [B ] =

1 L1

0 0

, [D ] = 0

det ( s [I ] - [A ]) = and [ C ]adj (s [I ] - [A ]) T [B ] = H (s ) =

s3 + ( Ro CL
1

Ro L3

Rs L1

RoRs R o + Rs ) s2 + ( 1 +1 + )s + L3 C 2 L 1 C2 L3 L1 L 1 L3 C2

L3
Ro L3

s3 + (

Rs L1

)s 2 + (

C 1L L3 C 2

Ro
1

L3 L
1

1 C2

Ro Rs L 3 L1

)s +

Ro + Rs L 1 L 3 C2

After substituting in component values and reducing in terms of


3 c

H (s ) =

s3

+2

s2

+2

2 c

s +

3 c

It was very reassuring that both the matrix loop equation and state variable technique produced the same transfer function for their common circuit.

Rs
12

L2

C1

C2

Ro

Figure 4: The

p CLC circuit

Node 1

Question 3 Matrix equation


i =0= 0= 0= 0= => 0= 0= U

node

iRs + i L 2 + iC v Rs Rs u-v Rs
du dt

1 t

+ C1
1

dv

+1 dt L2 d(0 - v dt

vdt + i (0)
0 1

+ C1 -C
1

+1 L2

( v2 - v
0

) dt + i(0)

Rs

dv1 dt

d2 ( v1 )
1

dt
2

+ 1 ( v2 - v L2
1

s( U - V Rs U-V 1 Rs = (1 +

-s

C 1 V1 + 1 (V - V L2 2

) (Laplace)

- sC

sC 1 R s

V1 + 1 (V - V 1 ) sL 2 2 Rs + ) V - R s V2 sL 2 1 sL 2
1

Node 2
i =0= 0= 0= 0= = > 0= 0= iL
2

+ i C 2 + iRo + C2 + C2 + C2 dv
t

vRo Ro v2 Ro
dv 2 dt

+1 dt L2 1 L2 dt -

vdt + i(0)
0 t

d( v2 ) d2 ( v2 ) dt -

( v1 - v
0

) dt - i

(0)

1 L2 1 L2 1

Ro sV 2 Ro V2 Ro

( v1 - v
2

+ s 2 C 2 V2 + sC 2 V2 -

( V1 - V ( V1 - V
2

) (Laplace) )

sL

0=

- 1 sL 2
Rs s 2 L

V1 + ( 1 + sC 3 + 1 )V sL 2 Ro 2
-R s s 2 L sC

(1 + sC 1 R s +
- 1 s 2 L

) (
1 s L
2

+ )

1 Ro

)
-R s s 2 L sC

V1 V2

=
- 1

U 0 U 0

V1 V2

= (1 +

sC 1 R s +
- 1 s 2 L

Rs s 2 L

1 s L
2

1 Ro

But :

y Y Y

= = =1 =

v2 V2 U det sL
2

where :

sL 2 det

c1 R s C 3 L 2 ( s 3 + (
Rs 1 C1 C3 L

)
2

1 C1 Rs

1 C3 Ro

) s2 + (

1 C1 Rs C3 Ro

1 C3 L

+
2

1 C 1 L2

)s +

1 R o C 1 C 3 L2

But :

Y H

= =

HU ( s3 + (
1 C1 Rs

1 C3 Ro

) s2 + (

1 C1 Rs C3

1 c1 R s C 3 L 2 1 + Ro C3 L 2

1 C 1 L2

)s +

1 R o C 1 C3 L

+
2

1 R s C 1 C3 L

)
2

After substituting in component values and reducing in terms of


3

H (s ) =

s3

+2

s2

+2

2 c

s+

3 c

state technique

variable
di 1 dt dv 2 dt di 3 dt y = = = = a 1 1 i1 + a1 2 v 2 + a 1 3 i3 + b1 1 u a 2 1 i1 + a2 2 v 2 + a 2 3 i3 + b2 1 u a 3 1 i1 + a3 2 v 2 + a 3 3 i3 + b3 1 u c1 1 i 1 + c1 2 v 2 + c1 3 i 3 + d1 1 u

Identical algebra to that covered in Question 2 : state variable H =[ C ]adj ( s [I ] - [A ])T [B ] det ( s [I ] - [A ]) + [ D]

s+ ( s[I ]- [A ]) =

1 Rs C1 - 1 L2

1 C1

0 s +
1 L2 Ro C 1
3

- 1 C3

, [C ] = 0 0 1

, [B ] =

1 R s C1

0 0

, [D ] = 0

det ( s [I ] - [A ]) = s3 +(
1 Ro C1

1 Rs C3

) s2 + (

1 C 1 L2

1 C3 L2

1 R o R s C1 C 3

)s +

1 Ro Rs

1 R s R o C 1 L2

1 R s R o C 3 L2

and [ C ]adj ( s[I ] - [A ]) T [B ] = 1 H (s ) =


1 Rs C 1 L 2 C 3 1 Ro Rs C 1 C 3

R s C1 L 2 C 3

s 3 +(

1 Ro C 1

1 Rs C 3

) s2 +(

1 C 1 L 2

1 C 3 L 2

)s +

1 Ro Rs

1 Rs Ro C 1L 2

1 Rs Ro C 3 L 2

After substituting in component values and reducing in terms of


3 c

H ( s) =

s3

+2

s2

+2

2 c

s +

3 c

Again the separate derivations converged on the same transfer function, and corroborated the earlier transfer function garnered from the T configuration topology. This consistency verified the inherent characteristics of the filter which are independent of the topology we choose to adopt.

Characteristic polynomial : System di erential equation :

Question 4

s3 + s 2 2
d y dt
3

+ s2
d y c dt
2

2 c

+2

+2

3 c 2 dy c dt

3 c

y =

3 c

There are no zeros since there are no s terms in the numerator. We need to discover the poles of the transfer function, so we simply factorise the denominator. 1 s3 + s2 2 (s + 1 (s +
c c

Question 5

+ s2 1 + j

2 c

+
2 c

3 c

)(

s2

s +
v 2 3

) )

)( s +

+ j

v 2

)( s +

eigenfrequencies :

s or s or s

v = c

2+ 2 j
c

j v

3 2 3 2
c c

Figure 5: Pole Zero diagram Since the poles are all on the left hand side of the imaginary axis, we know from our notes that the filter is stable.

Question 6
3

H ( s) =

s3 + 2

s2 + 2

2 c

s +
v 2 2 3
3 c

3 c

H ( s) =

(s +

)( s + c

+ j

c
3 c

)( s +

j +
c

v 2

H (j

)= (j +
c

)( j

v 2

2 3

)( j

v 2

Magnitude is given by : |H (j )| = | |( j +
c
3 c

) || ( j

v 2

2 3

| j
c

) || ( j v 3 2

v 2

)| v 3 2

Phase is given by : H (j )= - ( j +
c

) - ( j

) - (

2+

10

3rd o rd e r B u tt er wo rt h h ig h p as s f ilt er wc = 2 k h z

1.2

0.8

0.6

0.4

0.2

0 -2 5000 -2 0000 -1 5000 -10 000 -50 00 0 500 0 1000 0 1500 0 2000 0 2500 0 Fr eq uen cy [r ad s]

Figure 6: excel : Normalised gain vs frequency

25 0

20 0

15 0

10 0

50

0 -2 5 00 0 - 20 0 00 -1 50 0 0 - 10 0 00 -5 00 0 0 50 0 0 1 0 00 0 15 0 00 2 0 00 0 25 0 00

-5 0

- 10 0

- 15 0

- 20 0

- 25 0 fre que nc y [r a ds]

Figure 7: excel : phase vs frequency

11

0 .9

0 .8

0 .7

0 .6

0 .5

0 .4

0 .3

0 .2

0 .1

0 - 2 - 1.5 - 1 -0 .5 0 0.5 1 1.5 2 freq uenc y [r ads ] x 10


4

Figure 8: matlab : gain vs frequency

200

150

100

50

- 50

- 100

- 150

- 200

-2 -1. 5 - 1 -0.5 0 0.5 1 1. 5 2 fr equenc y [r ads ] x 10


4

Figure 9: matlab : phase vs frequency

12

These graphs, which were derived independently in excel and matlab, are consistent with each other and show the transfer function behaving as expected, with the at passband characterstic of a Butterworth filter. The filter allows low frequencies through, and attenuates the amplitude of the input signal by v 2 at the cuto frequency. ( c 12000 rads)

Looking at the pole zero diagram, we can imagine a third dimension, representing gain, stemming out of the page with the poles rising o to infinity and stretching the surrounding area upwards. Looking at the imaginary axis, we can see the angular frequency running o to infinity in both directions. At the origin the gain is a maximum, with all three poles pulling up the surrounding area. As the angular frequency increases away in both directions the gain diminishes as the vector distance from all three poles steadily increases. The at passband evident in the gain vs frequency graph, is conveyed in the varying real/imaginary components of the poles. The completely real pole has the largest impact on gain, with the conjugate imaginary poles constructively adding their gain as the gain from the real pole rolls o .

Question 7

Question 8
a (s +
c

)( s +

+ j

v 2

3
3 c

)( s +

j j

v 2

=
3 c

K1 (s + K1 (s + ) + (s + c
2
c

K2
c

) =

) + (s +

+ j K2 + j

v 2

+
3 c

K3 (s +
c

) +

(s +

c )( s +

+ j

v 2

2 3 c )( s + 2
c

v 2

c )

v 2

j K3 j

v 2

c )

(s +

v 2

13

Question 8 wc h = wc/2 = root(3)/2*jwc = 10882.7961854053i

12566.37061 100 6283.185307

p1 p2 p3 wc -wc/2 - j(root(3)/2*wc) -wc/2 + j(root(3)/2*wc) -12566.37061 -6283.18530717959-10882.7961854053i -6283.18530717959+10882.7961854053i alpha residues k1 6283.18530717961 k2 -3141.5926535898+1813.79936423422i k3 -3141.5926535898-1813.79936423422i
Figure 10: Excel calculated residues

9.92201E+11

4/23/05 2:10 PM MATLAB Command Window 1 of 1

alpha = 9.9220e+011

K1 = 6.2832e+003

K2 = -3.1416e+003 +1.8138e+003i

K3 = -3.1416e+003 -1.8138e+003i

Figure 11: Matlab calculated residues

14

The Laplace transform of


v

Question 9
c

a
3 2 c

(s +

)( s +

c 2

+ j

)( s +

c 2

K
3 2 c

-j

ep

+ K 2 ep

+ K 3 ep

= h ( t)

Where : K1 = K 2 6283.18530717961 = K 3 -3141.5926535898+1813.79936423422i = -3141.59265358981813.79936423422i p1 = p2 -12566.37061 = -6283.18530717959p3 10882.7961854053i = -6283.18530717959+10882.7961854053i h (t ) = h (t ) = Since K2 h (t ) = h (t ) = = K 1 ep


1

+ K 2 ep

+ K 3 ep

K 1 e1 2 5 6 6. 3 7 0 6 1t + |K|e K 3 (Conjugate pair) K 1 e1 2 5 6 6. 3 7 0 6 1t + |K|e K1 e1 2 5 6 6. 3 7 0 6 1t +2

- 62 8 3 . 1 8 5 3 0 7 1 7 9t 59

( ei

e-i

1 0 8 8 2.7 9 6 1 8 5 4 0 5t 3

+ ei ei(

K3

ei 1 0 8 8 2. 7 9 6 1 8 5 4 0 5t )
3 K +1 0 8 8 2 . 7 9 6 1 8 5 4 0 5t ) 3

- 62 8 3 . 1 8 5 3 0 7 1 7 9t ( e- i ( K 3 +1 0 8 8 2 . 7 9 6 1 8 5 4 0 5t ) + 59 3 |K|e - 62 8 3 . 1 8 5 3 0 7 1 7 95t cos ( K 3 + . 796185405 9

t)

10882

15

3 00 0

2 50 0

2 00 0

1 50 0

1 00 0

50 0

0 0 0 . 00 0 2 0. 0 0 04 0 . 00 0 6 0. 0 0 08 0 . 00 1 0 .0 0 12 0 . 0 01 4 0 .0 0 1 6 0 . 0 01 8 0 .0 0 2

- 50 0 ti m e (s )

Figure 12: Excel impulse response

3000

2500

2000

1500

1000

500

-500

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 ti me [s ec onds ] x 10


-3

Figure 13: MatLab impulse response

16

Using the the bilinear transform within Matlab : Pi =


1+ 1T 2 T 2

Question 10
Pi Pi

fs
e

[hz ] P1 P2 48000 0.7685 0.8561 - 0.1975i 0.8561 + 0.1975i 0.1202 0.1595 - 0.5663i 0.1595 + 8000 0.5663i Table 1: Matlab generated poles for the digital filters
ampl

P3

This bilinear transformation shifts the frequency response of the resulting filters. The higher the sampling frequency, the milder the resulting shift in frequency response. The filter with f s amp = 48kHz therefore basically retains le its initial frequency characteristics, while the filter with f s amp = 8kHz has its le f c dropped to 1700Hz.

Question 11
H (z ) = (1 + z 1

)N -M M
N i =1

(1 Z (1 - P i z - 1 )
i =1

z-

Where there are M = 0 zeros and N = 3 poles H (z ) = (1 + z 3 i=1 1 )3 i

(1 - P

z-

Where the values of the poles are given in table 1 (above) and = K(
3 c

T 2) T

N -M

M i =1 N i= 1

(1 (1 -

T 2 T 2

Zi ) Pi )

3 3 i =1

1 (1 T 2

2( 2)

Pi )

f requency 8000 0.0565 48000 0.000864 Table 2: values

17

for f sa
mple

= 48000Hz (1 + z 1 )3 1

H (z ) =

48000

(1 - 0.7685 z = 8000Hz

)(1 - (0 . 8561 - 0. 1975 i ) z -

)(1 - (0 . 8561 + . 1975 i) z 0

for f sa
mple

H (z ) =

(1 + z 8000

1 )3 1

(1 - 0.1202 z -

)(1 - (0 . 1595 - 0. 5663 i ) z -

)(1 - (0 . 1595 + . 5663 i) z 0

There are three zeros at -1, divulged from the numerator term. The denominator reveals three poles, demarcated by Xes on the graph
I m (z)

Question 12

-1

1 R e (z)

Figure 14: 48000 Hz filter Pole Zero diagram

I m (z)

-1

1 R e (z)

Figure 15: 8000 Hz filter Pole Zero diagram

18

Question 13
Similarly to question 6 Magnitude : |H ( z ) | = | (1 + z |(1 - P
1 1

) |3
1

z-

) || (1 - P

z-

) || (1 - P

z-

)|

Where Phase : H (z ) = S ( H (z ) = 3

is taken from table 2 and

P values are taken from table 1

zeros ) - S ( poles ) (1 + z1

) - (1

-P

z-

) - (1

-P

z-

) - (1

-P

z-

Both Matlab and excel were used in order to establish corroborative evidence for the frequency response of the filter. I felt this was necessary since the shifting inherent in the bilinear transform was not immediate obvious, and I was initially concerned with my results.

19

1.2

0.8

0.6

0.4

0.2

0 -4 - 3 -2 -1 0 1 2 3 4 the ta [r a ds]

Figure 16: Excel: 8000 Hz digital filter normalised gain

30 0

20 0

10 0

0 -4 - 3 -2 -1 0 1 2 3 4

- 10 0

- 20 0

- 30 0 the ta [r a ds]

Figure 17: Excel: 8000 Hz digital filter phase response

20

1.2

0.8

0.6

0.4

0.2

0 -4 - 3 -2 -1 0 1 2 3 4 the ta [r a ds]

Figure 18: Excel: 48000 Hz digital filter normalised gain

30 0

20 0

10 0

0 -4 - 3 -2 -1 0 1 2 3 4

- 10 0

- 20 0

- 30 0 the ta [r a ds]

Figure 19: Excel: 48000 Hz digital filter phase response

21

0 .9

0 .8

0 .7

0 .6

0 .5

0 .4

0 .3

0 .2

0 .1

0 -4 - 3 -2 -1 0 1 2 3 4 theta

Figure 20: Matlab : 8000 Hz digital filter normalised gain

300

200

100

-100

-200

-300 -4 -3 - 2 - 1 0 1 2 3 4 theta

Figure 21: Matlab : 8000 Hz digital filter phase response

22

0 .9

0 .8

0 .7

0 .6

0 .5

0 .4

0 .3

0 .2

0 .1

0 -4 - 3 -2 -1 0 1 2 3 4 theta

Figure 22: Matlab : 48000 Hz digital filter normalised gain

300

200

100

-100

-200

-300 -4 -3 - 2 - 1 0 1 2 3 4 theta

Figure 23: Matlab : 48000 Hz digital filter phase response

23

Question 14
H (z ) = But : Y (z ) X (z ) = (1 - P
1

(1 + z (1 - P H (z ) =
1

1 )3

z- 1

)(1 - P

z-

)(1 - P

z-

Y (z ) X (z ) (1 + z z- 1 )(1 - P
2 1 )3

z-

)(1 - P

z-

Y ( z ) (1 - P Y ( z ) (1 - P
1

z-

)(1 - P
2

z-

)(1 - P
2

z-

) = X (z )
2

(1 + z 3

1 )3

z-

-P

z-

-P

z-

+ P1 P2 z-

+ P 2 P3 z-

+ P1 P3 z(1 + 3

-P z- 1 -P
1

P 2 P3 z z- 2

)=
3

X (z ) yn - P y n-P yn -P yn + P1 P 2 yn + P 2 P 3 yn -

+3

+ z-

Using the inverse Z transform properties given on pg. 25 of the digital section
1 1 2 1 3 1 2 2

+ P 1 P 3 yn -

P 2 P 3 yn 2

)=
3

(x n + 3 xn -

+ 3 xn-

+ xn -

yn yn

=( =

P 1 + P 2 + P 3 ) yn ay n 1

- ( P 1 P 2 + P 2 P 3 + P 1 P 3 ) yn n- 3

+ P 1 P 2 P 3 yn 3

(x n + 3 xn -

+ 3 xn-

+ xn -

- y

n- 2

+ y

( xn + 3 x n -

+ 3 xn-

+ xn-

This recurrence relation is common to both filters, with the coe cients of the terms assuming di erent values depending on the sampling frequency.

111 xn 1 z
- 1

3 1 3

z-

yn

z-

z-

z-

z-

Figure 24: Signal ow diagram for both filters The following coe cients were calculated in Matlab :

24

[Hz ] a 8000 0.4392 0.3845 0.0416 2.4808 48000 2.0878 0.5933 Table 3: Matlab generated values for
ampl e

fs

a , and

The unit sample responses of both digital filters corresponded strongly to the original impulse response calculated for the analogue filter, with the impulse response being clearly recognisable. The lower the initial sampling frequency, the faster the emergence of the recognisable response was when observing the discrete impulse response.

Question 15

25

0 . 06

0 . 05

0 . 04

0 . 03

0 . 02

0 . 01

0 0 10 2 0 3 0 40 5 0 6 0 70

-0 . 01 n

Figure 25: Matlab : 48000 Hz filter impulse response

0 . 25

0 .2

0 . 15

0 .1

0 . 05

0 0 10 2 0 3 0 40 5 0 6 0 70

-0 . 05

-0 .1 n

Figure 26: Matlab : 8000 Hz filter impulse response

26

In designing an ideal low pass filter, we want a top-hat function in the frequency domain, ranging from - c to c

Question 16

Figure 27: Ideal low pass filter frequency response This transforms, via the inverse Fourier transform, into a sinc function in the time domain. We sample the signal at 41 di erent points in order to discover the magnitude of the signal at that point and the sampled impulse response can subsequently be digitally recreated by summing Dirac functions multiplied by these magnitudes. The function is non-causal, so it must be shifted in the positive direction, and incomplete since the sinc function continues on to infinity in reality and we have discarded all the unsampled points. This impacts on the accuracy of recreation, and there are many di erent windowing metho ds devoted to easing this cut-o point. As is clearly seen from graph 29, the di erent windowing functions attenuate the function to di ering degrees and in di erent ways, as it approaches its cuto frequency. Our coe cients ( ai )are calculated by multiplying the shifted magnitudes of the sampled points by an appropriate windowing coe cient.

27

0.8

0.6

0.4

0.2

-0.2

-0.4 0 5 10 15 20 25 30 35 40 45 n

Figure 28: Recreated impulse response

Fi na l c oeffi c i ents 1

-1 0 5 10 1 5 20 2 5 30 35 4 0 45 r ec ta ngul ar w i ndow 1

-1 0 5 10 1 5 20 2 5 30 35 4 0 45 H amm i ng w i ndo w 1

-1

0 5 10 1 5 20 2 5 30 35 4 0 45 Bla c k man wi nd ow

Figure 29: Di erent windowing methods

28

no Rectangular Hamming Blackman 1 0 0 0 2 -0.0335 -0.0029 -0.0001 3 0 0 0 4 0.0374 0.0049 0.0008 5 0 0 0 6 -0.0424 -0.0091 -0.0028 7 0 0 0 8 0.049 0.0162 0.0071 9 0 0 0 10 -0.0579 -0.0271 -0.0154 11 0 0 0 12 0.0707 0.0433 0.02990 13 0 0 14 -0.0909 -0.0681 -0.0546 15 0 0 0 16 0.1273 0.1102 0.09850 17 0 0 18 -0.2122 -0.2016 -0.1936 19 0 0 0 20 0.6366 0.633 0.63021 21 1 1 22 0.6366 0.633 0.63020 23 0 0 24 -0.2122 -0.2016 -0.1936 25 0 0 0 26 0.1273 0.1102 0.09850 27 0 0 28 -0.0909 -0.0681 -0.0546 29 0 0 0 30 0.0707 0.0433 0.02990 31 0 0 32 -0.0579 -0.0271 -0.0154 33 0 0 0 34 0.049 0.0162 0.00710 35 0 0 36 -0.0424 -0.0091 -0.0028 37 0 0 0 38 0.0374 0.0049 0.00080 39 0 0 40 -0.0335 -0.0029 -0.0001 41 0 0 0 Table 4: Table of coe cients

29

The recreated signal is therefore represented by :

Question 17

h (n ) = S y(n ) = y(n ) = S y(n ) = S

40 i=0

ai d( n - i )

The recurrence relation is there given by : h (n ) * x (n )


40 i=0 40 i=0

ai d( n - i ) * x ( n ) ai x ( n - i )(unit impulse convolution)

The transfer function can be deduced as :

y(n ) = S Y (z ) = S Y (z ) X (z ) = S H (z ) = S

40 i =0 40 i =0 40 i =0 40 i =0

ai x ( n - i ) ai X ( z ) z -i (Z transform) ai z -i ai z -i

Question 18
r ectan gula r wi ndow 1.5

0.5

-0.5

-1

-1.5

-1.5 -1 - 0.5 0 0.5 1 1.5 Re(z )

Figure 30: Rectangular window, pole zero diagram

30

Hammi ng w indow 1.5

0.5

-0.5

-1

-1.5

-1.5 -1 - 0.5 0 0.5 1 1.5 Re(z )

Figure 31: Hamming window, pole zero diagram

For some reason unbeknownst to me, the matlab roots function malfunctioned at 2000 kHz, leaving me with a severely unsatisfactory Blackmans window pole zero diagram. At 1995 kHz, the function stabilised, and gave me a pole zero diagram that was more readily believable in the context of the other plots. There are three poles in each pole zero diagram, though they are clustered at the origin of each of the respective pole zero diagrams. The zeros radiating beyond the unit circle were a point of some concern, before it was revealed that the lo cation of the zeros was unrestricted, and that the presence of the poles within the unit circle was the only point of concern regarding filter stability.

31

B l ac kma n wi ndow 1.5

0.5

-0.5

-1

-1.5 -1.5 -1 - 0.5 0 0.5 1 1.5 Re(z )

Figure 32: Blackman window, pole zero diagram

B l ac kma n wi ndow 1.5

0.5

-0.5

-1

-1.5 -1.5 -1 - 0.5 0 0.5 1 1.5 Re(z )

Figure 33: Blackman window, pole zero diagram (

f c = 1995)

32

I used Matlab to calculate the frequency response of the three fir digital filters, which simplified matters until I tried to calculate the phase of the filters. This returned a sharply discontinuous phase response graph, with Matlab automatically cycling values within a range of [ -p . . . p ]. The unwrap function, which was previously used to successfully maintain phase progression information under the iir filters, could not cope with the steep phase shift inherent to the filter. I had to write my own very rudimentary unwrap script (donunroll3), which was limited (very) to use with linearly varying phases. (Which the initial plots of the discontinuous phase revealed it to be.) The gain and phase are plotted around the unit circle in the s plane. This unit circle in the s plane is related to the frequency plane by :

Question 19

= 2pf f Where = [ f =[ = =

Ts
e

ampl ampl ampl

fs f es
e

2p -p . . . p

- 4000 . . 4000] .

All the FIR filters were discovered to have linear phase response. Gibbs phenomenon is normally associated with sudden cuto s in the frequency domain resulting in a ripple in the time domain. The sudden cuto s applied by our di erent windowing functions, in sampling the impulse response, induce similar rippling in the frequency domain. This e ect is incredibly pronounced in the rectangular window filter, and results in a strong ripple at the edge of the passband. It results in a barely perceivable waver in the passband when using the Hamming window and in absent in the passband when using the Blackman window.

33

Rec tangu lar wi ndo w, 2k hz LP F ,s ampl e fr equenc y 8k hz 1

0 .9

0 .8

0 .7

0 .6

0 .5

0 .4

0 .3

0 .2

0 .1

0 -4 - 3 -2 -1 0 1 2 3 4 th eta [r ads ]

Figure 34: Rectangular window, digital filter normalised gain

Rec tangul ar w indow, 2khz LP F,s ampl e fre quency 8k hz 4000

3000

2000

1000

-1000

-2000

-3000

-4000 -4 -3 -2 - 1 0 1 2 3 4 the ta [rads ]

Figure 35: Rectangular window, digital filter phase response

34

Ham min g wi ndow , 2k hz LP F ,sa mpl e fre quenc y 8k hz 1

0 .9

0 .8

0 .7

0 .6

0 .5

0 .4

0 .3

0 .2

0 .1

0 -4 - 3 -2 -1 0 1 2 3 4 th eta [r ads ]

Figure 36: Hamming window, digital filter normalised gain

Ham ming w indow , 2khz LP F,s ampl e fr equency 8k hz 4000

3000

2000

1000

-1000

-2000

-3000

-4000 -4 -3 -2 - 1 0 1 2 3 4 the ta [rads ]

Figure 37: Hamming window, digital filter phase response

35

B l ac k mans wi ndo w, 2k hz LP F ,s ampl e fr equenc y 8k hz 1

0 .9

0 .8

0 .7

0 .6

0 .5

0 .4

0 .3

0 .2

0 .1

0 -4 - 3 -2 -1 0 1 2 3 4 th eta [r ads ]

Figure 38: Blackman window, digital filter normalised gain

B lac k man wi ndow, 2k hz LP F ,sa mple f requenc y 8k hz 4000

3000

2000

1000

-1000

-2000

-3000

-4000 -4 -3 -2 - 1 0 1 2 3 4 the ta [rads ]

Figure 39: Blackman window, digital filter phase response

36

It became apparent in the later comparison of implementation vs theory, that the graphs o er far more information when the gain was displayed in decibels. The graphs below clearly show the ripple at the edge of the passband, moving away from the passband as we progress from the rectangular window to the Blackman window. Gibbs phenomena can not avoided, but the more advanced windowing methods shift the oscillation away from the passband, where they have a greatly diminished e ect on the filtering process.
Rec tangul ar wi ndow, 2k hz LP F, sam ple frequ enc y 8k hz 0

-1 0

-2 0

-3 0

-4 0

-5 0

-6 0

-7 0

-8 0

-9 0

0 0.5 1 1.5 2 2.5 3 3.5 theta [rads ]

Figure 40: Rectangular window, digital filter normalised gain in dB

37

Hamm ing w indow , 2kh z LP F,s am ple fr equenc y 8k hz 0

- 50

- 100

- 150 0 0.5 1 1.5 2 2.5 3 3.5 th eta [rads ]

Figure 41: Hamming window, digital filter normalised gain in dB

B l ac km an wi ndow, 2k hz LPF ,s ampl e frequen cy 8k hz 0

- 20

- 40

- 60

- 80

- 100

- 120

- 140

- 160 0 0.5 1 1.5 2 2.5 3 3.5 th eta [rads ]

Figure 42: Blackman window, digital filter normalised gain in dB

38

You might also like