小波阈值去噪

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/baidu_27643275/article/details/85303420

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

小波阈值去噪有两个关键点:一是阈值的选取,二是阈值函数的选取。

硬阈值法:将信号的绝对值与阈值进行比较,小于阈值的点置为零,其他保持不变
软阈值法:将信号的绝对值和阈值进行比较,小于阈值的点置为零,大于或等于阈值的点则向零收缩,变为该点值与阈值之差

在这里插入图片描述

硬阈值法可以对图像的边缘和细节等局部信息进行保留,但图像会发生局部失真;而软阈值处理则相对平滑 ,但其又使得边缘模糊 、图像失真

在这里插入图片描述

# python实现
import numpy as np
import pywt
data = np.linspace(1, 4, 7)
# array([ 1. ,  1.5,  2. ,  2.5,  3. ,  3.5,  4. ])

# 软阈值法(绝对值与阈值比较,大于缩小,小于置零)
pywt.threshold(data, 2, 'soft')
# array([ 0. ,  0. ,  0. ,  0.5,  1. ,  1.5,  2. ])
# 硬阈值法(绝对值与阈值比较,大于不变,小于置零)
pywt.threshold(data, 2, 'hard')
# array([ 0. ,  0. ,  2. ,  2.5,  3. ,  3.5,  4. ])
# greater
pywt.threshold(data, 2, 'greater')
# array([ 0. ,  0. ,  2. ,  2.5,  3. ,  3.5,  4. ])
# less
pywt.threshold(data, 2, 'less')
# array([ 1. ,  1.5,  2. ,  0. ,  0. ,  0. ,  0. ])

完整过程可参考:
http://blancosilva.github.io/course-material/2011/01/23/denoising-wavelet-thresholding.html

更多去噪方法可参考:
https://github.com/1273545169/wavelet-transform/blob/master/小波信号去噪.pdf

参考资料:
https://blog.csdn.net/zhang0558/article/details/76019832
https://github.com/1273545169/wavelet-transform

猜你喜欢

转载自blog.csdn.net/baidu_27643275/article/details/85303420
今日推荐