Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

ELEC 403 Lab 2 Prep

Name: David Li
Student Number: V00818631 June 5, 2017

2.6.1
Z π
J(h0 ) = [2(cos(2ω) − 1)h0 + 0.5(cos(ω) + 1)]2 dω
Z0.7π
π h
ω i2
J(h0 ) = 4(cos2 (ω) − 1)h0 + 0.5(2 cos2 ( )) dω
2
Z0.7π
π h  ω i2
J(h0 ) = −4(sin2 (ω))h0 + cos2 dω
0.7π 2
Z π ω  ω 
J(h0 ) = 16 sin4 (ω)h20 + 2(−4 sin2 (ω) cos2 + cos4 dω
0.7π 2 2
Z π Z π   Z π
2 ω
ω 
2 4 2
J(h0 ) = 16h0 sin (ω) − 8h0 sin (ω) cos + cos4 dω
0.7π 0.7π 2 0.7π 2

Useful integrals are: Z π


sin4 (ω)dω = 0.0972968
0.7π
Z π ω 
sin2 (ω) cos2 dω = 0.028486
0.7π 2
Z π ω 
cos4 dω = 0.00836171
0.7π 2

J(h0 ) = 16h20 (0.0972968) − 8h0 (0.028486) + (0.00836171)


J(h0 ) = 1.5567488h20 − 0.227888h0 + 0.00836171

2.6.2
∇J(h0 ) = 3.1134975h0 − 0.227888 = 0 → h0 = 0.07319357
h0 = 0.07319357

h1 = 0.25
h2 = 0.5 − 2h0 = 0.5 − 2(0.07319357) = 0.35361286
H(z) = 0.07319357 + 0.25z −1 + 0.35361286z −2 + 0.25z −3 + 0.07319357z −4

1
2.6.3

Listing 1: Matlab Code to Plot frequency response


a = [ 1 ] ; b = [0.07319357 0.25 0.35361286 0.25 0. 07 3 19 35 7 ];
[ H,w] = f r e q z ( b , a , 1 0 2 4 ) ;
f i g u r e , p l o t (w, abs (H) ) ;
x l a b e l ({ ’ $\omega$ ’ } , ’ I n t e r p r e t e r ’ , ’ l a t e x ’ ) ;
y l a b e l ({ ’$H(\ omega ) $ ’ } , ’ I n t e r p r e t e r ’ , ’ l a t e x ’ ) ;
p r i n t ( ’ MysavedPlot ’ , ’−dpng ’ , ’−r600 ’ )

Figure 1: Plot of frequency response

You might also like