Main Content

designMultirateFIR

Design and implement antialiasing and anti-imaging lowpass FIR filter

Description

B = designMultirateFIR designs a multirate FIR filter. The output B is a vector of filter coefficients. To implement the filter, you must assign the filter coefficients B to a multirate filter object.

The multirate FIR filter is an antialiasing and anti-imaging lowpass FIR filter used in digital rate conversion.

B = designMultirateFIR(Name=Value) specifies options using one or more name-value arguments. (since R2024a)

For example, B = designMultirateFIR(InterpolationFactor=3,DecimationFactor=2,SystemObject=true) designs an FIR rate converter with the interpolation factor of 3, decimation factor of 2, polyphase length of 24, and the stopband attenuation of 80 dB. As the SystemObject argument is true, the function returns a dsp.FIRRateConverter System object™.

When you specify only a partial list of filter parameters, the function designs the filter by setting the other design parameters to their default values.

When you specify any of the numeric input arguments in single precision, the function designs the filter coefficients in single precision. Alternatively, you can use the Datatype and like arguments to control the data type of the coefficients. (since R2024b)

example

Examples

collapse all

To design an FIR interpolator using the designMultirateFIR function, specify the interpolation factor (usually a value greater than 1) and set the decimation factor to 1. You can use the default polyphase length and stopband attenuation or you can use nondefault values.

Design an FIR interpolator with the interpolation factor of 5. Use the default polyphase length of 24 and the default stopband attenuation of 80 dB.

b = designMultirateFIR(InterpolationFactor=5,DecimationFactor=1);
impz(b)

Figure contains an axes object. The axes object with title Impulse Response, xlabel n (samples), ylabel Amplitude contains an object of type stem.

Design a polyphase FIR interpolator by using the designMultirateFIR function with the interpolation factor of 5, normalized transition width of 0.01, and stopband attenuation of 60 dB. Set the 'SystemObject' argument to true to create a dsp.FIRInterpolator object. To design the filter in single-precision, use the Datatype or like argument. Alternatively, you can specify any of the numerical arguments in single-precision.

firInterp = designMultirateFIR(InterpolationFactor=5,...
    TransitionWidth=0.01,...
    StopbandAttenuation=60,...
    Datatype="single",...
    SystemObject=true,...
    Verbose=true)
designMultirateFIR(InterpolationFactor=5, DecimationFactor=1, TransitionWidth=0.01, InputSampleRate="normalized", OverlapTransition=true, DesignMethod="kaiser", StopbandAttenuation=60, Datatype="single", SystemObject=true)
firInterp = 
  dsp.FIRInterpolator with properties:

    InterpolationFactor: 5
        NumeratorSource: 'Property'
              Numerator: [8.5015e-05 8.9039e-05 5.7574e-05 0 -6.2845e-05 -1.0610e-04 -1.1061e-04 -7.1214e-05 0 7.7112e-05 1.2970e-04 1.3474e-04 8.6452e-05 0 -9.3019e-05 -1.5599e-04 -1.6159e-04 -1.0340e-04 0 1.1067e-04 1.8515e-04 … ] (1×727 single)

  Show all properties

Visualize the magnitude and phase response of the FIR interpolator using the freqzmr function. The response curves show the magnitude and phase responses of a linearly interpolated filter.

freqzmr(firInterp)

Figure Output spectrum (one sided) contains 2 axes objects. Axes object 1 with title Output Magnitude, xlabel Frequency (Hz), ylabel Magnitude (dB) contains an object of type line. Axes object 2 with title Output Phase, xlabel Frequency (Hz), ylabel Phase (rad) contains an object of type line.

Compute the cost of implementing the filter.

cost(firInterp)
ans = struct with fields:
                  NumCoefficients: 582
                        NumStates: 145
    MultiplicationsPerInputSample: 582
          AdditionsPerInputSample: 578

Measure the frequency response characteristics of the filter object.

measure(firInterp)
ans = 
Sample Rate      : N/A (normalized frequency)
Passband Edge    : 0.195                     
3-dB Point       : 0.19884                   
6-dB Point       : 0.2                       
Stopband Edge    : 0.205                     
Passband Ripple  : 0.016474 dB               
Stopband Atten.  : 60.183 dB                 
Transition Width : 0.01                      
 

Design a polyphase FIR interpolator using the "lagrange" design method with the interpolation factor of 5. To use the zero-order hold method, set the polyphase length to 1.

