torchsig.utils.dsp.upconversion_anti_aliasing_filter

torchsig.utils.dsp.upconversion_anti_aliasing_filter(input_signal: ndarray, center_freq: float, bandwidth: float, sample_rate: float, frequency_max: float, frequency_min: float)[source]

Applies a BPF to avoid aliasing

Upconversion of a signal away from baseband can force energy to alias around the -fs/2 or +fs/2 boundary, depending on the amount of sidelobes and the amount the signal has been frequency shifted by. The function checks the combination of the center frequency and bandwidth to see if any of the energy exceeds the limits specified by frequency_max and frequency_min, and if so, builds and applies the filter.

Parameters:
  • input_signal (np.ndarray) – Input signal modulated to band-pass

  • center_freq (float) – Center frequency of the signal

  • bandwidth (float) – Bandwidth of the signal

  • sample_rate (float) – Sample rate of the signal

  • frequency_max (float) – The maximum frequency where energy content can reside

  • frequency_min (float) – The minimum frequency where energy content can reside

Returns:

Anti-aliased signal float: Updated center frequency for the bounding box float: Updated bandwidth for the bounding box

Return type:

np.ndarray