• No results found

adaptfilt.bap 0 200 400 600 800

−4 −2 0 2 4 In−Phase Components Time Index Signal Value Desired Output Error 0 200 400 600 800 1000 −4 −3 −2 −1 0 1 2 3 Quadrature Components Time Index Signal Value Desired Output Error −2 0 2 −3 −2 −1 0 1 2 3

Received Signal Scatter Plot

Real[x] Imag[x] −2 0 2 −3 −2 −1 0 1 2 3

Equalized Signal Scatter Plot

Real[y]

Imag[y]

Using the block affine projection object in QPSK results in the plots shown here.

See Also

adaptfilt,adaptfilt.ap,adaptfilt.apru

References

[1] Ozeki, K. and T. Omeda, “An Adaptive Filtering Algorithm Using an Orthogonal Projection to an Affine Subspace and Its Properties,” Electronics and Communications in Japan, vol. 67-A, no. 5, pp. 19-27, May 1984

[2] Montazeri, M. and Duhamel, P, “A Set of Algorithms Linking NLMS and Block RLS Algorithms,” IEEE Transactions Signal Processing, vol. 43, no. 2, pp, 444-453, February 1995

Purpose

FIR adaptive filter that uses BLMS

Syntax

ha = adaptfilt.blms(l,step,leakage,blocklen,coeffs,states)

Description

ha = adaptfilt.blms(l,step,leakage,blocklen,coeffs,states)

constructs an FIR block LMS adaptive filterha, wherelis the adaptive

filter length (the number of coefficients or taps) and must be a positive integer. ldefaults to 10.

stepis the block LMS step size. You must set step to a nonnegative

scalar. You can use functionmaxstepto determine a reasonable range

of step size values for the signals being processed. When unspecified,

stepdefaults to 0.

leakageis the block LMS leakage factor. It must be a scalar between 0

and 1. If you set leakage to be less than one, you implement the leaky block LMS algorithm. leakagedefaults to 1 specifying no leakage in

the adapting algorithm.

blocklenis the block length used. It must be a positive integer and

the signal vectorsdandxshould be divisible byblocklen. Larger

block lengths result in faster per-sample execution times but with poor adaptation characteristics. When you chooseblocklensuch that blocklen+length(coeffs)is a power of 2, useadaptfilt.blmsfft. blocklendefaults tol.

coeffsis a vector of initial filter coefficients. it must be a lengthl

vector. coeffsdefaults to lengthlvector of zeros.

statescontains a vector of your initial filter states. It must be a length lvector and defaults to a lengthlvector of zeros when you do not

include it in your calling function.

Properties

In the syntax for creating theadaptfiltobject, the input options are

properties of the object created. This table lists the properties for the adjoint LMS object, their default values, and a brief description of the property.

adaptfilt.blms

Property

Default

Value Description

Algorithm None Defines the adaptive filter algorithm

the object uses during adaptation

FilterLength Any

positive integer

Reports the length of the filter, the number of coefficients or taps

Coefficients Vector of

elements Vector containing the initial filtercoefficients. It must be a length

lvector wherelis the number of

filter coefficients. coeffsdefaults to

lengthlvector of zeros when you do

not provide the argument for input.

States Vector of

elements Vector of the adaptive filter states.statesdefaults to a vector of zeros

which has length equal tol Leakage Specifies the leakage parameter.

Allows you to implement a leaky algorithm. Including a leakage factor can improve the results of the algorithm by forcing the algorithm to continue to adapt even after it reaches a minimum value. Ranges between 0 and 1.

BlockLength Vector of

lengthl

Size of the blocks of data processed in each iteration

Property

Default

Value Description

StepSize 0.1 Sets the block LMS algorithm step

size used for each iteration of the adapting algorithm. Determines both how quickly and how closely the adaptive filter converges to the filter solution. Usemaxstepto determine

the maximum usable step size.

PersistentMemory false or true

Determine whether the filter states get restored to their starting values for each filtering operation. The starting values are the values in place when you create the filter.

PersistentMemoryreturns to zero

any state that the filter changes during processing. States that the filter does not change are not affected. Defaults tofalse.

Example

