Anda di halaman 1dari 8

EE110B Lab 4 Report

Zaza Nguyen 860967146 Partners: Steven Li, Richard Dinh TA: Asong Tambo Sec. 22 Mon 11am 2pm 02- 11 -2013

Introduction: In this lab, we were to evaluate the effect of echoes and test an echo cancellation filter. We are given background information that the echo we want to evaluate comes from a person talking not too closely to a microphone. These echoes are distortion and could cause many problem; therefore we would want to test a cancellation filter. In the first task, we treat our voice from the mount as input and the acoustic signal picked up by [ ] [ ] the microphone as output, which are relation to each other as: [ ] [ ] [ ], where h[0] is the signal attenuation of the direct path between your mouth and the microphone, and h[k] for k>0 can be viewed as the coefficients of the echoes. We are given an distorted input equation and different h[n]s to plot x[n] and y[n] and visually see the distortion of the signal. For task 2, we are given the same input, except a different h[n] equation where we compute y[n] = h[n] * x[n] and plot the signal. Then with another equation given, we use it to multiply y[n]*g[n] to compute and plot the echo cancellation filter. This will show us visually if g[n] is a perfect echo cancellation filter. Lastly, in task 3, we will replace h[n] equation in task 2 with another equation where we use another method to compute and find the perfect echo cancellation filter. In this task, we will compute it is through ( ) . We would find g[n] ), where we would plot and also see the signal of the again whos DTFT is ( cancellation filter. Procedures: [ ] [ ] . Choose h[0] = 1, h[4] = 0.5, h[7] = 0.2, Task 1: [ ] and all other h[k] = 0. Plot x[n] and y[n] on the same figure. [ ] and [ ] [ ] Task 2: Same input x[n] as above; assume [ ] [ ] Compute and plot distorted signal y[n] = h[n]*x[n] and the output v[n] of the echo cancellation filter v[n] = y[n]*g[n]. Is g[n] a perfect echo cancellation filter? [ ] [ ], the perfect echo Task 3: Replacing h[n] in task 2 with [ ] cancellation filter will be different. The best way to find it is to compute ( ) and invert it to ( ). Find g[n] whose DTFT is ( ) Compute and plot x[n], y[n] = x[n]*h[n], and v[n] = y[n]*g[n].

Matlab Results: Task 1:


x[n] 1

0.8

0.6

0.4

0.2

10

20

30

40

50

60

70

80

90

100

y[n] 1.4 1.2 1 0.8 0.6 0.4 0.2 0

10

20

30

40

50

60

70

80

90

100

In this task, we were asked to graph the distorted signal that, we can see in the plot that the points are distorted. The points do not seem to flow evenly and we can see that we would need a filter to help make the signal smoother.

Task 2:
y[n] 4.5 4 3.5 3 2.5 2 1.5 1 0.5 0 0 10 20 30 40 50 60 70 80 90 100

v[n] 1.2 1 0.8 0.6 0.4 0.2 0 -0.2

10

20

30

40

50

60

70

80

90

100

In this task, we are asked to graph the signal as well as the echo cancellation filter signal. This graph shows a smooth plot of how the signal becomes better with the filter convoluted with it. This graph shows that the echo cancellation filter is perfect because it shows a better signal compared to the signal shown in task 1.

Task 3:
x[n] 1 0.8 0.6 0.4 0.2 0 0 10 20 30 40 50 y[n] 6 5 4 3 2 1 0 0 10 20 30 40 50 v[n] 6 5 4 3 2 1 0 0 10 20 30 40 50 60 70 80 90 100 60 70 80 90 100 60 70 80 90 100

In this task, we were asked to calculate a different echo cancellation filter through a different method and then graph it. This echo cancellation filter for this task is perfect because the signal is also perfect like task 2. The graphs in task 3 shows the signals being distorted to smooth with the new echo cancellation filter. You can see that the curve is very smooth going upwards and then downwards, approaching zero. Conclusion: In conclusion, I have successfully completed the lab to understand how the echo cancellation filter works. Given background of where the echoes came from, we were to compute to calculate and find the signal between the inputs coming from the mouth to the acoustic signal picked up by the microphone as output. In the beginning of the lab, we calculated and plotted the signal where we saw how distorted it was. Then, we would calculate another signal using the equation y[n] = h[n]* x[n] and v[n] = y[n] *g[n] to plot the echo cancellation filter where we can visually see if the filter had work on the distorted signal. Then we replaced the equation with another echo cancellation filter, and by using another method of DTFT, we were also able to plot and visually see the filter fixing the distorted graph. In conclusion, we were able to change the distorted signal into a better signal using the filter and applying our knowledge that we have learned in this class of DTFT and convolution.

Appendix:
%task 1: n = 0:100 ; x = sin(pi*n/10) .* (myheaviside(n) - myheaviside(n-10)); h = zeros(1,101); init = [ 1 0 0 0 .5 0 0 .2]; h(1:8) = init; y = zeros(1,101); g = length(x); p = length(h); for j = 1:p+g-1 for k = 1:g; if(j-k+1>0) if(j<101) y(j) = y(j) + (x(k)*h(j-k+1)); end end end end subplot(2,1,1) stem(n,x) title('x[n]') subplot(2,1,2) stem(n,y) title('y[n]') %task2 n = 0:100 ; x = sin(pi*n/10) .* (myheaviside(n) - myheaviside(n-10)); h = .9.^n .* myheaviside(n); ge = cero(n) - .9*cero(n-1) %n=0:200; y = zeros(1,101); g = length(x); p = length(h); for j = 1:p+g-1 for k = 1:g; if(j-k+1>0) if(j<101) y(j) = y(j) + (x(k)*h(j-k+1)); end end end end subplot(2,1,1) stem(n,y) title('y[n]')

v = g = p = for

zeros(1,101); length(x); length(h); j = 1:p+g-1 for k = 1:g; if(j-k+1>0) if(j<101) v(j) = v(j) + (ge(k)*y(j-k+1)); end end end

end subplot(2,1,2) stem(n,v) title('v[n]') %task3 n = 0:100 ; x = sin(pi*n/10) .* (myheaviside(n) - myheaviside(n-10)); h = .9.^n .* myheaviside(n) + cero(n); w = -pi/2:.01*pi:pi/2 G = (1 - .9*exp(-j*w))/(2-.9*exp(-j*w)) ge = ifft(G) y = zeros(1,101); g = length(x); p = length(h); for j = 1:p+g-1 for k = 1:g; if(j-k+1>0) if(j<101) y(j) = y(j) + (x(k)*h(j-k+1)); end end end end subplot(3,1,1) stem(n,x) title('x[n]') subplot(3,1,2) stem(n,y) title('y[n]') v = zeros(1,101); g = length(ge); p = length(y); for j = 1:p+g-1 for k = 1:g; if(j-k+1>0) if(j<101) v(j) = v(j) + (ge(k)*y(j-k+1)); end

end end end subplot(3,1,3) stem(n,v) title('v[n]')

Anda mungkin juga menyukai