main content

adaptive lattice filter -凯发k8网页登录

adaptive lattice filter

description

the dsp.adaptivelatticefilter system object™ computes output, error, and coefficients using a lattice-based fir adaptive filter.

to implement the adaptive fir filter object:

  1. create the dsp.adaptivelatticefilter 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

alf = dsp.adaptivelatticefilter returns a lattice-based fir adaptive filter system object, alf. this system object computes the filtered output and the filter error for a given input and desired signal.

example

alf = dsp.adaptivelatticefilter(len) returns an adaptivelatticefilter system object with the length property set to len.

example

alf = dsp.adaptivelatticefilter(name,value) returns an adaptivelatticefilter system object with each specified property set to the specified value. enclose each property name in single quotes. unspecified properties have default values.

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 .

specify the method used to calculate filter coefficients as one of 'least-squares lattice', 'qr-decomposition least-squares lattice', 'gradient adaptive lattice'. the default value is 'least-squares lattice'. for algorithms used to implement these three different methods, refer to [1] [2]. this property is nontunable.

specify the length of the fir filter coefficients vector as a positive integer value. this property is nontunable.

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

specify the least-squares lattice forgetting factor as a scalar positive numeric value less than or equal to 1. setting this value to 1 denotes infinite memory during adaptation.

tunable: yes

dependencies

this property applies only if the method property is set to 'least-squares lattice' or 'qr-decomposition least-squares lattice'.

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

specify the joint process step size of the gradient adaptive lattice filter as a positive numeric scalar less than or equal to 1.

tunable: yes

dependencies

this property applies only if the method property is set to 'gradient adaptive lattice'.

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

specify an offset value for the denominator of the stepsize normalization term as a nonnegative numeric scalar. a nonzero offset helps avoid a divide-by-near-zero condition when the input signal amplitude is very small.

tunable: yes

dependencies

this property applies only if the method property is set to 'gradient adaptive lattice'.

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

specify the reflection process step size of the gradient adaptive lattice filter as a scalar numeric value between 0 and 1, both inclusive. the default value is the stepsize property value.

tunable: yes

dependencies

use this property only if the method property is set to 'gradient adaptive lattice'.

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

specify the averaging factor as a positive numeric scalar less than 1. use this property to compute the exponentially windowed forward and backward prediction error powers for the coefficient updates. the default is the value of 1 - stepsize.

tunable: yes

dependencies

this property applies only if the method property is set to'gradient adaptive lattice.

data types: single | double

specify the initial values for the prediction error vectors as a scalar positive numeric value.

if the method property is set to 'least-squares lattice' or 'qr-decomposition least-squares lattice', the default value is 1.0. if the method property is set to 'gradient adaptive lattice', the default value is 0.1.

tunable: yes

data types: single | double

specify the initial values of the fir adaptive filter coefficients as a scalar or a vector of length equal to the value of the length property.

tunable: yes

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

specify whether to lock the filter coefficient values. by default, the value of this property is false, and the object continuously updates the filter coefficients. if this property is set to true, the filter coefficients do not update and their values remain the same.

tunable: yes

dependencies

this property is applicable only if the method property is set to 'gradient adaptive lattice'.

usage

description

example

[y,err] = alf(x,d) filters the input x, using d as the desired signal, and returns the filtered output in y and the filter error in err. the system object estimates the filter weights needed to minimize the error between the output signal and the desired signal. you can access these coefficients by accessing the coefficients property of the object. this can be done only after calling the object. for example, to access the optimized coefficients of the alf filter, call alf.coefficients after you pass the input and desired signal to the object.

input arguments

the signal to be filtered by the adaptive lattice filter. the input, x, and the desired signal, d, must have the same size and data type.

the input can be a variable-size signal. you can change the number of elements in the column vector even when the object is locked. the system object locks when you call the object.

data types: single | double
complex number support: yes

the adaptive lattice filter adapts its coefficients to minimize the error, err, and converge the input signal x to the desired signal d as closely as possible.

the input, x, and the desired signal, d, must have the same size and data type.

the desired signal can be a variable-size signal. you can change the number of elements in the column vector even when the object is locked. the system object locks when you call the object.

data types: single | double
complex number support: yes

output arguments

filtered output, returned as a scalar or a column vector. the object adapts its filter coefficients to converge the input signal x to match the desired signal d. the filter outputs the converged signal.

data types: single | double
complex number support: yes

