Engee documentation

designMultirateFIR

Calculation of a multi-speed FIR filter.

Library

EngeeDSP

Syntax

Function call

  • B = designMultirateFIR(L, M) — performs the calculation of coefficients B multi-speed FIR filter with an interpolation coefficient L and the decimation coefficient M.

  • B = designMultirateFIR(L, M, P) — calculates the coefficients of a multi-speed FIR filter with a half-phase length P. By default P=12. If the first coefficient is zero (B(1) = 0), then the resulting length of the polyphase is 2P otherwise , the length of the polyphase is 2P + 1.

  • B = designMultirateFIR(L, M, TW) — calculates the coefficients of a multi-speed FIR filter with a normalized transition width TW. Meaning TW It must be from 0 before 1.

  • B = designMultirateFIR(L, M, P, ASTOP) — calculates the coefficients of a multi-speed FIR filter with a half-phase length P and the attenuation coefficient in the barrier strip ASTOP in dB. By default ASTOP=80 dB.

  • B = designMultirateFIR(L, M, TW, ASTOP) — calculates the coefficients of a multi-speed FIR filter with a normalized transition width TW and the attenuation coefficient in the barrier strip ASTOP in dB. By default ASTOP=80 dB.

Arguments

Input arguments

# L is the interpolation coefficient

+ scalar

Details

The interpolation coefficient, set as a positive integer scalar.

To design a decimator, set L an equal 1.

# M is the decimation coefficient

+ scalar

Details

The decimation coefficient, set as a positive integer scalar.

To design an interpolator, install M an equal 1.

# P is the half— phase length

+ 12 (by default) | scalar

Details

The half-phase length. By default P=12. If the first coefficient is zero (B(1) = 0), then the resulting length of the polyphase is 2P otherwise , the length of the polyphase is 2P + 1.

# TW — normalized transition width

+ scalar

Details

The normalized transition width, set as a scalar from 0 before 1.

# ASTOP is the attenuation coefficient in the boom band in dB

+ 80 (by default) | scalar

Details

Attenuation coefficient in the boom band in dB. By default ASTOP=80 dB.

Output arguments

# B — filter coefficients

+ vector

Details

Coefficients of a multi-speed FIR filter.

Examples

Calculation of the FIR interpolator

Details

To design a FIR interpolator using the function designMultirateFIR, specify the interpolation coefficient (usually more than 1) and set the decimation coefficient to 1. You can use the default polyphase length and delay band attenuation, or use values other than the default values.

Let’s design a FIR interpolator with an interpolation coefficient 5. We use the default half-phase length and attenuation in the barrier band.

import EngeeDSP.Functions: designMultirateFIR
import EngeeDSP.Functions: impz
using Plots

b = designMultirateFIR(5, 1)
response = impz(b)

plot(response[2], response[1],
     marker = :o, title = "Impulse Response",
     xlabel = "n (samples)", ylabel = "Amplitude")

designmultiratefir 1

Literature

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