BIQUAD(9)

πŸ“¦
version 2.9.4 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ BIQUAD πŸ’…

okay bestie, welcome to the biquad page from the HAL Component manual β€” this is section 9, and it is lowkey the moment πŸŽ€


🌸 NAME 🌸

biquad β€” the Biquad IIR filter. that's it, that's the name, periodt πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

loadrt biquad [count=N|names=name1[,name2...]]

like, you load it with loadrt, and you can either say how many you want with count=N or name them individually with names=name1[,name2...]. iconic behaviour, no notes 🫢


πŸ‘‘ DESCRIPTION πŸ‘‘

so biquad is a Biquad IIR filter, and it implements this transfer function, and you're gonna want to look at it because it's literally the whole thing:

H(z) = (n0 + n1z-1 + n2z-2) / (1+ d1z-1 + d2z-2)

that's the math, bestie, and the rest of this page is just how you poke at it πŸ“


πŸ’œ FUNCTIONS πŸ’œ

  • biquad.N β€” and bestie, heads up, this one requires a floating-point thread. no float thread, no vibes. it's giving needy but we love it anyway πŸ’€

🌈 PINS 🌈

  • biquad.N.in float in β€” the filter input. stuff goes in here.
  • biquad.N.out float out β€” the filter output. stuff comes out here. the circle of life ✨
  • biquad.N.enable bit in (default: 0) β€” the filter enable. when it's false, the in pin gets passed straight to the out pin with zero filtering β€” just raw dogging the signal through. but when it transitions from false to true, that's when the filter coefficients get calculated, based on the current type plus whatever the describing pins and params are set to. so like, flip it on when you're ready πŸ’…
  • biquad.N.valid bit out (default: 0) β€” when this is false, it means an error happened while calculating the filter coefficients. specifically, it needs 2>Q>0.5 and f0>sampleRate/2. so if your numbers are wild, this pin is gonna tell you 😭
  • biquad.N.type u32 in (default: 0) β€” the filter type, which decides what kind of filter coefficients get calculated. when it's 0, the coefficients have to be loaded directly from the n0,n1,n2,d1 params. when it's 1, you get a low pass filter, specified by the f0,Q pins. when it's 2, you get a notch filter, also specified by the f0,Q pins. three flavours, pick your fighter πŸ‘‘
  • biquad.N.f0 float in (default: 250.0) β€” the corner frequency of the filter.
  • biquad.N.Q float in (default: 0.7071) β€” the Q of the filter.
  • biquad.N.s1 float out (default: 0.0) β€” the 1st-delayed internal state. for debug only, bestie, don't build your whole personality around it 🫣
  • biquad.N.s2 float out (default: 0.0) β€” the 2nd-delayed internal state. also for debug only. same energy πŸ’€

πŸŽ€ PARAMETERS πŸŽ€

  • biquad.N.d1 float rw (default: 0.0) β€” 1st-delayed denominator coef.
  • biquad.N.d2 float rw (default: 0.0) β€” 2nd-delayed denominator coef.
  • biquad.N.n0 float rw (default: 1.0) β€” non-delayed numerator coef.
  • biquad.N.n1 float rw (default: 0.0) β€” 1st-delayed numerator coef.
  • biquad.N.n2 float rw (default: 0.0) β€” 2nd-delayed numerator coef.

those rw ones are read-write, so go off, tune them, make it yours πŸ’–


🌟 AUTHOR 🌟

Peter G. Vavaroutsos β€” the actual main character who wrote this 🫢


⭐ LICENSE ⭐

GPL β€” go wild, respectfully πŸ’œ


and that's the whole page, bestie!! this was pulled straight from the LinuxCNC Documentation, dated 2026-03-17, and honestly? the biquad page ate and left no crumbs πŸŒΈπŸ’…βœ¨ no cap, fr fr πŸ¦‹

πŸ“¦ where this page comes from