Main Content

dsp.firfilter.

Static or time-varying FIR filter

描述

Thedsp.firfilter.系统对象™使用静态或时变的FIR滤波器实现来筛选输入的每个通道。

To filter each channel of the input:

  1. 创造dsp.firfilter.对象并设置其属性。

  2. 用参数调用对象,就像它是一个函数一样。

To learn more about how System objects work, see什么是系统对象?

在特定条件下,此系统对象还支持SIMD代码生成。万博1manbetx有关详细信息,请参阅Code Generation

创建

描述

fir= dsp.firfilter.返回有限脉冲响应(FIR)过滤器对象,fir, which independently filters each channel of the input over time using a specified FIR filter implementation.

example

fir= dsp.firfilter(num)returns an FIR filter System object,fir,与之分子property set tonum

fir= dsp.firfilter(Name,Value)returns an FIR filter System object,fir,每个属性都设置为指定值。

特性

展开全部

除非另有说明,否则属性是不宜,这意味着在调用对象后无法更改其值。当您调用它们时,对象锁定,以及release功能解锁它们。

如果属性是调节, you can change its value at any time.

有关更改属性值的详细信息,请参阅System Design in MATLAB Using System Objects

指定过滤器结构。您可以将过滤器结构指定为一个Direct form|Direct form symmetric|Direct form antisymmetric|Direct form transposed|Lattice MA

指定滤波器系数的源作为Property要么输入端口。When you specify输入端口,过滤器对象每帧更新一次变化过滤器。

依赖性

设置时适用StructureDirect form|Direct form symmetric|Direct form antisymmetric|Direct form transposed

指定the source of the Lattice filter coefficients asProperty要么输入端口。When you specify输入端口,过滤器对象每帧更新一次变化过滤器。

依赖性

设置时适用StructureLattice MA

指定the filter coefficients as a real or complex numeric row vector.

可调:是的

依赖性

This property applies when you set the分子Sourceproperty toProperty,而且Structureproperty is set toDirect form,Direct form symmetric,Direct form antisymmetric, 要么Direct form transposed

数据类型:单身的|双倍的|INT8.|int16|int32|INT64.|uint8.|uint16|UINT32|UINT64
Complex Number Support:是的

指定the reflection coefficients of a lattice filter as a real or complex numeric row vector.

可调:是的

依赖性

This property applies when you set theStructureproperty toLattice MA,而且RELLICTIONCOEFFICERSSOURCE.property toProperty

数据类型:单身的|双倍的|INT8.|int16|int32|INT64.|uint8.|uint16|UINT32|UINT64
Complex Number Support:是的

指定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.

可调:是的

数据类型:单身的|双倍的|INT8.|int16|int32|INT64.|uint8.|uint16|UINT32|UINT64

Fixed-Point Properties

指定是否使用完全精确规则。如果你设置了FullPrecisionOverridetrue,这是默认情况下,对象使用完全精确规则计算所有内部算术和输出数据类型。这些规则提供了最准确的定点数字。它还关闭其他固定点属性的显示,因为它们不单独应用。这些规则保证了对象内没有量化。根据需要,添加位,以确保不会发生循环或溢出。如果你设置了FullPrecisionOverridefalse, fixed-point data types are controlled through individual fixed-point property settings. For more information, seeFull Precision for Fixed-Point System Objects

指定舍入方法。

依赖性

仅当对象不处于完全精度模式时,此属性才适用。

指定the overflow action asWrap要么饱和

依赖性

仅当对象不处于完全精度模式时,此属性才适用。

指定系数定点数据类型为Same word length as input要么Custom

依赖性

This property applies when you set the分子Sourceproperty toProperty

指定the coefficients fixed-point type as a signed or unsignednumerictype(Fixed-Point Designer)目的。

依赖性

This property applies when you set theCoefficientsDataTypeproperty toCustom

指定the reflection coefficients fixed-point data type asSame word length as input要么Custom

依赖性

This property applies when you set theRELLICTIONCOEFFICERSSOURCE.property toProperty

指定the reflection coefficients fixed-point type as a signed or unsignednumerictype(Fixed-Point Designer)目的。

依赖性

This property applies when you set theReflectionCoefficientsDataTypeproperty toCustom

指定产品固定点数据类型全精确,与输入相同, 要么Custom

指定the product fixed-point type as a signed or unsigned scalednumerictype(Fixed-Point Designer)目的。

