simulink block having lower output refresh rate than input
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I programmed a matlab function enabling to calculate an online frequency analysis of time data (online generation of a Bode diagram) and it works fine offline.
Now I have to implement it to make it work online with sensors. I will write a C function and convert it to a MEX S-Function to use it in simulink. I will than get a block having two inputs (two signals) and giving the estimated transfer function as output.
The problem is that the sensors (i.e generating the input data) have are refreshed avery 5ms, and my block can only output a value each 5 secs. Is it possible to make this work with simulink ? I would have:
input signal (updated each ts=5 ms) during 5 seconds --> Function processing the data acquired --> input signal next 5 seconds --> processing the data acquired.
So that it takes 10 seconds of input signal (10*fs values) to generate 2 estimations of the transfer function.
I have also the feeling that the processing of the acquired data should be done in parallel while data continues to be acquired (because the signals are updated during the processing time!), is that possible? It would be great if you could tell me where I can find some documentation or examples of such kind of implementation because I didn't found anything on the subject.
Thank you :)
0 个评论
采纳的回答
Kaustubha Govind
2013-7-12
Yes, it is possible to write S-functions that have different sample rates at the ports. Type "sfcndemo_sfun_multirate" at the MATLAB prompt to see an example of such an S-function. When you update the model, the sample-time colors denote how the input and output rates are different.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Discontinuities 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!