Use an adaptive filter to identify an unknown 32nd-order FIR filter. In this example 500 input samples result in 500 iterations of the adaptation process. You see in the plot that follows the example code that the adaptive filter has determined the coefficients of the unknown system under test.

x = randn(1,500); % Input to the filter

b = fir1(31,0.5); % FIR system to be identified no = 0.1*randn(1,500); % Observation noise signal d = filter(b,1,x)+no; % Desired signal

mu = 0.008; % Block LMS step size n = 5; % Block length

ha = adaptfilt.blms(32,mu,1,n); [y,e] = filter(ha,x,d);

adaptfilt.blms

title('System Identification of an FIR Filter'); legend('Desired','Output','Error');

xlabel('Time Index'); ylabel('Signal Value'); subplot(2,1,2); stem([b.',ha.coefficients.']); legend('Actual','Estimated');

xlabel('Coefficient #'); ylabel('Coefficient Value'); grid on;

Based on looking at the figures here, the adaptive filter correctly identified the unknown system after 500 iterations, or fewer. In the lower plot, you see the comparison between the actual filter coefficients and those determined by the adaptation process.

0 50 100 150 200 250 300 350 400 450 500 −3 −2 −1 0 1 2 3

System Identification of an FIR filter

Time Index Signal Value Desired Output Error 0 5 10 15 20 25 30 35 −0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 Coefficient # Coefficient Value Actual Estimated

References

Shynk, J.J.,“Frequency-Domain and Multirate Adaptive Filtering,” IEEE®Signal Processing Magazine, vol. 9, no. 1, pp. 14-37, Jan. 1992.

adaptfilt.blmsfft

Purpose

FIR adaptive filter that uses FFT-based BLMS

Syntax

ha = adaptfilt.blmsfft(l,step,leakage,blocklen,coeffs, states)

Description

ha = adaptfilt.blmsfft(l,step,leakage,blocklen,coeffs, states)constructs an FIR block LMS adaptive filter objecthawhere lis the adaptive filter length (the number of coefficients or taps) and

must be a positive integer. ldefaults to 10. stepis the block LMS

step size. It must be a nonnegative scalar. The functionmaxstepmay

be helpful to determine a reasonable range of step size values for the signals you are processing. stepdefaults to 0.

leakageis the block LMS leakage factor. It must also be a

scalar between 0 and 1. Whenleakageis less than one, the

adaptfilt.blmsfftimplements a leaky block LMS algorithm.leakage

defaults to 1 (no leakage).blocklenis the block length used. It must be

a positive integer such that

blocklen + length(coeffs)

is a power of two; otherwise, anadaptfilt.blmsalgorithm is used

for adapting. Larger block lengths result in faster execution times, with poor adaptation characteristics as the cost of the speed gained.

blocklendefaults tol. Enter your initial filter coefficients incoeffs, a

vector of lengthl. When omitted,coeffsdefaults to a lengthlvector of

all zeros. statescontains a vector of initial filter states; it must be a

lengthlvector. statesdefaults to a lengthlvector of all zeros when

you omit thestatesargument in the calling syntax.

Properties

In the syntax for creating theadaptfiltobject, the input options

are properties of the object you create. This table lists the properties for the block LMS object, their default values, and a brief description of the property.

Property

Default

Value Description

Algorithm None Defines the adaptive filter

algorithm the object uses during adaptation

FilterLength Any

positive integer

Reports the length of the filter, the number of coefficients or taps

Coefficients Vector of

elements Vector containing the initial filtercoefficients. It must be a length

lvector wherelis the number of

filter coefficients. coefficients

defaults to length l vector of

zeros when you do not provide the argument for input.

States Vector of

elements of length

l

Vector of the adaptive filter states.

statesdefaults to a vector of zeros

which has length equal tol Leakage 1 Specifies the leakage parameter.

Allows you to implement a leaky algorithm. Including a leakage factor can improve the results of the algorithm by forcing the algorithm to continue to adapt even after it reaches a minimum value. Ranges between 0 and 1.

BlockLength Vector of

lengthl

Size of the blocks of data processed in each iteration

adaptfilt.blmsfft

Property

Default

Value Description

StepSize 0.1 Sets the block LMS algorithm step

