matlab lms自适应滤波,[转载]Matlab的自适应滤波LMS

来源:http://www.mathworks.com/access/helpdesk/help/toolbox/filterdesign/index.html?/access/helpdesk/help/toolbox/filterdesign/ref/adaptfilt.adjlms.html&http://www.google.com/search?hl=en&newwindow=1&q=alg+%3D+lms(stepsize)+matlab&btnG=Search

adaptfilt.adjlms -

FIR adaptive filter that uses adjoint LMS

algorithm

Syntax

ha =

adaptfilt.adjlms(l,step,leakage,pathcoeffs,pathest,...

errstates,pstates,coeffs,states)

Description

ha =

adaptfilt.adjlms(l,step,leakage,pathcoeffs,pathest,...

errstates,pstates,coeffs,states) constructs object

ha, an FIR adjoint LMS adaptive filter. l is the

adaptive filter length (the number of coefficients or taps) and

must be a positive integer. l defaults to 10 when you omit

the argument. step is the adjoint LMS step size. It must

be a nonnegative scalar. When you omit the step argument,

step defaults to 0.1.

leakage is the adjoint LMS leakage factor. It must be a

scalar between 0 and 1. When leakage is less than one, you

implement a leaky version of the adjlms algorithm to

determine the filter coefficients. leakage defaults to 1

specifying no leakage in the algorithm.

pathcoeffs is the secondary path filter model. This

vector should contain the coefficient values of the secondary path

from the output actuator to the error sensor.

pathest is the estimate of the secondary path filter

model. pathest defaults to the values in

pathcoeffs.

errstates is a vector of error states of the adaptive

filter. It must have a length equal to the filter order of the

secondary path model estimate. errstates defaults to a

vector of zeros of appropriate length. pstates contains

the secondary path FIR filter states. It must be a vector of length

equal to the filter order of the secondary path model.

pstates defaults to a vector of zeros of appropriate

length. The initial filter coefficients for the secondary path

filter compose vector coeffs. It must be a length

l vector. coeffs defaults to a length l

vector of zeros. states is a vector containing the initial

filter states. It must be a vector of length

l+ne-1, where ne is the length of

errstates. When you omit states, it defaults to

an appropriate length vector of zeros.

Properties

In the syntax for creating the adaptfilt object, 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.

Property

Default Value

Description

Algorithm

None

Specifies the adaptive filter algorithm the object uses during

adaptation

Coefficients

Length l vector with zeros for all elements

Adjoint LMS FIR filter coefficients. Should be initialized with

the initial coefficients for the FIR filter prior to adapting. You

need l entries in coefficients. Updated filter

coefficients are returned in coefficients when you use

s as an output argument.

ErrorStates

[0,...,0]

A vector of the error states for your adaptive filter, with

length equal to the order of your secondary path filter.

FilterLength

10

The number of coefficients in your adaptive filter.

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.

SecondaryPathCoeffs

No default

A vector that contains the coefficient values of your secondary

path from the output actuator to the error sensor.

SecondaryPathEstimate

pathcoeffs values

An estimate of the secondary path filter model.

SecondaryPathStates

Length of the secondary path filter. All elements are zeros.

The states of the secondary path filter, the unknown system

States

l+ne+1, where ne is length(errstates)

Contains the initial conditions for your adaptive filter and

returns the states of the FIR filter after adaptation. If omitted,

it defaults to a zero vector of length equal to l+ne+1. When you

use adaptfilt.adjlms in a loop structure, use this element

to specify the initial filter states for the adapting FIR

filter.

Stepsize

0.1

Sets the adjoint 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.

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.

PersistentMemory returns to zero any state that the filter

changes during processing. States that the filter does not change

are not affected. Defaults to false.

Example

Demonstrate active noise control of a random noise signal that

runs for 1000 samples.

x = randn(1,1000); % Noise source

g = fir1(47,0.4); % FIR primary path system model

n = 0.1*randn(1,1000); % Observation noise signal

d = filter(g,1,x)+n; % Signal to be canceled (desired)

b = fir1(31,0.5); % FIR secondary path system model

mu = 0.008; % Adjoint LMS step size

ha = adaptfilt.adjlms(32,mu,1,b);

[y,e] = filter(ha,x,d);

plot(1:1000,d,'b',1:1000,e,'r');

title('Active Noise Control of a Random Noise Signal');

legend('Original','Attenuated');

xlabel('Time Index');

ylabel('Signal Value');

grid on;

Reviewing the figure shows that the adaptive filter attenuates

the original noise signal as you expect.

a4c26d1e5885305701be709a3d33442f.png

See Also

References

Wan, Eric., "Adjoint LMS: An Alternative to Filtered-X LMS and

Multiple Error LMS," Proceedings of the International Conference on

Acoustics, Speech, and Signal Processing (ICASSP), pp. 1841-1845,

1997

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值