P = 1;
firInterpLagrange = designMultirateFIR(InterpolationFactor=5,...
    DesignMethod='lagrange',PolyphaseLength=P,...
    SystemObject=true)
firInterpLagrange = 
  dsp.FIRInterpolator with properties:

    InterpolationFactor: 5
        NumeratorSource: 'Property'
              Numerator: [1 1 1 1 1]

  Show all properties

Pass the sinusoidal input signal to the FIR interpolation filter.

u = sin(2*pi*(0:7)/8)';
y = firInterpLagrange(u);

To plot the input and output signals of the FIR interpolation filter on the same plot, you need to account for the output delay of the filter. To compute the output delay, use the outputDelay function.

[D,FsOut] = outputDelay(firInterpLagrange)
D = 
0.4000
FsOut = 
5

Initialize the timescope object. Update the TimeDisplayOffet property with the output delay of the filter. Visualize the input and output signals on the time scope.

ts = timescope(NumInputPorts=2,SampleRate=[FsOut 1],...
    TimeDisplayOffset=[0, D],...
    ChannelNames={"Output","Input"}, ...
    TimeSpan=length(u)*1.1, ...
    YLimits=[-1.1,1.1],...
    PlotType="stem");

ts(y,u)

Design an FIR decimator with the decimation factor of 3 and polyphase length of 28. Use the default stopband attenuation of 80 dB.

b = designMultirateFIR(InterpolationFactor=1,...
    DecimationFactor=3,...
    PolyphaseLength=28);
impz(b)

Figure contains an axes object. The axes object with title Impulse Response, xlabel n (samples), ylabel Amplitude contains an object of type stem.

Create a dsp.FIRDecimator object by setting the SystemObject flag to true. This design has the OverlapTransition set to true by default. The transition bands therefore overlap.

bSysObjwithOverlap = designMultirateFIR(InterpolationFactor=1,...
    DecimationFactor=3,...
    PolyphaseLength=28,SystemObject=true,...
    Verbose=true)
designMultirateFIR(InterpolationFactor=1, DecimationFactor=3, PolyphaseLength=28, InputSampleRate="normalized", OverlapTransition=true, DesignMethod="kaiser", StopbandAttenuation=80, Datatype="double", SystemObject=true)
bSysObjwithOverlap = 
  dsp.FIRDecimator with properties:

   Main
    DecimationFactor: 3
     NumeratorSource: 'Property'
           Numerator: [0 -3.3618e-05 -5.6028e-05 0 1.2589e-04 1.7681e-04 0 -3.2083e-04 -4.1865e-04 0 6.7942e-04 8.4848e-04 0 -0.0013 -0.0016 0 0.0022 0.0026 0 -0.0036 -0.0043 0 0.0057 0.0066 0 -0.0087 -0.0099 0 0.0130 0.0148 0 -0.0194 … ] (1×84 double)
           Structure: 'Direct form'

  Show all properties

Set the OverlapTransition to false and redesign the FIR decimator.

bSysObjwithNoOverlap = designMultirateFIR(InterpolationFactor=1,...
    DecimationFactor=3,...
    PolyphaseLength=28,SystemObject=true,...
    OverlapTransition=false,Verbose=true)
designMultirateFIR(InterpolationFactor=1, DecimationFactor=3, PolyphaseLength=28, InputSampleRate="normalized", OverlapTransition=false, DesignMethod="kaiser", StopbandAttenuation=80, Datatype="double", SystemObject=true)
bSysObjwithNoOverlap = 
  dsp.FIRDecimator with properties:

   Main
    DecimationFactor: 3
     NumeratorSource: 'Property'
           Numerator: [-1.7738e-05 -2.1857e-05 1.0313e-05 7.8283e-05 1.2681e-04 7.1241e-05 -1.1841e-04 -3.3767e-04 -3.7033e-04 -5.2466e-05 5.1928e-04 9.3352e-04 7.0375e-04 -2.9223e-04 -0.0015 -0.0020 -8.6943e-04 0.0014 0.0034 0.0033 … ] (1×85 double)
           Structure: 'Direct form'

  Show all properties

Visualize the magnitude response of the two designs using freqzmr. The design with overlap shows distortion at higher frequencies.

freqzmr(bSysObjwithOverlap)

Figure Output spectrum (one sided) contains 2 axes objects. Axes object 1 with title Output Magnitude, xlabel Frequency (mHz), ylabel Magnitude (dB) contains an object of type patch. Axes object 2 with title Output Phase, xlabel Frequency (mHz), ylabel Phase (rad) contains an object of type line.

