You are here : matlabSignal Processingupfirdn

upfirdn() - Signal Processing

```upfirdn performs a cascade of three operations:Upsampling the input data in the matrix xin by
a factor of the integer p (inserting zeros)FIR filtering the upsampled signal data
with the impulse response sequence given in the vector or matrix hDownsampling the result by a factor
of the integer q (throwing away samples)upfirdn has been implemented as a MEX-file
for maximum speed, so only the outputs actually needed are computed.
The FIR filter is usually a lowpass filter, which you must design
using another function such as firpm or fir1.Note

The function resample performs
an FIR design using firls,
followed by rate changing implemented with upfirdn.yout = upfirdn(xin,h) filters
the input signal xin with the FIR filter having
impulse response h. If xin is
a row or column vector, then it represents a single signal. If xin is
a matrix, then each column is filtered independently. If h is
a row or column vector, then it represents one FIR filter. If h is
a matrix, then each column is a separate FIR impulse response sequence.
If yout is a row or column vector, then it represents
one signal. If yout is a matrix, then each column
is a separate output. No upsampling or downsampling is implemented
with this syntax.yout = upfirdn(xin,h,p) specifies
the integer upsampling factor p,
where p has a default value of 1.yout = upfirdn(xin,h,p,q) specifies
the integer downsampling factor q,
where q has a default value of 1.
The length of the output, yout, is ceil(((length(xin)-1)*p+length(h))/q)Note

Since upfirdn performs convolution and rate
changing, the yout signals have a different length
than xin. The number of rows of yout is
approximately p/q times the number of rows of xin.```

Syntax

`yout = upfirdn(xin,h)yout = upfirdn(xin,h,p)yout = upfirdn(xin,h,p,q)`

Example

`Filter length is too large - reduce problem complexity.`