Real-time constraint for DSP: you must process each sample (or block of samples) before the next one arrives. Miss the deadline and you have a buffer overrun — samples are lost, the pipeline breaks.

The basic loop:

  1. Interrupt fires at sample rate (e.g., 44.1 kHz)
  2. DMA transfers new sample to buffer
  3. Processing task wakes
  4. Filter / transform / detect
  5. Output result
  6. Must complete before next interrupt (22.7μs at 44.1 kHz)

Timing budget for PulsarSync-Core (RP2040, 125 MHz):

  • Sample rate: 1 MSPS (from ADC)
  • Budget per sample: 1μs
  • At 125 MHz: 125 cycles per sample
  • Dispersion measure correction: ~80 cycles (FIR filter, 8 taps, Q15)
  • Pulse period accumulator: ~20 cycles
  • Total: ~100 cycles — fits with 25-cycle margin

The dual-core split in PulsarSync gives Core 0 the FIR filter (80 cycles, tight) and Core 1 the feature extraction (can accumulate over multiple samples, latency-tolerant).

Double buffering: While Core 0 processes buffer A, the DMA fills buffer B. When DMA completes buffer B, Core 0 switches to processing B while DMA refills A. This eliminates the race between DMA writes and CPU reads.