The design with no overlap has no aliasing or imaging issues at the higher frequencies.

freqzmr(bSysObjwithNoOverlap)

Figure Output spectrum (one sided) contains 2 axes objects. Axes object 1 with title Output Magnitude, xlabel Frequency (mHz), ylabel Magnitude (dB) contains an object of type patch. Axes object 2 with title Output Phase, xlabel Frequency (mHz), ylabel Phase (rad) contains an object of type line.

Design an FIR rate converter with the interpolation factor of 3, decimation factor of 4, polyphase length of 28, and stopband attenuation of 90 dB. Use the Datatype argument to design the filter in single-precision.

L = 3;
M = 4;
PL = 28;
Ast = 90;
b = designMultirateFIR(InterpolationFactor=L,...
    DecimationFactor=M,...
    PolyphaseLength=PL,...
    StopbandAttenuation=Ast,...
    Datatype="single");
impz(b,1)

Figure contains an axes object. The axes object with title Impulse Response, xlabel n (samples), ylabel Amplitude contains an object of type stem.

Design an FIR rate converter with the interpolation factor of 3, decimation factor of 4, normalized transition width of 0.2, and stopband attenuation of 90 dB. Use the like argument to design the filter in single-precision.

TW = 0.2;
bTW = designMultirateFIR(InterpolationFactor=L,...
    DecimationFactor=M,...
    TransitionWidth=TW,...
    StopbandAttenuation=Ast,...
    like=single(M));
impz(bTW,1)

Figure contains an axes object. The axes object with title Impulse Response, xlabel n (samples), ylabel Amplitude contains an object of type stem.

Since R2024b

Design an FIR rate converter using the Kaiser window design method. The design has nonoverlapping transition bands. Compare the design containing a polyphase length of 40 with a design of polyphase length 80.

Use the designMultirateFIR function to design the two rate conversion filters.

  • Set DecimationFactor to 9

  • Set InterpolationFactor to 5

  • Set DesignMethod to "kaiser"

  • Set OverlapTransition to false.

  • Set PolyphaseLength to 40 and 80, respectively, for the two filters.

  • Set InputSampleRate to 1200 Hz.

rcPoly40 = designMultirateFIR(DecimationFactor=9,...
    InterpolationFactor=5,OverlapTransition=false,...
    PolyphaseLength=40,InputSampleRate=1200,...
    Verbose=true,SystemObject=true)
designMultirateFIR(InterpolationFactor=5, DecimationFactor=9, PolyphaseLength=40, InputSampleRate=1200, OverlapTransition=false, DesignMethod="kaiser", StopbandAttenuation=80, Datatype="double", SystemObject=true)
rcPoly40 = 
  dsp.FIRRateConverter with properties:

   Main
    InterpolationFactor: 5
       DecimationFactor: 9
        NumeratorSource: 'Property'
              Numerator: [3.5638e-05 5.0900e-05 6.5026e-05 7.4794e-05 7.6537e-05 6.6569e-05 4.1705e-05 -1.3935e-07 -5.9359e-05 -1.3414e-04 -2.2010e-04 -3.1017e-04 -3.9481e-04 -4.6249e-04 -5.0064e-04 -4.9684e-04 -4.4025e-04 -3.2327e-04 … ] (1×201 double)

  Show all properties

rcPoly80 = designMultirateFIR(DecimationFactor=9,...
    InterpolationFactor=5,OverlapTransition=false,...
    PolyphaseLength=80,InputSampleRate=1200,...
    Verbose=true,SystemObject=true)
designMultirateFIR(InterpolationFactor=5, DecimationFactor=9, PolyphaseLength=80, InputSampleRate=1200, OverlapTransition=false, DesignMethod="kaiser", StopbandAttenuation=80, Datatype="double", SystemObject=true)
rcPoly80 = 
  dsp.FIRRateConverter with properties:

   Main
    InterpolationFactor: 5
       DecimationFactor: 9
        NumeratorSource: 'Property'
              Numerator: [-1.5627e-05 -2.1798e-05 -2.6892e-05 -2.9819e-05 -2.9550e-05 -2.5283e-05 -1.6599e-05 -3.6000e-06 1.3008e-05 3.1892e-05 5.1155e-05 6.8479e-05 8.1348e-05 8.7337e-05 8.4428e-05 7.1331e-05 4.7765e-05 1.4649e-05 … ] (1×401 double)

  Show all properties

