1 %>@brief Helps find thresholds
for wavelet de-noising
6 %> [1] M. Misiti, Y. Misiti, G. Oppenheim, and J.-M. Poggi, Wavelet Toolbox User’s Guide R2012b. Mathworks, 2012.
8 disp(
'*** Helps find thresholds for wavelet de-noising ***');
9 varname = input(
'Enter dataset variable name [Demo Raman dataset]: ',
's');
14 dataset = eval([varname ';']);
16 no = size(dataset.X, 1);
20 idx = input(sprintf('Enter index of spectrum to use (between 1 and %d) [1]: ', no));
22 if isempty(idx) || idx <= 0
26 dataset = dataset.map_rows(idx);
29 thresholds = [0, 0, 0, 1000, 1000, 1000];
34 no_levels_ = input(sprintf('Enter no_levels [%g]: ', no_levels));
35 if ~isempty(no_levels_)
36 no_levels = no_levels_;
39 thresholds_ = input(sprintf('Enter thresholds [%s]: ', mat2str(thresholds)));
40 if ~isempty(thresholds_)
41 thresholds = thresholds_;
46 dataset2.X =
wden(dataset.X, no_levels, thresholds, 'haar');
51 plot(dataset.fea_x, dataset.X, 'r', 'LineWidth', 2);
53 plot(dataset.fea_x, dataset2.X, 'b', 'LineWidth', 2);
54 plot(dataset.fea_x, dataset.X-dataset2.X, 'k', 'LineWidth', 2);
55 legend({
'Before',
'After',
'Difference'});
59 % s_happy = input(sprintf(
'Are you happy with thresholds = %d and no_levels = %g [y/N]? ', thresholds, no_levels),
's');
60 s_happy = input(sprintf(
'Are you happy [y/N]? '),
's');
61 if ~isempty(intersect({s_happy}, {
'y',
'Y'}))
function wden(in X, in no_levels, in thresholds, in waveletname)
function load_data_raman_sample()