logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

lowpass - Low-pass filter

Author

       Jeff Epler

Functions

lowpass.N (requires a floating-point thread)

License

       GPL

LinuxCNC Documentation                             2025-08-07                                         LOWPASS(9)

Name

       lowpass - Low-pass filter

Notes

gain pin setting

       The  digital filter implemented is equivalent to a unity-gain continuous-time single-pole low-pass filter
       that is preceded by a zero-order-hold and sampled at a fixed period.  For a pole at -a  (radians/seconds)
       the corresponding continuous-time lowpass filter LaPlace transfer function is:

       H(s)=a/(s+a)

       For a sampling period T (seconds), the gain for this Hal lowpass component is:

       gain=1-e^(-a*T)

       e = 2.71828 https://en.wikipedia.org/wiki/E_(mathematical_constant)

       Examples:
            T = 0.001 seconds (typical servo thread period)
            a = (2*pi*100)    (100Hz bandwidth single pole)
         gain = 0.466

            T = 0.001 seconds (typical servo thread period)
            a = (2*pi*10)     ( 10Hz bandwidth single pole)
         gain = 0.0609

            T = 0.001 seconds (typical servo thread period)
            a = (2*pi*1)      ( 1Hz bandwidth single pole)
         gain = 0.0063

Parameters

lowpass.N.gain float rw

Pins

lowpass.N.in float in
       lowpass.N.out float out
               out += (in - out) * gain

       lowpass.N.load bit in
              When TRUE, copy in to out instead of applying the filter equation.

Synopsis

loadrtlowpass[count=N|names=name1[,name2...]]

See Also