依赖性

This property applies when you set theProductDataTypeproperty toCustom

指定the accumulator fixed-point data type to全精确,与输入相同,Same as product, 要么Custom

将累加器定点类型指定为符号或无符号缩放numerictype(Fixed-Point Designer)目的。

依赖性

This property applies when you set theAccumulatorDataTypeproperty toCustom

指定状态定点数据类型作为其中一个与输入相同,与累加器相同, 要么Custom

依赖性

This property does not apply to any of the direct form or direct form I filter structures.

指定the state fixed-point type as a signed or unsigned scalednumerictype(Fixed-Point Designer)目的。

依赖性

This property applies when you set theStateDataTypeproperty toCustom

将输出定点数据类型指定为一个与输入相同,与累加器相同, 要么Custom

指定the output fixed-point type as a signed or unsigned scalednumerictype(Fixed-Point Designer)目的。

依赖性

This property applies when you set theoutputDatType.property toCustom

Usage

描述

example

y=冷杉(x)将FIR滤波器应用于真实或复杂的输入信号x生产输出y

y=冷杉(x,co)uses the time-varying coefficients,co, to filter the input signalxand produce the outputy。You can use this option when you set the分子Source要么RELLICTIONCOEFFICERSSOURCE.property to输入端口

Input Arguments

展开全部

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 toDirect form symmetric要么Direct form antisymmetric。FIR滤波器对象在输入信号的每个通道上独立于对对象的连续呼叫操作。

This System object supports variable-size input.

数据类型:单身的|双倍的|INT8.|int16|int32|uint8.|uint16|UINT32|fi
Complex Number Support:是的

Time-varying filter coefficients, specified as a row vector. The data and coefficient inputs must have the same data type.

数据类型:单身的|双倍的|INT8.|int16|int32|uint8.|uint16|UINT32|fi
Complex Number Support:是的

输出参数

展开全部

Filtered output, returned as a vector or a matrix. The output has the same size and data type as the input.

数据类型:单身的|双倍的|INT8.|int16|int32|uint8.|uint16|UINT32|fi
Complex Number Support:是的

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 namedobj, use this syntax:

release(obj)

展开全部

freqz Frequency response of discrete-time filter系统对象
FVTool. Visualize frequency response of DSP filters
轰炸 Impulse response of discrete-time filter系统对象
info Information about filter系统对象
cos Returns the filter系统对象coicients in a structure
cost Estimate cost of implementing filter系统对象
grpdelay Group delay response of discrete-time filter系统对象
generatehdl Generate HDL code for quantized DSP filter (requires过滤器设计HDL编码器)
跑步系统对象algorithm
release Release resources and allow changes to系统对象property values and input characteristics
重置 Reset internal states of系统对象

例子

collapse all

Use an FIR filter to apply a low pass filter to a waveform with two sinusoidal components.

t =(0:1000)'/ 8e3;xin = sin(2 * pi * 0.3e3 * t)+ sin(2 * pi * 3e3 * t);sr = dsp.signalsource;sr.signal = xin;inrint = dsp.signalsink;fir = dsp.firfilter(fir1(10,0.5));sa = dsp.spectrumanalyzer('采样率',8e3,......'PlotAsTwoSidedSpectrum',false,......'OverlapPercent', 80,'PowerUnits','dbw',......'YLimits',[-150 -10]);while〜ISDONE(SR)输入= SR();filteredOutput = FIR(输入);水槽(FilteredOutput);SA(FilteredOutput)endfilteredResult = sink.Buffer; fvtool(fir,'FS',8000)

设计FIR滤波器作为系统对象。

n = 10;FC = 0.4;B = fir1(N,Fc); fir1 = dsp.FIRFilter(B); fvtool(fir1)

This can also be achieved by usingfdesign作为构造函数和设计到设计the filter.

n = 10;FC = 0.4;speclowpass = fdesign.lowpass('n,fc',n,fc);FiR2 = Design(Speclowpass,'systemobject',true) fvtool(fir2);
fir2 = dsp.FIRFilter with properties: Structure: 'Direct form' NumeratorSource: 'Property' Numerator: [1x11 double] InitialConditions: 0 Use get to show all properties

Algorithms

这个对象实现该算法,输入,outputs described on theDiscrete FIR Filter(Simulink)block reference page. The object properties correspond to the block parameters.

扩展能力

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Introduced in R2012a