getRefGain.m

- fixed superpositiion of gain, time and freq references
- RX: beautify plot

git-svn-id: http://moon:8086/svn/matlab/trunk@45 801c6759-fa7c-4059-a304-17956f83a07c
This commit is contained in:
2015-04-30 19:39:04 +00:00
parent c5c6c37848
commit be93069dd0
2 changed files with 33 additions and 8 deletions
+30 -5
View File
@@ -18,10 +18,6 @@ mag = sqrt(2);
ref_a = mag*ones(1,length(k));
ref_c = k;
for b=spec_occ.boost
ref_a(find(ref_c == b)) = 2*mag;
end
switch ofdm_params.mode
case 'A'
@@ -41,5 +37,34 @@ switch ofdm_params.mode
ref_p = [];
ref_a = [];
error ('Implement Mode E!');
end;
% Fix superposition of carriers
[freqRef_c, freqRef_p, freqRef_a] = getRefFreq(ofdm_params.mode);
[ref_c, ref_p, ref_a] = fix_superposition(ref_c, ref_p, ref_a, freqRef_c, freqRef_p, freqRef_a);
if (s == 0)
[timeRef_c, timeRef_p, timeRef_a] = getRefTime(ofdm_params.mode);
[ref_c, ref_p, ref_a] = fix_superposition(ref_c, ref_p, ref_a, timeRef_c, timeRef_p, timeRef_a);
end
for b=spec_occ.boost
ref_a(find(ref_c == b)) = sqrt(4);
end
function [new_c, new_p, new_a] = fix_superposition(ref_c, ref_p, ref_a, super_c, super_p, super_a)
new_c = ref_c;
new_p = ref_p;
new_a = ref_a;
end;
super_index = 1;
for c=super_c
curr_index = find(ref_c == c);
if (~isempty(curr_index))
new_p(curr_index) = super_p(super_index);
new_a(curr_index) = super_a(super_index);
end
super_index = super_index + 1;
end