Coiflet小波

Coiflet小波英格麗·多貝西羅納德·科夫曼的要求所設計的一種離散小波。Coiflet小波的調整函式(scaling function)及小波函式(wavelet function)能同時擁有高消失動量,且其波形接近對稱,常被用於數位訊號處理[1]

Coiflet with two vanishing moments

性質编辑

  • 定義
一個正交小波(orthogonal wavelet)系統若符合以下條件,則稱為Generalized Coiflet Wavelet(GOC)。
其中 為小波函式, 為調整函式
  • 濾波器長度與消失動量
為濾波器長度,而 為系統消失動量,則最小的 為:
  • 近線性相位(Near-linear phase)濾波器
夠小時,GOC的低通濾波器頻率響應擁有漸進型態(asymptotic form):
其中 則為常數項。因此 具有漸近線性相位(asymptotic linear phase)的特性:

應用编辑

Coiflet小波除了被使用在影像壓縮外,目前也有被使用在電力系統訊號監測上[2]

係數编辑

下表為coiflet小波調整函式C6~30的係數,小波函式的係數可以藉由每兩個係數變換一次符號來推導(例如C6 wavelet = {−0.022140543057, 0.102859456942, 0.544281086116, −1.205718913884, 0.477859456942, 0.102859456942})
Coiflets係數
kC6C12C18C24C30
-10-0.0002999290456692
-90.0005071055047161
-80.00126192242286190.0030805734519904
-7-0.0023044502875399-0.0058821563280714
-6-0.0053648373418441-0.0103890503269406-0.0143282246988201
-50.01100625341566280.02272492296652970.0331043666129858
-40.02317519347743370.03316712095834070.03773447713912610.0398380343959686
-3-0.0586402759669371-0.0930155289574539-0.1149284838038540-0.1299967565094460
-2-0.1028594569415370-0.0952791806220162-0.0864415271204239-0.0793053059248983-0.0736051069489375
-10.47785945694153700.54604209306953300.57300667054729500.58733481003220100.5961918029174380
01.20571891388307001.14936478771373001.12257051374066001.10625291007910001.0950165427080700
10.54428108611692600.58973438739123800.60596714354564800.61431461933577100.6194005181568410
2-0.1028594569415370-0.1081712141834230-0.1015402815097780-0.0942254750477914-0.0877346296564723
3-0.0221405430584631-0.0840529609215432-0.1163925015231710-0.1360762293560410-0.1492888402656790
40.03348882032655900.04886818864233390.05562727391693900.0583893855505615
50.00793576722592400.02245848192407570.03547166284540620.0462091445541337
6-0.0025784067122813-0.0127392020220977-0.0215126323101745-0.0279425853727641
7-0.0010190107982153-0.0036409178311325-0.0080020216899011-0.0129534995030117
80.00158041020191520.00530532982706100.0095622335982613
90.00065933034758640.00179118785539060.0034387669687710
10-0.0001003855491065-0.0008330003901883-0.0023498958688271
11-0.0000489314685106-0.0003676592334273-0.0009016444801393
120.00008816045323200.0004268915950172
130.00004416569382460.0001984938227975
14-0.0000046098383254-0.0000582936877724
15-0.0000025243583600-0.0000300806359640
160.0000052336193200
170.0000029150058427
18-0.0000002296399300
19-0.0000001358212135

濾波器编辑

這邊列出6, 12 ,18點的filter消失點(vanish moment)也就是k/6。

這邊的g是低頻的濾波器,h是高頻的濾波器。

可以看出 ,這邊採用python的語法,h會是g的反序,且n為奇數時要乘上-1

Daubechies filter

01234567891011121314151617
-0.0727-0.33780.8525-0.38486-0.07270.0156
-0.0156-0.07270.384860.85250.3378-0.0727
0.0010-0.0026 0.0079-0.03350.0841-0.10820.5897-1.14940.5460-0.0953-0.0586-0.0232
0.02320.05860.09530.54601.14940.58970.10820.08410.03350.00790.00260.0010
-0.003793-0.0077820.0234520.065771-0.06112-0.405170.79377-0.42848-0.0717990.0823010.034555-0.015880-0.00900790.002574-0.0011170.000466-0.00007098-0.0000345
-0.0000345-0.000070980.0004660.001117-0.002574-0.00900790.0158800.034555-0.082301-0.0717990.428480.793770.40517-0.06112-0.0657710.0234520.007782-0.003793

