📄 cp0704_lse_pulse_combination.m
字号:
%
% FUNCTION 7.12 : "cp0704_LSE_pulse_combination"
%
% This function implements the Least Square Error (LSE)
% selection algorithm described in Section 7.2 for the
% determination of a combination of the first 15 Gaussian
% derivatives fitting the FCC indoor emission mask
%
% 'smp' samples of the Gaussian pulse are considered, in
% the time interval 'Tmax - Tmin'
%
% The function receives in input:
% 1) the index 'i' indicating which setting must be adopted
% for the shape factors of the derivatives
% 2) the Pulse Repetition Period Ts
%
% The function returns:
% 1) the best coefficient set 'coefficient'
% 2) the set of derivatives 'derivative'
% The function individuates the best coefficient set in the
% sense of the
% LSE minimization between the combination of the first 15
% derivatives of the Gaussian pulse and the energy signal
% in the time domain corresponding to the FCC emission
% mask.
%
% The function then plots the target mask, and the PSD of
% the waveform obtained through the LSE minimization.
%
% Programmed by Luca De Nardis
function [coefficient, derivative] = ...
cp0704_LSE_pulse_combination(i,Ts)
% -----------------------------------------------
% Step Zero - Input parameters and Initialization
% -----------------------------------------------
Tmin = -4e-9;
% Lower time interval limit
Tmax = 4e-9;
% Upper time interval limit
smp = 1024;
% Number of samples
frequencysmoothingfactor = 4;
% Frequency smoothing factor
dt = (Tmax - Tmin) / smp;
% sampling period
fs = 1/dt;
% sampling frequency
N = frequencysmoothingfactor * smp;
% number of samples (i.e. size of the FFT)
df = 1 / (N * dt);
% fundamental frequency
positivefrequency=linspace(0,(fs/2),N/2);
% Inizialization of the positive frequency axis
t=linspace(Tmin,Tmax,smp);
% Inizialization of the time axis
alpha=cp0703_get_alpha_value(i);
% Loading the alpha vector depending on the input 'i'
for i=1:15
% ---------------------------------------------
% Step One - Pulse waveforms in the time domain
% ---------------------------------------------
derivative(i,:) = ...
cp0702_analytical_waveforms(t,i,alpha(i));
derivative(i,:) = (derivative(i,:)...
/ max(abs(derivative(i,:))));
end
% ---------------------------------------------
% Step Two - Determination of the LSE solution to the
% approximation problem
% ---------------------------------------------
timeemissionmask = cp0704_time_mask(Tmin,Tmax,smp); % Determination of the signal generating the mask in the...
% frequency domain
% Application of the LSE method
coefficient = sqrt(Ts * 377) * ...
lsqlin(derivative',timeemissionmask');
X = fft(coefficient'*derivative,N);
% double-sided MATLAB amplitude spectrum
X = X / N;
% conversion from MATLAB spectrum to fourier spectrum
E = fftshift(abs(X).^2/(df^2));
% DOUBLE-SIDED ESD
Ess = 2 * E((N/2+1):N);
% SINGLE-SIDED ESD
PSD = 10 * log10 ((1/Ts) * Ess / 377) + 90;
% PSD of the combination in dBm/MHz
% -----------------------------
% Step Three - Graphical output
% -----------------------------
emissionmask = cp0703_generate_mask(N, fs);
% Loading the emission mask on N/2 points
figure(1);
plot(positivefrequency/1e6,...
emissionmask,'r','Linewidth',[2]);
hold on;
PF = plot(positivefrequency/1e6, PSD);
set(PF,'LineWidth',[2]);
AX=gca;
set(AX,'FontSize',12);
set(AX,'FontSize',12);
T=title('LSE combination');
set(T,'FontSize',14);
X=xlabel('Frequency [MHz]');
set(X,'FontSize',14);
Y=ylabel('PSD [dBm/MHz]');
set(Y,'FontSize',14);
axis([0 10e3 -400 0]);
alphavalue = '\alpha = 0.714 ns';
text(8e3, -100, alphavalue,'BackgroundColor', [1 1 1]);
text(3.5e3, -250, 'LSE combination', 'BackgroundColor',...
[1 1 1]);
text(5e3, -25, 'FCC UWB indoor emission mask',...
'BackgroundColor', [1 1 1]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -