BIQUAD(9)
β¨ 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.infloat in β the filter input. stuff goes in here.biquad.N.outfloat out β the filter output. stuff comes out here. the circle of life β¨biquad.N.enablebit in (default:0) β the filter enable. when it's false, theinpin gets passed straight to theoutpin 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.validbit out (default:0) β when this is false, it means an error happened while calculating the filter coefficients. specifically, it needs2>Q>0.5andf0>sampleRate/2. so if your numbers are wild, this pin is gonna tell you πbiquad.N.typeu32 in (default:0) β the filter type, which decides what kind of filter coefficients get calculated. when it's0, the coefficients have to be loaded directly from then0,n1,n2,d1params. when it's1, you get a low pass filter, specified by thef0,Qpins. when it's2, you get a notch filter, also specified by thef0,Qpins. three flavours, pick your fighter πbiquad.N.f0float in (default:250.0) β the corner frequency of the filter.biquad.N.Qfloat in (default:0.7071) β the Q of the filter.biquad.N.s1float out (default:0.0) β the 1st-delayed internal state. for debug only, bestie, don't build your whole personality around it π«£biquad.N.s2float out (default:0.0) β the 2nd-delayed internal state. also for debug only. same energy π
π PARAMETERS π
biquad.N.d1float rw (default:0.0) β 1st-delayed denominator coef.biquad.N.d2float rw (default:0.0) β 2nd-delayed denominator coef.biquad.N.n0float rw (default:1.0) β non-delayed numerator coef.biquad.N.n1float rw (default:0.0) β 1st-delayed numerator coef.biquad.N.n2float 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
- ubuntu resolute: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms