FFT Average [TM]
Time-multiplexed variant of the FFT Average block: consumes the TM spectrum stream of FFT TM Realtime / FFT Windowed TM (R bins per clock) and accumulates a runtime-programmable power-of-two number of complete spectra bin by bin. The averaged spectrum leaves either in the same TM packing or serialized to a non-TM sequential burst in natural bin order, ready for the scalar-burst consumers. Double buffered: accumulation never stops while the result streams out.
Introduction
Averaging $M$ spectra of a stationary signal reduces the noise-floor variance by $M$ while leaving coherent lines untouched:
$$ \bar{X}[k] = \frac{1}{2^{NAVG}}\sum_{m=0}^{2^{NAVG}-1} X_m[k] $$
The block consumes the gapless TM spectrum format of FFT TM Realtime and
FFT Windowed TM: every CE-gated clock carries $R$ bins (TM Factor
lanes), with lane $q$ carrying bin $k + q,N/R$ at DV cycle $k$ and
START (chain FRAME_START) marking the first cycle of each frame. Each
lane is accumulated independently into a BRAM accumulator; when $2^{NAVG}$
complete spectra have been summed the averaged spectrum streams out.
Two output formats are available (compile-time property, both from the same accumulator):
- TM (R bins per clock) — the average leaves in exactly the input packing and lane mapping, as an $N/R$-clock burst: drop-in for anything that already consumes the TM FFT stream (e.g. IFFT TM Realtime).
- Serialized (one bin per clock) — the average leaves as a non-TM sequential burst in natural bin order $0 \ldots N-1$ ($N$ clocks), i.e. the same format the scalar FFT block emits: chain it to the scalar IFFT, to a DMA, or to any scalar-burst consumer. The serializer sweeps the accumulator once per lane (lane $q$ outer, row $k$ inner), which is exactly natural order thanks to the TM lane mapping.
NAVG is a runtime input (log2 of the number of spectra, e.g. 10 →
1024), clamped to the compile-time Max averages budget and latched at the
start of every round. The accumulator is ping-pong double buffered, so
accumulation of the next round proceeds while the previous average streams
out and its memory is cleared row by row.
Pin Description
Properties
Number of bins of one FFT frame. Must match the Length of the TM FFT block feeding this averager.
Number of bins N of one spectrum (64 .. 65536, power of 2). Must match the Length of the TM FFT feeding the averager, and be at least 2 x TM Factor.Default: 1024
Options: 64 128 256 512 1024 2048 4096 8192 16384 32768 65536
Number of TM lanes R of the input spectrum stream (must match the source TM FFT).
Number of TM lanes R of the input stream (2 .. 32, power of 2). Must match the source TM FFT.Default: 4
Options: 2 4 8 16 32
Width of one IN_RE / IN_IM lane (the TM FFT blocks output 32 bit per lane).
Width of one IN_RE / IN_IM lane (8..48, signed). The TM FFT blocks output 32 bit per lane.Default: 32
Range: 8 – 48
Largest number of spectra the runtime NAVG input can request. Sizes the accumulator BRAM: each of the 2 x Length bins stores 2 x (InputBits + log2(MaxAverages)) bits.
Largest number of spectra the runtime NAVG input can request (2 .. 65536, power of 2). Sizes the BRAM accumulators.Default: 1024
Options: 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536
Same as input (rounded): each output bin is InputBits wide, average rounded half-up. Fixed point (+16 fractional bits): each output bin is InputBits+16 wide and EXACT, the 16 extra LSBs are fractional bits.
- Same as input (rounded): each output bin is InputBits wide, rounded half-up.
- Fixed point (+16 fractional bits): each output bin is InputBits+16 wide and exact (Q x.16).
Default: Same as input (rounded)
Options: Same as input (rounded) Fixed point (+16 fractional bits)
TM (R bins per clock): the averaged spectrum leaves with the same TM packing and lane mapping as the input (N/R clocks). Serialized (one bin per clock): non-TM sequential burst in natural bin order 0..N-1 (N clocks), directly compatible with the scalar FFT burst consumers. With serialized output and gapless TM input, NAVG must be >= log2(TM Factor) or completed rounds are dropped while the previous burst is still streaming.
- TM (R bins per clock): averaged spectrum in the input TM packing and lane mapping, N/R-clock burst.
- Serialized (one bin per clock): non-TM sequential burst in natural bin order 0..N-1 (N clocks) — the scalar FFT burst format. With gapless TM input use NAVG >= log2(TM Factor).
Default: TM (R bins per clock)
Options: TM (R bins per clock) Serialized (one bin per clock)
Chaining from the TM FFT blocks
OUT_RE→IN_RE,OUT_IM→IN_IM(TM pins, same TM Factor)FRAME_START→STARTDV→CE
Leaving CE unconnected ties it to ‘1’; leaving NAVG unconnected gives
$2^0 = 1$ (passthrough).
Output scaling
Same options as the scalar FFT Average:
- Same as input (rounded) — each output bin is InputBits wide, average rounded half-up. No overflow is possible.
- Fixed point (+16 fractional bits) — each output bin is InputBits + 16 wide and exact; the 16 extra LSBs are fractional bits with the input integer scaling (Q x.16, ready for the Fixed P. family).
Round lifecycle
- Every
CEclock accumulates one TM row ($R$ bins);STARTresynchronizes the row counter. AVG_CNTreports in realtime how many complete spectra of the current round have been accumulated.- When the round completes the buffers swap and the average streams out
(
START_OUT+DV_OUT,BUSYhigh for the whole burst): $N/R$ clocks in TM mode, $N$ clocks serialized. Rows are cleared right after their last read. CLR(orRESET) discards the round in progress and restarts from zero.
Throughput limit of the serialized output
The serialized burst is $N$ clocks while a round lasts at least $(N/R)\cdot 2^{NAVG}$ input clocks: with gapless TM input, choose $NAVG \geq \log_2 R$ (e.g. $R = 4$ → at least 4 averages) or rounds that complete while the previous burst is still streaming are dropped (accumulation itself never stops, and the TM output mode only has the scalar $NAVG = 0$ corner). In practice any real averaging setting is safe.
Resources
Two BRAM buffers of $N/R$ rows, each row $2R,(\text{InputBits} + \log_2\text{MaxAverages})$ bits — the total bit count is the same as the scalar block for equal $N$. No DSP, no HLS: pure VHDL.
Verified with a self-checking GHDL regression (4 TM configurations — TM and serialized outputs, TM factors 2/4/8, both scalings — 556 checks: lane mapping, natural-order serialization, rounding on negative accumulations, CE gaps, buffer reuse, mid-round CLR, runtime NAVG change, DV/START_OUT/BUSY framing, AVG_CNT progress; mutation-tested).