Skip to content

FIR based Upsampling

David Young edited this page Apr 30, 2025 · 1 revision

Description

This utility function upsamples input complex data, typically used internally when loading signals (e.g., pulse waveforms via Signal::load). It increases the sampling rate by an integer factor specified by the simulation parameter params::oversampleRatio. The upsampling process involves inserting zeros between original samples (zero-stuffing) and then applying a Finite Impulse Response (FIR) low-pass interpolation filter designed using a Blackman window.

Assumptions

  • The Blackman window provides suitable filter characteristics (e.g., stopband attenuation, transition bandwidth) for the interpolation task required.
  • The filter length specified by the simulation parameter params::renderFilterLength() is adequate for the desired filter performance (e.g., sharpness of cutoff, suppression of artifacts).
  • Assumes that the input complex data requires upsampling to meet internal simulation rate requirements or desired fidelity before being used in rendering calculations.

Limitations

  • Suboptimal Implementation: Explicitly marked as suboptimal in code comments (dsp_filters.cpp::upsample). Recommendations in the code suggest using external oversampling before loading data into FERS or replacing this with a more advanced multirate filter implementation.
  • Fixed Filter Design: Uses only a Blackman window for the FIR filter design. Other window types (e.g., Kaiser) or optimal filter design methods (e.g., Parks-McClellan) might offer better performance trade-offs for specific signals but are not available through this function.
  • Potential Artifacts: Depending on the signal content being upsampled and the filter characteristics (particularly the stopband attenuation determined by the window and filter length), there is potential for imaging artifacts (unwanted copies of the signal's spectrum at higher frequencies) not being sufficiently suppressed by the interpolation filter.
  • Computational Efficiency: The straightforward FIR filtering approach implemented (zero-stuffing followed by filtering the expanded signal) can be less computationally efficient than optimized polyphase filter bank implementations, especially for large upsampling factors (params::oversampleRatio).

Related Components

  • Source Code: dsp_filters.cpp::upsample, dsp_filters.cpp::blackmanFir
  • Calling Context: signal::Signal::load
  • Configuration Parameters: params::oversampleRatio, params::renderFilterLength
  • Related Wiki Pages: Pulse Handling, Signal Processing Utilities

Validation Status

  • Needs Verification: Yes. The "Suboptimal" status and potential for artifacts necessitate verification.
  • Key Areas for Validation:
    • Spectral analysis of the output signal to quantify the suppression level of imaging artifacts for various test signals (e.g., sinusoids, broadband noise, representative pulse shapes).
    • Verification of correct signal amplitude and phase preservation through the upsampling process.
    • Comparison of output signal quality (e.g., Signal-to-Noise-and-Distortion Ratio - SINAD) against a reference upsampling implementation (e.g., using MATLAB, SciPy, or a dedicated DSP library) for the same input signals and upsampling ratio.
    • Assessment of how params::renderFilterLength impacts both the suppression of artifacts and the computational cost.
  • Priority: Medium (Affects the fidelity of input signals like pulses, but may be adequate for some use cases; flagged issues warrant investigation).

Clone this wiki locally