git-svn-id: http://moon:8086/svn/matlab/trunk@157 801c6759-fa7c-4059-a304-17956f83a07c
55 lines
853 B
Matlab
Executable File
55 lines
853 B
Matlab
Executable File
function fse_eval()
|
|
|
|
N = 7;
|
|
M = 2;
|
|
L = 5000;
|
|
mu = 0.05;
|
|
|
|
% Model source
|
|
j = sqrt(-1);
|
|
s(1:2:L) = 0.5-(rand(L/2,1)) + (0.5-(rand(L/2,1)))*j;
|
|
s(2:2:L) = 2*(0.5-round(rand(L/2,1))) + 2*(0.5-round(rand(L/2,1)))*j;
|
|
s = 1/sqrt(2)*s';
|
|
|
|
|
|
% Model channel
|
|
cb = 1;
|
|
ca = [1 0.7];
|
|
hd = zeros(N,1);
|
|
hd(fix(N/2)) = 1;
|
|
|
|
% Filter source
|
|
r = [zeros(1,N-1) filter(cb,ca,s)']';
|
|
awgn = 2*(0.5-randn(L+N-1,1)) + 2*(0.5-randn(L+N-1,1))*j;
|
|
r = r + 0.0004*awgn;
|
|
f = [0 zeros(1, N-1)]';
|
|
d = filter(hd,1,s(2:M:L));
|
|
|
|
k = 0;
|
|
for n=1:M:L-N
|
|
k = k + 1;
|
|
x = r(N+n-1:-1:n);
|
|
y(k) = f'*x;
|
|
e(k) = d(k) - y(k);
|
|
f = f + mu*conj(e(k))*x;
|
|
end;
|
|
ss = filter(f,1,r);
|
|
|
|
close all;
|
|
figure(1)
|
|
plot(abs(e))
|
|
grid
|
|
|
|
figure(2)
|
|
plot(r,'g+')
|
|
hold on
|
|
plot(ss,'bx')
|
|
plot(s,'ro')
|
|
hold off
|
|
grid
|
|
|
|
figure(3)
|
|
plot(1:k, abs(y));
|
|
grid
|
|
|
|
f |