upfirdn
Upsample, apply FIR filter, and downsample
Description
Examples
Input Arguments
Output Arguments
Tips
The valid combinations of the sizes of xin
and h
are:
xin
is a vector andh
is a vector.The inputs are one filter and one signal, so the function convolves
xin
withh
. The output signalyout
is a row vector ifxin
is a row vector; otherwise,yout
is a column vector.xin
is a matrix andh
is a vector.The inputs are one filter and many signals, so the function convolves
h
with each column ofxin
. The resultingyout
is a matrix with the same number of columns asxin
.xin
is a vector andh
is a matrix.The inputs are multiple filters and one signal, so the function convolves each column of
h
withxin
. The resultingyout
is a matrix with the same number of columns ash
.xin
is a matrix andh
is a matrix, both with the same number of columns.The inputs are multiple filters and multiple signals, so the function convolves corresponding columns of
xin
andh
. The resultingyout
is a matrix with the same number of columns asxin
andh
.
Algorithms
upfirdn
uses a polyphase interpolation structure. The number of
multiply-add operations in the polyphase structure is approximately (LhLx
– pLx)/q where Lh and
Lx are the lengths of
h(n) and x(n),
respectively. For long signals, this formula is often exact.
upfirdn
performs a cascade of three operations:
The FIR filter is usually a lowpass filter, which you must design using another function
such as firpm
or fir1
.
References
[1] Crochiere, R. E. "A General Program to Perform Sampling Rate Conversion of Data by Rational Ratios." Programs for Digital Signal Processing (Digital Signal Processing Committee of the IEEE Acoustics, Speech, and Signal Processing Society, eds.). New York: IEEE Press, 1979, Programs 8.2-1–8.2-7.
[2] Crochiere, R. E., and Lawrence R. Rabiner. Multirate Digital Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, 1983.