Tải bản đầy đủ (.pdf) (29 trang)

TIỂU LUẬN MÔN : XỬ LÝ TÍN HIỆU NÂNG CAO Mô phỏng ứng dụng mạch lọc thích nghi

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (749.54 KB, 29 trang )

1



HC VI 
KHOA QUỐC TẾ VÀ ĐÀO TẠO SAU ĐẠI HỌC






TIỂU LUẬN
Môn: XỬ LÝ TÍN HIỆU NÂNG CAO
ĐỀ TÀI: BỘ LỌC THÍCH NGHI



Giáo viên hướng dẫn: TS. Nguyễn Ngọc Minh
Nhóm Học viên thực hiện: Lý Hoàng Sáng
Nguyễn Xuân Khánh
Nguyễn Ngọc Bá
Đào Văn Thái
Lớp cao học: M12CQDT02-B





Hà Nội, tháng 01 năm 2012
2



Contents
T V 3
1. B l 4
1.1. H thng FIR truyn thng 4
1.2. B lu trc tip 5
2. Ph 6
2.1. Ph 6
2.2. Lc ng bii wavelet. 9
2.2.1. Phi gian 10
2.2.2. Ph 12
ng ng dng mch l 16


3

ĐẶT VẤN ĐỀ
Thut ng l ch tt c  th c li dng ca
n tn s cu l tu li ra thu
mong mu t ngt ca mt hoc mu t 
(nhu nhiu chng h lc s c t
u mong mun.
 khc pht b li,
 s ca b l   ng vi s i
bt ng cu t lch l s c g
mch l
Lc s d nh mng mong mu s ca
mch lc phc chn la sau mong mup nht vi
u l c thc hin nu sai s e[n] hi t v
 i t 

   hoi v 
th c s d u sai s
e[n]. Nu mong muu dc cc tiu
  n mt mch lc rt ni tich lc
c g
Hu hi mch lc Wiener. Trong
 t tng trng s cu sai s
c cc tin mt mch lc ti v liu

y, mch lc thit k hoc bc thc b
   t k  nh, cn ph   t s  ng
 d lich lc cn x  thit
k c mch lc Wiener cn phi bit th
sng h u d
i gian b
Mc ti  c thc hin
 c nhn thit cho vic thit k mch lc Wiener hoch
4

lc tu ng dng thc t u lc
s d li ra ca mch lu
ca mch lc theo mt s  dng kt qu c
 u ch s ca mch theo kiu lp. S d 
i gi  hiu cht thng
i vi th nghim lp, c s ca mch l
th t u ch t thi.
Trong phm vi tiu lu u mt s v n
 l
1. Bộ lọc thích nghi
1.1. Hệ thống FIR truyền thống

B l lng xung chiu hn, tng xung ch 
t khou hn N (t n N-1). B lc FIR vi bc ca b
lc biu din nh:




a b lc FIR truyn thng

   u l  a mch
   u li ra ca mch
ng xung ca mch
L vi nhau bc:
N1
y[n] =

h[k]x[n 
k]
k=0
  y[k] t u lu l tr,
5

b  cng. Vi b lph-
m ca li ra.
y, b l ng chm,
u lt khong th
ng mc xut ra.
1.2. Bộ lọc FIR thích nghi kiểu trực tiếp
Cc s dng trong mch l 


Ca mch l

a mch lc.
x[n] = [x
n
x
n-1
x
n-2
 x
n-N+1
]
T
ng s ca b l
w =

[w
0
w
1

N-1
]
T
i ra ca mch lc
0
[ ] w[ ] [ ]w [ ]
T
k
y n k x n k x n





6

i ra mong mun
 giu mong muu ra y[n]
e[n] = d[n] - y[n]
T chui thiu chung thit lc tuy
cho h s b lc.
 nhc t d li nhng
ng c c. H s wng
ca h s th ng ph thu a bn ghi d liu,
 cc trong h thng x a b lc. V th 2 c
n x[n] , trong b hiu chnh
 n s  bii theo th 1 h qu
 ng ci theo thi
 s ca b li theo th
ph i theo thi gian cu   l
ng c  mu
c s d u
 h s ca b l bii theo thi gian  th
thi gian c bin nh lc d
tip m quy mi khi nhc mt m  
  c c ca h s b lc t mt
khi d liu ti mt khc khi phi nh, chim mt khong thi
gian ngi khong th a d lii
m.
2. Phương pháp và giải thuật tính toán bộ lọc thích nghi

2.1. Phương pháp LMS
B lu nhi
nhiu gii thu u qu cho b l i thut
LMS (Least Mean Square.). Gii thu s t lc. Phn
 gii thiu mt s gii thut thc hiu t ng
dng ca lt s ng h  gii quyt
 thi.
7

n MMSE (Minimum mean square error)
Gii thu  s ca mch lc FIR t
vic ti s u
  phc) v

