Вы находитесь на странице: 1из 12

1

... 02.11.04.

4: .
, , .
. , V ....
, .
. , .

: . 4.1. Wavelet Toolbox. .


. . 4.2. .
. . -.
. . GUI. 4.3. .
4.4. . 4.5. . .
. - . . 4.6.
-. . .
. .
.


Wavelet Toolbox Matlab.
, ,
GUI.
Wavelet Toolbox :
o -
.
o , .
o .
o .
o .
o .
o .
22.1. WAVELET TOOLBOX /34/.
.

(t) , .

.
'haar' .
'db' .
'sym' .
'coif' .
'bior' .
'rbio' .
'meyr' .
'dmey' .
'gaus' .
'mexh' .
'morl' .
'cgau' .
'shan' .
'fbsp' -.
'cmor' .
, , (/),
(), : 'db1',
'gaus3', 'bior2.6', 'fbsp2-1-0.5'. :
>> wavemngr('read') ,
>> wavemngr('read',1) ,
>> waveinfo('') .
- waveinfo('gaus').
() wavemngr ( 'add'), ,
() . :

2
>> wavemngr(['add',]FN,FSN,WT,NUMS,FILE[,B]),
>> wavemngr(['add',]FN,FSN,WT,{NUMS,TYPNUMS},FILE[,B]),
FN , FSN , WT , NUMS
( , **),
TYPNUMS ('integer', 'real' 'string'), FILE mat m, B
(
). WT
: WT=1 , WT=2 , WT=3
, WT-4 , WT=5
.
.
:
wavemngr('add','Mainwave','mnw',1,'1 2 3','mainw1')
wavefun psi- (x)
phi- (x) ( ),
. ( ) :
[Phi1,Psi1,Phi2,Psi2,X] = wavefun('wname',ITER).
2ITER. Phi1,Psi1 (x) (x)
() ( ), Phi2,Psi2
(x) (x) () .
Phi2 Psi2 .
Phi1. '' ,
. ( 'gaus')
ITER =2ITER , ,
.
'sym2'
(. 4.1.1):

iter = 10; wav = 'db2';


for i = 1: iter
[phi,psi,x] = wavefun(wav,i); plot(x,psi); hold on
end; hold off
. 4.1.1.

Matlab '>>'.
-

( ). :
Q = centfrq('wname'[,ITER]),
ITER , 'wname'
.

db2
, , .
4.1.2.
>> f = centfrq('db2',16,'plot'); grid
f=
. 4.1.2.
0.6667
4.2. /34/.

(D)
: LD ( ,
) D ( ).
, (R) LR
HR.
.

3
(dbN), (symN) (coifN), N
(1,2,...). .
.
, - , -
. phi psi,
,
.
0.7 5% , coif1
0.8 .
phi- psi- .
[ph2,ps2,x] = wavefun('db2',10); [ph4,ps4,x1] = wavefun('db4',10);
[ph6,ps6,x2] = wavefun('db6',10); [ph8,ps8,x3] = wavefun('db8',10);
subplot(141);plot(x,ph2,x,ps2);grid; subplot(142);plot(x1,ph4,x1,ps4);grid;
subplot(143);plot(x2,ph6,x2,ps6);grid; subplot(144);plot(x3,ph8,x3,ps8);grid;

. 4.2.1. .

. 4.2.1 . N=2
psi-.
phi- psi- ,
psi- . db1
, .

. 4.2.2. .

. 4.2.2. .

:
load wname; LM = wname;
, .
:
LM = dbaux(N,SUMLM), N=1,2,3,- , SUMLM = sum(LM)
.
LM = dbwavf('wname').
:
LM = symaux(N,SUMLM).

4
LM = symwavf('wname').
LM = coifwavf('wname').
'db8' .
LM = dbwavf('db8'); Lm=LM;
Lm(128)=0; Lmf = fft(Lm);
LMF = fftshift(Lmf);
%
f=((0:length(LMF)-1)/length(LMF))-0.5;
% .
subplot(211); stem(LM); grid; title('LM-cc db8');
subplot(212); plot(f,abs(LMF)); grid; title('C LM-');

