CWT design in simulink
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
my motivation for using the simulink is it supports particular hardware package , as per my project i have a sound signals which will give the output frequency peaks when CWTFT applied using CWT tools and I have tried to convert my implemented matlab code to C/C++ using code gen while converting the function and sub functions are too many (32 sub-fn's for scl2frq ) and unsupported syntax like "try" "catch" i switched to simulink design , How would i design scl2frq, morl ,cwt functions blocks for simulation in matlab if i design my code in simulink the entire design would support for C code gen ?
1 commentaire
Réponses (2)
Paramonte
le 10 Mai 2018
Did you get any reply? Also interested
2 commentaires
NIKOLAY YAKOVENKO
le 29 Nov 2021
This is probably too old thread, but I think I solved this. I do use full blown codegen including the embedded coder. When try to use CWT withing Simulink like a Matlab Function block subsystem, the Simulink tells that CWT is not supported for codegen. And it gives you a hint saying: "use CWTFILTERBANK instead". So I used that, it will define cwtfilterbank structure, which I pass to another function called wavelets(), and that function will generate the whole set of wavelets as per parameter given, i.e. for the script below it will generate 57 wavelets:
fb = cwtfilterbank('SignalLength',100,'SamplingFrequency',10,'WaveletParameters',[3,9]);
[psi, freq]=wavelets(fb);
So now we've got wavelets. The further path of your activity will depend on your task. If you have a finite chunk of signal for example in the file of 100 samples, and you need to get answer, which of wavelets (frequencies)
correlates to that chunk the most, you use cross correlator (xcorr) simulink block from DSP toolkit. The xcorr for 100 samples of signal and 100 samples of wavelets length will produce 199 samples vector of correlation output, and max() on that vector will give you the answer for each wavelet.
My task was to use continuous sliding cwt(), for indefinite length of the signal, so xcorr was not a good fit, i needed something else that will multiply and accumulate 100 samples of signal against each wavelets 100 samples, sample rate times per second. The suitable block either can be done in simulink subsystem, or Matlab function subsystem. I used the ready solution -- the DSP toolkit Discrete FIR Filter block. The only issue with that it does not support multiple sets of coefficients (matrix) so I reversed inputs, i.e. put the wavelet samples as a signal input (which supports matrix input), and the signal to coefficient input of the block.
The approach worked, it generated the correct embedded code.
Leila Farahani
le 11 Juin 2023
I should find instantenous frequency of a signal with cwt in simulink, whats your suggestion for my problem?
do you have any simulink model that helps me?
NIKOLAY YAKOVENKO
le 9 Fév 2023
Modifié(e) : NIKOLAY YAKOVENKO
le 9 Fév 2023
I use my own CWT block in SImulink that calculates a running CWT for set of my constructed family of wavelets made of Fractional derivatives of the Gaussian function. I use it in embedded system with Simulink code generator to C language.
https://www.mathworks.com/matlabcentral/answers/38849-harmonic-analysis-using-wavelet#answer_1167710
0 commentaires
Voir également
Catégories
En savoir plus sur Continuous Wavelet Transforms dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!