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
MODE param enum
Select operation mode
0 difference
1 average
ENABLE bit_mux Enable event
TRIG bit_mux Trigger event
INP pos_mux Input data
OUT pos_out Output data
READY bit_out Output Ready
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)

../_images/filter_doc-1.png

After the operation, the latched value is updated to be the current value on the input.

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

../_images/filter_doc-2.png

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)

../_images/filter_doc-3.png

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)

../_images/filter_doc-4.png

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

../_images/filter_doc-5.png

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

../_images/filter_doc-6.png

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)

../_images/filter_doc-7.png

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

../_images/filter_doc-8.png