toMultirate
Create multirate filter System object from digital FIR filter object
Since R2025a
Description
creates a multirate FIR filter System object™ from the input multiFiltObj = toMultirate(digiFiltObj,Name=Value)digitalFilter object based on the properties
you specify using one or more name-value arguments. For example, multiFiltObj =
toMultirate(digitFiltObj,InterpolationFactor=7,DecimationFactor=3) creates a
dsp.FIRRateConverter object with an interpolation factor of 7 and a decimation
factor of 3 using the filter coefficients from the digiFiltObj
object.
Examples
Design a lowpass digital FIR filter object with these design specifications using the designfilt function:
Filter order of 22
Passband frequency of 100 Hz
Stopband frequency of 275 Hz
Sample rate of 1000 Hz
Least-squares design method
designedFilter = designfilt('lowpassfir', ... 'FilterOrder',22,'PassbandFrequency',100, ... 'StopbandFrequency',275,'SampleRate',1e3, ... 'DesignMethod','ls')
designedFilter =
digitalFilter with properties:
Coefficients:
Numerator: [-9.9314e-05 -0.0016 -0.0031 0.0015 0.0131 0.0136 -0.0166 -0.0547 -0.0286 0.1064 0.2853 0.3693 0.2853 0.1064 -0.0286 -0.0547 -0.0166 0.0136 0.0131 0.0015 -0.0031 -0.0016 -9.9314e-05]
Denominator: 1
Specifications:
FrequencyResponse: 'lowpass'
ImpulseResponse: 'fir'
NormalizedFrequency: 0
SampleRate: 1000
StopbandFrequency: 275
PassbandFrequency: 100
FilterOrder: 22
DesignMethod: 'ls'
Use filterAnalyzer to visualize filter
Use designfilt to edit filter
Use filter to filter data
Convert the designed digitalFilter object into a dsp.FIRRateConverter object using the toMultirate function. Specify the interpolation factor as 7, decimation factor as 3, and scale the passband gain by the interpolation factor.
firrcScaledGain = toMultirate(designedFilter,... InterpolationFactor=7,DecimationFactor=3,... ScaleByInterpolationFactor=true)
firrcScaledGain =
dsp.FIRRateConverter with properties:
Main
InterpolationFactor: 7
DecimationFactor: 3
NumeratorSource: 'Property'
Numerator: [-6.9520e-04 -0.0111 -0.0219 0.0105 0.0914 0.0953 -0.1165 -0.3830 -0.2000 0.7448 1.9973 2.5854 1.9973 0.7448 -0.2000 -0.3830 -0.1165 0.0953 0.0914 0.0105 -0.0219 -0.0111 -6.9520e-04]
Show all properties
Create another instance of the dsp.FIRRateConverter object with the same design specifications, but do not scale the passband gain of the filter.
firrcunityGain = toMultirate(designedFilter,... InterpolationFactor=7,DecimationFactor=3,... ScaleByInterpolationFactor=false)
firrcunityGain =
dsp.FIRRateConverter with properties:
Main
InterpolationFactor: 7
DecimationFactor: 3
NumeratorSource: 'Property'
Numerator: [-9.9314e-05 -0.0016 -0.0031 0.0015 0.0131 0.0136 -0.0166 -0.0547 -0.0286 0.1064 0.2853 0.3693 0.2853 0.1064 -0.0286 -0.0547 -0.0166 0.0136 0.0131 0.0015 -0.0031 -0.0016 -9.9314e-05]
Show all properties
Visualize the frequency response of these filters using filterAnalyzer. Note the difference in the passband gain for both these filters.
filterAnalyzer(firrcScaledGain,firrcunityGain)

Input Arguments
Digital FIR filter, specified as a digitalFilter object. Use the designfilt function in the form digiFiltObj =
designfilt(firResp,Name=Value) to create the digital filter object with the
FIR response type. Customize the filter using the name-value arguments.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: multiFiltObj =
toMultirate(digiFiltObj,InterpolationFactor=3,DecimationFactor=2,ScaleByInterpolationFactor=true)
Interpolation factor of the multirate filter object, specified as a positive
integer. The values of the InterpolationFactor and
DecimationFactor arguments must not have any common factors,
that is,
gcd(InterpolationFactor,DecimationFactor)
must equal 1.
Data Types: single | double
Decimation factor of the multirate filter object, specified as a positive integer.
The values of the InterpolationFactor and
DecimationFactor arguments must not have any common factors,
that is,
gcd(InterpolationFactor,DecimationFactor)
must equal 1.
Data Types: single | double
Option to scale the passband gain by the interpolation factor, specified as one of these:
true–– The multirate filter object scales its passband gain by the interpolation factor that you specify in theInterpolationFactorargument.false–– The multirate filter object maintains its passband gain at unity.
Data Types: logical
Output Arguments
Multirate filter object, returned as one of these filter System objects:
dsp.FIRRateConverter––InterpolationFactor> 1,DecimationFactor> 1dsp.FIRInterpolator––InterpolationFactor> 1,DecimationFactor= 1dsp.FIRDecimator––InterpolationFactor= 1,DecimationFactor> 1dsp.FIRFilter––InterpolationFactor= 1,DecimationFactor= 1
Version History
Introduced in R2025a
See Also
Functions
Objects
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- 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)