main content

single section or cascaded allpass filter -凯发k8网页登录

single section or cascaded allpass filter

description

the dsp.allpassfilter object filters each channel of the input using allpass filter implementations. to import this object into simulink®, use the matlab® system block.

to filter each channel of the input:

  1. create the dsp.allpassfilter object and set its properties.

  2. call the object with arguments, as if it were a function.

to learn more about how system objects work, see what are system objects?

creation

description

allpass = dsp.allpassfilter returns an allpass filter system object™, allpass, that filters each channel of the input signal independently using an allpass filter, with the default structure and coefficients.

example

allpass = dsp.allpassfilter(name,value) returns an allpass filter system object, allpass, with each property set to the specified value.

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 function unlocks them.

if a property is tunable, you can change its value at any time.

for more information on changing property values, see .

you can specify the internal allpass filter implementation structure as one of | minimum multiplier | lattice | wave digital filter. each structure uses a different set of coefficients, independently stored in the corresponding object property.

specify the real allpass polynomial filter coefficients. specify this property as either an n-by-1 or n-by-2 matrix of n first-order or second-order allpass sections. the default value defines a stable second-order allpass filter with poles and zeros located at ±π/3 in the z plane.

tunable: yes

dependencies

this property is applicable only when the structure property is set to minimum multiplier.

data types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

specify the real allpass coefficients in the wave digital filter form. specify this property as either a n-by-1 or n-by-2 matrix of n first-order or second-order allpass sections. all elements must have absolute values less than or equal to 1. this value is a transformed version of the default value of allpasscoefficients, computed using allpass2wdf(allpasscoefficients). these coefficients define the same stable second-order allpass filter as when structure is set to 'minimum multiplier'.

tunable: yes

dependencies

this property is only applicable when the structure property is set to wave digital filter.

data types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

specify the real or complex allpass coefficients as lattice reflection coefficients. specify this property as either a row vector (single-section configuration) or a column vector. this value is a transformed and transposed version of the default value of allpasscoefficients, computed using transpose(tf2latc([1 h.allpasscoefficients])). these coefficients define the same stable second-order allpass filter as when structure is set to 'lattice'.

tunable: yes

dependencies

this property is applicable only if the structure property is set to lattice.

data types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
complex number support: yes

indicate if last section is first order or second order. when you set trailingfirstordersection to true, the last section is considered to be first-order, and the second element of the last row of the n-by-2 matrix is ignored. when you set trailingfirstordersection to false, the last section is considered to be second-order.

usage

description

example

y = allpass(x) filters the input signal x using an allpass filter to produce the output y. each column of x is filtered independently as a separate channel over time.

input arguments

data input, specified as a vector or a matrix. this object also accepts variable-size inputs. once the object is locked, you can change the size of each input channel, but you cannot change the number of channels.

data types: single | double
complex number support: yes

output arguments

filtered output, returned as a vector or a matrix. the size, data type, and complexity of the output signal matches that of the input signal.

data types: double | single
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:

release(obj)
frequency response of discrete-time filter system object
visualize frequency response of dsp filters
impulse response of discrete-time filter system object
information about filter system object
returns the filter system object coefficients in a structure
estimate cost of implementing filter system object
group delay response of discrete-time filter system object
run system object algorithm
release resources and allow changes to system object property values and input characteristics
reset internal states of system object

examples

construct the allpass filters

fs  = 48000;    % in hz
fl = 1024;
apf1 = dsp.allpassfilter('allpasscoefficients',...
    [-0.710525516540603   0.208818210000029]);
apf2 =  dsp.allpassfilter('allpasscoefficients',...
    [-0.940456403667957   0.6;...
    -0.324919696232907   0],...
    'trailingfirstordersection',true);

construct the transfer function estimator to estimate the transfer function between the random input and the allpass filtered output

tfe = dsp.transferfunctionestimator('frequencyrange',...
    'onesided','spectralaverages',2);

construct the arrayplot to plot the magnitude response

ap = dsp.arrayplot('plottype','line','ylimits', [-80 5],...
    'ylabel','magnitude (db)','sampleincrement', fs/fl,...
    'xlabel','frequency (hz)','title','magnitude response',...
    'showlegend', true,'channelnames',{'magnitude response'});

filter the input and show the magnitude response of the estimated transfer function between the input and the filtered output

tic;
while toc < 5
    in  = randn(fl,1);
    out = 0.5.*(apf1(in)   apf2(in));
    a = tfe(in, out);
    ap(db(a));
end

algorithms

the transfer function of an allpass filter is given by

h(z)=c(n) c(n1)z1 ... zn1 c(1)z1 ... c(n)zn.

c is allpass polynomial coefficients vector. the order, n, of the transfer function is the length of vector c.

in the minimum multiplier form and wave digital form, the allpass filter is implemented as a cascade of either second-order (biquad) sections or first-order sections. when the coefficients are specified as an n-by-2 matrix, each row of the matrix specifies the coefficients of a second-order filter. the last element of the last row can be ignored based on the trailing first-order setting. when the coefficients are specified as an n-by-1 matrix, each element in the matrix specifies the coefficient of a first-order filter. the cascade of all the filter sections forms the allpass filter.

in the lattice form, the coefficients are specified as a vector.

these structures are computationally more economical and structurally more stable compared to the generic iir filters, such as df1, df1t, df2, df2t. for all structures, the allpass filter can be a single-section or a multiple-section (cascaded) filter. the different sections can have different orders, but they are all implemented according to the same structure.

references

[1] regalia, philip a. and mitra sanjit k. and vaidyanathan, p. p. (1988) “the digital all-pass filter: aversatile signal processing building block.” proceedings of the ieee, vol. 76, no. 1, 1988, pp. 19–37

[2] m. lutovac, d. tosic, b. evans, filter design for signal processing using matlab and mathematica. upper saddle river, nj: prentice hall, 2001.

extended capabilities

version history

introduced in r2013a

see also

functions

  • | | | | | | |

objects

  • |

topics

    网站地图