Skip to content

Reduce sync demodulation FFT work - #1061

Open
Josalo-III wants to merge 1 commit into
happycube:mainfrom
Josalo-III:feature/sync-demodulation-performance
Open

Reduce sync demodulation FFT work#1061
Josalo-III wants to merge 1 commit into
happycube:mainfrom
Josalo-III:feature/sync-demodulation-performance

Conversation

@Josalo-III

Copy link
Copy Markdown
Contributor

Checklist

  • I have searched the open pull requests to confirm this change has not already been submitted.
  • My branch is up to date with the target branch.
  • I have tested my changes and all existing tests pass.
  • Documentation is unchanged because this does not alter user-facing behavior or configuration.
  • My code follows the project's coding standards (see CONTRIBUTING.md).

Description

Use the existing phase-adjusted real-FFT filter for sync-only demodulation.

Motivation

The sync-only path still performed a full FFT, full inverse FFT, and time-domain roll for a real-valued result. The main demodulation path already precomputes the equivalent positive-frequency filter with its sample offset applied in the frequency domain.

Related Issues

N/A

Changes Made

  • Replace the sync path's full transform and inverse transform with rfft and irfft.
  • Reuse the existing phase-adjusted 0.5 MHz half-spectrum.
  • Extend the deterministic NTSC and PAL regression comparisons to cover sync-only demodulation.

Testing

  • Full suite: nix develop --command python -m pytest -q — 84 passed.
  • Focused tests: nix develop --command python -m pytest -q tests/test_demod_fft.py — 2 passed.
  • Synthetic benchmark against the former implementation:
    • NTSC: 1.934 → 1.639 ms/block (15.3% lower)
    • PAL: 1.965 → 1.701 ms/block (13.4% lower)

Screenshots (if applicable)

N/A

Additional Notes

No dependency or output-format changes.

Use the existing phase-adjusted half-spectrum for the sync-only path, avoiding a full transform, inverse transform, and time-domain roll. Extend the deterministic NTSC and PAL comparisons to cover sync demodulation.
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