热门问题
时间线
聊天
视角

Coiflet小波

来自维基百科,自由的百科全书

Coiflet小波
Remove ads

Coiflet小波英格丽·多贝西罗纳德·科夫曼的要求所设计的一种离散小波。Coiflet小波的调整函式(scaling function)及小波函式(wavelet function)能同时拥有高消失动量,且其波形接近对称,常被用于数字信号处理[1]

Thumb
Coiflet with two vanishing moments

性质

  • 定义
一个正交小波英语Orthogonal_wavelet(orthogonal wavelet)系统若符合以下条件,则称为Generalized Coiflet Wavelet(GOC)。
其中为小波函式,为调整函式
  • 滤波器长度与消失动量
为滤波器长度,而为系统消失动量,则最小的为:
  • 近线性相位(Near-linear phase)滤波器
够小时,GOC的低通滤波器频率响应拥有渐进型态(asymptotic form):
其中则为常数项。因此具有渐近线性相位(asymptotic linear phase)的特性:
Remove ads

应用

Coiflet小波除了被使用在影像压缩外,目前也有被使用在电力系统讯号监测上[2]

系数

下表为coiflet小波调整函式C6~30的系数,小波函式的系数可以借由每两个系数变换一次符号来推导(例如C6 wavelet = {−0.022140543057, 0.102859456942, 0.544281086116, −1.205718913884, 0.477859456942, 0.102859456942})
更多信息 k, C6 ...
Remove ads

滤波器

这边列出6, 12 ,18点的filter消失点(vanish moment)也就是k/6。

这边的g是低频的滤波器,h是高频的滤波器。

可以看出,这边采用python的语法,h会是g的反序,且n为奇数时要乘上-1

更多信息 , ...
Remove ads

Matlab程式

F = coifwavf(W)会回传N=str2num(W)的coiflet小波的调整函式,其中N只能为1~5的整数。[3]

Python程式

这边根据上面所提供的高频和低频的滤波器去实作出离散小波转换并且应用到影像压缩上面,

透过小波转换良好的性质,尝试实作出连续的影像压缩。

这边单纯是在示范小波转换进行多次压缩和反压缩的结果,

如果不想转换这么多次修改Jmax即可。

import numpy as np
def subsampling(x, d):
    if d == 1:
        y = x[::2, :]
    elif d == 2:
        y = x[:, ::2]
    return y

def 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


Remove ads

双正交Coiflet小波

  • 定义
一个order为的双正交Coiflet小波需符合以下条件:
  • 性质
为偶数时,会对称于原点:。这让双正交coiflet在图片压缩方面能有较好的峰值信噪比(PSNR)。
Remove ads

参考资料

Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.

Remove ads