Matlab程式编辑

F = coifwavf(W)會回傳N=str2num(W)的coiflet小波的調整函式,其中N只能為1~5的整數。[3]

Python程式编辑

這邊根據上面所提供的高頻和低頻的濾波器去實作出離散小波轉換並且應用到影像壓縮上面,

透過小波轉換良好的性質,嘗試實作出連續的影像壓縮。

這邊單純是在示範小波轉換進行多次壓縮和反壓縮的結果,

如果不想轉換這麼多次修改Jmax即可。

import numpy as npdef subsampling(x, d):    if d == 1:        y = x[::2, :]    elif d == 2:        y = x[:, ::2]    return ydef upsampling(x, d):    s = x.shape    if d == 1:        y = np.zeros((p * s[0], s[1]))        y[::2, :] = x    elif d == 2:        y = np.zeros((s[0], p * s[1]))        y[:, ::2] = x    return y    def cconv(x, h, d):    if d == 2:        return np.transpose(cconv(np.transpose(x), h, 1))    y = np.zeros(x.shape)    p = len(h)    pc = int(round( float((p - 1) / 2 )))    for i in range(0, p):        y = y + h[i] * np.roll(x, i - pc, axis=0)    return y    def DWT_compression(image, h, g): # discrete wavelet transformation    Jmin = 0    Jmax = log2(n)-1    fW = image.copy()    j = int(np.log2(image.shape[0])-1)    A = fW[:2**(j+1):,:2**(j+1):]    for j in arange(Jmax,Jmin-1,-1):        A = fW[:2**(j+1):,:2**(j+1):]        for d in arange(1,3):            Coarse = subsampling(cconv(A,h,d),d)            Detail = subsampling(cconv(A,g,d),d)            A = concatenate( (Coarse, Detail), axis=d-1 )        fW[:2**(j+1):,:2**(j+1):] = A        j1 = Jmax-j    return fW    def iDWT_decompression(image, fW, h, g): #image is original, fW is after DWT of that.    Jmin = 0    Jmax = int(np.log2(image.shape[0])-1)    f1 = fW.copy()    j = int(np.log2(image.shape[0])-1)    A = f1[:2**(j+1):,:2**(j+1):]    h1 = h[::-1]    g1 = g[::-1]    for j in arange(Jmin,Jmax+1):         A = f1[:2**(j+1):,:2**(j+1):]        for d in arange(1,3):            if d==1:                Coarse = A[:2**j:,:]                Detail = A[2**j:2**(j+1):,:]            else:                Coarse = A[:,:2**j:]                Detail = A[:,2**j:2**(j+1):]            Coarse = cconv(upsampling(Coarse,d),h1,d)            Detail = cconv(upsampling(Detail,d),g1,d)            A = Coarse + Detail            j1 = Jmax-j            if j1>0 and j1<5:                imageplot(A, 'j=' + str(int(j)), [2,2,j1])    f1[:2**(j+1):,:2**(j+1):] = A    return f1


雙正交Coiflet小波编辑

  • 定義
一個order為 的雙正交Coiflet小波需符合以下條件:
  • 性質
為偶數時, 會對稱於原點: 。這讓雙正交coiflet在圖片壓縮方面能有較好的峰值信噪比(PSNR)。

参考资料编辑

  1. ^ COIFLET-TYPE WAVELETS: THEORY, DESIGN, AND APPLICATIONS (PDF). [2016-01-25]. (原始内容 (PDF)存档于2016-03-05). 
  2. ^ Coiflet wavelet transform applied to inspect power system disturbance-generated signals. Shyh-Jier Huang, and Cheng-Tao Hsieh. 2002. 
  3. ^ coifwavf. http://www.mathworks.com/. [22 January 2015]. (原始内容存档于2016-05-22).