- sdr.fractional_delay_fir(length: int, delay: float) NDArray[float64]
Designs a fractional delay FIR filter impulse response \(h[n]\) using the Kaiser window method.
- Parameters:¶
- Returns:¶
The filter impulse response \(h[n]\) with length \(L\). The center of the passband has 0 dB gain.
Notes
The filter group delay is \(\tau = L_{even}/2 - 1 + \Delta n\) at DC.
References
Examples
Design a \(\Delta n = 0.25\) delay filter with length 8. Observe the width and flatness of the frequency response passband. Also observe the group delay of 3.25 at DC.
In [1]: h_8 = sdr.fractional_delay_fir(8, 0.25) In [2]: plt.figure(); \ ...: sdr.plot.impulse_response(h_8); ...: In [3]: plt.figure(); \ ...: sdr.plot.magnitude_response(h_8); \ ...: plt.ylim(-4, 1); ...: In [4]: plt.figure(); \ ...: sdr.plot.group_delay(h_8); ...:
Compare the magnitude response and group delay of filters with different lengths.
In [5]: h_16 = sdr.fractional_delay_fir(16, 0.25); \ ...: h_32 = sdr.fractional_delay_fir(32, 0.25); \ ...: h_64 = sdr.fractional_delay_fir(64, 0.25) ...: In [6]: plt.figure(); \ ...: sdr.plot.magnitude_response(h_8, label="Length 8"); \ ...: sdr.plot.magnitude_response(h_16, label="Length 16"); \ ...: sdr.plot.magnitude_response(h_32, label="Length 32"); \ ...: sdr.plot.magnitude_response(h_64, label="Length 64"); \ ...: plt.ylim(-4, 1); ...: In [7]: plt.figure(); \ ...: sdr.plot.group_delay(h_8, label="Length 8"); \ ...: sdr.plot.group_delay(h_16, label="Length 16"); \ ...: sdr.plot.group_delay(h_32, label="Length 32"); \ ...: sdr.plot.group_delay(h_64, label="Length 64"); ...: