1
$\begingroup$

I'm trying to understand a variant of the filter presented in http://www.stockspotter.com/files/PredictiveIndicators.pdf in the "Code Listing 1.". Its expression is given as follow:

$$y_n = c_0 x_n + c_1 y_{n-1} + c_{2} y_{n-2}$$ with:

\begin{align} c_0&=(1-c_1-c_2) \\ c_1&=2 a \cos\left(2\frac{\pi\sqrt{2}}{T_s}\right) \\ c_2&=-a^2 \end{align}

and:

\begin{align} a&=\exp\left({-\frac{\pi\sqrt{2}}{T_s}}\right) \\ T_s&=10 \end{align}

I'm wondering how these coefficients were computed. I'm told it might be a 2-pole Butterworth filter, but my attempts at finding the coefficients for such a filter failed (and my searches online give me many different results, sometimes involving $x_{n-1}$ and $x_{n-2}$ whereas they are not used in this expression.

Does this ``SuperSmoother'' filter has another name in the literature ? How could I describe the effect of such a filter (beside being a low-pass filter)?

The paper is cited in the Linux Kernel's packet rate estimation smoothing.


For the records, here is the response of this filter using the notebook provided in the answers, compared with a moving average and an exponential moving average:

frequency response for three different filters


As someone remarked on IRC, this filter looks a lot like the "multiple feedback digital low-pass filter" from Chamberlin 1987 book "Musical Applications of Microprocessors", with $F=\frac{\sqrt{2}}{16}$ and $Q=1$:Multiple feedback digital low-pass filter

$\endgroup$
  • 1
    $\begingroup$ Thanks for the edit! The resonance at $\omega= 0.6\$ looks indeed a bit worrying; I don't think you wouldn't want to have for smoothing... it's consistently worse than the EWMA, too, up until frequencies that are larger than ¼ of the sampling rate. Huh. $\endgroup$ – Marcus Müller Oct 25 at 8:36
3
$\begingroup$

Seeing that the paper cites the author of the paper as inventor of the "SuperSmoother" filter, and this filter was (supposedly) good for this specific use case, there's no indication this filter is based on anything but the author's inventive force (his fantasy). He does mention it's a "converted analog filter made from capacitors and resistors", and you'd often apply Bilinear Transform to do a continuous/discrete time transform.

So, you won't find that "SuperSmoother" filter in literature. It seems to be a purpose-specific invention, not derived methodically using mathematical approaches.

Notice that you're very much on scientifically thin ice with the whole article.

There's no reason you'd want to base your analysis smoothing filter on an analog filter design; the author also doesn't explain why you'd want that. That's something that someone not really understanding how to design filters would do if they have but an analog filter to go on – and building analog filters that are as good for any particular discrete analysis purpose as a filter directly designed for the digital purpose in digital design is um, impossible; the optimization goals are in discrete time, not continuous time.

Also, nope, Butterworth is certainly not a minimum-lag filter, it's a maximum-flatness filtering approach.

He makes it sound like minimal-lag filter design is a new thing that he invented. That's nonsense, minimum-phase filters are literally entry level concepts in any discrete system lecture I've had material of.

The whole paper is very handwaving and has premises that are plain wrong¹. I'd put it into the category of pseudoscience – which means that while I really applaud you looking for meaning and scientific sense in there, you won't.


¹ for example

We also know that the market is fractal; a daily interval chart looks just like a weekly, monthly, or intraday chart.

No, that's nonsense, and that can be easily seen by the trivial autocorrelation. Or by the fact that there is an average weak-periodic component, but a month isn't "naturally" split into 7 equally sized units, and you won't find that in any autocorrelation. Really, this description is magic/superstition.
The paper claims to be based on scientific studies, but fails to cite even a single one – this should really make you think whether the author isn't trying to sell you that he's got a skill he really doesn't have.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks, to be honest I didn't read much of the paper, that's just the inspiration for some filter used in another domain ( namely, in the Linux Minstrel rate adaptation algorithm: lore.kernel.org/linux-wireless/… ). So I guess can only study this filter without understanding how it was designed. $\endgroup$ – R. G. Oct 25 at 7:23
  • $\begingroup$ you really don't have to study that filter from the article. It's not a good one for any particular use case, and certainly not for packet rate smoothing! I don't really understand why it ended up in the linux kernel. There's a lot of tools that can help you design an IIR filter like that and analyze them, so that you can come up with something good. $\endgroup$ – Marcus Müller Oct 25 at 7:47
  • $\begingroup$ @R.G. I guess if an analysis tool helps you: try this 5-minutes-hacked-together-mess-of-python gist.github.com/marcusmueller/6a01705caf7f8e56ec496cc6c553b93f $\endgroup$ – Marcus Müller Oct 25 at 8:14
  • $\begingroup$ Thank you, I'll try to explore this way. As this is how the algorithm actually works in the linux kernel, this is still of interest to me, but I get that something better exists out there. I edited my question to add the frequency response of this weird filter. $\endgroup$ – R. G. Oct 25 at 8:32
  • $\begingroup$ @R.G. cool, that'd be much appreciated! I'm interested, too, but I'm too busy at the moment to start contributing to kernel code. (also, be nice to Johannes Berg, the subsystem maintainer – I know his brother) $\endgroup$ – Marcus Müller Oct 25 at 8:33

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.