Filter out certain numbers (a Sigmund question)

Alec Gordon's icon

Alec Gordon

2月 05 2021 | 5:00 午後

Hey,

So I'm having a little trouble. I'm trying to use the sigmund object for pitch detection, but it's somewhat unstable. Is there a way that I can filter a stream of numbers to only pass numbers that fit within the window defined by previous numbers?
For example, in the sigmund object, I can get a stream like this:
330., 330, 330, -1500, 331, 334, 330
Where I would want to tell it to ignore the -1500. I had thought about a simple thing like
"if $f1 < x then previous number"
but I can't really work out how I would do that.

Any help is massively appreciated.
Cheers, Alec.