0
$\begingroup$

I am having this simple function which acts on two state variable $s_t$ (states being $\{0,1\}$, boolean in sense), and I am evaluating it in discrete time steps. The function is $f_t=1$ if $s_t$ has been $1$ for last $W$ samples (some fixed window size), and $f_t=0$ otherwise. So basically this will set the output to active if the input signal has been active for certain amount of time/samples. Is there some name or category for this? I thought it is latching but according to definitions on web it seems latching is more about delaying the signal, instead of asking "was the signal delayed on input".

$\endgroup$
  • $\begingroup$ latching isn't about delaying, I'd say. It's about acquiring, and storing, the state of an input on a specific condition, for example on a rising clock edge. $\endgroup$ – Marcus Müller Apr 19 at 12:41
1
$\begingroup$

There's no known name for this kind of filter in the signal processing world, as far as I know – and what good would such a name be, anyway?

So, I'd describe it in a signal processing context as "discrete state moving window sum with threshold", since it's a non-linear filter (and not much of a signal filter, if you ask me!). Simply because that's how I'd implement it: Sum up the last $W$ states, and output a 1 iff the result is $W$.

If you leave the realm of signal processing and think more of the basic electronic circuits that implement that, or by the purpose: You could call it a watchdog, or a digital anti-ringing, or a self-resetting cycle counter with a threshold, for example.

Your approach with the latch is from the latter category of names; "latch" is not anything that I'd call a filter in a signal processing context. Especially, the functionality you describe is not a latch (alone).

$\endgroup$
  • $\begingroup$ The purpose for which it was used in my case was to ensure that an action is triggered only after some input condition is stable for some time, so that it is not triggered by some random fluctuations... The watchdog seems to be close (although it feels a bit of negated). Anyways I am fine if it has no name, just wanted to make sure I'm not missing something familiar/commonly used. $\endgroup$ – Sil Apr 19 at 12:57
  • $\begingroup$ no, "watchdog" is usually meant to "watch" that e.g. a CPU hasn't crashed, and if it did (e.g. the "I'm in decode stage" flag is on for 10 cycles), reset it. What you seem to be describing is something that removes ringing (as in: when you press a button, it might lead to the input of a microcontroller oscillate from low to high, and back, for a couple of milliseconds, don't count each one of the low-high transitions as isolated button press) $\endgroup$ – Marcus Müller Apr 19 at 13:00
  • $\begingroup$ Yes that anti-ringing is pretty much what I am after then, I guess. In the current system this functionality/filter (whatever) is called Delay, which did not make sense to me, guess I will rename it to some AntiRinger or something (although it sounds horrible :D ) $\endgroup$ – Sil Apr 19 at 13:06
  • $\begingroup$ "Delay" isn't that wrong – technically, you could implement this as an "self-resetting monostable", which is a delay. $\endgroup$ – Marcus Müller Apr 19 at 13:07
  • $\begingroup$ Problem with "Delay" was also that people expected it to delay the signal, like it would give you the value from several samples in past (not sure what use that would be though), which is not what this does. There is also a function "Stable" which would fit perhaps as well, but that is more general (being within some min/max bounds for some time), but anyways thank you, you gave me a lot to think about, I will utilize that. $\endgroup$ – Sil Apr 19 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.