An Example Application of the Discrete Wavelet Transform | Understanding Wavelets, Part 3
From the series: Understanding Wavelets
Denoise a signal with the discrete wavelet transform using MATLAB®. Compare different denoising techniques with the discrete wavelet transform.
Published: 16 Aug 2016
In this video, we will discuss how to use MATLAB to denoise a signal using the discrete wavelet transform. Let us load a signal and plot it in MATLAB. There are two signals here: The first is the original signal, and the second one is the original signal with some noise added to it. Our goal here is to denoise the noisy signal using the discrete wavelet transform.
Soon you will see how easy it is to do this in MATLAB. Here is an overview of the steps involved in wavelet denoising:
1. Your first step is to obtain the approximation and the detail coefficients. Do this by performing a multilevel wavelet decomposition. Recall that the discrete wavelet transform splits up a signal into a low pass subband (also called the “approximation level”) and high pass subband (also called the “detail level”). You can decompose the approximation subband at multiple levels or scales for a fine scale analysis.
2. The second step is to analyze the details and identify a suitable thresholding technique. I will cover this later in the video.
3. The third step is to threshold the detail coefficients and reconstruct the signal. Let us first perform a multilevel wavelet decomposition using the function wavedec. We will use a sym6 wavelet and decompose the noisy signal down to five levels. The function outputs the fifth level approximation coefficients along with the detail coefficients from levels one through five. The first-level detail coefficients capture the high frequencies of the signal.
Most of the high frequency content comprises the noise present in the signal. However, part of the high frequency is made up of abrupt changes in the signal. There are times when these abrupt changes carry meaning, and you would want to retain this information while removing the noise. Let us take a closer look at the details subband. To extract the coefficients, you can use the detcoef function and plot the coefficients for each level. I am using a helper function to extract and plot the coefficients. What you are seeing here is the original signal, along with the details plotted for levels one through five. Notice that the activity reduces drastically as the scale or level increases. So, we will focus on the level one details and ignore the rest for now. Our aim here is to retain these sharp changes while getting rid of the noise. One way to do this is by scaling the detail coefficients by a threshold. There are four main techniques available in MATLAB to help you compute a threshold for the purpose of denoising. The universal threshold is the simplest to compute and is computed using this formula.
Manually computing the threshold for the other three denoising techniques is not as straightforward. Instead, you can use MATLAB for this, so that you can focus on using the threshold value without worrying about how it is computed. There are two ways of applying the threshold. There are two thresholding operations, soft thresholding and hard thresholding. In both cases, the coefficients with a magnitude less than the threshold are set to zero. The difference between these two thresholding operations lies in how they deal with coefficients that are greater in magnitude than the threshold. In the case of soft thresholding, the coefficients greater in magnitude than the threshold are shrunk towards zero by subtracting the threshold value from the coefficient value, whereas in hard thresholding, the coefficients greater in magnitude than the threshold are left unchanged. Coming back to our example, let us denoise our noisy signal using Sure Shrink with the soft thresholding technique. Soft thresholding is a good starting point if you are not sure which technique to choose.
The entire process of thresholding the coefficients and reconstructing the signal from the new coefficients can be done using a single function as shown here. The first parameter, f, is the noisy signal. The second parameter specifies the thresholding technique; in this case, Sure Shrink. s denotes soft thresholding, and the parameter sln indicates threshold rescaling using a single estimate of noise based on first-level coefficients. level indicates the wavelet decomposition level, and the last parameter specifies the wavelet, which is sym6 in this case. The function wden performs a multilevel decomposition of the input signal, computes and applies the threshold to the detail coefficients, reconstructs the signal with the new detail coefficients, and provides it as an output. Let us now use the plot command to compare the noisy signal with the denoised signal, which was the output of the previous step. Clearly, the denoised version has less noise.
You can also compare the performance of the denoising technique we discussed earlier with other denoising techniques such as Savitzky-Golay filtering or the moving average technique. You can see that the wavelet denoising method outperforms other denoising techniques. Therefore, the benefits of using wavelet techniques to denoise a signal are clear.
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)