IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Commit 36d8a9bb authored by Martin Hudlicka's avatar Martin Hudlicka
Browse files

Updated code

parent 1cdb16d1
...@@ -28,7 +28,7 @@ function [G_OPT,EVM] = F_EVM_Computation_on_Symbols(params,Symb,Sideal) ...@@ -28,7 +28,7 @@ function [G_OPT,EVM] = F_EVM_Computation_on_Symbols(params,Symb,Sideal)
G_OPT = CC / AC ; % Gsymb = CC / ACideal; G_OPT = CC / AC ; % Gsymb = CC / ACideal;
fprintf('Optimum gain on symbols for EVM computation\n'); fprintf('Optimum gain on symbols for EVM computation\n');
fprintf(' amplitude = %8.6f phase = %8.2f \n',... fprintf(' amplitude = %8.6f phase = %8.2f °\n',...
abs(G_OPT), angle(G_OPT) * 180 / pi ); abs(G_OPT), angle(G_OPT) * 180 / pi );
% EVM Calculation same as the single-carrier case Section 5.1.2.5 % EVM Calculation same as the single-carrier case Section 5.1.2.5
...@@ -42,7 +42,7 @@ function [G_OPT,EVM] = F_EVM_Computation_on_Symbols(params,Symb,Sideal) ...@@ -42,7 +42,7 @@ function [G_OPT,EVM] = F_EVM_Computation_on_Symbols(params,Symb,Sideal)
% cos2 = real(CC*conj(CC) / AC / ACideal); % cos2 = real(CC*conj(CC) / AC / ACideal);
% if structGlobal.printdebug % if structGlobal.printdebug
% fprintf('Angle between measured symbols and reference symbols\n'); % fprintf('Angle between measured symbols and reference symbols\n');
% fprintf(' cos2 = %8.6f angle = %10.6f \n',cos2,acosd(sqrt(cos2))); % fprintf(' cos2 = %8.6f angle = %10.6f °\n',cos2,acosd(sqrt(cos2)));
% end % end
% EVM = sqrt(1/cos2-1); % = tangent of angle % EVM = sqrt(1/cos2-1); % = tangent of angle
...@@ -54,20 +54,7 @@ function [G_OPT,EVM] = F_EVM_Computation_on_Symbols(params,Symb,Sideal) ...@@ -54,20 +54,7 @@ function [G_OPT,EVM] = F_EVM_Computation_on_Symbols(params,Symb,Sideal)
Symb = Symb * G_OPT * params.Ac; Symb = Symb * G_OPT * params.Ac;
Sideal = Sideal * params.Ac; Sideal = Sideal * params.Ac;
if structGlobal.tracedebug >0 if structGlobal.tracedebug >0
figure1 = figure(25); clf; grid on; box on; F_Plot_Constellation_Diagram_OFDM(Sideal,Symb,params);
hold on; axis('square');
axis([-params.N/2 params.N/2 -params.N/2 params.N/2]);
set(gca,'XTick',(-params.N/2:1:params.N/2));
set(gca,'YTick',(-params.N/2:1:params.N/2));
title('Ideal and measured symbols constellations');
plot(real(Symb(1:params.Nc*params.NS)),imag(Symb(1:params.Nc*params.NS)),'ro')
plot(real(Sideal(1:params.Nc*params.NS)),imag(Sideal(1:params.Nc*params.NS)),'k*');
plot(params.Ac*cos(pi*(0:360)/180),params.Ac*sin(pi*(0:360)/180),'-b');
% Saving figure as graphic file in current directory (plot must still be present in MATLAB plot window)
stri_fig = fullfile(structGlobal.evm_results_folder,strcat(structGlobal.filename,'_baseline.jpg')); % Change file naming to save as needed
set(figure1,'PaperPositionMode','auto');
print(figure1,stri_fig,'-djpeg','-r0');
end end
end end
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment