git-svn-id: http://moon:8086/svn/matlab/trunk@32 801c6759-fa7c-4059-a304-17956f83a07c
41 lines
902 B
Matlab
41 lines
902 B
Matlab
function [ref_c ref_p ref_a] = getRefGain(spec_occ, ofdm_params, sym_count)
|
|
|
|
switch ofdm_params.mode
|
|
case 'A'
|
|
ref_c = [];
|
|
ref_p = [];
|
|
ref_a = [];
|
|
error ('Implement Mode A!');
|
|
|
|
case 'B'
|
|
k0 = 1;
|
|
x = 2;
|
|
y = 3;
|
|
k = (spec_occ.kmin:1:spec_occ.kmax);
|
|
ref_c = 1 + 2*mod(sym_count,3)+6*k;
|
|
ref_c(find(ref_c > spec_occ.kmax)) = [];
|
|
ref_c(find(ref_c < spec_occ.kmin)) = [];
|
|
n = mod(sym_count, y);
|
|
m = floor(sym_count/y);
|
|
p = (ref_c - k0 - n*x)/(x*y);
|
|
ref_p = mod(4*ofdm_params.Z(n+1,m+1) + p*ofdm_params.W(n+1,m+1) + p.*p*(1+sym_count)*ofdm_params.Q, 1024);
|
|
ref_a = sqrt(2)*ones(1,length(ref_c));
|
|
|
|
case 'C'
|
|
ref_c = [];
|
|
ref_p = [];
|
|
ref_a = [];
|
|
error ('Implement Mode C!');
|
|
|
|
case 'D'
|
|
ref_c = [];
|
|
ref_p = [];
|
|
ref_a = [];
|
|
error ('Implement Mode D!');
|
|
|
|
case 'E'
|
|
ref_c = [];
|
|
ref_p = [];
|
|
ref_a = [];
|
|
error ('Implement Mode E!');
|
|
end; |