-
Notifications
You must be signed in to change notification settings - Fork 0
/
fnDFE.m
82 lines (67 loc) · 2.62 KB
/
fnDFE.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
function [ hDFE, vy, vyDcs ] = fnDFE( hDFE, vu, tsPos, txSym )
% DFE Upgrade
% Miz.Wong
vy = zeros(length(vu), 1);
vyDcs = [];
vyd = zeros(length(vu), 1);
hDFE.e = zeros(length(vu), 1);
% -------------------1/Z-----1/Z-----1/Z ... 1/Z--|
% | | | | ... |
% | | | | ... |
% | / w1 w2 w3 wN
% | / | | | |
% | / -------------------------
% | / | + |------------------------------------ y
% |/ ------------------------- | |
% RLS \ | | | | Decision |
% | \ wL wL-1 wL-2 w1 | |
% | \ | | | | | |
% | | | | | | |
% | ---1/Z-----1/Z-----1/Z-----1/Z-----/ -Training Sequence |
% | | |
% | | |
% |----------------------------------Calc error-----------------------|
for ii = 1 : 1 : length(vu)
% Step 1 . FFF
if ii < hDFE.FFTAPs + 1
yFF(ii) = [zeros(1,hDFE.FFTAPs-ii),vu(1:ii).'] * hDFE.wFF;
else
yFF(ii) = vu(ii-hDFE.FFTAPs+1:ii).' * hDFE.wFF;
end
% Step 2 . FBF
if ii-1 < hDFE.FBTAPs + 1
yFB(ii) = [zeros(1,hDFE.FBTAPs-(ii-1)),vyd(1:(ii-1)).'] * hDFE.wFB;
else
yFB(ii) = vyd((ii-1)-hDFE.FBTAPs+1:(ii-1)).' * hDFE.wFB;
end
% Step 3 . Calc yout
vy(ii) = yFF(ii) + yFB(ii);
% Step 4 . Decision
tmpDcs = step(hDFE.hDEM, vy(ii));
vyDcs = [vyDcs, tmpDcs'];
% Step 5 . Calc error
if ismember(ii, tsPos)
vyd(ii) = txSym(ii);
else
vyd(ii) = step(hDFE.hMOD, tmpDcs);
end
hDFE.e(ii) = vyd(ii) - vy(ii);
% Step 6 . Adaptive upgrading
if ii < hDFE.FFTAPs + 1
FFInput = [zeros(1,hDFE.FFTAPs-ii),vu(1:ii).'].';
else
FFInput = vu(ii-hDFE.FFTAPs+1:ii);
end
if ii-1 < hDFE.FBTAPs + 1
FBInput = [zeros(1,hDFE.FBTAPs-(ii-1)),vyd(1:(ii-1)).'].';
else
FBInput = vyd((ii-1)-hDFE.FBTAPs+1:(ii-1));
end
[deltaW, hDFE.hRLS] = fnRLS( hDFE.hRLS, [FFInput;FBInput], hDFE.e(ii), 0 );
deltaW_FF = deltaW(1:hDFE.FFTAPs);
deltaW_FB = deltaW(end-hDFE.FBTAPs+1:end);
% Step 7 . Upgrade weight
hDFE.wFF = hDFE.wFF + deltaW_FF;
hDFE.wFB = hDFE.wFB + deltaW_FB;
end
end