0

My overall goal is to use a moving average filter where the filter length changes dynamiclly. My problem is that I really do not know how to change the parametrs in a simulink block. It seems like they are ment to be constant.

I am working with a data stream, i.e. each measurement comes in individually. So there is not one big array/list of numbers I want to apply that to.

My Ideas are

  • Make a Custum S-function
  • Somehow change the parameter for filter length in the moving mean block.
  • Use the matlab function block and make it happen in there.

My problem as a complete beginner is that I do not know which why works (best) and which way is the 'correct' way. And that I would not know how to actually exectute any of the three.

Any help would be greatly appreceated.

  • 1
    couple questions: do you want to change the filter at runtime or before running? also, which simulink block 'seems to have constant parameters'? also, share what you tried (if you tried anything at all) – Ferro Luca Jun 20 '23 at 05:56
  • Yes I want to change the size of the sample window during runtime. The parameter which seems to be constant, at least during runtime, is the window size of the moving mean block. How could I share simulink `code` ? – Constantin Höing Jun 20 '23 at 07:06
  • probably an image would do. I couldn't find such block, do you mean the moving average block or it is a block in a toolbox (which apparently i dont have): – Ferro Luca Jun 21 '23 at 10:52
  • the idea you had is probably the way to go anyways, meaning that you need a matlab function block with code using the movmean() function. – Ferro Luca Jun 21 '23 at 10:56

0 Answers0