dsp.FIRFilter
Static or time-varying FIR filter
静态或时变 FIR 滤波器
Description 描述
The dsp.FIRFilter
System object™ filters each channel of the input using static or time-varying FIR filter
implementations.
dsp.FIRFilter
System 对象™使用静态或时变 FIR 滤波器实现对输入的每个通道进行滤波。
To filter each channel of the input:
要滤波输入的每个通道:
Create the
dsp.FIRFilter
object and set its properties.
创建dsp.FIRFilter
对象并设置其属性。Call the object with arguments, as if it were a function.
使用参数调用对象,就好像它是一个函数一样。
To learn more about how System objects work, see What
Are System Objects?
若要了解有关系统对象如何工作的详细信息,请参阅什么是系统对象?
This object supports C/C++ code generation and SIMD code generation under certain
conditions. For more information, see Code Generation.
此对象在特定条件下支持 C/C++ 代码生成和 SIMD 代码生成。有关详细信息,请参阅代码生成。
Creation 创造
Description 描述
returns a finite impulse
response (FIR) filter object, fir
= dsp.FIRFilterfir
, which independently filters each
channel of the input over time using a specified FIR filter implementation.
返回一个有限脉冲响应 (FIR) 滤波器对象, fir
= dsp.FIRFilterfir
该对象使用指定的 FIR 滤波器实现随时间推移独立滤波输入的每个通道。
returns an FIR filter System object, fir
= dsp.FIRFilter(num
)fir
, with the Numerator
property
set to num
.
返回一个 FIR 筛选器 System 对象 , fir
= dsp.FIRFilter(num
)fir
并将 Numerator
属性设置为 num
。
returns an FIR filter System object, fir
= dsp.FIRFilter(Name,Value
)fir
, with each property set to the specified
value.
返回一个 FIR 筛选器 System 对象 , fir
= dsp.FIRFilter(Name,Value
)fir
其中每个属性都设置为指定值。
Properties 性能
Unless otherwise indicated, properties are nontunable, which means you cannot change their
values after calling the object. Objects lock when you call them, and the
release
function unlocks them.
除非另有说明,否则属性是不可调的,这意味着在调用对象后无法更改其值。当您调用对象时,对象会锁定,并且 release
该函数会解锁它们。
If a property is tunable, you can change its value at
any time.
如果属性是可调的,则可以随时更改其值。
For more information on changing property values, see
System Design in MATLAB Using System Objects.
有关更改属性值的更多信息,请参阅使用系统对象在 MATLAB 中进行系统设计。
Structure
— Filter structure
Direct form
(default) | Direct form symmetric
| Direct form antisymmetric
| Direct form transposed
| Lattice MA
Structure
— 过滤器结构 Direct form
(默认) | Direct form symmetric
| Direct form antisymmetric
| Direct form transposed
| Lattice MA
Specify the filter structure. You can specify the filter structure as one of
Direct form
| Direct form symmetric
|
Direct form antisymmetric
| Direct form
transposed
| Lattice MA
.
NumeratorSource
— Source of filter coefficients
Property
(default) | Input port
NumeratorSource
— 滤波器系数的来源 Property
(默认) | Input port
Specify the source of the filter coefficients as Property
or
Input port
. When you specify Input port
, the
filter object updates the time-varying filter once every frame.
Dependencies
This applies when you set the Structure
to
Direct form
| Direct form symmetric
|
Direct form antisymmetric
| Direct form
transposed
.
ReflectionCoefficientsSource
— Source of filter coefficients
Property
(default) | Input port
ReflectionCoefficientsSource
— 滤波器系数的来源 Property
(默认) | Input port
Specify the source of the Lattice filter coefficients as Property
or Input port
. When you specify Input port
, the
filter object updates the time-varying filter once every frame.
Dependencies
This applies when you set the Structure
to
Lattice MA
.
Numerator
— Numerator coefficients
[0.5 0.5]
(default) | row vector
Numerator
— 分子系数 [0.5 0.5]
(默认) |行向量
Specify the filter coefficients as a real or complex numeric row vector.
Tunable: Yes
Dependencies
This property applies when you set the NumeratorSource
property to Property
, and the Structure property is set to Direct
form
, Direct form symmetric
, Direct form
antisymmetric
, or Direct form transposed
.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Complex Number Support: Yes
ReflectionCoefficients
— Reflection coefficients of lattice filter structure
[0.5 0.5]
(default) | row vector
ReflectionCoefficients
— 晶格滤波器结构 [0.5 0.5]
的反射系数(默认) |行向量
Specify the reflection coefficients of a lattice filter as a real or complex numeric row vector.
Tunable: Yes
Dependencies
This property applies when you set the Structure property to Lattice
MA
, and the ReflectionCoefficientsSource
property to
Property
.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Complex Number Support: Yes
InitialConditions
— Initial conditions for the FIR filter
0
(default) | scalar | vector | matrix
InitialConditions
— FIR 滤波器 0
的初始条件(默认) |标量 |矢量 |矩阵
Specify the initial conditions of the filter states. The number of states or delay elements equals the number of reflection coefficients for the lattice structure, or the number of filter coefficients–1 for the other direct form structures.
You can specify the initial conditions as a scalar, vector, or matrix. If you specify a scalar value, the FIR filter object initializes all delay elements in the filter to that value. If you specify a vector whose length equals the number of delay elements in the filter, each vector element specifies a unique initial condition for the corresponding delay element. The object applies the same vector of initial conditions to each channel of the input signal.
If you specify a vector whose length equals the product of the number of input channels and the number of delay elements in the filter, each element specifies a unique initial condition for the corresponding delay element in the corresponding channel.
If you specify a matrix with the same number of rows as the number of delay elements in the filter, and one column for each channel of the input signal, each element specifies a unique initial condition for the corresponding delay element in the corresponding channel.
Tunable: Yes
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Fixed-Point Properties 定点属性
FullPrecisionOverride
— Full precision override for fixed-point arithmetic
true
(default) | false
FullPrecisionOverride
— 定点算术的全精度覆盖 true
(默认) | false
Specify whether to use full precision rules. If you set FullPrecisionOverride
to true
, which is the default,
the object computes all internal arithmetic and output data types using full precision
rules. These rules provide the most accurate fixed-point numerics. It also turns off
the display of other fixed-point properties because they do not apply individually.
These rules guarantee that no quantization occurs within the object. Bits are added,
as needed, to ensure that no roundoff or overflow occurs. If you set FullPrecisionOverride
to false
,
fixed-point data types are controlled through individual fixed-point property
settings. For more information, see Full Precision for Fixed-Point System Objects.
RoundingMethod
— Rounding method for fixed-point operations
Floor
(default) | Ceiling
| Convergent
| Nearest
| Round
| Simplest
| Zero
RoundingMethod
— 定点运算 Floor
的舍入方法(默认) | Ceiling
| Convergent
| Nearest
| Round
| Simplest
| Zero
Specify the rounding method.
Dependencies
This property applies only if the object is not in full precision mode.
OverflowAction
— Overflow action for fixed-point operations
Wrap
(default) | Saturate
OverflowAction
— 定点运算 Wrap
的溢出操作(默认) | Saturate
Specify the overflow action as Wrap
or
Saturate
.
Dependencies
This property applies only if the object is not in full precision mode.
CoefficientsDataType
— Coefficients word and fraction lengths
Same word length as input
(default) | Custom
CoefficientsDataType
— 系数字和分数长度 Same word length as input
(默认) | Custom
Specify the coefficients fixed-point data type as Same word length as
input
or Custom
.
Dependencies
This property applies when you set the NumeratorSource
property to Property
.
CustomCoefficientsDataType
— Custom coefficients word and fraction lengths
numerictype(true,16,15)
(default) | numerictype
CustomCoefficientsDataType
— 自定义系数字和分数长度 numerictype(true,16,15)
(默认) |数值类型
Specify the coefficients fixed-point type as a signed or unsigned numerictype
(Fixed-Point Designer) object.
Dependencies
This property applies when you set the CoefficientsDataType
property to Custom
.
ReflectionCoefficientsDataType
— Reflection coefficients word and fraction lengths
Same word length as input
(default) | Custom
ReflectionCoefficientsDataType
— 反射系数字和分数长度 Same word length as input
(默认) | Custom
Specify the reflection coefficients fixed-point data type as Same word
length as input
or Custom
.
Dependencies
This property applies when you set the
ReflectionCoefficientsSource
property to
Property
.
CustomReflectionCoefficientsDataType
— Custom reflection coefficients word and fraction lengths
numerictype(true,16,15)
(default) | numerictype
CustomReflectionCoefficientsDataType
— 自定义反射系数字和分数长度 numerictype(true,16,15)
(默认) |数值类型
Specify the reflection coefficients fixed-point type as a signed or unsigned
numerictype
(Fixed-Point Designer) object.
Dependencies
This property applies when you set the
ReflectionCoefficientsDataType
property to
Custom
.
ProductDataType
— Product word and fraction lengths
Full precision
(default) | Same as input
| Custom
ProductDataType
— 产品字数和分数长度 Full precision
(默认) | Same as input
| Custom
Specify the product fixed-point data type as Full precision
,
Same as input
, or Custom
.
CustomProductDataType
— Custom product word and fraction lengths
numerictype(true,32,30)
(default) | numerictype
CustomProductDataType
— 自定义产品字数和分数长度 numerictype(true,32,30)
(默认) |数值类型
Specify the product fixed-point type as a signed or unsigned scaled numerictype
(Fixed-Point Designer) object.
Dependencies
This property applies when you set the ProductDataType
property to Custom
.
AccumulatorDataType
— Accumulator word and fraction lengths
Full precision
(default) | Same as input
| Same as product
| Custom
AccumulatorDataType
— 累加器字数和分数长度 Full precision
(默认) | Same as input
| Same as product
| Custom
Specify the accumulator fixed-point data type to Full
precision
, Same as input
, Same as
product
, or Custom
.
CustomAccumulatorDataType
— Custom accumulator word and fraction lengths
numerictype(true,32,30)
(default) | numerictype
CustomAccumulatorDataType
— 自定义累加器字数和分数长度 numerictype(true,32,30)
(默认) |数值类型
Specify the accumulator fixed-point type as a signed or unsigned scaled numerictype
(Fixed-Point Designer) object.
Dependencies
This property applies when you set the AccumulatorDataType
property to Custom
.
StateDataType
— State word and fraction lengths
Same as accumulator
(default) | Same as input
| Custom
StateDataType
— 状态字和分数长度 Same as accumulator
(默认) | Same as input
| Custom
Specify the state fixed-point data type as one of Same as
input
, Same as accumulator
, or
Custom
.
Dependencies
This property does not apply to any of the direct form or direct form I filter structures.
CustomStateDataType
— Custom state word and fraction lengths
numerictype(true,16,15)
(default) | numerictype
CustomStateDataType
— 自定义状态字和分数长度 numerictype(true,16,15)
(默认) |数值类型
Specify the state fixed-point type as a signed or unsigned scaled numerictype
(Fixed-Point Designer) object.
Dependencies
This property applies when you set the StateDataType
property to Custom
.
OutputDataType
— Output word and fraction lengths
Same as accumulator
(default) | Same as input
| Custom
OutputDataType
— 输出字数和分数长度 Same as accumulator
(默认) | Same as input
| Custom
Specify the output fixed-point data type as one of Same as
input
, Same as accumulator
, or
Custom
.
CustomOutputDataType
— Custom output word and fraction lengths
numerictype(true,16,15) (default) | numerictype
CustomOutputDataType
— 自定义输出字和分数长度numerictype(true,16,15) (默认) |数值类型
Specify the output fixed-point type as a signed or unsigned scaled numerictype
(Fixed-Point Designer) object.
Dependencies
This property applies when you set the OutputDataType property to
Custom
.
Usage 用法
Syntax 语法
Description 描述
uses the time-varying coefficients, y
= fir(x
,coeff
)coeff
, to filter the input
signal x
and produce the output y
. You can use
this option when you set the NumeratorSource
or ReflectionCoefficientsSource
property to Input
port
.
使用时变系数 y
= fir(x
,coeff
)coeff
, 来滤除输入信号 x
并产生输出 y
。在将 NumeratorSource
or 属性设置为 Input
port
时 ReflectionCoefficientsSource
,可以使用此选项。
Input Arguments 输入参数
x
— Data input
vector | matrix
x
— 数据输入向量 |矩阵
Data input, specified as a vector or a matrix. When the input data is of a
fixed-point type, it must be signed when the structure is set to Direct form
symmetric
or Direct form antisymmetric
. The FIR filter
object operates on each channel of the input signal independently over successive
calls to the object.
This System object supports variable-size input.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
| fi
Complex Number Support: Yes
coeff
— Filter coefficients
row vector
coeff
— 滤波系数行向量
Time-varying filter coefficients, specified as a row vector. The data and coefficient inputs must have the same data type.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
| fi
Complex Number Support: Yes
Output Arguments 输出参数
y
— Filtered output
vector | matrix
y
— 滤波输出矢量 |矩阵
Filtered output, returned as a vector or a matrix. The output has the same size and data type as the input.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
| fi
Complex Number Support: Yes
Object Functions 对象函数
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
若要使用对象函数,请将 System 对象指定为第一个输入参数。例如,若要释放名为 obj
的 System 对象的系统资源,请使用以下语法:
release(obj)
Specific to dsp.FIRFilter
具体对象 dsp.FIRFilter
freqz | Frequency response of discrete-time filter System object |
fvtool | Visualize frequency response of DSP filters |
impz | Impulse response of discrete-time filter System object |
info | Information about filter System object |
coeffs | Returns the filter System object coefficients in a structure |
cost | Estimate cost of implementing filter System object |
grpdelay | Group delay response of discrete-time filter System object |
generatehdl | Generate HDL code for quantized DSP filter (requires Filter Design HDL Coder) |
outputDelay | Determine output delay of single-rate or multirate filter |
Examples 例子
Lowpass Filter a Sinusoid Signal Using FIRFilter object
低通滤波正弦信号 使用 FIRFilter 对象
Use an FIR filter to apply a lowpass filter to a waveform with two sinusoidal components.
使用 FIR 滤波器将低通滤波器应用于具有两个正弦分量的波形。
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
t = (0:1000)'/8e3; xin = sin(2*pi*0.3e3*t)+sin(2*pi*3e3*t); sr = dsp.SignalSource; sr.Signal = xin; sink = dsp.SignalSink; fir = dsp.FIRFilter(designLowpassFIR(FilterOrder=10,CutoffFrequency=0.5)); sa = spectrumAnalyzer(... 'SampleRate',8e3,... 'Method','welch',... 'PlotAsTwoSidedSpectrum',false,... 'OverlapPercent',80,... 'SpectrumUnits','dBW',... 'YLimits',[-150 -10]); while ~isDone(sr) input = sr(); filteredOutput = fir(input); sink(filteredOutput); sa(filteredOutput) end
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
filteredResult = sink.Buffer;
fvtool(fir,'Fs',8000)
Design an FIR filter as a System object.
将 FIR 滤波器设计为 System 对象。
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
N = 10; Fc = 0.4; firFiltObj = designLowpassFIR(FilterOrder=N,CutoffFrequency=Fc,SystemObject=true)
firFiltObj =
dsp.FIRFilter with properties:
Structure: 'Direct form'
NumeratorSource: 'Property'
Numerator: [-1.2414e-18 -0.0126 -0.0247 0.0635 0.2748 0.3981 0.2748 0.0635 -0.0247 -0.0126 -1.2414e-18]
InitialConditions: 0
Use get to show all properties
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
fvtool(firFiltObj)
Design and Implement Lowpass FIR Filter with Tunable Cutoff Frequency
设计和实现具有可调截止频率的低通FIR滤波器
Create a dsp.FIRFilter
object, and set the NumeratorSource
property to 'Input port'
so that you can vary the coefficients of the FIR filter through the input port during simulation.
创建一个 dsp.FIRFilter
对象,并将 NumeratorSource
该属性设置为, 'Input port'
以便在仿真期间通过输入端口改变 FIR 滤波器的系数。
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
firFilt = dsp.FIRFilter(NumeratorSource="Input port")
firFilt =
dsp.FIRFilter with properties:
Structure: 'Direct form'
NumeratorSource: 'Input port'
InitialConditions: 0
Use get to show all properties
Create a spectrumAnalyzer
object to visualize the spectra of the input and output signals.
创建一个 spectrumAnalyzer
对象来可视化输入和输出信号的频谱。
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
spectrumScope = spectrumAnalyzer(SampleRate=44100,PlotAsTwoSidedSpectrum=false,... ChannelNames=["Input Signal","Filtered Signal"]);
Create a dsp.DynamicFilterVisualizer
object to visualize the magnitude response of the varying filter.
创建一个 dsp.DynamicFilterVisualizer
对象以可视化变化滤波器的幅度响应。
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
filterViz = dsp.DynamicFilterVisualizer(NormalizedFrequency=true);
Stream in random data and filter the signal using the dsp.FIRFilter
object. Use the designLowpassFIR
function to design the filter coefficients. By default, this function returns a vector of FIR filter coefficients. Assign these coefficients to the dsp.FIRFilter
object.
流式传输随机数据并使用 dsp.FIRFilter
对象过滤信号。使用该 designLowpassFIR
函数设计滤波器系数。默认情况下,此函数返回 FIR 滤波器系数的向量。将这些系数分配给 dsp.FIRFilter
对象。
Vary the cutoff frequency of the filter during simulation. The designLowpassFIR
function redesigns the coefficients based on the updated filter specifications. Pass these updated coefficients to the FIR filter. Visualize the spectra of the input and filtered signals using the spectrum analyzer.
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
Fcut = 0.5; for idx = 1:500 num = designLowpassFIR(FilterOrder=30,CutoffFrequency=Fcut,Window="hann"); x = randn(1024,1); y = firFilt(x,num); spectrumScope(x,y); filterViz(num); Fcut = Fcut + 0.0005; end
Design and Implement Lowpass FIR Filter Object
Design and implement a lowpass FIR filter object using the designLowpassFIR
function. The function returns a dsp.FIRFilter
object when you set the SystemObject
argument to true
.
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
firFilt = designLowpassFIR(FilterOrder=30,CutoffFrequency=0.5,Window="hann",... SystemObject=true)
firFilt =
dsp.FIRFilter with properties:
Structure: 'Direct form'
NumeratorSource: 'Property'
Numerator: [0 2.1297e-19 0.0011 -1.8613e-18 -0.0048 4.8729e-18 0.0122 -8.7270e-18 -0.0251 1.2757e-17 0.0477 -1.6267e-17 -0.0960 1.8649e-17 0.3148 0.5000 0.3148 1.8649e-17 -0.0960 -1.6267e-17 0.0477 1.2757e-17 -0.0251 ... ] (1x31 double)
InitialConditions: 0
Use get to show all properties
Create a dsp.DynamicFilterVisualizer
object to visualize the magnitude response of the filter.
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
filterViz = dsp.DynamicFilterVisualizer(NormalizedFrequency=true); filterViz(firFilt)
Create a spectrumAnalyzer
object to visualize the spectra of the input and output signals.
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
spectrumScope = spectrumAnalyzer(SampleRate=44100,PlotAsTwoSidedSpectrum=false,... ChannelNames=["Input Signal","Filtered Signal"]);
Stream in random data and filter the signal using the dsp.FIRFilter
object. Visualize the spectra of the input and filtered signals using the spectrum analyzer.
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
for idx = 1:500 x = randn(1024,1); y = firFilt(x); spectrumScope(x,y); end
Design and Implement Equiripple FIR Halfband Filter
Design an equiripple FIR halfband filter with the order of 24 and a transition width of 0.1 using the designHalfbandFIR
function. Assign the filter coefficients to a dsp.FIRFilter
System object.
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
b = designHalfbandFIR(FilterOrder=24,DesignMethod='equiripple'); hbFIR = dsp.FIRFilter(b);
Create a dsp.DynamicFilterVisualizer
object and visualize the magnitude response of the filter.
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
dfv = dsp.DynamicFilterVisualizer(NormalizedFrequency=true); dfv(hbFIR);
Create a spectrumAnalyzer
object to visualize the spectra of the input and output signals.
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
scope = spectrumAnalyzer(SampleRate=2, PlotAsTwoSidedSpectrum=false,... ChannelNames=["Input Signal","Filtered Signal"]);
Stream in random data and filter the signal using the FIR halfband filter.
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
for i = 1:1000 x = randn(1024, 1); y = hbFIR(x); scope(x,y); end
Design Lowpass FIR Filter Using designfilt
Since R2023b
Design a lowpass FIR filter using the designfilt
function.
The filter is a minimum order filter with a passband frequency of 0.45 and a stopband frequency of 0.55 in normalized frequency units. The passband ripple is 1 dB and the stopband attenuation is 60 dB. Use the Kaiser window
design method and set the SystemObject
argument to true
.
With these specifications, the designfilt
function generates a dsp.FIRFilter
System object™.
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
lpFIRFilter = designfilt('lowpassfir', ... 'PassbandFrequency',0.45,'StopbandFrequency',0.55, ... 'PassbandRipple',1,'StopbandAttenuation',60, ... 'DesignMethod','kaiserwin','SystemObject',true)
lpFIRFilter =
dsp.FIRFilter with properties:
Structure: 'Direct form'
NumeratorSource: 'Property'
Numerator: [1.2573e-04 -1.9141e-04 -2.7282e-04 3.7207e-04 4.9141e-04 -6.3325e-04 -8.0016e-04 9.9490e-04 0.0012 -0.0015 -0.0018 0.0021 0.0025 -0.0029 -0.0034 0.0040 0.0046 -0.0053 -0.0060 0.0069 0.0079 -0.0090 -0.0102 0.0116 ... ] (1x74 double)
InitialConditions: 0
Use get to show all properties
Visualize the magnitude and phase responses of this filter using freqz
.
Copy openExample Command
Paste command in MATLAB to download and open example files- Try This Example
freqz(lpFIRFilter.Numerator)
Algorithms
This object implements the algorithm, inputs, and outputs described on the Discrete FIR Filter (Simulink) block reference page. The object properties correspond to the block parameters.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
Only the
Numerator
property is tunable for code generation.See System Objects in MATLAB Code Generation (MATLAB Coder).
The dsp.FIRFilter
System object supports SIMD code generation using Intel® AVX2 code replacement library under these conditions:
Filter structure is set to
'Direct form'
or'Direct form transposed'
.Input signal is real-valued with real filter coefficients.
When the filter structure is set to
'Direct form'
, the input signal can also be complex-valued with real or complex filter coefficients.Input signal has a data type of
single
ordouble
.
The SIMD technology significantly improves the performance of the generated code. For more information, see SIMD Code Generation. To generate SIMD code from this object, see Use Intel AVX2 Code Replacement Library to Generate SIMD Code from MATLAB Algorithms.
HDL Code Generation
Generate VHDL, Verilog and SystemVerilog code for FPGA and ASIC designs using HDL Coder™.
This object supports HDL code generation with the HDL Coder™ or Filter Design HDL Coder™ products. For HDL Coder workflow and limitations, see HDL Code Generation for System Objects (HDL Coder). For Filter Design HDL Coder workflow and limitations, see Generate HDL Code for Filter System Objects (Filter Design HDL Coder).
Version History
Introduced in R2012aR2023b: The designfilt
function and the Design Filter Live Editor task support dsp.FIRFilter
object
The designfilt
function generates a
dsp.FIRFilter
object when you specify 'lowpassfir'
and 'highpassfir'
filter responses and set the
'SystemObject'
flag to 'true'
.
lpFIRFilter = designfilt('lowpassfir', ... 'PassbandFrequency',0.45,'StopbandFrequency',0.55, ... 'PassbandRipple',1,'StopbandAttenuation',60, ... 'DesignMethod','kaiserwin','SystemObject',true)
lpFIRFilter =
dsp.FIRFilter with properties:
Structure: 'Direct form'
NumeratorSource: 'Property'
Numerator: [1.2573e-04 -1.9141e-04 -2.7282e-04 3.7207e-04 … ] (1×74 double)
InitialConditions: 0
The Design
Filter Live Editor task generates a dsp.FIRFilter
object
for lowpass FIR and highpass FIR filter responses when you select the Use a System
object to implement filter check box in the task UI and run the
designfilt
code the task generates.
See Also
Functions
freqz
|fvtool
|impz
|info
|coeffs
|cost
|grpdelay
|generatehdl
|outputDelay
|designLowpassFIR
|designBandpassFIR
|designBandstopFIR
|designHighpassFIR
|designFracDelayFIR
|designHalfbandFIR
Objects
Blocks
- Discrete FIR Filter (Simulink)
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: 中国.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- 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)