FILTER - Filter
The filter block has two different modes of operation: Difference and Average. They both work by latching the values on the input and performing an operation comparing to the current value.
Fields
Name |
Type |
Description |
---|---|---|
ENABLE |
bit_mux |
Enable event |
TRIG |
bit_mux |
Trigger event |
INP |
pos_mux |
Input data |
MODE |
param enum |
Select operation mode
0 difference
1 average
|
READY |
bit_out |
Output Ready |
OUT |
pos_out |
Output data |
HEALTH |
read enum |
Error
0 OK
1 Accumulator overflow
2 Divider retrigger
|
Difference
The difference operation works by latching the value on the input on the rising edge of the Enable signal. On a rising edge of the trigger signal the output is given as the the current input value minus the latched value.
(Source code
, png
, hires.png
, pdf
)

After the operation, the latched value is updated to be the current value on the input.
(Source code
, png
, hires.png
, pdf
)

The operation continues to work if the current value is less than the latched value: a negative result is outputted
(Source code
, png
, hires.png
, pdf
)

Average
The average function appends a sum value on each clock pulse. When a trigger signal is received it divides the summed value by the number of clock pulses that have passed.
(Source code
, png
, hires.png
, pdf
)

(Source code
, png
, hires.png
, pdf
)

(Source code
, png
, hires.png
, pdf
)

If a calculation is triggered before the calculation is ready, the system will show an error on the HEALTH output and will then need to be re-enabled before another calculation can be sent.
(Source code
, png
, hires.png
, pdf
)

(Source code
, png
, hires.png
, pdf
)