size used for each iteration of the adapting algorithm. Determines both how quickly and how closely the adaptive filter converges to the filter solution. Usemaxstepto

determine the maximum usable step size.

PersistentMemory falseor true

Determine whether the filter states get restored to their starting values for each filtering operation. The starting values are the values in place when you create the filter.

PersistentMemoryreturns to zero

any state that the filter changes during processing. States that the filter does not change are not affected. Defaults tofalse.

Example

Identify an unknown FIR filter with 32 coefficients using 512 iterations of the adapting algorithm.

x = randn(1,512); % Input to the filter

b = fir1(31,0.5); % FIR system to be identified no = 0.1*randn(1,512); % Observation noise signal d = filter(b,1,x)+no; % Desired signal

mu = 0.008; % Step size n = 16; % Block length ha = adaptfilt.blmsfft(32,mu,1,n); [y,e] = filter(ha,x,d);

subplot(2,1,1); plot(1:500,[d(1:500);y(1:500);e(1:500)]); title('System Identification of an FIR Filter');

ylabel('Signal Value');

subplot(2,1,2); stem([b.',ha.coefficients.']); legend('actual','estimated'); grid on;

xlabel('Coefficient #'); ylabel('Coefficient Value');

0 50 100 150 200 250 300 350 400 450 500 −2 −1 0 1 2 3

System Identification of an FIR Filter

Time Index Signal Value Desired Output Error 0 5 10 15 20 25 30 35 −0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 Coefficient # Coefficient Value actual estimated

As a result of running the adaptation process, filter objecthanow

matches the unknown system FIR filterb, based on comparing the filter

coefficients derived during adaptation.

See Also

adaptfilt.blms,adaptfilt.fdaf,adaptfilt.lms,filter

References

Shynk, J.J., “Frequency-Domain and Multirate Adaptive Filtering,” IEEE Signal Processing Magazine, vol. 9, no. 1, pp. 14-37, Jan. 1992.

adaptfilt.dlms

Purpose

FIR adaptive filter that uses delayed LMS

Syntax

ha = adaptfilt.dlms(l,step,leakage,delay,errstates,coeffs, ...states)

Description

ha = adaptfilt.dlms(l,step,leakage,delay,errstates,coeffs, ...states)constructs an FIR delayed LMS adaptive filterha.

Input Arguments

Entries in the following table describe the input arguments for

adaptfilt.dlms.

Input

Argument Description

l Adaptive filter length (the number of coefficients or

taps) and it must be a positive integer. ldefaults

to 10.

step LMS step size. It must be a nonnegative scalar. You

can usemaxstepto determine a reasonable range

of step size values for the signals being processed.

stepdefaults to 0.

leakage Your LMS leakage factor. It must be a scalar

between 0 and 1. Whenleakageis less than one, adaptfilt.lmsimplements a leaky LMS algorithm.

When you omit theleakageproperty in the calling

syntax, it defaults to 1 providing no leakage in the adapting algorithm.

delay Update delay given in time samples. This scalar

should be a positive integer — negative delays do not work. delaydefaults to 1.

errstates Vector of the error states of your adaptive filter. It

must have a length equal to the update delay (delay)

Input

Argument Description

coeffs Vector of initial filter coefficients. it must be a

lengthlvector. coeffsdefaults to lengthlvector

with elements equal to zero.

states Vector of initial filter states for the adaptive filter.

It must be a lengthl-1 vector. statesdefaults to a

length l-1 vector of zeros.

Properties

In the syntax for creating theadaptfiltobject, the input options

are properties of the object you create. This table lists the properties for the block LMS object, their default values, and a brief description of the property.

Property

Default

Value Description

Algorithm None Defines the adaptive filter

algorithm the object uses during adaptation

Coefficients Vector of

elements Vector containing the initial filtercoefficients. It must be a length

lvector wherelis the number

of filter coefficients. coeffs

defaults to length lvector of

zeros when you do not provide the argument for input. LMS FIR filter coefficients. Should be initialized with the initial coefficients for the FIR filter prior to adapting. You needl

entries incoeffs.

Delay 1 Specifies the update delay for the

adaptfilt.dlms