Can someone please help me(provide me) with Bilinear LMS algo along with MATLAB code?
1 回表示 (過去 30 日間)
古いコメントを表示
I am working on the estimation of 3 phase symmetrical components using Bilinear LMS algorithm. The equation is expanded in bilinear form and components are to be estimated using LMS algo. What I need help is with the code of Bilinear LMS, my code should give the output for 500 samples, however, after only 10 samples the output tends to infinite( NaN).
0 件のコメント
回答 (3 件)
Abraham Boayue
2018 年 3 月 22 日
There are different formulations of the bilinear lms algorithm on the Internet. Perhaps you can post the one you are working with. The lms algorithm and its variants are usually not difficult to code.
Abraham Boayue
2018 年 3 月 22 日
Hey Anuj; I wrote a function based on your algorithm and tested it on a channel estimation problem. The image below is a sample average of the cost function, however, I still have some questions that I need your response to before making any conclusion. I assumed that x and y are the input signals, with input vectors, XA, XB and XC. In addition, I took N1 = N2 for the forward and recursive coefficient vectors, A, B and C. Are there assumptions realistic concerning your problem?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/180339/image.png)
Abraham Boayue
2018 年 4 月 7 日
編集済み: Abraham Boayue
2018 年 4 月 7 日
Here is the code.
function [e,A,B,C,Wa,Wb,Wc,ya,yb,yc] = BilinearLMS(x,y,d,mua,mub,muc,M1,M2)
% Define length of signal vectors
N1 = length(x);
N = length(y);
% Initialize coefficient vectors
A = zeros(M1,1); Wa = zeros(M1,N);
B = zeros(M1,1); Wb = zeros(M1,N);
C = zeros(M2,1); Wc = zeros(M2,N);
% Initialize the regressors for input signals
ua = zeros(1,M1);
ub = ua;
uc = zeros(1,M2);
% Initialize the output signal vectors
ya = zeros(1,N1);
yb = ya;
yc = zeros(1,N);
e = zeros(1,N);
delay = 1;
% Perform the bilinear lms
for k = 1:N
ua = [x(k),ua(1:M1-1)];
y = [zeros(1,delay) y(1,1:N-delay)];
uc = [y(k),uc(1:M2-1)];
ub = [x(k)*y(k),ub(1:M2-1)];
ya(k) = ua*A;
yb(k) = ub*B;
yc(k) = uc*C;
e(k) = d(k)-(ya(k)+ yb(k)+ yc(k));
A = A + mua*ua'*e(k); Wa(:,k) = A;
B = B + mub*ub'*e(k); Wb(:,k) = B;
C = C + muc*uc'*e(k); Wc(:,k) = C;
end
end
clear
close all
% Parameters
N = 1000; % number of iterations
L = 500; % number of runs
M1 = 4;
M2 = 4;
mua = 0.01;
mub = 0.03;
muc = 0.06;
sigman = sqrt(0.01);
h = [1 0.5 -1 2]'; % Channel
% Initialization
J_ave = zeros(1,N);
w1 = zeros(1,N);
w2 = zeros(1,N);
w3 = zeros(1,N);
w4 = zeros(1,N);
for k = 1:L
v = sigman*randn(1,N); % adiditive noise at channel output
x = randn(1,N); % input signals x and y,
y = x;
d = filter(h,1,x)+v;
[e,A,B,C,Wa,Wb,Wc,ya,yb,yc]=BilinearLMS(x,y,d,mua,mub,muc,M1,M2);
J_ave = J_ave + abs(e).^2;
w1 = w1 + Wa(1,:);
w2 = w2 + Wa(2,:);
w3 = w3 + Wa(3,:);
w4 = w4 + Wa(4,:);
end
ind = 0:N-1;
J_ave = J_ave/L;
J_ave = 10*log10(J_ave);
w1 = w1/L;
w2 = w2/L;
w3 = w3/L;
w4 = w4/L;
% Color codes
s = distinguishable_colors(60);
%figure : Average MSE ,J(ei)
figure
plot(ind,J_ave,'linewidth',3,'color', s(38,:));
grid
a =title('Using Bilinear LMS J_{average} = |e(i)|^2 over N = 500');
set(a,'fontsize',14);
a = xlabel('NO. OF ITERATIONS');
set(a,'fontsize',14);
a = ylabel('MSE dB');
set(a,'fontsize',14);
% figure : Average estimated coefficient vector
% A = [1.0011 0.4906 -1.0011 2.0066] ,w1 to w4
figure
indw = 0:N-1;
plot(indw,w1,'linewidth',2,'color', s(1,:));
hold on
plot(indw,w2,'linewidth',2,'color', s(2,:));
plot(indw,w3,'linewidth',2,'color', s(7,:));
plot(indw,w4,'linewidth',2,'color', s(26,:));
a = title('Estimated coefficients');
set(a,'fontsize',14);
a = xlabel('NO. OF ITERATIONS');
set(a,'fontsize',14);
a = ylabel('coef. trajectories');
set(a,'fontsize',14);
grid
% %%
% figure
% image(reshape(s,[1 size(s)]))
%
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!