I noticed this oddity while using a [phasor~] at low frequencies to ping a resonant filter: [hip~] oscillates quietly for cutoff frequencies below 20. You also get an interesting "zing" when you step its input between DC levels.
hip~ 1 oscillation.pd
No biggie, just something weird I noticed. I bet the math behind it is interesting.
-
strange oscillation in [hip~ 1]
-
@jameslo @seb-harmonik.ar wrote about the maths here....... https://forum.pdpatchrepo.info/topic/11850/explanation-for-lop-object-in-this-patch-requested/12
David. -
@jameslo @whale-av I've been looking at this & I think it has to do with floating-point roundoff stuff.
I think hypothetically the[hip~]
reaches some point of equilibrium in the phasor's cycle, when the increment of the phasor offsets the highpass zero characteristic (but the pole part is still acting, so the pole + phasor increment kind of cancel out the zero, at a given state of the filter). But when the new internal value is subtracted from the last internal value it probably creates a periodic effect that's due to roundoff error when subtracting the 2. It probably depends on the current state of the filter and the current[phasor~]
values coming in. The effect is pronounced at low frequencies because the numbers being subtracted are larger due to the pole location being closer to 1.
that's my guess -
I found this old thread as I was just about to open a new topic about the numerical error of [hip~] at low frequencies ... Well, to me at least the issue seems to be more of a "biggie" than you might have thought, because this kind of noise is added to the signal whenever [hip~] is used as a DC blocker (which is, after all, one of its main use cases). With good headphones this can become quite audible: Just try feeding [osc~ 0.1] into [hip~ 5] and listen to it at high gain!
Trying to understand what's going on here, I found this hint in Julius Smith's introduction to digital filters. So it really seems to be a result of the specific implementation structure of [hip~], where the zero is placed after instead of before the pole. I tried both implementations and can confirm that there is no (or much less) noise added if the zero precedes the pole.
As a simpler workaround I suggest to use [lop~] and subtract its output from the input signal.
Edit: So here's a little patch to demonstrate this ... hip-noise.pd