CWT design in simulink

14 次查看(过去 30 天)
vinod naidu
vinod naidu 2016-5-25
评论: Ahmad Aldiab 2024-4-17,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 个评论
Ahmad Aldiab
Ahmad Aldiab 2024-4-17,11:46
is it possible to share your model please, thanks a lot

请先登录,再进行评论。

回答(2 个)

Paramonte
Paramonte 2018-5-10
Did you get any reply? Also interested
  2 个评论
NIKOLAY YAKOVENKO
NIKOLAY YAKOVENKO 2021-11-29
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 2023-6-11
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
编辑:NIKOLAY YAKOVENKO 2023-2-9
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

类别

Help CenterFile Exchange 中查找有关 Continuous Wavelet Transforms 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by