dsp.VariableFIRInterpolator
Description
The dsp.VariableFIRInterpolator
object performs an efficient polyphase
FIR interpolation with a tunable interpolation factor. You can update the interpolation factor
and the filter coefficients while the simulation is running. To control the interpolation, you
can specify the interpolation factor or the output frame length.
When you specify the interpolation factor, if the input frame length changes (variable-size signal) during simulation, the output frame length also changes in order to keep the interpolation factor constant. When you specify the output frame length instead of the interpolation factor, and if the input frame length changes (variable-size signal) during simulation, the interpolation factor also changes in order to keep the output frame length constant.
Conceptually, the FIR interpolator (as shown in the schematic) consists of an upsampler
followed by an FIR anti-imaging filter, which is usually an approximation of an ideal
band-limited interpolation filter. To design an FIR anti-imaging filter, use the designMultirateFIR
function. The upsampler upsamples each channel of the input
to a higher rate by inserting L–1 zeros between samples. The FIR filter
that follows filters each channel of the upsampled data. The resulting discrete-time signal
has a sample rate that is L times the original sample rate.
Note that the actual object algorithm implements a direct-form FIR polyphase structure, an efficient equivalent of the combined system depicted in the diagram. For more details, see Algorithms.
This object supports C and C++ code generation.
To implement the variable FIR interpolator:
Create the
dsp.VariableFIRInterpolator
object and set its properties.Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
Creation
Syntax
Description
returns a variable FIR interpolator object with a maximum interpolation factor of 24. The
object designs the FIR filter using varFIRInterp
= dsp.VariableFIRInterpolatordesignMultirateFIR(24,1)
.
sets the varFIRInterp
= dsp.VariableFIRInterpolator(Lmax
)MaxInterpolationFactor
property to
Lmax.
sets the varFIRInterp
= dsp.VariableFIRInterpolator(Lmax
,L
)InterpolationFactor
property to L. The
object designs the FIR filter using
designMultirateFIR
(L,1). The designed filter
corresponds to a lowpass filter with a cutoff at π/L in radial
frequency units.
returns a variable FIR interpolator object with additional properties specified by one or
more name-value arguments. For example, varFIRInterp
= dsp.VariableFIRDecimator(Name=Value
)varFIRInterp =
dsp.VariableFIRInterpolator(Specification="Output frame length")
creates a
variable FIR interpolator object with an output frame length of 48.
Properties
Usage
Description
Input Arguments
Output Arguments
Object Functions
To use an object function, specify the
System object™ as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)
Examples
Algorithms
The FIR interpolation filter is implemented efficiently using a polyphase structure.
To derive the polyphase structure, start with the transfer function of the FIR filter
where N+1 is the length of the FIR filter.
You can rearrange this equation as
where Lmax is the number of polyphase components, and its value equals the maximum interpolation factor.
You can write H(z) as
where E0(zLmax), E1(zLmax), ..., ELmax-1(zLmax) are polyphase components of the FIR filter H(z).
During simulation, the algorithm reconstructs the filter H(z) based on the current interpolation factor L.
Rewriting H(z) in terms of the interpolation factor L yields
where r = Lmax/L.
Conceptually, the FIR interpolation filter contains an upsampler followed by an FIR lowpass filter H(z).
Replace H(z) with its polyphase representation.
This is the multirate noble identity for interpolation.
Applying the noble identity for interpolation moves the upsampling operation to after the filtering operation. This move enables you to filter the signal at a lower rate.
You can replace the upsampling operator, delay block, and adder with a commutator switch. The switch starts on the first branch 0 and moves in the counterclockwise direction, each time receiving one sample from each branch. The interpolator effectively outputs L samples for every one input sample it receives. Hence the sample rate at the output of the FIR interpolation filter is Lfs.
References
[1] Orfanidis, Sophocles J. Introduction to Signal Processing. Upper Saddle River, NJ: Prentice-Hall, 1996.
Extended Capabilities
Version History
Introduced in R2024b