Visualize the magnitude response of these two filters. The filter with the longer polyphase length has a narrower transition width. The stopband edge for both filters is exactly 1/max(9,5) or 1/9.

filterAnalyzer(rcPoly40,rcPoly80,FilterNames=["PolyphaseLength40","PolyphaseLength80"])

Since R2024b

Design FIR rate converter that converts a signal from 44.1 kHz to 48 kHz with a polyphase length of 24. Design the filter with both the Kaiser method and equiripple method. Compare the two designs.

Use the designMultirateFIR function to design the two filters.

  • Set InterpolationFactor to 160.

  • Set DecimationFactor to 147.

  • Set OverlapTransition to false so that the two filters have nonoverlapping transition bands.

  • Set PolyphaseLength to 24.

  • Set DesignMethod to "equiripple" and "kaiser", respectively, for the two filters.

L = 160;
M = 147;
rcEqui = designMultirateFIR(DecimationFactor=M,...
    InterpolationFactor=L,OverlapTransition=false,...
    PolyphaseLength=24, DesignMethod='equiripple',Systemobject=true)
rcEqui = 
  dsp.FIRRateConverter with properties:

   Main
    InterpolationFactor: 160
       DecimationFactor: 147
        NumeratorSource: 'Property'
              Numerator: [-0.0081 -1.7231e-04 -1.7393e-04 -1.7543e-04 -1.7679e-04 -1.7802e-04 -1.7911e-04 -1.8005e-04 -1.8085e-04 -1.8151e-04 -1.8201e-04 -1.8235e-04 -1.8254e-04 -1.8257e-04 -1.8243e-04 -1.8213e-04 -1.8166e-04 … ] (1×3840 double)

  Show all properties

rcKaiser = designMultirateFIR(DecimationFactor=M,...
    InterpolationFactor=L, OverlapTransition=false,...
    PolyphaseLength=24, DesignMethod='kaiser',Systemobject=true)
rcKaiser = 
  dsp.FIRRateConverter with properties:

   Main
    InterpolationFactor: 160
       DecimationFactor: 147
        NumeratorSource: 'Property'
              Numerator: [-7.0937e-05 -7.2078e-05 -7.3209e-05 -7.4331e-05 -7.5442e-05 -7.6541e-05 -7.7628e-05 -7.8701e-05 -7.9760e-05 -8.0804e-05 -8.1832e-05 -8.2843e-05 -8.3836e-05 -8.4811e-05 -8.5766e-05 -8.6701e-05 -8.7614e-05 … ] (1×3841 double)

  Show all properties

Compare the magnitude response of the two designs. The equiripple design performs slightly better in the transition band at the expense of a nearly negligible passband ripple.

fa = filterAnalyzer(rcEqui,rcKaiser,FilterNames=["Equiripple","Kaiser"]);
zoom(fa,"x",[0 0.03])

Since R2024b

Design a minimum-order FIR decimator from 32 kHz to 1 kHz with a transition width of 0.005. Compare the Kaiser design with the equiripple design.

Use the designMultirateFIR function to design two FIR decimators, one with the Kaiser design and the other with the equiripple design. Set the decimation factor to 32, OverlapTransition to false, and the transition width to 0.005. The interpolation factor is 1 by default.

M = 32;
Tw = 0.005;
minOrderKaiser = designMultirateFIR(DecimationFactor=M,...
    OverlapTransition=false,TransitionWidth=Tw,...
    DesignMethod='kaiser',SystemObject=true,...
    Verbose=true)
designMultirateFIR(InterpolationFactor=1, DecimationFactor=32, TransitionWidth=0.005, InputSampleRate="normalized", OverlapTransition=false, DesignMethod="kaiser", StopbandAttenuation=80, Datatype="double", SystemObject=true)
minOrderKaiser = 
  dsp.FIRDecimator with properties:

   Main
    DecimationFactor: 32
     NumeratorSource: 'Property'
           Numerator: [3.4905e-07 4.3070e-07 5.1335e-07 5.9619e-07 6.7836e-07 7.5896e-07 8.3709e-07 9.1179e-07 9.8213e-07 1.0471e-06 1.1059e-06 1.1574e-06 1.2009e-06 1.2354e-06 1.2602e-06 1.2744e-06 1.2775e-06 1.2689e-06 1.2479e-06 … ] (1×2009 double)
           Structure: 'Direct form'

  Show all properties

