<< unwrap2 | FOSSEE_Signal_Processing_Toolbox | upsample >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > upfirdn

# upfirdn

Upsample, filter, and downsample a signal.

### Syntax

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

### Parameters

xin:

  Input signal (vector).

h:

  Filter coefficients (vector).

p:

  Upsampling factor (positive integer). Default is 1.

q:

  Downsampling factor (positive integer). Default is 1.

yout:

  Output signal after upsampling, filtering, and downsampling.

### Description

The `upfirdn` function performs three operations on the input signal `xin`: 1. Upsampling by a factor `p` (inserting zeros between samples). 2. Filtering the upsampled signal using the filter coefficients `h`. 3. Downsampling the filtered signal by a factor `q` (keeping every q-th sample).

### Examples

    // Perform upsampling, filtering, and downsampling:
    xin = 1:10
    h = [1, 2, 1]
    p = 2
    q = 3
    yout = upfirdn(xin, h, p, q)

### Authors

- FOSSEE Team
- toolbox@scilab.in

Report an issue
<< unwrap2 | FOSSEE_Signal_Processing_Toolbox | upsample >>