xx
(m) = E[x(n)x
*
(n-m)]
u x(n) qua h thng cnh, tng
th lc FIR v s -1. Tu ra
ca mch l





.x(n-k)
Sai s 
e(n) = y(n)  -





.x(n-k)
 s:
J(hM) = E[e(n)
2
]
=E{y(n) -




.x(n-k)
2
}
= E{{y(n){2-2Re[




-1) +
 








-
1)x(n-k)]}}}
= 
2
y  2Re[




(l)]
yx
(l) +
 





(l)h(k) 
yx
(l-k)
Vi 
2
y = E[y(n)]
2
, 
yx
(l) = E[y(n).x*(n-a h s.
Ta thy rng sai s i vi
 s ca mch lc. Do vc tiu ca MSE hay J(hM) ta ln

t lng h s  c t






yx
(1-k) = 
yx
(l)
B lc v s c t t lc Wiener, 
yx
(1-

yx
(l) l t
theo dng ma trn sau:

M
h
M
= 
y

8

Vi 
M
n (MxM) vn t 

lk
= 
xx
(l-
y

n t 
yz
-1. Gii tp h
 s ca b lc t
h
opt
= 
M-1
, 
y
t qu MSE cc tiu v s cho bi h
opt
= 
M-1
, 
y

J
min
= J(h
opt
) = 
2
[y 







]
Jmin = 
2
[y - *y. 
M-1
. 
y
]
Gii thut
i h  phn  
h s ta mch lt h th
 c tiu cu bi
mi v s ca mch hy h t cc
tiu duy nhp.
Ma trn t 
M

y
c .
ng :
H
M
(n+1) = h
M

(n) +


 
Vi h
M
 s mch lc ti ln lp th  c nhy
ln th ng cho ln lp th u h
M
c chn bt
ku d
n nh c tiu ca J(h
M
p d
ving dc nht ( Steepest - ng
dc nh
S(n) = -g(n). vi ln lp th 
g(n) = dJ(h
M
(n))/d h
M
(n)

M
. h
M
(n) - 
i mi ln l ca h
M
(n) theo

c vi thut lp dng dc nh
M(n+1) = h
M
(n) -


i n = 0,1
9

Hay
h
M
(n+1) = [I-
M
]h
M

c rng h
M
(n) s hi t n h
opt
u ki

Hai gii thuc ng c  hi t gii thu
hi thut Fletcher-powell.
 biu di
g(n) = E[e(n).X*M(n)] = y(n)  
M
.h
M

(n)
V      n t x(n-   -  y, vector
n 
g(n) = -2e(n).X*M(n)
Vi e(n) = y(n)  p hp M mu ti ln lp th 
i thut:
h
M
(n+1) = h
M
(n) + (n)e(n).X*M(n)
Gii thuc gi thut Stochastic-gradient- mt bi
 c nhy (n) c 
(n) c nh d thc hin cho c phn cng ln phn mm.
(n) c p vi vic thi theo th
i s thay  x
nhi thu
h
M
(n+1) = h
M
(n) + e(n).X*M(n)
Vi    c nhy c nh.
Gii thut LMS thc hic s dng rng
ng dnh mch li hn c
c nhiu.
2.2. Lọc thích nghi bằng biến đổi wavelet.
Bii wavelet ri rc b l
10


c hi s hai. Gi l s p li l
chia ti s  a b l
i tho t s u ki u kin
trc giao s  s trc giao. Nhc biu ding
u s d
i gian th hin nhc trc ti s lc,
thc hin gii thut ti d
o tham s  s c t tho c hin gii thut t
c.
2.2.1. Phương pháp vùng thời gian


x = [x
0
, ,x
7
]
T


c
0
,. c
3

0
, d
3



{
0,

1,

2,

3,

0
,
1
,
2
,
3
}
T
=C
1
.x
 :
3 2 1 0
3 2 1 0
3 2 1 0
1 0 3 2
1
3 2 1 0
3 2 1 0
3 2 1 0

1 0 3 2
0000
0 0 0 0
0000
0000
0000
0 0 0 0
0000
0000
c c c c
c c c c
c c c c
c c c c
C
d d d d
d d d d
d d d d
d d d d



   l      lc  


0,

1,

1,


2,

0

1

2

3
}
T

0,

1,

2,

3,

0

1

2

3
}
T


11

 :

3 2 1 0
2 0 3 1
3 2 1 0
3 2 1 0
2
0000
0000
0000
0000
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0
c c c c
c c c c
d d d d
d d d d
C

















Kt hc biu y s 
y= C.x= C
2
.C
1
.x
D y rng C
1
c giao, C
2
u kin trc giao s 
2222
0 1 2 3
1cccc   

0 2 1 3
0c c c c

2222
0 1 2 3
1dddd   


0 2 1 3
0d d d d

0 0 1 1 2 2 3 3
0c d c d c d c d   

0 2 1 3
0c d c d

0 0 3 1
0c d c d

Trong   k   k v    c th m    k 
 c
tho mn bng  ch

12

3
( 1) ; (0, ,3)
k
kk
d c k

  

Trong g h tng qu    b lc: N+1      M+1,
 i
wavelet:


.y C x

Vi :
1 1 0 ma x
. ;
QQ
C C C C C Q Q



Q
max
 smc   c   thuc   di       lc
max 2
1
(log )
1
M
Q floor
N




u kin trc giao t  :
2
2
1
( ); 0, ,
2

N
n n k
nk
N
c c k k







2
2
1
( ); 0, ,
2
N
n n k
nk
N
d d k k







2

2
1
( ); 0, ,
2
N
n n k
nk
N
c d k k







2
2
1
( ); 0, ,
2
N
n k n
nk
N
c d k k








 s l  lp :
3
( 1) ; (0, ,3)
k
kk
d c k

  

2.2.2. Phương pháp lưới.
 l c t tho u bng
 lc 4 h su kin c (7) c th s 
13

22
0 2 1 3
1c c c c   

u ki tho t:
0 1 2
1 1 2
2 1 2
3 1 2
cos cos
cos sin
sin sin
sin cos

c
c
c
c









ng hp t
   
22
2 2 1
1
1; 0, ,
2
kk
N
c c k


  


t :
1 1 1 1

2 2 2 2
2 2 1
0 0 0 0
cos ; cos
N N N N
n n n n
n n n n
cc

   

   
   
   

   
   
   
   

Ta s  :
   
   
   
   
21
0 1 2 0 2
21
1 1 2 0 2
21

2 1 2 1 2
21
3 1 2 1 2
cos cos cos
cos sin sin
sin sin sin
sin cos cos
cc
cc
cc
cc
  
  
  
  


  


Vii dng ma trn :
(2)
2
3
(2) (1)
2
01
(2) (1)
2
10

(2)
2
0
cos 0
sin 0
0 sin
0 cos
c
cc
cc
c
























14

 m rng cho 6 h s :
(3)
3
5
(3) (2)
3
43
(3) (2)
33
32
(3) (2)
33
21
(3) (2)
3
10
(3)
3
0
000
000
00
00
0 0 0

0 0 0
k
c
s
cc
sk
cc
kk
cc
s
cc
k
c

































si n ; cos
j j j j
sk



 vi h s d, kt hc :
(3) (3) (3) (3) (3) (3)
5 4 3 2 1 0
(3) (3) (3) (3) (3) (3)
5 4 3 2 1 0
33
33
1 1 2 2
33

1 1 2 2
33
0 0 0 0
0 0 0 0
00
0 0 0 0
00
0 0 0 0
cccccc
dddddd
ks
sk
s k k s
ks
k s s k
sk








  


  




  



y tng bii ma trn wavelet th nhc biu dii dng :
1 1 2 3
. ( ). . ( ). . ( )C E R S R S R
  



j
 :
15

000000
000000
0 0 0 0 0 0
0 0 0 0 0 0
()
0 0 0 0 0 0
0 0 0 0 0 0
000000
000000
jj
jj
jj
jj
j

jj
jj
jj
jj
sk
ks
sk
ks
R
sk
ks
sk
ks























n d
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1
00000000
S 
















  s l p.
Trng hp ti b l
1 1 2
. ( ). . ( ) . ( )
k
C E R S R S R
  


Ma trn bi  :
(1) (2) ( ) (1) 2 ( )
1 1 1 1 1 1 1
( . . . . ) ( . . . . )
kk
Q Q Q Q Q Q Q
C C C E R S R S R E R S R S R

 t nht s c cht s n
nh tham s o t
16

u hoc mt lu bc ting, th t
gi bii wavelet. Kt hp ch tt nh
vi s bi 
bu s l m tri c. Tuy
u kii v s li rt thp cho
c li tr v c.
  wavelet m t
ng vi cu c th  c ch khi
thc hin x i thu thc hi

 lc cho h vi x t hp vi DSP biu s dng
wavelet, ng dc trong thc t.
3. Mô phỏng ứng dụng mạch lọc thích nghi
Tri AEC)
  ng dng ca b l dng trong vic tri
vang.
: Scott C. Douglas
Nội dung:
- Gii thiu
- 
- u gn
- u xa
- u Microphone
- B ln tn s (The Frequency-Domain Adaptive Filter  FDAF)
- ng tri li (Echo Return Loss Enhancement  ERLE)
- Nhng ng ca Nh 
-  ng tri li
Giới thiệu
Tring vi cuc hi thoi trong vi
phng cuc hi thon thiu microphone d(n) bao gm
u gn (near-u xa
17

(the far-end echoed speech signal dhat(n)). Mn loi b 
ng v vic tri dng b l
Đáp ứng xung trong phòng
         n t    
       g      s
dng b l n cht v ng xung vi
t l mu h th

M = 4001;
fs = 8000;
[B,A] = cheby2(4,20,[0.1 0.7]);
Hd = dfilt.df2t([zeros(1,6) B],A);
hFVT = fvtool(Hd); % Analyze the filter
set(hFVT, 'Color', [1 1 1])


H = filter(Hd,log(0.99*rand(1,M)+0.01).*
sign(randn(1,M)).*exp(-0.002*(1:M)));
H = H/norm(H)*4; % Room Impulse Response
plot(0:1/fs:0.5,H);
xlabel('Time [sec]');
ylabel('Amplitude');
title('Room Impulse Response');
set(gcf, 'Color', [1 1 1])
18



Tín hiệu âm thanh đầu gần
Trong h thi s d thng Microphone s dng, do

load nearspeech
n = 1:length(v);
t = n/fs;
plot(t,v);
axis([0 33.5 -1 1]);
xlabel('Time [sec]');
ylabel('Amplitude');

title('Near-End Speech Signal');
set(gcf, 'Color', [1 1 1])
p8 = audioplayer(v,fs);
playblocking(p8);


19



Tín hiệu âm thanh đầu xa
Trong h th u gc truyn
u xa chuyn l
load farspeech
x = x(1:length(x));
dhat = filter(H,1,x);
plot(t,dhat);
axis([0 33.5 -1 1]);
xlabel('Time [sec]');
ylabel('Amplitude');
title('Far-End Echoed Speech Signal');
set(gcf, 'Color', [1 1 1])
p8 = audioplayer(dhat,fs);
playblocking(p8);


20


Tín hiệu Microphone thu được.

Tin hiu tc bao gu gu xa (khi
n lu gy cn
loi b c truyn lu vn.
d = dhat + v+0.001*randn(length(v),1);
plot(t,d);
axis([0 33.5 -1 1]);
xlabel('Time [sec]');
ylabel('Amplitude');
title('Microphone Signal');
set(gcf, 'Color', [1 1 1])
p8 = audioplayer(d,fs);
playblocking(p8);
21








Bộ lọc thích nghi miền tần số (FDAF)
thu s dng trong b ln tn s (FDAF).
Thut hng xung c h th
s dng mt k thu p nht b lc.
c thc hin m
c ci thin hiu sut hi t  n s-
 chn mt s  u cho b l m b
gi
22


plot(t,v(n),'g');
axis([0 33.5 -1 1]);
ylabel('Amplitude');
title('Near-End Speech Signal');
subplot(3,1,2);
plot(t,d(n),'b');
axis([0 33.5 -1 1]);
ylabel('Amplitude');
title('Microphone Signal');
subplot(3,1,3);
plot(t,e(n),'r');
axis([0 33.5 -1 1]);
xlabel('Time [sec]');
ylabel('Amplitude');
title('Output of Acoustic Echo Canceller');
set(gcf, 'Color', [1 1 1])
p8 = audioplayer(e/max(abs(e)),fs);
playblocking(p8);
23


Tăng cường triệt tiêu âm quay trở lại (Echo Return Loss Enhancement – ERLE)
 n truy c u gu xa vang l
 u xa vang li, b d
mn (trong dB) tu. Ta th ng 30 dB ERLE
c hi t.
24




erle = filter(Hd2,(e-v(1:length(e))).^2)./
(filter(Hd2,dhat(1:length(e)).^2));
erledB = -10*log10(erle);
plot(t,erledB);
axis([0 33.5 0 40]);
xlabel('Time [sec]');
ylabel('ERLE [dB]');
title('Echo Return Loss Enhancement');
set(gcf, 'Color', [1 1 1])




25








Hiệu quả của những giá trị kích thước bước khác nhau
 c s hi t  th b dng m
c lt s hiu  lc

×