Docsity

Homework 3 Solutions - Selected Topics | ECE 802, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE 802-601 Homework 3 Solutions
1. In terms of the basis functions in V2,f(x) = 2φ(4x)−3φ(4x−1)+φ(4x−2)+3φ(4x−3).
V2can be decomposed into V1and W1as:
f(x) = φ(2x) + ψ(2x)−3
2φ(2x) + 3
2ψ(2x) + 1
2φ(2x−1) + 1
2ψ(2x−1)
+3
2φ(2x−1) −3
2ψ(2x−1)
=−1
2φ(2x) + 5
2ψ(2x) + 2φ(2x−1) −ψ(2x−1)
(1)
V1can further be decomposed into V0and W0yielding:
f(x) = −1
4φ(x)−1
4ψ(x) + 5
2ψ(2x) + φ(x)−ψ(x)−ψ(2x−1)
=3
4φ(x)−5
4ψ(x) + 5
2ψ(2x)−ψ(2x−1) (2)
2. a)
t=[0:1/256:255/256];
f=exp(-(t.^2)/10).*(sin(2*t)+2*cos(4*t)+0.4*sin(t).*sin(50*t));
h=[1/sqrt(2) 1/sqrt(2)]; L=length(h);hf=fliplr(h); h1=[1/sqrt(2)
-1/sqrt(2)]; a=f; d=[]; for j=8:-1:jstop+1;
n=length(a);
a=[a(mod((-L+1:-1),n)+1) a];
b=conv(a,h1);b=b(L+1:2:L+n-1)/2;
a=conv(a,hf);a=a(L:L+n-1)/2;
ab=a(1:L);a=[a(L+1:n) ab];a=a(2:2:n);d=[b,d];
end w=[a,t];JJ=2^jstop; ww=[w(JJ) w(1:JJ)];
tt=linspace(0,1,JJ+1);ll=length(tt);
ta=[tt;tt];tt=ta(1:2*ll);wa=[ww;ww]; ww=wa(1:2*ll);ww=[ww(2*ll)
ww(1:2*ll-1)]; plot(tt,ww);
b) c)
[C,L]=wavedec(f,8,’haar’); Cm=C.*(abs(C)>=0.1);
fm=waverec(Cm,L,’haar’);
d)
1
pf3
pf4
pf5

Partial preview of the text

Download Homework 3 Solutions - Selected Topics | ECE 802 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

ECE 802-601 Homework 3 Solutions

  1. In terms of the basis functions in V 2 , f (x) = 2φ(4x)− 3 φ(4x−1)+φ(4x−2)+3φ(4x−3). V 2 can be decomposed into V 1 and W 1 as:

f (x) = φ(2x) + ψ(2x) −

φ(2x) +

ψ(2x) +

φ(2x − 1) +

ψ(2x − 1)

φ(2x − 1) −

ψ(2x − 1)

=

φ(2x) +

ψ(2x) + 2φ(2x − 1) − ψ(2x − 1) (1)

V 1 can further be decomposed into V 0 and W 0 yielding:

f (x) =

φ(x) −

ψ(x) +

ψ(2x) + φ(x) − ψ(x) − ψ(2x − 1)

=

φ(x) −

ψ(x) +

ψ(2x) − ψ(2x − 1) (2)

  1. a)

t=[0:1/256:255/256]; f=exp(-(t.^2)/10).(sin(2t)+2cos(4t)+0.4sin(t).sin(50t)); h=[1/sqrt(2) 1/sqrt(2)]; L=length(h);hf=fliplr(h); h1=[1/sqrt(2) -1/sqrt(2)]; a=f; d=[]; for j=8:-1:jstop+1; n=length(a); a=[a(mod((-L+1:-1),n)+1) a]; b=conv(a,h1);b=b(L+1:2:L+n-1)/2; a=conv(a,hf);a=a(L:L+n-1)/2; ab=a(1:L);a=[a(L+1:n) ab];a=a(2:2:n);d=[b,d]; end w=[a,t];JJ=2^jstop; ww=[w(JJ) w(1:JJ)]; tt=linspace(0,1,JJ+1);ll=length(tt); ta=[tt;tt];tt=ta(1:2ll);wa=[ww;ww]; ww=wa(1:2ll);ww=[ww(2ll) ww(1:2*ll-1)]; plot(tt,ww);