difference between the output signal y and the desired signal d, returned as a scalar or a column vector. the objective of the adaptive lattice filter is to minimize this error. the object adapts its coefficients to converge towards optimal filter coefficients that produce an output signal that matches closely with the desired signal. to access the adaptive lattice filter coefficients, call alf.coefficients after you pass the input and desired signal to the object algorithm.

data types: single | double
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)
estimated mean squared error for adaptive filters
run system object algorithm
release resources and allow changes to system object property values and input characteristics
reset internal states of system object

examples

create the qpsk signal and the noise, filter them to obtain the received signal, and delay the received signal to obtain the desired signal.

d = 16;
b = exp(1i*pi/4)*[-0.7 1];
a = [1 -0.7];
ntr = 1000;
s = sign(randn(1,ntr d))   1i*sign(randn(1,ntr d));
n = 0.1*(randn(1,ntr d)   1i*randn(1,ntr d));
r = filter(b,a,s)   n;
x = r(1 d:ntr d);
d = s(1:ntr);

use the adaptive lattice filter to compute the filtered output and the filter error for the input and desired signal.

lam = 0.995;
del = 1;
alf = dsp.adaptivelatticefilter('length', 32, ...
    'forgettingfactor', lam, 'initialpredictionerrorpower', del);
[y,e] = alf(x,d);

plot the in-phase and the quadrature components of the desired, output, and the error signals.

subplot(2,2,1); plot(1:ntr,real([d;y;e]));
title('in-phase components');
legend('desired','output','error');
xlabel('time index'); ylabel('signal value');
subplot(2,2,2); plot(1:ntr,imag([d;y;e]));
title('quadrature components');
legend('desired','output','error');
xlabel('time index'); ylabel('signal value');

figure contains 2 axes objects. axes object 1 with title in-phase components, xlabel time index, ylabel signal value contains 3 objects of type line. these objects represent desired, output, error. axes object 2 with title quadrature components, xlabel time index, ylabel signal value contains 3 objects of type line. these objects represent desired, output, error.

plot the received and equalized signals’ scatter plots.

subplot(2,2,3); plot(x(ntr-100:ntr),'.'); axis([-3 3 -3 3]);
title('received signal scatter plot'); axis('square'); 
xlabel('real[x]'); ylabel('imag[x]'); grid on;
subplot(2,2,4); plot(y(ntr-100:ntr),'.'); axis([-3 3 -3 3]);
title('equalized signal scatter plot'); axis('square');
xlabel('real[y]'); ylabel('imag[y]'); grid on;

figure contains 4 axes objects. axes object 1 with title in-phase components, xlabel time index, ylabel signal value contains 3 objects of type line. these objects represent desired, output, error. axes object 2 with title quadrature components, xlabel time index, ylabel signal value contains 3 objects of type line. these objects represent desired, output, error. axes object 3 with title received signal scatter plot, xlabel real[x], ylabel imag[x] contains a line object which displays its values using only markers. axes object 4 with title equalized signal scatter plot, xlabel real[y], ylabel imag[y] contains a line object which displays its values using only markers.

ha = fir1(31,0.5);
% fir system to be identified 
fir = dsp.firfilter('numerator',ha); 
iir = dsp.iirfilter('numerator',sqrt(0.75),...
        'denominator',[1 -0.5]);
x = iir(sign(randn(2000,25))); 
% observation noise signal 
n = 0.1*randn(size(x)); 
 % desired signal 
d = fir(x) n;
% filter length 
l = 32;
% decimation factor for analysis
% and simulation results 
m  = 5;                             
ha = dsp.adaptivelatticefilter(l); 
[simmse,meanwsim,wsim,traceksim] = msesim(ha,x,d,m);
plot(m*(1:length(simmse)),10*log10(simmse));
xlabel('iteration'); 
ylabel('mse (db)');
% plot the learning curve used for 
% adaptive lattice filter used in system identification
title('learning curve')

figure contains an axes object. the axes object with title learning curve, xlabel iteration, ylabel mse (db) contains an object of type line.

references

[1] griffiths, lloyd j. “a continuously adaptive filter implemented as a lattice structure”. proceedings of ieee int. conf. on acoustics, speech, and signal processing, hartford, ct, pp. 683–686, 1977 .

[2] haykin, s. adaptive filter theory, 4th ed. upper saddle river, nj: prentice hall, 1996.

extended capabilities

version history

introduced in r2013b

网站地图