/** * Set the alpha coefficient for the low-pass filter. y[n] = alpha*y[n-1] + (1-alpha)*x[n]. I.e., * values near one represent low-pass filters with greater effect. The nominal sample rate is * 500Hz. * * @param alpha [0,1]. */ public void setLPF(double alpha) { assert (alpha >= 0 && alpha <= 1.0); int v = (int) (alpha * 65536); orc.doCommand( 0x3000, new byte[] {(byte) port, (byte) ((v >> 8) & 0xff), (byte) ((v >> 0) & 0xff)}); }