# Lowpass Resampler

**Libraries:**

Mixed-Signal Blockset /
Utilities

## Description

The Lowpass Resampler block converts either a fixed-step discrete or a variable-step discrete sample time at its input to a different sample time at its output. To calculate the output sample values, the block uses a lowpass filtering interpolation algorithm. The algorithm minimizes frequency aliasing at the output with respect to an output rise/fall time.

If the output rise/fall time is inherited from a fixed-step discrete input, the cutoff frequency is the Nyquist rate of the input. Otherwise, the cutoff frequency is the Nyquist rate associated with a sample interval obtained by scaling the specified 20%−80% output rise/fall time to a value for 0%−100% rise/fall time.

## Examples

### Define Output Samples in Lowpass Resampler

To demonstrate the variable step discrete behavior of the Lowpass Resampler block, open the model `LowpassResamplerOutputSampling`

.

## Ports

### Input

**in** — Discrete time input signal

scalar

Discrete time input signal, specified as fixed-step or variable-step scalar.

**Data Types: **`single`

| `double`

| `int8`

| `int16`

| `int32`

| `uint8`

| `uint16`

| `uint32`

| `Boolean`

### Output

**out** — Continuous time output signal

scalar

Continuous time output signal, returned as a fixed-step or variable-step scalar.

**Data Types: **`single`

| `double`

## Parameters

**Inherit output rise/fall time** — Inherit output rise/fall time from fixed-step input sample time

on (default) | off

Select to inherit the output rise/fall time from the fixed-step input sample time.

**Note**

In case of variable step input, there is no rise/fall time to inherit.

**Output rise/fall time** — 20%−80% output rise/fall time

`1e-10`

(default) | positive real scalar

20%−80% output rise/fall time, specified as a positive real scalar.

#### Dependencies

To enable this parameter, deselect the **Inherit output rise/fall
time** parameter.

#### Programmatic Use

Block parameter:
`OutputRiseFall` |

Type: character vector |

Values: positive real scalar |

Default:
`1e-10` |

**Number of samples of delay** — Number of samples of propagation delay for fixed-step operation

`1`

(default) | positive real scalar

Number of samples of propagation delay for fixed-step operation, specified as a positive real scalar.

If the Lowpass Resampler block inherits **Output rise/fall
time** in fixed-step mode, the resampler conversion delay is given by *NDelay*·*τ*, where *NDelay* is the **Number of samples of
delay** parameter and *τ* is the inherited input sample
interval.

In the variable-step input mode, the resampler conversion delay is given by
0.6*τ _{v}* when

*NDelay*equals to one, and is (

*NDelay*-0.5)·

*τ*when

_{v}*NDelay*is greater than one.

*τ*is 5/3 times the

_{v}**Output rise/fall time**parameter.

There is a tradeoff between the delay of the conversion and the suppression of out-of-band numerical artifacts, with greater delay producing better fidelity in band and greater suppression out-of-band.

**Note**

If you need anti-aliasing filter rejection, set **Number of samples of
delay** to 5 or higher.

#### Dependencies

To enable this parameter, deselect the **Inherit output rise/fall
time** parameter.

#### Programmatic Use

Block parameter:
`NDelay` |

Type: character vector |

Values: positive real scalar |

Default:
`1` |

**Output sample time** — Type of output sample time

`Inherited`

(default) | `Fixed step discrete`

| `Variable step discrete`

Type of the output sample time to be used by downstream blocks, specified as either fixed step discrete or variable step discrete. The output sampling rate must be higher than the input sampling rate. For more information, see Variable Step Sampling Scheme.

#### Programmatic Use

Block parameter:
`OutputTsType` |

Type: character vector |

Values:
`Fixed step discrete` | ```
Variable step
discrete
``` |

Default:
`Inherited` |

**Samples out per rise/fall time** — Number of output samples in single output rise/fall time

`5`

(default) | positive real scalar

Number of output samples in a single output rise/fall time, specified as a positive real scalar.

#### Dependencies

To enable this parameter, select the option ```
Fixed step
discrete
```

or `Variable step discrete`

in the
**Output sample time** parameter.

#### Programmatic Use

Block parameter:
`OutputTsRatio` |

Type: character vector |

Values: positive real scalar |

Default:
`5` |

**Enable large buffer** — Enable extra buffer samples

on (default) | off

Select to enable extra buffer samples. This option is enabled by default.

**Number of extra buffer samples** — Number of extra buffer samples to support sample delays

`10`

(default) | positive real scalar

Number of extra buffer samples needed to support the number of samples of delay, specified as a positive real scalar.

#### Programmatic Use

Block parameter:
`NBuffer` |

Type: character vector |

Values: positive real scalar |

Default:
`10` |

## More About

### Frequency and Step Response

The Lowpass Resampler block interpolates the incoming discrete signal using an anti-aliasing filter. The anti-aliasing filter introduces some delay and the suppression of outputs above the specified signal bandwidth is not perfect. Introducing larger delays produces better fidelity in band and greater suppression out-of-band at the cost of more delay inserted in the signal path. In all cases, the interpolation filter is designed to produce negligible group delay distortion in-band.

In the time domain, the interpolation does introduce some ringing in the step response
of the anti-aliasing filter, which could affect some digital switching applications.
However, the choice of **Number of samples of delay** parameter of
`1`

and **Output rise/fall time** parameter greater than
zero is specifically designed to produce a smooth waveform transition with no
ringing.

### Variable Step Sampling Scheme

In some cases, it might be necessary for the Lowpass Resampler block to define its own sample time. This is particularly true if the block receives an unspecified output sample time at its input.

If the Lowpass Resampler block receives a signal that changes its value
at the input, the block generates some output samples to show the transition. The number of
samples are defined by the **Samples out per rise/fall time**
parameter.

## Version History

**Introduced in R2021a**

### R2022a: Updated in R2022a

Lowpass Resampler can define its own output sample times.

### R2021a: Introduced in R2021a

Use to change the sampling time of a signal.

## MATLAB 명령

다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.

명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)