Skip to content

Add efficient FIR interpolation and decimation blocks - #1197

Open
nbecker wants to merge 3 commits into
NVlabs:mainfrom
nbecker:feat/rate-change-fir
Open

nbecker wants to merge 3 commits into
NVlabs:mainfrom
nbecker:feat/rate-change-fir

Conversation

@nbecker

@nbecker nbecker commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Applying the existing upsample/filter/downsample chain computes inserted zeros and discarded output phases. This adds InterpolatingFIR and DecimatingFIR, using transposed and strided convolutions, and a composing UpFirDn block.

The blocks process consecutive chunks as one stream: concatenated call outputs match a single call on the whole input, without flushing between chunks. Interpolation emits N*L samples per call and retains the FIR overlap. Decimation retains input history, decimation phase, and an optional output quota. flush() returns the final tail and resets the stream. Including that tail gives the same result as the existing full-convolution chain.

The public exports and API documentation include all three blocks. Tests cover numerical equivalence, uneven and single-sample chunks, decimation offsets, output limits, and reset behavior.

Validation

pytest -q test/unit/signal/test_rate_change_fir.py test/unit/signal/test_upsampling.py test/unit/signal/test_downsampling.py test/unit/signal/test_filter.py --device=cpu

259 passed, plus 18 phase subtests.

pytest -s -q test/benchmarks/test_rate_change_fir_benchmark.py --device=cpu

1 passed. On one CPU run with batch 32, length 2048, factor 4, and 33 taps, interpolation measured 2.38x faster and decimation 2.10x faster, including flush(). The benchmark is opt-in and has no timing threshold because results depend on hardware and input shape.

LLM assistance

The implementation, tests, and benchmark scripts were written with the assistance of an LLM. I reviewed these files and found no obvious third-party copied code blocks or third-party attribution notices beyond the project license headers.

@nbecker
nbecker force-pushed the feat/rate-change-fir branch from 6a70d71 to a89f65f Compare September 30, 2026 13:55
Neal Becker added 3 commits October 9, 2026 13:08
Signed-off-by: Neal Becker <neal.becker@hughes.com>
Signed-off-by: Neal Becker <neal.becker@hughes.com>
Signed-off-by: Neal Becker <neal.becker@hughes.com>
@nbecker
nbecker force-pushed the feat/rate-change-fir branch from a89f65f to 5630d5d Compare October 9, 2026 17:09

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant