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;
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
+3 -3
View File
@@ -248,16 +248,16 @@ for k=start:length(Z_)
sym_out(:, kk) = ZZ ./ H;
if 1
subplot(2, 1, 1)
plot(0:length(H)-1, abs(H)); grid; title('abs(H)'); axis([0 length(H)-1 0 15+0*max(abs(H))]); title(str);
plot(ofdm_spec_occ.kmin:ofdm_spec_occ.kmax, abs(H)); grid; title('abs(H)'); axis([ofdm_spec_occ.kmin ofdm_spec_occ.kmax 0 15+0*max(abs(H))]); title(str);
subplot(2, 1, 2)
plot(0:length(H)-1, angle(H)); grid; title('phi(H)'); axis([0 length(H)-1 -4 4]); title(str);
plot(ofdm_spec_occ.kmin:ofdm_spec_occ.kmax, angle(H)); grid; title('phi(H)'); axis([ofdm_spec_occ.kmin ofdm_spec_occ.kmax -4 4]); title(str);
else
hold on;
plot(sym_out(:, kk), '+');
hold off;
grid; title('Sym');
end
pause(0.025);
pause(0.01);
else
ii = [H_gain_carriers_cell{1:6}]
H = H_gain;