Products & Services Solutions Academia Support User Community Company

Learn more about Filter Design Toolbox   

msesim - Measured mean-squared error for adaptive filter

Syntax

mse = msesim(ha,x,d)
[mse,meanw,w,tracek] = msesim(ha,x,d)
[mse,meanw,w,tracek] = msesim(ha,x,d,m)

Description

mse = msesim(ha,x,d) returns the sequence of mean-square errors in column vector mse. The vector contains estimates of the mean-square error of the adaptive filter at each time instant during adaptation. The length of mse is equal to size(x,1). The columns of matrix x contain individual input signal sequences, and the columns of the matrix d contain corresponding desired response signal sequences.

[mse,meanw,w,tracek] = msesim(ha,x,d) calculates three parameters that correspond to the simulated behavior of the adaptive filter defined by ha:

[mse,meanw,w,tracek] = msesim(ha,x,d,m) specifies an optional input argument m that is the decimation factor for computing meanw, mse, and tracek. When m > 1, msepsim saves every mth predicted value of each of these sequences. When you omit the optional argument m, it defaults to one.

Examples

Simulation of a 32-coefficient FIR filter using 25 trials, each trial having 2000 iterations of the adaptation process.

x = zeros(2000,25); d = x;          % Initialize variables
ha = fir1(31,0.5);                  % FIR system to be identified
x = filter(sqrt(0.75),[1 -0.5],sign(randn(size(x)))); 
n = 0.1*randn(size(x));             % Observation noise signal
d = filter(ha,1,x)+n;               % Desired signal
l = 32;                             % Filter length
mu = 0.008;                         % LMS Step size.
m  = 5;                             % Decimation factor for analysis 
                                    % and simulation results
ha = adaptfilt.lms(l,mu);
[simmse,meanWsim,Wsim,traceKsim] = msesim(ha,x,d,m);
nn = m:m:size(x,1);   
subplot(2,1,1);
plot(nn,meanWsim(:,12),'b',nn,meanWsim(:,13:15),'b');
title('Average Coefficient Trajectories for W(12), W(13),... 
W(14) and W(15)');
xlabel('Time Index'); ylabel('Coefficient Value');
subplot(2,2,3);
semilogy(nn,simmse);
title('Mean-Square Error Performance'); axis([0 size(x,1) 0.001... 
10]);
legend('Measured MSE');
xlabel('Time Index'); ylabel('Squared Error Value');
subplot(2,2,4);
semilogy(nn,traceKsim);
title('Sum-of-Squared Coefficient Errors'); axis([0 size(x,1)... 
0.0001 1]);
xlabel('Time Index'); ylabel('Squared Error Value');

Calculating the mean squared error for an adaptive filter is one measure of the performance of the adapting algorithm. In this figure, you see a variety of measures of the filter, including the error values.

See Also

filter, msepred

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS