File Comparison Report
C:\Users\richardm\OneDrive - Samtec\Documents\research\MLSE\MLSE_U1_c_178A.m vs. C:\Users\richardm\OneDrive - Samtec\COM\COM\src\com_fcts\MLSE_U1_c_178A.m
richardm
12-Aug-2024
Files
Left File | Right File | |
File name | MLSE_U1_c_178A | MLSE_U1_c_178A |
File path | C:\Users\richardm\OneDrive - Samtec\Documents\research\MLSE | C:\Users\richardm\OneDrive - Samtec\COM\COM\src\com_fcts |
Last modified | 12-Aug-2024 14:30:45 | 15-May-2024 16:20:08 |
Environment
MATLAB | 9.14 (R2023a) |
Comparison Results
+ | Insertion | − | Deletion | ≠ | Modification |
1 | function [MLSE_results] = MLSE_U1_c_178A(param,b,A_s,A_ni,PDF,CDF,PSD_results) | 1 | function [MLSE_results] = MLSE_U1_c_178A(param,b,A_s,A_ni,PDF,CDF,PSD_results) | ||
2 | if 1 | 2 | if 1 | ||
3 | num_ui=param.num_ui_RXFF_noise; | 3 | num_ui=param.num_ui_RXFF_noise; | ||
4 | M=param.samples_per_ui; | 4 | M=param.samples_per_ui; | ||
5 | L=param.levels; | 5 | L=param.levels; | ||
6 | sigma_X2=(L^2-1)/(3*(L-1)^2); | 6 | sigma_X2=(L^2-1)/(3*(L-1)^2); | ||
7 | f_b=param.fb; | 7 | f_b=param.fb; | ||
8 | end | 8 | end | ||
9 | COM_from_matlab=20*log10(A_s/A_ni); | 9 | COM_from_matlab=20*log10(A_s/A_ni); | ||
10 | DER_DFE= 2*(L-1)/L*CDF_ev(A_s,PDF, CDF); | 10 | DER_DFE= 2*(L-1)/L*CDF_ev(A_s,PDF, CDF); | ||
11 | S_ni=PSD_results.Sn_rho; | 11 | S_ni=PSD_results.Sn_rho; | ||
12 | R_ni=ifft(S_ni)*f_b; | 12 | R_ni=ifft(S_ni)*f_b; | ||
13 | p_scaled_by_b=scalePDF(PDF,b(1)); | 13 | p_scaled_by_b=scalePDF(PDF,b(1)); | ||
14 | p_j=conv_fct(PDF,p_scaled_by_b); | 14 | p_j=conv_fct(PDF,p_scaled_by_b); | ||
15 | p_scaled_by_1mb=scalePDF(PDF,1-b(1)); | 15 | p_scaled_by_1mb=scalePDF(PDF,1-b(1)); | ||
− | 16 | %% %% shakiba_3dj_01_2407 (to add MLSE sequence truncation penalty) |
| ||
17 | p_trunc = PDF; | ||||
18 | % | 16 | % | ||
19 | j=1; DER_MLSE=0; DER_MLSE_j= inf; | 17 | j=1; DER_MLSE=0; DER_MLSE_j= inf; | ||
20 | P_j.y=cumsum(p_j.y); | 18 | P_j.y=cumsum(p_j.y); | ||
21 | smallest_relative_change=.0001; | 19 | smallest_relative_change=.0001; | ||
22 | %% 178A–37 | 20 | %% 178A–37 | ||
23 | rou=R_ni'/R_ni(1); | 21 | rou=R_ni'/R_ni(1); | ||
24 | if DER_DFE <= param.DER_CDR | 22 | if DER_DFE <= param.DER_CDR | ||
25 | while j <= floor(num_ui/2) && DER_MLSE_j> DER_MLSE*smallest_relative_change | 23 | while j <= floor(num_ui/2) && DER_MLSE_j> DER_MLSE*smallest_relative_change | ||
26 | u_j=[ 1;(1-b(1))*ones(j-1,1); (-1)^(j+1)*b(1) ] ;% Eq slide (178A–38) | 24 | u_j=[ 1;(1-b(1))*ones(j-1,1); (-1)^(j+1)*b(1) ] ;% Eq slide (178A–38) | ||
27 | u_j(2:2:end-1)=-u_j(2:2:end-1); | 25 | u_j(2:2:end-1)=-u_j(2:2:end-1); | ||
28 | % V_j=toeplitz(R_ni(1:j+1).'/R_ni(1)); | 26 | % V_j=toeplitz(R_ni(1:j+1).'/R_ni(1)); | ||
29 | V_j=toeplitz(rou(1:j+1)); | 27 | V_j=toeplitz(rou(1:j+1)); | ||
30 | P_j=cumsum(p_j.y); | 28 | P_j=cumsum(p_j.y); | ||
31 | DER_MLSE_j= ((L-1)/L)^(j-1) * ( CDF_ev( A_s *(u_j.'* u_j )^(3/2)/( u_j.'*V_j*u_j)^(1/2), p_j, P_j ) ) ; % CDF_ev is (1-CDF) | 29 | DER_MLSE_j= ((L-1)/L)^(j-1) * ( CDF_ev( A_s *(u_j.'* u_j )^(3/2)/( u_j.'*V_j*u_j)^(1/2), p_j, P_j ) ) ; % CDF_ev is (1-CDF) | ||
32 | % DER_MLSE_j= 2*(3/4)^(j) * ( CDF_ev( A_s *(u_j.'* u_j )^(3/2)/( u_j.'*V_j*u_j)^(0.5), p_j, P_j ) ) ; % CDF_ev is (1-CDF) | 30 | % DER_MLSE_j= 2*(3/4)^(j) * ( CDF_ev( A_s *(u_j.'* u_j )^(3/2)/( u_j.'*V_j*u_j)^(0.5), p_j, P_j ) ) ; % CDF_ev is (1-CDF) | ||
33 | DER_MLSE=DER_MLSE+DER_MLSE_j; | 31 | DER_MLSE=DER_MLSE+DER_MLSE_j; | ||
34 | p_j=conv_fct(p_j,p_scaled_by_1mb); | 32 | p_j=conv_fct(p_j,p_scaled_by_1mb); | ||
− | 35 | %% %% shakiba_3dj_01_2407(to add MLSE sequence truncation penalty) |
| ||
36 | if j == param.trunc | ||||
37 | u_trunc = u_j(1:j); | ||||
38 | V_trunc = V_j(1:j, 1:j); | ||||
39 | P_trunc = cumsum(p_trunc.y); | ||||
40 | DER_MLSE_trunc = DER_MLSE_trunc+L*((L-1)/L)^(j-1)*CDF_ev(A_s*(u_trunc'*u_trunc)^(3/2)/(u_trunc'*V_trunc*u_trunc)^(1/2), p_trunc, P_trunc); | ||||
41 | elseif j < param.trunc | ||||
42 | DER_MLSE_trunc = DER_MLSE; | ||||
43 | p_trunc = conv_fct(p_trunc, p_scaled_by_1mb); % Convolves trunc-1 times | ||||
44 | end | ||||
≠ | 45 | j=j+1; | ≠ | 33 | j=j+1; |
46 | end | 34 | end | ||
≠ | 47 | %% healey_3dj_01a_2407 | ≠ | 35 | %% Eq (178A–36) a |
− | 48 | if param.Q_budget_adj == 0 |
| ||
49 | Q_budget_adj=0; | ||||
50 | else | ||||
51 | Q_budget_adj=param.Q_budget_adj(1) -param.Q_budget_adj(2)*COM_from_matlab; | ||||
52 | end | ||||
53 | %% shakiba_3dj_01_2407 | ||||
≠ | 54 | % delta_com=20*log10(1/A_s *-CDF_inv_ev ( DER_MLSE ,PDF,CDF ) )- param.Q ;% shakiba_3dj_01_2405 | ≠ | 36 | delta_com=20*log10(1/A_s *-CDF_inv_ev ( DER_MLSE,PDF,CDF ) )- param.Q ;% shakiba_3dj_01_2405 |
− | 55 | delta_com=20*log10(1/A_s *-CDF_inv_ev ( DER_MLSE_trunc,PDF,CDF ) )- Q_budget_adj ;% shakiba_3dj_01_2405 |
| ||
56 | %% shakiba_3dj_01_2407 | ||||
≠ | 57 | % delta_com=20*log10(1/A_s *-CDF_inv_ev ( 2/3*DER_MLSE,PDF,CDF ) )- Q ;% (178A–36) | ≠ | 37 | % delta_com=20*log10(1/A_s *-CDF_inv_ev ( 2/3*DER_MLSE,PDF,CDF ) )- param.Q ;% (178A–36) |
58 | new_com=COM_from_matlab+delta_com; | 38 | new_com=COM_from_matlab+delta_com; | ||
− | 59 | if(delta_com<0) |
| ||
60 | delta_com=0; | ||||
61 | warning('MLSE truncation failed. Try increasing trunc') | ||||
62 | try | ||||
63 | hx=msgbox('MLSE truncation failed. Try increasing N_tc','warning','warn'); | ||||
64 | set(hx,'Color',[1 0 1]); | ||||
65 | movegui(hx,[randn randn]*100) | ||||
66 | set(hx,'Tag','COM') % | ||||
67 | catch | ||||
68 | end | ||||
69 | end | ||||
70 | else | 39 | else | ||
71 | warning('MLSE not applied because the DER is less than that required for the CDR to lock') | 40 | warning('MLSE not applied because the DER is less than that required for the CDR to lock') | ||
72 | DER_MLSE=NaN; | 41 | DER_MLSE=NaN; | ||
73 | new_com=COM_from_matlab; | 42 | new_com=COM_from_matlab; | ||
| + | 43 | delta_com=0; | ||
74 | delta_com=0; | 44 | delta_com=0; | ||
− | 75 | Q=0; |
| ||
76 | Q_budget_adj=0; | ||||
77 | %% shakiba_3dj_01_2407 | ||||
78 | end | 45 | end | ||
79 | 46 | ||||
80 | %% | 47 | %% | ||
− | 81 | MLSE_results.DER_MLSE_trunc = DER_MLSE_trunc;% shakiba_3dj_01_2407 (to add MLSE sequence truncation penalty) |
| ||
82 | MLSE_results.Q_budget_adj=Q_budget_adj; % healey_3dj_01a_2407 | ||||
83 | MLSE_results.COM_from_matlab=COM_from_matlab; | 48 | MLSE_results.COM_from_matlab=COM_from_matlab; | ||
84 | MLSE_results.DER_MLSE=DER_MLSE; | 49 | MLSE_results.DER_MLSE=DER_MLSE; | ||
85 | MLSE_results.DER_DFE=DER_DFE; | 50 | MLSE_results.DER_DFE=DER_DFE; | ||
86 | MLSE_results.COM=new_com; | 51 | MLSE_results.COM=new_com; | ||
87 | MLSE_results.delta_com=delta_com; | 52 | MLSE_results.delta_com=delta_com; | ||
88 | 53 | ||||
89 | 54 | ||||
90 | 55 | ||||
91 | 56 |