Interpolate signal using polyphase IIR halfband filter
Filtering/Filter Designs
dspfdesign
The IIR Halfband Interpolator block performs efficient polyphase interpolation of the input signal by a factor of two. To design the halfband filter, you can specify the block to use an elliptic design or a quasi-linear phase design. The block uses these design methods to compute the filter coefficients. To filter the inputs, the block uses a polyphase structure. The allpass filters in the polyphase structure are in a minimum multiplier form.
Elliptic design introduces nonlinear phase and creates the filter using fewer coefficients than quasi linear design. Quasi-linear phase design overcomes phase nonlinearity at the cost of additional coefficients.
Alternatively, instead of designing the halfband filter using a design method, you can specify the filter coefficients directly. When you choose this option, the allpass filters in the two branches of the polyphase implementation can be in a minimum multiplier form or in a wave digital form.
You can also use the block to implement the synthesis portion of a two-band filter bank to synthesize a signal from lowpass and highpass subbands.
The input signal can be a real- or complex-valued column vector or matrix. If the input signal is a matrix, each column of the matrix is treated as an independent channel.
Parameters used to design the IIR halfband filter. Because the filter design has only two degrees of freedom, you can specify only two of the three parameters:
Transition width and stopband
attenuation
(default) — Design the
filter using Transition width (Hz) and
Stopband attenuation (dB). This design
is the minimum order design.
Filter order and transition width
— Design the filter using Filter
order and Transition width
(Hz).
Filter order and stopband
attenuation
— Design the filter using
Filter order and Stopband
attenuation (dB).
Coefficients
— Specify the
filter coefficients directly using the enabled
parameters.
Transition width of the IIR halfband filter, specified as a real positive
scalar in Hz. The transition width must be less than half the input sample
rate.This parameter applies when Filter specification
is set to Filter order and transition width
or
Transition width and stopband attenuation
.
The default is 4.1e3
.
Filter order, specified as a finite positive integer. If you set
Design method to
Elliptic
, then Filter
order must be an odd integer greater than one. If you set
Design method to Quasi-linear
phase
, then Filter order must be a
multiple of four. This parameter applies when Filter
specification is set to Filter order and
transition width
or Filter order and stopband
attenuation
. The default is 9
.
Minimum attenuation needed in the stopband of the IIR halfband filter,
specified as a real positive scalar in dB. This parameter applies when
Filter specification is set to Filter
order and stopband attenuation
or Transition
width and stopband attenuation
. The default is
80
.
Design method for the IIR halfband filter.
Elliptic
(default) — The
filter has nonlinear phase and uses few coefficients.
Quasi-linear phase
— The
first branch of the polyphase filter structure is a pure delay,
which results in an approximately linear phase response.
This parameter applies when you set Filter
specification to any option except
Coefficients
.
Internal allpass filter implementation structure, specified as
Minimum multiplier
or Wave
Digital Filter
. This parameter applies when you set
Filter specification to
Coefficients
. Each structure uses a different
coefficients set, independently stored in the corresponding coefficients
property. The default is Minimum
multiplier
.
When you select this check box, the first branch of the polyphase filter
structure becomes a pure delay, and the Branch 1 allpass
polynomial coefficients and Branch 1 Wave Digital
coefficients parameters do not apply. This parameter applies
when you set Filter specification to
Coefficients
.
By default, this check box is selected.
Length of the first branch delay, specified as a finite positive scalar.
This parameter applies when you set Filter
specification to Coefficients
and
select Make the first branch a pure delay. The default
is 1
.
When you select this check box, the branch 1 allpass polynomial coefficients and branch 2 allpass polynomial coefficients are input through the input ports coeffs1 and coeffs2. When you clear this check box, the coefficients are specified on the block dialog through the Branch 1 allpass polynomial coefficients and Branch 2 allpass polynomial coefficients parameters.
This parameter applies when you set Filter
specification to Coefficients
and
Internal allpass structure to Minimum
multiplier
.
Allpass polynomial filter coefficients of the first branch, specified as
an N-by-1
or
N-by-2
matrix of
N first-order or second-order allpass sections. This
parameter applies only when you set Filter
specification to Coefficients
and
Internal allpass structure to Minimum
multiplier
. The default is [0.1284563;
0.7906755
].
This parameter applies when you set Filter
specification to Coefficients
, set
Internal allpass structure to Minimum
multiplier
, and clear the Specify coefficients
from input port parameter.
This parameter is tunable. That is, you can change its value during simulation.
Allpass polynomial filter coefficients of the second branch, specified as
an N-by-1
or
N-by-2
matrix of
N first-order or second-order allpass sections. This
parameter applies only when you set Filter
specification to Coefficients
and
Internal allpass structure to Minimum
multiplier
. The default is
0.4295667
.
This parameter applies when you set Filter
specification to Coefficients
, set
Internal allpass structure to Minimum
multiplier
, and clear the Specify coefficients
from input port parameter.
This parameter is tunable. That is, you can change its value during simulation.
Allpass filter coefficients of the first branch in Wave Digital Filter
form, specified as an N-by-1
or
N-by-2
matrix of
N first-order or second-order allpass sections. This
parameter applies only when you set Filter
specification to Coefficients
and
Internal allpass structure to Wave
Digital Filter
. The default is [0.1284563;
0.7906755
].
This parameter applies when you set Filter
specification to Coefficients
and
Internal allpass structure to Wave
Digital Filter
.
Allpass filter coefficients of the second branch in Wave Digital Filter
form, specified as an N-by-1
or
N-by-2
matrix of
N first-order or second-order allpass sections. This
parameter applies only when you set Filter
specification to Coefficients
and
Internal allpass structure to Wave
Digital Filter
. The default is
0.4295667
.
This parameter applies when you set Filter
specification to Coefficients
and
Internal allpass structure to Wave
Digital Filter
.
When you select this check box, the last section of the second branch is
treated as a first order section. This parameter applies only when you set
Filter specification to
Coefficients
. When the coefficients of the
second branch are in an N-by-2
matrix,
the block ignores the second element of the last row of the matrix. The last
section of the second branch then becomes a first-order section.
When this check box is cleared, the last section of the second branch is
treated as a second-order section. When the coefficients of the second
branch are in an N-by-1
matrix, the
block ignores this parameter.
By default, this check box is cleared.
When you select this check box, the block acts as a synthesis filter bank. The block accepts two inputs to synthesize: lowpass and highpass subbands. When you clear this check box, the block acts as an IIR half band interpolator and accepts a single vector or matrix as input. By default, this check box is cleared.
When you select this check box, the block inherits its sample rate from the input signal. The block calculates the sample rate based on the sample time of the input port. When you clear this check box, you specify the sample rate in Input sample rate (Hz).
Input sample rate, specified as a scalar in Hz. The default is
44100
. You can specify an input sample rate when the
Inherit sample rate from input check box is
cleared.
Opens the Filter Visualization Tool FVTool and displays the magnitude/phase response of the IIR Halfband Interpolator. The response is based on the block dialog box parameters. Changes made to these parameters update FVTool.
To update the magnitude response while FVTool is running, modify the dialog box parameters and click Apply.
Type of simulation to run. You can set this parameter to:
Code generation
(default)
Simulate model using generated C code. The first time you run
a simulation, Simulink® generates C code for the block. The C code is
reused for subsequent simulations, as long as the model does not
change. This option requires additional startup time but
provides faster simulation speed
than Interpreted
execution
.
Interpreted execution
Simulate model using the MATLAB® interpreter. This option shortens startup
time but has slower simulation speed than Code
generation
.
Port | Supported Data Types |
---|---|
Input |
|
Output |
|
dsp.IIRHalfbandInterpolator | DSP System Toolbox |
dsp.IIRHalfbandDecimator | DSP System Toolbox |
IIR Halfband Decimator | DSP System Toolbox |
FIR Halfband Interpolator | DSP System Toolbox |
FIR Halfband Decimator | DSP System Toolbox |
This block brings the capabilities of the dsp.IIRHalfbandInterpolator
System object™ to the Simulink environment.
For information on the algorithms used by this block, see the Algorithms section of
dsp.IIRHalfbandInterpolator
.