. 4.2.3. .

. 4.2.3 db8
db2 db4. ,
.
psi-
-. ,
db, sym coif
. .
.
-, :
[LD,HD,LR,HR] = orthfilt(LM),
LD () , HD (), LR
, HR .
'db6' (. 4.2.4).
load db6; LM = db6;
[LD,HD,LR,HR] = orthfilt(LM);
subplot(221); stem(LD); grid; title('LD- db6');
subplot(222); stem(HD); grid; title('HD- db6');
subplot(223); stem(LR); grid; title('LR- db6');
subplot(224); stem(HR); grid; title('HR- db6');

. 4.2.4.

( )
:
[LD,HD,LR,HR] = wfilters('wname').
. (
LM LM/sqrt(2)) LR
LM. , LR HR

5
LD HD.
( )
:
dlmwrite('file',A,'dlm'[,rows[,cols]]) - () ,
, ( ).
'dlm' (
'\t', ).
A=dlmread('file','dlm'[,rows[,cols]]) - () .
"rows,cols"
: [ , , , ].
LD .
dlmwrite('LDfilter.prn',LD,'\t');
.
, , ,
, (. 4.2.5)
.
db6 ( ).
Ld=LD; Hd=HD; Lr=LR; Hr=HR;
Ld(128)=0; Hd(128)=0; Lr(128)=0; Hr(128)=0;
LDF = fftshift(fft(Ld/sqrt(2))); HDF = fftshift(fft(Hd/sqrt(2)));
LRF = fftshift(fft(Lr/sqrt(2))); HRF = fftshift(fft(Hr/sqrt(2)));
f=((0:length(Ld)-1)/length(Ld))-0.5;
subplot(221); plot(f,abs(LDF)); grid; title('LDF-c db6');
subplot(222); plot(f,abs(HDF)); grid; title('HDF-c db6');
subplot(223); plot(f,abs(LRF)); grid; title('LRF-c db6');
subplot(224); plot(f,abs(HRF)); grid; title('HRF-c db6');

. 4.2.5. .

,
.
.
(meyr) (dmey) . phi psi
( )
. .
[-8,8]. .
:
[PH,PS,] = meyer(sb,ub,N),
, N
(
2), sb
( < -6), ub
( > 6).

. 4.2.6.
,
, : [PS,X]=meyer(-8,8,1024,'psi').
. 4.2.6.
,

6
.
(. 4.2.7).
load dmey; LM = dmey;
[LD,HD,LR,HR] = orthfilt(LM);

. 4.2.7.

-
(. 4.2.5), .

. 4.2.8.
GUI. , phi- psi GUI,
wavemenu,
Wavelet Toolbox Wavelet Toolbox Main Menu Matlab
" ".
. 4.2.8.
. "One-Dimensional"
.
"Two-Dimensional" .
, /
"Display". -
( , , .) 46 .

. 4.2.9.

, 'Display' 'Wavelet Display',


, . 4.2.9.
("Wavelet"), 'Display'.
phi psi
. "Display" ,
.
, , GUI 'Display'
,
.
4.3. /34/.

,
(-) ,
, (
). ,
, :
m,k =
s(k)m,k(x) dx,

m,k

s = cm,k#m,k.
k


. Wavelet Toolbox
- biorNr.Nd
rbioNr.Nd, Nr Nd :
Nr = 1, Nd = 1,3,5.
Nr = 2, Nd = 2,4,6,8.
Nr = 3, Nd = 1,3,5,7,9.
Nr = 4, Nd = 4.
Nr = 5, ND = 5.
Nr = 6, Nd = 8.
phi- psi- . Phi , psi- ,
.
, , .

. 4.3.1.

. 4.3.1 phi- psi- bior1.Nd.


. si- .
[Phi1,Psi1,Phi2,Psi2,X] = wavefun('wname',ITER).
psi-
bior3.Nd. . 4.3.3. bior3.Nd
Nd<7 () ,
bior2, . 4.3.2.

. 4.3.2.

. 4.3.2 phi- psi- bior2.N.