b) c)

[C,L]=wavedec(f,8,’haar’); Cm=C.*(abs(C)>=0.1); fm=waverec(Cm,L,’haar’);

d)

−2 0 0.5 1

0

2 J=

−2 0 0.5 1

0

2 J=

−1 0 0.5 1

0

1 J=

−1 0 0.5 1

0

1 J=

−0.5 0 0.5 1

0

0.5^ J= −0.5 0 0.5 1

0

0.5^ J=

−0.2 0 0.5 1

0

0.2^ J=

Figure 1: The approximations in the different subspaces

−0.05 0 50 100 150

0

The wavelet coefficients

−0.2 0 20 40 60 80

0

−0.5 0 10 20 30 40

0

−1 0 5 10 15 20

0

1

(^00 2 4 6 )

1

2

−5 1 2 3 4

0

5

(^01) 1.5 2

5

10

(^00) 0.5 1 1.5 2

10

20

Figure 2: The wavelet coefficients

  1. a)If f (t) ∈ Vj , this means that f (t) is continuous except at 2 kj. Therefore, f (2t) ∈ Vj+1. b)One can show that this set of functions is not orthogonal, since < φ(t), φ(t−k) > 6 = 0. For example, for k = 1, this inner product equals to 16. Since φ(t) = φ(2t) + 12 φ(2t −
      • 12 φ(2t + 1), the coefficients in the scaling equation should be h(−1) = h(1) = 1 2 √ 2 , h(0) =^ √^1
  2. c) From the filter in part (b), we can find the equivalent wavelet filter h 1 (n) = (−1)^1 −nh(1 − n). Therefore, h 1 (0) = 2 −√^12 , h 1 (1) = √^12 , h 1 (2) = 2 −√^12. Using the scaling equation for the wavelet function, ψ(t) = − 21 φ(2t) + φ(2t − 1) + − 21 φ(2t − 2).

(^00) 0.05 0.1 0.15 0.

1

2

2.5 x 10

−

Threshold

MSE

Figure 5: MSE versus the threshold

b) In this example, we generate a shifted version of the chirp signal and compare the wavelet coefficients. It is sufficient to compare the wavelet coefficients at only one level to conclude that DWT is not shift-invariant. For this example, we look at the level 4 coefficients. By zooming into the coefficients, it is possible to see that the values have changed. For example, for the original signal the highest wavelet coefficient magnitude is 0.4036, whereas the maximum wavelet coefficient for the shifted signal is 0.3682.

−1 0 100 200 300

−0.

0

1

−1 0 100 200 300

−0.

0

1

−0.5 0 50 100 150

0

Wavelet Coefficients at level 4

−0.4 0 50 100 150

−0.

0

Wavelet Coefficients at level 4

Figure 6: MSE versus the threshold

  1. a) W 0 is the space of all functions bandlimited to [− 2 π, −π] ∪ [π, 2 π], since V 1 = V 0

⊕ W 0.

b)The frequency domain equivalent of the dilation equation is Φ(ω) = √^12 H(ω 2 )Φ(ω 2 ).

c)By using the recursion equation in the frequency domain, H(ω) =

2 , |ω| < π/2. Therefore, h(n) = √^12 sinc(n 2 ).

d) Since h 1 (n) = (−1)nh(−n+1), H 1 (ω) = e−jωH∗(ω +π) =

2 e−jω, ω ∈ [−π, −π/2]∪ [π/ 2 , π]. Therefore,

Ψ(ω) =

H 1 (

ω 2

ω 2

= e−jω/^2 , ω ∈ [− 2 π, −π] ∪ [π, 2 π] (4)

The corresponding wavelet function is ψ(t) = 2sinc(2t − 1) − sinc(t − 0 .5).