MATLAB Answers

Tapped delay function with varying size in Simulink

12 ビュー (過去 30 日間)
Swati Poduval
Swati Poduval 2020 年 5 月 20 日
コメント済み: Swati Poduval 2020 年 5 月 29 日
I wanted to know if there a way to give the "Number of delays" externally in the tapped delay function.
My idea is, the user should be able to connect an input port and this port gives the number of delays that the tapped function needs to have. So as to make it dynamic and not static where I set the number of delays during development phase itself.
(Setting parameters of the tapped delay function in simulink externally)

  0 件のコメント



Jonas 2020 年 5 月 26 日
Hi Swati
I have tested a few things and I don't think it is an easy problem to solve.
I have personally never used the Tapped Delay - and I don't know why you need it in your specific application - but the issue I see is that the output dimension depends on the number of delays you put into the dialog. If you enter 4, then the signal dimension of the output is 4. If you chose 7, the signal dimension if 7. That's why it is very difficult - I believe even impossible - to provide it as an input port.
One thing I was thinking about, is that the Unit delay block can have the delay length as an Input port. You can change this during simulation. But it will only output the input signal with the defined delay, it will not provide all other signals such as the Tapped Delay block does.
With kind regards,

  4 件のコメント

表示 1 件の古いコメント
Jonas 2020 年 5 月 28 日
So you are trying to implement a Moving Average Filter?
Take a look at the answer posted here. Using the Selector and Memory block, you can store the last N samples of a signal. What you can do, is implement this where N is the highest amount of samples you will want to store or take the average of. Afterwards, you can use another Selector block where the index is not a fixed value such as N, but an input port with the amount of samples you want to select.
The reason why you need another Selector block is that the Memory and IC block require a fixed size, so you first store the maximum you will need which is fixed (N), and then after you pick a smaller selection of that which can be flexible.
Jonas 2020 年 5 月 28 日
Please check attached for the Simulink model. I have saved it in version R2019a.
Swati Poduval
Swati Poduval 2020 年 5 月 29 日
Din't realise that the function i was trying to acheive using a tapped delay can also be implemented using the selector.


その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by