![background image](http://html1.mh-extra.com/html/ls/a2c-sg2-m12/a2c-sg2-m12_manual_1943703026.webp)
A2C-SG2-M12
WWW.LILLIESYSTEMS.COM
26 of 44
11
Setting up FIR filter
The A2C-SG2 features a user programable FIR
When the FIR filter is enabled it will process the calibrated values from the sensor.
FIR features
Selectable number of taps, up to 32.
Different coefficients and taps on both channels
Floating point coefficients easily developed with MATLAB / Octave
Floats are using Big Endian
The FIR filter algorithm is based upon a sequence of multiply-accumulate (MAC) operations. Each filter coefficient b[n] is multiplied
by a state variable which equals a previous input sample
x[n]
.
y[n] = b[0]*x[n]+b[1]*x[n-1]+b[2]*x[n-2]+...+b[numTaps-1]*x[n-1]
The coefficients points to a coefficient array of size numTaps. Coefficients are stored in
time reversed order
.
{b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]}
11.1.1
Command: Set FIR parameters
Send this command:
Command
Sub Command
Data[0]
Data[1]
Data[2]
Data[3]
Data[4]
Data[5]
0x44
Channel
EN
TAPS
DLC = 0x04 (values above 0x04 are also valid, but Data bytes are not used)
Channel:
is the channel number that is requested and must be one of the following values
0x00 = channel 1
0x01 = channel 2
EN:
Enable filter
0x00 = Filter disabled (bypassed)
0x01 = Filter enabled
TAPS:
Number of taps used. Number to be between 1 and 32
11.1.2
Command: Set FIR Coefficients
Command
Sub Command
Data[0]
Data[1]
Data[2]
Data[3]
Data[4]
Data[5]
0x45
Channel
INX
RESV
COEFF
COEFF
COEFF
COEFF
DLC = 0x08
Channel:
0x00 = Calibrate channel 1