CWT design in simulink

15 visualizaciones (últimos 30 días)
vinod naidu
vinod naidu el 25 de Mayo de 2016
Comentada: Ahmad Aldiab el 17 de Abr. de 2024 a las 11:46
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 comentario
Ahmad Aldiab
Ahmad Aldiab el 17 de Abr. de 2024 a las 11:46
is it possible to share your model please, thanks a lot

Iniciar sesión para comentar.

Respuestas (2)

Paramonte
Paramonte el 10 de Mayo de 2018
Did you get any reply? Also interested
  2 comentarios
NIKOLAY YAKOVENKO
NIKOLAY YAKOVENKO el 29 de Nov. de 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
Leila Farahani el 11 de Jun. de 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?

Iniciar sesión para comentar.


NIKOLAY YAKOVENKO
NIKOLAY YAKOVENKO el 9 de Feb. de 2023
Editada: NIKOLAY YAKOVENKO el 9 de Feb. de 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

Categorías

Más información sobre Continuous Wavelet Transforms en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by