Wavelet Denoising - Thresholding Equations in PyWavelets

1,716 views
Skip to first unread message

mhp...@gmail.com

unread,
Mar 26, 2018, 3:45:27 PM3/26/18
to PyWavelets

Greetings,

I've been looking for thresholding functions/formulas/equations to apply to noisy signals in order to find a best reconstruction method for a given signal.
As it stands, I've been able to find a Universal Threshold implementation, a.k.a. VisuShrink, and although that serves the purpose of denoising that signal, without testing that method against other known variants, such as BayesShrink and SureShrink (Rigorous SURE and Heuristic SURE), it's hard to know how well VisuShrink actually works.

Does anyone have an implementation of these methods to share?
Otherwise, can anyone help implement them in python?

Thanks in advance!
~ Matt

Gregory Lee

unread,
Mar 26, 2018, 5:23:59 PM3/26/18
to pywav...@googlegroups.com
Hi Matt,

There is an implementation of BayesShrink in the current release of scikit-image (via PyWavelets).  It corresponds to the following paper:

[1] Chang, S. Grace, Bin Yu, and Martin Vetterli. "Adaptive wavelet thresholding for image denoising and compression." Image Processing, IEEE Transactions on 9.9 (2000): 1532-1546.  DOI: 10.1109/83.862633


Finally, VisuShrink will also be available in the next release, but it often results in images that look overly smoothed in comparison to BayesShrink:




--
You received this message because you are subscribed to the Google Groups "PyWavelets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pywavelets+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Gregory Lee

unread,
Mar 27, 2018, 6:36:11 PM3/27/18
to pywav...@googlegroups.com
If there is a problem with the scikit-image denoise_wavelet function, please open an issue at https://github.com/scikit-image/scikit-image and we can try to diagnose the problem.

Here is a minimal example where it seems to be working as expected :

import numpy as np
import pywt
from skimage.restoration import denoise_wavelet
import matplotlib.pyplot as plt

x = pywt.data.ecg().astype(float) / 256

sigma = .05
x_noisy = x + sigma * np.random.randn(x.size)

x_denoise = denoise_wavelet(x_noisy, sigma=sigma, wavelet='sym4', multichannel=False)

plt.figure()
plt.plot(x_noisy)
plt.plot(x_denoise)



On Mon, Mar 26, 2018 at 11:26 PM, <mhp...@gmail.com> wrote:
Heya Gregory,

Thanks a lot for the prompt reply.

I had in fact found the scikit-image library, however for some reason whenever I try to apply BayesShrink to this data it simply does not conform. I've even tried re-writing the code based on _denoise.py, but the output has no smoothing whatsoever, having instead of denoising simply normalized/shrunk the original signal upon rebuilding the coefficients, at any level.

I'll try to find this implementation, or rebuild it, as well as the plotted output so you can visualize what I mean.

For the record, the data I'm analyzing consists of single precision floating point discrete time-series data.
I'm using a Discrete Wavelet Transform, and the signal extension method is periodization.

Regards,
~ Matt
To unsubscribe from this group and stop receiving emails from it, send an email to pywavelets+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages