Adding custom wavelet to modwt

4 views (last 30 days)
Fred Severgnini
Fred Severgnini on 29 Jun 2023
Answered: Balaji on 23 Aug 2023
Hello,
I am trying to work with a custom wavelet, which I call "qrs". Following the code example from wavemngr, I creates a .m file containin my wavelet, and added it to the system doing the following:
wavemngr('add','QRScomplex','qrs',1,'1 2 3 4 5','qrswavf')
I can tell the wavelet works because I can see it listed using
wavemngr('read')
Additionally, when I open the waveletAnalyzer I can use it in the "Wavelet 1D" option.
However, when I try to call my wavelet with modwt I get an error:
wt = modwt(signal, 'qre', 2);
Does anyone know why this is happening and how it can be fixed?
Here's the error message:
Error using wavemngr
Invalid wavelet name: qrs.
Error in wavemngr (line 339)
case 'wn' , i_fam = wavemngr('indw',arg);
Error in wfilters (line 63)
[wtype,fname] = wavemngr('fields',wname,'type','file');
Error in modwt (line 176)
[~,~,Lo,Hi] = wfilters(params.wname);
Error in get_wavelet_transform (line 17)
wt = modwt(signal, wavelet, level);

Answers (1)

Balaji
Balaji on 23 Aug 2023
Hi Fred,
As per my understanding, you’re facing issues while trying to use the custom wavelet created using the “wavemngr” function.
The code for the custom wavelet is in the “qrswavf.m” file that you have created, therefore the input argument of “qrswavf” as you have determined should be the argument you should be passing to the “modwt” function.
If you are following the example code given in the documentation of “wavemngr”, you can modify your code, provided you have changed only the name of the variable, as follows:
wt = modwt(signal, 'qrs2');
You can refer to the documentation of “wavemngr” below:
https://in.mathworks.com/help/wavelet/ref/wavemngr.html
provide required documentation links as support. [SM1]

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!