Documentation

dsp.AllpoleFilter System object

Package: dsp

IIR Filter with no zeros

Description

The AllpoleFilter object filters each channel of the input using Allpole filter implementations.

To filter each channel of the input:

  1. Define and set up your Allpole filter. See Construction.

  2. Call step to filter each channel of the input according to the properties of dsp.AllpoleFilter. The behavior of step is specific to each object in the toolbox.

Construction

HAllpole = dsp.AllpoleFilter returns an Allpole filter System object™, HAllpole, which independently filters each channel of the input over successive calls to the step method. This System object uses a specified Allpole filter implementation, and it supports variable-size input.

HAllpole = dsp.AllpoleFilter('PropertyName',PropertyValue, ...) returns an Allpole filter System object, HAllpole, with each property set to the specified value.

Properties

Structure

Filter structure

Specify the filter structure.

You can specify the filter structure as one of | Direct form | Direct form transposed | Lattice AR. The default is Direct form. Analysis methods are not supported for fixed-point processing if the structure is Direct form or Direct form transposed. This property is nontunable.

Denominator

Filter denominator coefficients

Specify the denominator coefficients as a real or complex numeric row vector. This property is applicable when the Structure property is set to one of Direct form | Direct form transposed. The default value of this property is [1 0.1]. This property is tunable.

ReflectionCoefficients

Lattice filter coefficients

Specify the lattice filter coefficients as a real or complex numeric row vector. This property is applicable when the Structure property is set to Lattice AR. The default value of this property is [0.2 0.4]. This property is tunable.

InitialConditions

Initial conditions for the filter states

Specify the initial conditions of the filter states. The default value is 0.

You can specify the initial conditions as a scalar, vector, or matrix. If you specify a scalar value, this System object initializes all delay elements in the filter to that value. You can also specify a vector whose length equals the number of delay elements in the filter. When you do so, 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.

You can also 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. In this case, each element specifies a unique initial condition for the corresponding delay element in the corresponding channel. This property is tunable.

CoefficientsDataType

Denominator coefficients word- and fraction-length designations

Specify the denominator coefficients fixed-point data type as one of Same word length as input | Custom. The default is Same word length as input. This property is nontunable.

ReflectionCoefficientsDataType

Reflection coefficients word- and fraction-length designations

Specify the reflection coefficients fixed-point data type as one of Same word length as input | Custom. The default is Same word length as input. This property is nontunable.

 Fixed-Point Properties

Methods

cloneCreate Allpole filter with same property values
freqzFrequency response
fvtoolOpen filter visualization tool
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs of step method
impzImpulse response
isLockedLocked status for input attributes and nontunable properties
phasezUnwrapped phase response
releaseAllow property value and input characteristics changes
resetReset internal states of Allpole filter
stepFilter input with Allpole filter object

More Analysis Methods for Filter System Objects.

    Note:   In AllpoleFilter, analysis methods are not supported for fixed-point processing if the structure is Direct form or Direct form transposed.

Examples

collapse all

Lowpass filtering a waveform with two frequencies

Use an Allpole filter to apply a lowpass filter to a waveform with two sinusoidal frequencies.

 t = [0:1000]./8e3;
 xin = sin(2*pi*1e3*t)+sin(2*pi*3e3*t);
 
 hSR = dsp.SignalSource(xin', 4);
 hLog = dsp.SignalSink;
 hallpole = dsp.AllpoleFilter;
 tt = (-25:25)';
 xsinc = 0.4*sinc(0.4*tt);
 asinc = lpc(xsinc,51);
 hallpole.Denominator = asinc;

 h = dsp.SpectrumAnalyzer('SampleRate',8e3,...
    'PlotAsTwoSidedSpectrum',false,...
    'OverlapPercent', 80,'PowerUnits','dBW',...
    'YLimits', [-150 50]);
 
while ~isDone(hSR)
      input = step(hSR);
      filteredOutput = step(hallpole,input);
      step(hLog,filteredOutput);
      step(h,filteredOutput)
 end

 filteredResult = hLog.Buffer;
 fvtool(hallpole,'Fs',8000)

Algorithms

This object implements the algorithm, inputs, and outputs described on the Allpole Filter block reference page. The object properties correspond to the block parameters.

Was this topic helpful?