Integrate "wdenoise" into Simulink

Hello all,
I wish to implement the following function in Simulink:
wcof = wdenoise(sig,8, ...
'Wavelet', 'fk18', ...
'DenoisingMethod', 'Bayes', ...
'ThresholdRule', 'Soft', ...
'NoiseEstimate', 'LevelIndependent');
I came across this video linked below which seemed to accomplish this goal using Dyadic Analysis/Synthesis Filter bank blocks, but unfortunately those blocks do not support the "Fejér-Korovkin" ('fk18') Wavelet decomposition method from the above function that I wish to implement.
I tried inserting wdenoise into a MATLAB function block, but I end up running into errors related to specifying the MATLAB function block's data types when I try to run the model, even though I have explicitly set these data types.
Below, I have inserted a screenshot containing the Simulink model containing the custom wdenoise block, model explorer showing explicitly declared data types and sizes, diagnostic report showing error related to variable size data types, and the MATLAB code within the custom wdenoise block.
Maybe I am not buffering the data into frames correctly before feeding it to the custom wdenoise block?
Please let me know of a good strategy for implementing the above wavelet denoising filter into Simulink.
I have included my Simulink files to this question.
Best,
-Gheorghe Schreiber

Answers (0)

Products

Release

R2020b

Asked:

on 6 May 2021

Edited:

on 7 May 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!