Thresholder Functional Description


The spectrometer's thresholder module compares the power of each frequency bin with a scaled local average and reports those bins that are over the noise floor. It is comprised of three subcomponents: a threshold computation (averaging plus scaling), the actual thresholder, and a reporting interface to the postprocessing software backend. It takes 36-bit data as complex samples from the PFB and FFT, and reports 32-bit data out as power squared (r^2 + i^2; from here on "power" refers to power squared).

Threshold computation

Local averages are calculated per PFB channel by taking the same data being fed to the the FFT directly from the corner turner. This way, the total power in each PFB bin can be accumulated while the FFT is being computed (via Parseval's theorem). A 36-bit power is calculated from each 36-bit complex sample received from the corner turner. The 32K (2^15) powers corresponding to a PFB bin are accumulated and divided by 32K to get the local average, then scaled according to the scalar set by the user via software. The scalar is input as a 32-bit integer, of which only the bottom 18 bits are used as an 18.9 unsigned number. The integer scalar setting is divided by 2^9, giving it an interpreted range of [0.001953125, 511.998046875]. The spectrometer boots to a default scalar of 48 (0.09375).

The small interpreted value of the scalar is misleading, due to the interaction of downshifts in the FFT. The spectral power doubles for every stage in the FFT that does not downshift, and halves for every stage that does. Thus, the power gets scaled by a factor of (2^N/2^n ; N = number of stages without downshift, n = number of stages with downshift) through the transform. A similar scaling happens in the FFT of the PFB module, but since the bin powers and local average powers are calculated from the same post-PFB data, that scale factor cancels out with regards to thresholding. Taking all of these factors into account, the threshold is set at integer_scalar/[(2^9*2^(N-n)] times the average power.

The spectrometer boots up with default settings at 11 of 15 stages downshifting in the FFT and an integer scalar of 48. Following the above the relation, this sets the threshold at 12 times the average power.

Thresholding and reporting

The thresholding triggers "hits" for FFT bins that are greater than or equal to the threshold power. Due to bandwidth limitations in the link between the BEE2 and post-processing PC, the number of hits reported per PFB bin is capped via a software-adjustable setting. To aid the software in determining the PFB baseline, the first sample of each PFB bin is always reported, though it may not be flagged as a "hit". Data is always reported a group of 5 32-bit numbers, which include the PFB bin number, the FFT bin number, the threshold power, the FFT bin power, and flags/error codes. Reported data is buffered in FIFOs that are self- regulating; when almost full writes are halted to avoid overflows that could cause data to become misaligned. The FIFOs are emptied by the on- chip PowerPC core to be assembled into UDP packets for transmission to the backend software.