cupyx.scipy.signal.upfirdn#
- cupyx.scipy.signal.upfirdn(h, x, up=1, down=1, axis=-1, mode='constant', cval=0)[source]#
Upsample, FIR filter, and downsample.
- Parameters:
h (array_like) – 1-dimensional FIR (finite-impulse response) filter coefficients.
x (array_like) – Input signal array.
up (int, optional) – Upsampling rate. Default is 1.
down (int, optional) – Downsampling rate. Default is 1.
axis (int, optional) – The axis of the input data array along which to apply the linear filter. The filter is applied to each subarray along this axis. Default is -1.
mode (str, optional) – This parameter is not implemented for values other than
"constant"
.cval (float, optional) – This parameter is not implemented for values other than 0.
- Returns:
y – The output signal array. Dimensions will be the same as x except for along axis, which will change size according to the h, up, and down parameters.
- Return type:
Notes
The algorithm is an implementation of the block diagram shown on page 129 of the Vaidyanathan text [1] (Figure 4.3-8d).
The direct approach of upsampling by factor of P with zero insertion, FIR filtering of length
N
, and downsampling by factor of Q is O(N*Q) per output sample. The polyphase implementation used here is O(N/P).See also
References