minOrderEquiripple = designMultirateFIR(DecimationFactor=M,...
    OverlapTransition=false,TransitionWidth=Tw,...
    DesignMethod='equiripple',SystemObject=true,...
    Verbose=true)
designMultirateFIR(InterpolationFactor=1, DecimationFactor=32, TransitionWidth=0.005, InputSampleRate="normalized", OverlapTransition=false, DesignMethod="equiripple", StopbandAttenuation=80, PassbandRipple=0.1, Datatype="double", SystemObject=true)
minOrderEquiripple = 
  dsp.FIRDecimator with properties:

   Main
    DecimationFactor: 32
     NumeratorSource: 'Property'
           Numerator: [5.2919e-05 1.1057e-05 1.2117e-05 1.3176e-05 1.4225e-05 1.5254e-05 1.6252e-05 1.7210e-05 1.8113e-05 1.8950e-05 1.9707e-05 2.0371e-05 2.0927e-05 2.1366e-05 2.1675e-05 2.1844e-05 2.1862e-05 2.1719e-05 2.1399e-05 … ] (1×1377 double)
           Structure: 'Direct form'

  Show all properties

Compare the magnitude response of the two designs. The Kaiser design performs better in the transition width compared to the equiripple design.

fa = filterAnalyzer(minOrderKaiser,minOrderEquiripple,...
    FilterNames=["MinOrderKaiser","MinOrderEquiripple"]);
zoom(fa,"x",[0 0.05])

Name-Value Arguments

collapse all

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: designMultirateFIR(InterpolationFactor=3,PolyphaseLength=32,SystemObject=true) designs and returns a dsp.FIRInterpolator object with an interpolation factor of 3.

Interpolation factor L, specified as a positive integer. To design a pure decimator, set L to 1.

If you design the filter using PolyphaseLength, the interpolation factor is tunable in the generated code, that is, you can pass the interpolation factor as a runtime variable while generating code.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Decimation factor M, specified as a positive integer. To design a pure interpolator, set M to 1.

If you design the filter using PolyphaseLength, the decimation factor is tunable in the generated code, that is, you can pass the decimation factor as a runtime variable while generating code.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Polyphase length P, specified as one of these:

  • 1 –– Set DesignMethod to "lagrange". The function uses the zero-order hold method.

  • 2 –– The function accepts all the design methods. If you set DesignMethod to "lagrange", then 2 is the default polyphase length and the function uses the linear interpolation method.

  • Positive even integer > 2 –– Set DesignMethod to "kaiser" or "equiripple".

The polyphase length is tunable in generated code, that is, you can pass the polyphase length as a runtime variable while generating code.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Since R2024b

Control the transition band overlap, specified as one of these values:

  • true –– The transition band of aliases or images overlap. You can use only the Kaiser-window-based design method or the Lagrange polynomial method.

  • false –– The transition bands do not overlap and this property reduces aliasing at higher frequencies. The stopband edge starts exactly at 1/max(L,M) and the entire transition band is contained completely below the stopband edge frequency. L is the interpolation factor and M is the decimation factor. This option allows you to use the equiripple design.

Top image shows transition bands with no overlap. Bottom image shows transition bands with overlap.

Data Types: logical

Since R2024b

Design method for the lowpass FIR filter, specified as one of these:

  • "kaiser" –– Kaiser-window-based design. The function uses this method by default if you set OverlapTransition to true.

  • "equiripple" –– Equiripple design method. The function supports this method only when you set OverlapTransition to false.

  • "lagrange" –– Lagrange polynomial method. To use this method, set:

    • PolyphaseLength to 1 (zero-order hold) or 2 (linear interpolation).

    • OverlapTransition to true.

    (since R2025a)

When you set DesignMethod to "kaiser" or "equiripple", specifying both the transition width and polyphase length results in an overdetermined design. The function does not support specifying both the values.

For more information on the design methods, see Algorithms.

Data Types: char | string

Transition width, TW, of the multirate FIR filter, specified as one of these:

  • Normalized scalar in the range (0,1) when you set InputSampleRate, FsIn, to "normalized".

    • When you set OverlapTransition to true, the value of the transition width must be less than or equal to 2/max(L,M), where L is the interpolation factor and M is the decimation factor.

    • When you set OverlapTransition to false, the value of the transition width must be less than or equal to 1/max(L,M).

  • Positive scalar in Hz when you set InputSampleRate, FsIn, to a positive scalar in Hz. (since R2025a)

    • When you set OverlapTransition to true, the value of the transition width must be less than or equal to FsIn×min(1,L/M).

    • When you set OverlapTransition to false, the value of the transition width must be less than or equal to FsIn×min(1,L/M)/2.

