...
The moving average algorithm subtracts the current sample from the previously calculated running average value at all times. This poses an issue for us when increasing the frequency of the x-ray bunch to frequencies larger than 120Hz. A Good way to go about this would be to control the enable of the running average block to to not consider the pulse in the background noise calculation. currently, the enable is enabled when there is a valid sample and the red (C & D) or green (A & B) calibration cycles are disabled. It will be enabled in these cases, but only X samples after receiving an event trigger. To demonstrate the improvement, a new simulation was performed using the pulse train used in the previous evaluation, and disabling the running average calculation up to 100 sample cycles after the trigger. The results are shown in the following figure. for more realistic results, a white noise was added to the signal with a peak of 100 ADC steps. It can be seen that the new running average implementation is converging to the value (1257) of the background noise, and maintaining a steady curve with a delta of 8 ADC steps.