,
.
bior4.4 bior5.5, . 4.3.3, bior6.8.

. 4.3.3.

, , ,

[LMR,LMD] = biorwavf('biorNr.Nd'),
[LMR,LMD] = rbiowavf('rbioNr.Nd'),

9
LMR , LMD .

[LD,HD,LR,HR] = biorfilt(LMD,LMR).
(. 4.3.4).
[LMR,LMD] = biorwavf('bior3.3'); [LD,HD,LR,HR] = biorfilt(LMD,LMR);
subplot(221); stem(LD); grid; title('LD- bior3.3');
subplot(222); stem(HD); grid; title('HD- bior3.3');
subplot(223); stem(LR); grid; title('LR- bior3.3');
subplot(224); stem(HR); grid; title('HR- bior3.3');

. 4.2.4.


:
[LD,HD,LR,HR] = wfilters('wname').

. 4.3.5. bior3.3.

. 4.3.5 ( 0.5 0.5 ).


4.4. /34/.

(crude)
(morl) (gaus).

(mexh), "mexihat" .
phi-, psi-
, ,
.
. N
[sb,ub] :
[psi,X] = morlet(sb,ub,N),
[psi,X] = mexihat(sb,ub,N),
[psi,X] = gauswavf(sb,ub,N,P),
.
:
(x) = exp[-x2/2)cos(5x)].
'mexh':
(x) = (1/ 3 ) -0.25 (1-x2) exp(-x2/2).

10

. 4.4.1.

. 4.4.1 . 'mexh'
0.25 . ,
. 16-
'morl', 0.8125 .
4.5. /34/.

(cgauN),
(cmorFb-Fc), (shanFb-Fc), - (fbspM-Fb-Fc). Phi , psi- ,
.
.
P-
F(x) = Cp exp(-jx) exp(-x2),
. N
[sb,ub]
[psi,X] = gauwavf(sb,ub,N,P).
(. 4.5.1)
[psi,x] = cgauwavf(-5,5,1000,5);
subplot(131); plot(x,abs(psi)); grid; title(' cgau5');
subplot(132); plot(x,real(psi)); grid; title('Real cgau5');
subplot(133); plot(x,imag(psi));grid; title('Imag cgau5');

. 4.5.1. .

(x) = (1/ Fb ) exp(2jFcx) exp(-x2/Fb),


Fc , Fb . N
[sb,ub]
[psi,X] = morwavf(sb,ub,N,Fb,Fc).

. 4.5.2. .
-

(x) =

Fb [sinc(Fbx/M)M exp(2jFcx)],

11
Fc , Fb , =1,2,... .
N [sb,ub]
[psi,X] = fbspwavf(sb,ub,N,M,Fb,Fc).

. 4.5.3. - .

. 4.5.3.

(x) = Fb [sinc(Fbx) exp(2jFcx)],
.. - =1. N
[sb,ub]
[psi,X] = shanwavf(sb,ub,N,Fb,Fc).
4.6. - /34/.


.
.
() :
Y = dyaddown(X,)
Y
, , ..:
Y(k) = X(2k),
,
Y(k) = X(2k+1), .

Y = dyaddown(X)
Y = dyaddown(X,0), .. .

Y = dyaddown(X,E,''), '' = 'r', 'c' 'm'


, (rows), (cols)
(m) ''.
( )
:
Y = dyadup(X,)
Y
, , ..:
Y(2k) = 0, Y(2k-1)=X(k),
,
Y(2k) = X(k), Y(2k-1)=0,
.

Y = dyadup(X)
Y = dyadup(X,1), .. Y.

Y = dyadup(X,E,'')
Y = dyadup(X,'',E), '' = 'r', 'c' 'm'
, (r), (c)
(m).
z(x) =

[Z,X] = intwave('wname'[,P])

(y) dy

12
x 2 . ,
8.
[ZD,ZR,X] = intwave('wname',P),
ZD ZR
.

34. ., . MATLAB. .
. .: , 2002, 608 .
36. .. . . / , 2001, .171, 5, .
465-501.
37. .. . .: . , 1999, 132 .