필터 지우기
필터 지우기

CWT design in simulink

조회 수: 2 (최근 30일)
vinod naidu
vinod naidu 2016년 5월 25일
댓글: Ahmad Aldiab 2024년 4월 17일
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일
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일
편집: 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