Specifying both transition width and polyphase length results in an overdetermined design. The function does not support specifying both the values. When you use the transition width to design the filter, the function determines the polyphase length (and therefore the filter length) iteratively.

If you set DesignMethod to "lagrange", you cannot set this argument. (since R2025a)

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Since R2025a

Sample rate of the filter input, FsIn, specified as one of these options:

  • "normalized" when frequency specifications such as the transition width are in the normalized frequency units (0,1). Filter analysis tools such as the filterAnalyzer analyze the filter in normalized frequency units.

  • Positive scalar when frequency specifications such as the transition width are specified in Hz. Filter analysis tools use this value to analyze the filter.

Data Types: single | double | char | string

Stopband attenuation in dB, specified as a nonnegative real scalar greater than or equal to 0.

The function applies the default stopband attenuation value of 80 dB only when you set the interpolation factor L or the decimation factor M to a value greater than 1.

If you design the filter using PolyphaseLength, the stopband attenuation is tunable in the generated code, that is, you can pass the stopband attenuation as a runtime variable while generating code.

If you set DesignMethod to "lagrange", you cannot set this argument. (since R2025a)

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Since R2024b

Passband ripple, specified as a positive scalar.

Dependencies

This property applies only when you set DesignMethod to "equiripple".

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Since R2024b

Data type of the filter coefficients by type name, specified as "double" or "single".

You can use the Dataype or the like argument to specify the data type of the filter coefficients, but you cannot use both arguments at the same time.

If you specify the data type of the filter coefficients using this argument, the function ignores the data types of the other numeric arguments.

Data Types: char | string

Since R2024b

Data type of the filter coefficients as a prototype, specified as a real floating-point value.

You can use the Dataype or the like argument to specify the data type of filter coefficients, but you cannot use both arguments at the same time.

If you specify the data type of the filter coefficients using this argument, the function ignores the data types of the other numeric arguments.

Example: B = designMultirateFIR(InterpolationFactor=L,DecimationFactor=M,like=single(M))

Example: M = single(5); B = designMultirateFIR(InterpolationFactor=L,DecimationFactor=M,like=M)

Data Types: single | double

Option to create a multirate filter System object, specified as one of these:

  • false –– The function returns a vector of multirate FIR filter coefficients.

  • true –– The function returns one of these System objects:

    When you set the SystemObject property to true, the function now factors out the GCD in the rate conversion ratio L:M. For example, the function treats an L:M ratio of 8:4 as 2:1. With this change, these two function calls have the same output.

    designMultirateFIR(InterpolationFactor=12,DecimationFactor=40,...
    SystemObject=true)
    designMultirateFIR(InterpolationFactor=3,DecimationFactor=10,...
    SystemObject=true)
    
    (since R2025a)

Data Types: logical

Option to print the entire function call in MATLAB, specified as one of these:

  • false –– The function does not print the function call.

  • true –– The function prints the entire function call including the default values of the Name=Value arguments that you did not specify when calling the function.

    Use this argument to view all the values used by the function to design and implement the filter.

Data Types: logical

Output Arguments

collapse all

Designed filter, returned as one of these options.

  • Multirate FIR filter coefficients –– The function returns a row vector of length N when you set the SystemObject argument to false.

    If both L and M are equal to 1, N = 1.

    If L > 1 or M > 1, N={PR+1PRM>L>1andmod(PL,M)0otherwise, where 2P is the polyphase length and R is defined by one of these equations:

    • R = L if L > 1

    • R = M if L = 1.

    For more details, see the Algorithms section.

    If you specify single-precision values in any of the input arguments, the function outputs single-precision filter coefficients. (since R2024a)

    If you specify the data type using the Datatype or the like argument, the function ignores the data types of the other numeric arguments. (since R2024b)

  • Multirate FIR filter object –– The function returns one of these multirate filter System objects when you set the SystemObject argument to true.

Data Types: single | double

Algorithms

collapse all

References

[1] Orfanidis, Sophocles J. Introduction to Signal Processing. Upper Saddle River, NJ: Prentice-Hall, 1996.

Extended Capabilities

expand all

Version History

Introduced in R2016a

expand all