MATLAB Coder problem with discrete wavelet thresholding
Show older comments
Hello everyone. I wanted to generate a C code for my ECG noise removal program with dwt, but I ran into a problem. The Coder doesn't seem to like the wdencmp function. The script is tested, and it is working as intended, I only use the Wavelet toolbox which came with MATLAB, and I checked, all of the functions used are supported for C/C++ generation, and I have enabled the variable-sizing option.
The script is as follows:
function out = denoise(input)
%the thresholding values
thr = [...
0.013347585482866 ; ...
0.015872023591907 ; ...
0.144506458583803 ; ...
0.374411347716711 ; ...
0.000000000000000 ; ...
0.000000000000000 ; ...
0.000000000000000 ; ...
0.000000000000000 ; ...
0.000000000000000 ; ...
0.000000000000000 ; ...
0.000000000000000 ; ...
0.000000000000000 ...
];
c = zeros(4170,1);
l = zeros(14,1);
% the deconstruction
[c,l] = wavedec(input,12,'sym4');
% thresholding algorithm
% 1. remove the average value
c(1:l(1)) = zeros(1,l(1));
% apply Heuristic SURE to the detail value
out = wdencmp('lvd',c,l,'sym4',12,thr,'s');
end
What am I overlooking? Any help would be appreciated.
Thanks in advance, Fehér Áron.
1 Comment
Fehér Áron
on 11 Jun 2017
Accepted Answer
More Answers (0)
Categories
Find more on Continuous Wavelet Transforms in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!