designMultirateFIR
Calculation of a multi-speed FIR filter.
| Library |
|
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.
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")
