How to remove samples not fulfilling a certain predicate in Simulink / DSP Matlab?

190 Views Asked by At

Let's assume the following setup:

I am using frame based processing in Simulink and I have fixed size frames of [1000x1] double.

Let's call this signal s.

Question : How can I produce a Simulink block, b, that removes all samples from s that do not satisfy a given predicate, say -1<x<1, where x is the sample value?

So, for example if I feed

[0.5 -0.2 2 2 2 2 2 ...] to b

then I would get [0.5 -0.2] because all the other samples do not satisfy the predicate -1<x<1.

Summary: I would like to create a filter operation in Simulink just like in functional languages like Haskell, Scala, ML, etc.

Is there a Simulink block like that already?

Or do I have to write my own ?

0

There are 0 best solutions below