IIR Halfband Interpolator
Interpolate signal using polyphase IIR halfband filter
Library
Filtering/Filter Designs
dspfdesign
Description
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
- Filter specification
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 (Hz)
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
orTransition width and stopband attenuation
. The default is4.1e3
.- Filter order
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 toQuasi-linear phase
, then Filter order must be a multiple of four. This parameter applies when Filter specification is set toFilter order and transition width
orFilter order and stopband attenuation
. The default is9
.- Stopband attenuation (dB)
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
orTransition width and stopband attenuation
. The default is80
.- Design method
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 structure
Internal allpass filter implementation structure, specified as
Minimum multiplier
orWave Digital Filter
. This parameter applies when you set Filter specification toCoefficients
. Each structure uses a different coefficients set, independently stored in the corresponding coefficients property. The default isMinimum multiplier
.- Make the first branch a pure delay
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.
- Delay length in samples for branch 1
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 is1
.- Specify coefficients from input port
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 toMinimum multiplier
.- Branch 1 allpass polynomial coefficients
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 toCoefficients
and Internal allpass structure toMinimum multiplier
. The default is [0.1284563; 0.7906755
].This parameter applies when you set Filter specification to
Coefficients
, set Internal allpass structure toMinimum multiplier
, and clear the Specify coefficients from input port parameter.This parameter is tunable. That is, you can change its value during simulation.
- Branch 2 allpass polynomial coefficients
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 toCoefficients
and Internal allpass structure toMinimum multiplier
. The default is0.4295667
.This parameter applies when you set Filter specification to
Coefficients
, set Internal allpass structure toMinimum multiplier
, and clear the Specify coefficients from input port parameter.This parameter is tunable. That is, you can change its value during simulation.
- Branch 1 Wave Digital coefficients
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 toCoefficients
and Internal allpass structure toWave Digital Filter
. The default is [0.1284563; 0.7906755
].This parameter applies when you set Filter specification to
Coefficients
and Internal allpass structure toWave Digital Filter
.- Branch 2 Wave Digital coefficients
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 toCoefficients
and Internal allpass structure toWave Digital Filter
. The default is0.4295667
.This parameter applies when you set Filter specification to
Coefficients
and Internal allpass structure toWave Digital Filter
.- Last section of branch 2 is first order
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.
- Input highpass subband
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.
- Inherit sample rate from input
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 (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.- View Filter Response
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.
- Simulate using
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
.
Supported Data Types
Port | Supported Data Types |
---|---|
Input |
|
Output |
|
See Also
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 |
Algorithms
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
.
Extended Capabilities
Version History
Introduced in R2015b