IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
pre_wden.m
Go to the documentation of this file.
1 %> @brief Wavelet De-noising block
2 %>
3 %> Wavelet de-noising uses the following techniques:
4 %> @arg Symmetric signal extension
5 %> @arg Stationary Wavelet Transform (SWT)
6 %> @arg Hard Thresholding
7 %>
8 %> The sequence is:
9 %> signal extension -> SWT decomposition -> thresholding -> SWT reconstruction
10 %>
11 %> The functions used are present in the Wavelet toolbox
12 %>
13 %> Probably the hard part of using this is to figure out the number of levels and the thresholds for each level. For a Raman spectrum, it has been found that 6 levels and the [0, 0, 0, 100, 1000, 1000] thresholds worked fine using a 'haar' wavelet.
14 %>
15 %> You can use the 'interactive_wden' tool to help finding these values.
16 %>
17 %> Alternatively you can use the 'Signal extension' followed by the 'SWT de-noising 1D' tool provided with the Wavelet Toolbox (accessed by typing 'wavemenu') to process one spetrum and get these parameters.
18 %>
19 %> See also MATLAB Wavelet Toolbox User's guide
20 %>
21 %> @image html "Screenshot-Stationary Wavelet Transform Denoising 1-D-1.png"
22 %> <center>Figure 1 - Finding thresholds using the utility from the MATLAB Wavelet Toolbox</center>
23 %> @sa uip_pre_wden.m
24 classdef pre_wden < pre
25  properties
26  %> ='haar'
27  waveletname = 'haar';
28  %> =6
29  no_levels = 6;
30  %> = [0 0 0 20 20 100] - given in the coarsest-to-finest order
31  thresholds = [0 0 0 20 20 100];
32  end;
33 
34 
35  methods
36  function o = pre_wden(o)
37  o.classtitle = 'Wavelet De-noising';
38  o.short = 'WDen';
39  end;
40  end;
41 
42  methods(Access=protected)
43 
44  %> Applies block to dataset
45  function data = do_use(o, data)
46  data.X = wden(data.X, o.no_levels, o.thresholds, o.waveletname);
47  end;
48  end;
49 end
Base Block class.
Definition: block.m:2