EngeeDSP.FIRFilter
Stationary or time-varying FIR filter.
| Library |
|
Description
To implement the structure of a stationary or time-varying FIR filter, follow these steps:
-
Create an object EngeeDSP.FIRFilter and set its properties.
-
Call the object with arguments as if it were a function.
To learn more about how to work with system objects, see Engee System Objects.
Syntax
Creation
-
fir = EngeeDSP.FIRFilter()returns the FIR filter objectfir, which independently filters each channel (column) of the input signal by time, using a given FIR filter implementation. -
fir = EngeeDSP.FIRFilter(num)returns the FIR filter objectfirwith the Numerator property set tonum. -
fir = EngeeDSP.FIRFilter(Name=Value)returns the FIR filter objectfirwith the specified propertyName, set to the specified valueValue. You can specify additional arguments as a name-value pair in any order (Name1=Value1,…,NameN=ValueN). Unspecified properties have default values.
Using
-
y = fir(x)filters the input signalxand outputs the filtered valuesy. -
y = fir(x,coeff)filters the input signalxusing time-varying coefficientscoeff, and outputs the filtered valuesy.This syntax can only be used if for the property NumeratorSource or for the property ReflectionCoefficientsSource value set
"Input port".
Arguments
Input arguments
x — input signal
+
vector | the matrix
Details
The input signal is specified as a vector or matrix.
If the input signal is represented in a fixed-point format, then the format must be specified if the property Structure has the value "Direct form symmetric" or "Direct form antisymmetric". The FIR filter object operates independently with each channel of the input signal during successive calls to the object.
This system object supports variable-size input data.
| Типы данных |
|
| Support for complex numbers |
Yes |
coeff — filter coefficients
+
vector string
Details
The time-varying filter coefficients are set as a row vector. The input signal x and the input coefficients must have the same data type.
| Типы данных |
|
| Support for complex numbers |
Yes |
Output arguments
y — filtered output signal
+
vector | the matrix
Details
The filtered output signal returned as a vector or matrix. The size and complexity of the output signal are the same as that of the input signal.
If the input signal is of type Float32 or Float64, then the type of output data is the same as the type of input data. For integer and fixed-point inputs, the type of output data depends on the value of the properties FullPrecisionOverride and OutputDataType.
| Типы данных |
|
| Support for complex numbers |
Yes |
Features
# Structure — filter structure
+
"Direct form" (by default) | "Direct form symmetric" | "Direct form antisymmetric" | "Direct form transposed" | "Lattice MA"
Details
The filter structure, defined as "Direct form", "Direct form symmetric", "Direct form antisymmetric", "Direct form transposed", "Lattice MA".
# NumeratorSource — the source of the filter coefficients
+
"Property" (by default) | "Input port"
Details
The source of the filter coefficients is specified as one of the following:
-
"Property"(by default) — filter coefficients are set via the Numerator property. -
"Input port"— the filter coefficients are specified as the input arguments of the object. The filter object updates the time-varying filter once in each frame.
Dependencies
To use this property, set the Structure property to "Direct form", "Direct form symmetric", "Direct form antisymmetric" or "Direct form transposed".
# ReflectionCoefficientsSource — source of filter coefficients
+
"Property" (by default) | "Input port"
Details
The source of the grid filter coefficients, specified as one of the following:
-
"Property"(by default) — the coefficients of the lattice filter are set via the ReflectionCoefficients. -
"Input port"— the filter coefficients are specified as the input arguments of the object. The filter object updates the time-varying filter once in each frame.
Dependencies
To use this property, set the Structure property to "Lattice MA".
# Numerator — coefficients of the numerator of the filter
+
[0.5 0.5] (by default) | vector string
Details
Filter coefficients specified as a vector of real or complex numbers.
Dependencies
To use this property, set the Structure property to "Direct form", "Direct form symmetric", "Direct form antisymmetric" or "Direct form transposed", and for the property NumeratorSource the value "Property".
| Типы данных |
|
| Support for complex numbers |
Yes |
# Reflectioncoeffients — reflection coefficients of the grid filter
+
[0.5 0.5] (by default) | vector string
Details
Reflection coefficients of a lattice filter, specified as a vector of real or complex numbers.
Dependencies
To use this property, set the Structure property to "Lattice MA", and for the property ReflectionCoefficientsSource value "Property".
| Типы данных |
|
| Support for complex numbers |
Yes |
# InitialConditions — initial conditions for the FIR filter
+
0 (by default) | scalar
Details
Specify the initial conditions of the filter states. The FIR filter object initializes all delay elements in the filter with this value.
| Типы данных |
|
# FullPrecisionOverride — using full precision for fixed-point arithmetic
+
true (by default) | false
Details
Specify whether the rules should be used with full precision. If you set FullPrecisionOverride to true, then the object will calculate all internal arithmetic and output data types using full precision rules. These rules provide the most accurate fixed-point calculations. Other fixed point properties are also not used, as they are not applied individually. These rules ensure that no quantization occurs inside the object. Bits are added as needed to eliminate rounding or overflow. If you set FullPrecisionOverride to false, then the fixed point data types will be controlled through individual fixed point property settings.
# RoundingMethod — rounding method
+
"Floor" (by default) | "Ceiling" | "Convergent" | "Nearest" | "Round" | "Simplest" | "Zero"
Details
The rounding method for operations with integers and fixed-point numbers, specified as one of the following:
-
"Floor"(by default); -
"Ceiling"; -
"Convergent"; -
"Nearest"; -
"Round"; -
"Simplest"; -
"Zero".
# OutputDataType is the data type of the output signal
+
"Same as input" (by default) | "Same as accumulator" | "Custom"
Details
The type of fixed-point output data, specified as "Same as input", "Same as accumulator" or "Custom". If the value is set "Custom", then in the property CustomOutputDataType it is necessary to specify the type of output data.
# CustomOutputDataType — custom output data type
+
data type
Details
The data type of the output signal used when working with integer types and fixed-point numbers.
Example: fir = EngeeDSP.FIRFilter(OutputDataType="Custom",CustomOutputDataType=fixdt(1, 16, 0))
Dependencies
To use this property, specify for the property OutputDataType meaning "Custom".