-
sdr.FarrowResampler.__call__(x: ArrayLike, rate: ArrayLike, mode: 'rate' | 'full' =
'rate'
) NDArray Resamples the input signal \(x[n]\) by the given arbitrary rate \(r\).
\[x[n] = x(n T_s)\]\[y[n] = x(n T_s / r)\]- Parameters:¶
- x: ArrayLike¶
The input signal \(x[n] = x(n T_s)\) with length \(L\).
- rate: ArrayLike¶
The resampling rate \(r\). The rate can either be a scalar or an array of the same size as the input signal \(x[n]\).
- mode: 'rate' | 'full' =
'rate'
¶ The convolution mode.
"rate"
: The output signal \(y[k]\) is aligned with the input signal, such that \(y[n] = x[n / r]\).In non-streaming mode, \((L - D) \cdot r\) output samples are produced. In streaming mode, the first call returns \((L - D) \cdot r\) output samples. On subsequent calls, \(L \cdot r\) output samples are produced.
"full"
: The full convolution is performed, and the filter delay \(D\) is observed, such that \(y[n] = x[(n - D) / r]\).In non-streaming mode, \(L \cdot r\) output samples are produced. In streaming mode, each call returns \(L \cdot r\) output samples.
- Returns:¶
The resampled signal \(y[n]\).
Examples¶
See the Farrow arbitrary resampler example.