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

Commit c78e4353 authored by Martin Hudlicka's avatar Martin Hudlicka
Browse files

license text added

parent 6d7fcb35
function params = F_Basic_Communication_Parameters() function params = F_Basic_Communication_Parameters()
%
% This function defines the basic communication parameters for the P1765 % Copyright 2021 IEEE P1765 Authors
% Baseline EVM Algorithm code for OFDM %
% * Redistribution and use in source and binary forms, with or without modification,
% are permitted provided that the following conditions are met:
%
% * Redistributions of source code must retain the above copyright notice,
% this list of conditions and the following disclaimer.
%
% * Redistributions in binary form must reproduce the above copyright notice,
% this list of conditions and the following disclaimer in the documentation
% and/or other materials provided with the distribution.
%
% * Neither the name of the copyright holder nor the names of its contributors
% may be used to endorse or promote products derived from this software without
% specific prior written permission.
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
% DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
% SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
% OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
% USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%
% SPDX-License-Identifier: BSD-3-Clause
%
% See the LICENSE file distributed with this work for copyright and licensing
% information, the AUTHORS file for a list of copyright holders, and the
% CONTRIBUTORS file for the list of contributors.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This function defines the basic communication parameters for the P1765
% Baseline EVM Algorithm code for OFDM
global structGlobal global structGlobal
...@@ -110,4 +145,4 @@ function params = F_Basic_Communication_Parameters() ...@@ -110,4 +145,4 @@ function params = F_Basic_Communication_Parameters()
fprintf('\n'); fprintf('\n');
end end
end end
\ No newline at end of file
function [G_OPT,EVM] = F_EVM_Computation_on_Symbols(params,Symb,Sideal) function [G_OPT,EVM] = F_EVM_Computation_on_Symbols(params,Symb,Sideal)
%
% This function performs EVM computation on symbols according to Section % Copyright 2021 IEEE P1765 Authors
% 5.2.1.5 of the IEEE P1765 Baseline EVM Algorithm for OFDM: %
% Determine the EVM of the User-Lab and Reference-Lab Measured Waveforms % * Redistribution and use in source and binary forms, with or without modification,
% % are permitted provided that the following conditions are met:
% Inputs: %
% Symb or r(nT): Recovered OFDM symbols % * Redistributions of source code must retain the above copyright notice,
% Sideal: Ideal OFDM symbols from ideal signal % this list of conditions and the following disclaimer.
% params: structure containing the basic communication paramters %
% % * Redistributions in binary form must reproduce the above copyright notice,
% Outputs: % this list of conditions and the following disclaimer in the documentation
% G_OPT: Optimum gain on symbols for EVM computation % and/or other materials provided with the distribution.
% EVM or Baseline signal EVM: Baseline rms EVM in percent %
% * Neither the name of the copyright holder nor the names of its contributors
% may be used to endorse or promote products derived from this software without
% specific prior written permission.
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
% DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
% SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
% OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
% USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%
% SPDX-License-Identifier: BSD-3-Clause
%
% See the LICENSE file distributed with this work for copyright and licensing
% information, the AUTHORS file for a list of copyright holders, and the
% CONTRIBUTORS file for the list of contributors.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This function performs EVM computation on symbols
% Refer to Section: Determine the EVM of the User-Lab and Reference-Lab
% Measured Waveforms in the IEEE P1765 Document.
%
% Inputs:
% Symb or r(nT): Recovered OFDM symbols
% Sideal: Ideal OFDM symbols from ideal signal
% params: structure containing the basic communication paramters
%
% Outputs:
% G_OPT: Optimum gain on symbols for EVM computation
% EVM or Baseline signal EVM: Baseline rms EVM in percent
global structGlobal global structGlobal
...@@ -28,7 +63,7 @@ function [G_OPT,EVM] = F_EVM_Computation_on_Symbols(params,Symb,Sideal) ...@@ -28,7 +63,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 +77,7 @@ function [G_OPT,EVM] = F_EVM_Computation_on_Symbols(params,Symb,Sideal) ...@@ -42,7 +77,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
...@@ -57,4 +92,4 @@ function [G_OPT,EVM] = F_EVM_Computation_on_Symbols(params,Symb,Sideal) ...@@ -57,4 +92,4 @@ function [G_OPT,EVM] = F_EVM_Computation_on_Symbols(params,Symb,Sideal)
F_Plot_Constellation_Diagram_OFDM(Sideal,Symb,params); F_Plot_Constellation_Diagram_OFDM(Sideal,Symb,params);
end end
end end
\ No newline at end of file
function Symb = F_OFDM_Symbols_Recovery(params,xF) function Symb = F_OFDM_Symbols_Recovery(params,xF)
%
% This function performs the OFDM symbols recovery according to Section % Copyright 2021 IEEE P1765 Authors
% 5.2.1.4 of the IEEE P1765 Baseline EVM Algorithm for OFDM. %
% % * Redistribution and use in source and binary forms, with or without modification,
% Inputs: % are permitted provided that the following conditions are met:
% xF: Time domain signal corrected for optimal time delay and %
% after normalization of signal average power % * Redistributions of source code must retain the above copyright notice,
% params: structure containing the basic communication paramters % this list of conditions and the following disclaimer.
% %
% Output: % * Redistributions in binary form must reproduce the above copyright notice,
% Symb or r(nT): Recovered OFDM symbols % this list of conditions and the following disclaimer in the documentation
% % and/or other materials provided with the distribution.
% When applied to ideal signal, this function recovers ideal symbols. %
% * Neither the name of the copyright holder nor the names of its contributors
% may be used to endorse or promote products derived from this software without
% specific prior written permission.
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
% DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
% SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
% OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
% USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%
% SPDX-License-Identifier: BSD-3-Clause
%
% See the LICENSE file distributed with this work for copyright and licensing
% information, the AUTHORS file for a list of copyright holders, and the
% CONTRIBUTORS file for the list of contributors.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This function performs the OFDM symbols recovery.
% Refer to Section: Determination of Symbol Values
% in the IEEE P1765 document.
%
% Inputs:
% xF: Time domain signal corrected for optimal time delay and
% after normalization of signal average power
% params: structure containing the basic communication paramters
%
% Output:
% Symb or r(nT): Recovered OFDM symbols
%
% When applied to ideal signal, this function recovers ideal symbols.
global structGlobal global structGlobal
......
function [delay,Gsymb,EVM] = F_P1765_OFDM_Baseline_EVM_Algorithm(params,xFideal,xF) function [delay,Gsymb,EVM] = F_P1765_OFDM_Baseline_EVM_Algorithm(params,xFideal,xF)
%
% This function applies the four steps of the P1765 OFDM Baseline EVM % Copyright 2021 IEEE P1765 Authors
% Algorithm, namely, coarse and fine time alignment, OFDM symbol %
% recovery and EVM calculation on symbols. % * Redistribution and use in source and binary forms, with or without modification,
% Refer to Section 5.2 of the IEEE P1765 document. % are permitted provided that the following conditions are met:
%
% * Redistributions of source code must retain the above copyright notice,
% this list of conditions and the following disclaimer.
%
% * Redistributions in binary form must reproduce the above copyright notice,
% this list of conditions and the following disclaimer in the documentation
% and/or other materials provided with the distribution.
%
% * Neither the name of the copyright holder nor the names of its contributors
% may be used to endorse or promote products derived from this software without
% specific prior written permission.
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
% DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
% SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
% OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
% USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%
% SPDX-License-Identifier: BSD-3-Clause
%
% See the LICENSE file distributed with this work for copyright and licensing
% information, the AUTHORS file for a list of copyright holders, and the
% CONTRIBUTORS file for the list of contributors.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This function applies the four steps of the P1765 OFDM Baseline EVM
% Algorithm, namely, coarse and fine time alignment, OFDM symbol
% recovery and EVM calculation on symbols.
% Refer to Section: The P1765 Baseline EVM Algorithm for Multi-Carrier OFDM
% Transmission Formats in the IEEE P1765 document.
global structGlobal global structGlobal
...@@ -15,7 +51,8 @@ function [delay,Gsymb,EVM] = F_P1765_OFDM_Baseline_EVM_Algorithm(params,xFideal, ...@@ -15,7 +51,8 @@ function [delay,Gsymb,EVM] = F_P1765_OFDM_Baseline_EVM_Algorithm(params,xFideal,
fxF = F_fft_direct(params, xF); fxF = F_fft_direct(params, xF);
%% Time alignment (Step1:Coarse, Step2:Fine, Section 5.2.1.2) %% Time alignment (Step1:Coarse, Step2:Fine)
% Refer to Section: Optimal Time Alignment of Waveform 2 to Waveform 1
[delay,fxF] = F_calculateOptimal(params,fxFideal,fxF); [delay,fxF] = F_calculateOptimal(params,fxFideal,fxF);
...@@ -32,7 +69,8 @@ function [delay,Gsymb,EVM] = F_P1765_OFDM_Baseline_EVM_Algorithm(params,xFideal, ...@@ -32,7 +69,8 @@ function [delay,Gsymb,EVM] = F_P1765_OFDM_Baseline_EVM_Algorithm(params,xFideal,
end end
%% OFDM Symbols Recovery (Step3, Section 5.2.1.4) %% OFDM Symbols Recovery (Step3)
% Refer to Section: Determination of Symbol Values
Symb = F_OFDM_Symbols_Recovery(params,xF); Symb = F_OFDM_Symbols_Recovery(params,xF);
...@@ -40,7 +78,9 @@ function [delay,Gsymb,EVM] = F_P1765_OFDM_Baseline_EVM_Algorithm(params,xFideal, ...@@ -40,7 +78,9 @@ function [delay,Gsymb,EVM] = F_P1765_OFDM_Baseline_EVM_Algorithm(params,xFideal,
Sideal = F_OFDM_Symbols_Recovery(params,xFideal); Sideal = F_OFDM_Symbols_Recovery(params,xFideal);
%% EVM Computation on symbols (Step4, Section 5.2.1.5) %% EVM Computation on symbols (Step4)
% % Refer to Section: Determine the EVM of the User-Lab and Reference-Lab
% Measured Waveforms in the IEEE P1765 Document.
[Gsymb,EVM] = F_EVM_Computation_on_Symbols(params, Symb, Sideal); [Gsymb,EVM] = F_EVM_Computation_on_Symbols(params, Symb, Sideal);
......
function F_Plot_Constellation_Diagram_OFDM(Sideal,Symb,params) function F_Plot_Constellation_Diagram_OFDM(Sideal,Symb,params)
%
% This function plots the reference and received signal constellation % Copyright 2021 IEEE P1765 Authors
% diagrams and saves it in the evm_results_folder which was taken as %
% input from the user in F_UserInputs_Rx(). % * Redistribution and use in source and binary forms, with or without modification,
% The constellation diagram is saved with the filename which was taken as % are permitted provided that the following conditions are met:
% input from the user in F_UserInputs_Rx(). %
% This version has been tested on several monitors and resolutions to % * Redistributions of source code must retain the above copyright notice,
% ensure that it plots reliable constellation diagrams without any adjustment. % this list of conditions and the following disclaimer.
% %
% Inputs: % * Redistributions in binary form must reproduce the above copyright notice,
% Sideal: Ideal OFDM symbols from ideal signal % this list of conditions and the following disclaimer in the documentation
% Symb: Recovered OFDM Symbols % and/or other materials provided with the distribution.
% params: Structure containing all the basic communication parameters %
% * Neither the name of the copyright holder nor the names of its contributors
% may be used to endorse or promote products derived from this software without
% specific prior written permission.
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
% DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
% SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
% OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
% USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%
% SPDX-License-Identifier: BSD-3-Clause
%
% See the LICENSE file distributed with this work for copyright and licensing
% information, the AUTHORS file for a list of copyright holders, and the
% CONTRIBUTORS file for the list of contributors.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This function plots the reference and received signal constellation
% diagrams and saves it in the evm_results_folder which was taken as
% input from the user in F_UserInputs_Rx().
% The constellation diagram is saved with the filename which was taken as
% input from the user in F_UserInputs_Rx().
% This version has been tested on several monitors and resolutions to
% ensure that it plots reliable constellation diagrams without any adjustment.
%
% Inputs:
% Sideal: Ideal OFDM symbols from ideal signal
% Symb: Recovered OFDM Symbols
% params: Structure containing all the basic communication parameters
global structGlobal global structGlobal
...@@ -48,7 +83,7 @@ function F_Plot_Constellation_Diagram_OFDM(Sideal,Symb,params) ...@@ -48,7 +83,7 @@ function F_Plot_Constellation_Diagram_OFDM(Sideal,Symb,params)
% Create legend % Create legend
legend1 = legend(axes1,'show'); legend1 = legend(axes1,'show');
% Placement of plot legend in MATLAB plot window % Placement of plot legend in MATLAB plot window
set(legend1,'Position',[0.60 0.03 0.35 0.08],'FontSize',14); set(legend1,'Position',[0.65 0.01 0.35 0.08],'FontSize',14);
% Set the remaining axes/figure properties % Set the remaining axes/figure properties
axis square axis square
...@@ -57,21 +92,21 @@ function F_Plot_Constellation_Diagram_OFDM(Sideal,Symb,params) ...@@ -57,21 +92,21 @@ function F_Plot_Constellation_Diagram_OFDM(Sideal,Symb,params)
set(axes1,'xtick',(-params.N/2:1:params.N/2)); set(axes1,'xtick',(-params.N/2:1:params.N/2));
set(axes1,'YLim',[-params.N/2 params.N/2]); set(axes1,'YLim',[-params.N/2 params.N/2]);
set(axes1,'ytick',(-params.N/2:1:params.N/2)); set(axes1,'ytick',(-params.N/2:1:params.N/2));
set(axes1,'FontSize',24,'GridAlpha',1,'XGrid','on','YGrid','on'); set(axes1,'FontSize',24,'GridLineStyle','-','XGrid','on','YGrid','on');
% Move the plot box up to accomodate the legend % Move the plot box up to accomodate the legend
current_position = get(gca, 'Position'); current_position = get(gca, 'Position');
set(gca, 'Position', current_position + [0, +0.02, 0, +0.02]); set(gca, 'Position', current_position + [0, +0.01, 0, +0.01]);
% Set the actual height and width of the box % Set the actual height and width of the box
width = 5; width = 6;
height = 5; height = 6;
set(gcf, 'Units', 'Inches', 'Position', [1, 1, width+1, height+1], 'PaperUnits', 'Inches', 'PaperSize', [width, height]) set(gcf, 'Units', 'Inches', 'Position', [1, 1, width+1, height+1], 'PaperUnits', 'Inches', 'PaperSize', [width, height])
set(gca, 'Fontsize', 14); set(gca, 'Fontsize', 14);
% Saving figure as graphic file in current directory (plot must still be present in MATLAB plot window) % 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_constellation,'.jpg')); stri_fig = fullfile(structGlobal.evm_results_folder,strcat(structGlobal.filename_constellation,'.jpg'));
set(figure1,'PaperPositionMode','auto'); set(figure1,'PaperPositionMode','auto');
print(figure1,stri_fig,'-djpeg','-r300'); print(figure1,stri_fig,'-djpeg','-r600');
end end
\ No newline at end of file
function F_Save_Results(EVMrms_pct, tau0, G_OPT) function F_Save_Results(EVMrms_pct, tau0, G_OPT)
%
% This function saves the IEEE P1765 Baseline EVM Algorithm's official outputs % Copyright 2021 IEEE P1765 Authors
% EVMrms_pct: Baseline rms EVM in percent %
% tau0: Optimal time delay before same sampling/calculation % * Redistribution and use in source and binary forms, with or without modification,
% G_OPT: Optimal complex gain / normalization factor for symbol samples % are permitted provided that the following conditions are met:
% (saved as absolute and phase parts) %
% * Redistributions of source code must retain the above copyright notice,
% this list of conditions and the following disclaimer.
%
% * Redistributions in binary form must reproduce the above copyright notice,
% this list of conditions and the following disclaimer in the documentation
% and/or other materials provided with the distribution.
%
% * Neither the name of the copyright holder nor the names of its contributors
% may be used to endorse or promote products derived from this software without
% specific prior written permission.
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
% DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
% SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
% OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
% USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%
% SPDX-License-Identifier: BSD-3-Clause
%
% See the LICENSE file distributed with this work for copyright and licensing
% information, the AUTHORS file for a list of copyright holders, and the
% CONTRIBUTORS file for the list of contributors.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This function saves the IEEE P1765 Baseline EVM Algorithm's official outputs
% EVMrms_pct: Baseline rms EVM in percent
% tau0: Optimal time delay before same sampling/calculation
% G_OPT: Optimal complex gain / normalization factor for symbol samples
% (saved as absolute and phase parts)
global structGlobal global structGlobal
......
function F_UserInputs_Rx() function F_UserInputs_Rx()
%
% Copyright 2021 IEEE P1765 Authors
%
% * Redistribution and use in source and binary forms, with or without modification,
% are permitted provided that the following conditions are met:
%
% * Redistributions of source code must retain the above copyright notice,
% this list of conditions and the following disclaimer.
%
% * Redistributions in binary form must reproduce the above copyright notice,
% this list of conditions and the following disclaimer in the documentation
% and/or other materials provided with the distribution.
%
% * Neither the name of the copyright holder nor the names of its contributors
% may be used to endorse or promote products derived from this software without
% specific prior written permission.
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
% DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
% SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
% OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
% USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%
% SPDX-License-Identifier: BSD-3-Clause
%
% See the LICENSE file distributed with this work for copyright and licensing
% information, the AUTHORS file for a list of copyright holders, and the
% CONTRIBUTORS file for the list of contributors.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global structGlobal global structGlobal
...@@ -16,7 +51,8 @@ function F_UserInputs_Rx() ...@@ -16,7 +51,8 @@ function F_UserInputs_Rx()
% Read in ASCII Baseband Reference Waveform file % Read in ASCII Baseband Reference Waveform file
disp('__________________________________________________________________'); disp('__________________________________________________________________');
disp('The user’s selection will be based on the P1765 Signal Impairment Sets'); disp('The user’s selection will be based on the P1765 Signal Impairment Sets');
disp('defined in Section 6.1 and Annex A of IEEE P1765'); disp('defined in Section: Reference waveform file generation and ');
disp('Annex: The Reference Waveforms (normative)');
disp('Read in ASCII Baseband Reference Waveform file'); disp('Read in ASCII Baseband Reference Waveform file');
disp('__________________________________________________________________'); disp('__________________________________________________________________');
...@@ -78,4 +114,4 @@ function F_UserInputs_Rx() ...@@ -78,4 +114,4 @@ function F_UserInputs_Rx()
disp(['Filename for the saving the constellation diagram: ',structGlobal.filename_constellation]); disp(['Filename for the saving the constellation diagram: ',structGlobal.filename_constellation]);
disp('__________________________________________________________________'); disp('__________________________________________________________________');
end end
\ No newline at end of file
function [delay,fxF] = F_calculateOptimal(params,fxFideal,fxF) function [delay,fxF] = F_calculateOptimal(params,fxFideal,fxF)
%
% Function to calculate optimal coarse and fine time delay. The coarse time % Copyright 2021 IEEE P1765 Authors
% alignment is performed in time domain while the fine time alignment is %
% performed in the frequency domain. % * Redistribution and use in source and binary forms, with or without modification,
% See Section 5.2.1.2 of IEEE P1765 document: % are permitted provided that the following conditions are met:
% Optimal Time Alignment of Waveform 2 to Waveform 1 %
% % * Redistributions of source code must retain the above copyright notice,
% Inputs: % this list of conditions and the following disclaimer.
% fxFideal or X(omega): Spectrum of the ideal OFDM signal %
% fxF or Y(omega): Spectrum of the impaired OFDM signal % * Redistributions in binary form must reproduce the above copyright notice,
% params: structure containing the basic communication paramters % this list of conditions and the following disclaimer in the documentation
% % and/or other materials provided with the distribution.
% Outputs: %
% delay or tau0: Optimal time delay applied on the measured spectrum % * Neither the name of the copyright holder nor the names of its contributors
% fxF or U(omega): Corrected measured spectrum after application of the optimal time delay % may be used to endorse or promote products derived from this software without
% specific prior written permission.
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE