How make an equivalent function of unit delay in matlab

4 views (last 30 days)
Hello,
I want to realise a average filter in simulink
The solution below work good, but the delay (5) is not a constant. it can be 10 or 20.
So i tried to make a matlab function in order to have this capability, but i cant find a proper delay function.
Have you got any ideas to perform this calculation?
Thanks a lot

Answers (1)

Birdman
Birdman on 16 Apr 2018

Delay block comes with its Input Port choice within the mask in its Source. Check the attached figures.

  3 Comments
Birdman
Birdman on 16 Apr 2018
Well, I did not understand clearly what you tried to do. I thought you want to continuously change the delay order throughout the simulation?
Baptiste Giroud
Baptiste Giroud on 16 Apr 2018
Ok i sum up.
i need to set a delay paramaters ( for ex : 180ms). Once the delay is set, i need to know the states @ z^-180 to z^-1
Then, i need to sum all this values and divide the results by the delay (180)
It's what i did on the simulink at the begining of the topic. It's work but the delay is a parameter. One time it can be 180ms and the other time it can be 30ms, and i need an adaptative calculation. I dont want to set a simulink with 180 delay block and next time 30 delay block...
I hope it is more understanding for you.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!