Skip to content
Snippets Groups Projects
Commit 0383f051 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Added hdl_N_int to simulate phase error when used nof_N_int > hdl_N_int.

parent 24f2b19a
No related branches found
No related tags found
No related merge requests found
...@@ -116,6 +116,8 @@ phi_error_max = 0.5; % choose maximum PT phase error in degrees ...@@ -116,6 +116,8 @@ phi_error_max = 0.5; % choose maximum PT phase error in degrees
phi0_extra_w = 0; % no extra bits are needed to achieve phi_error_max, however use e.g. 8 extra bits to see phi_quant approach phi_linear phi0_extra_w = 0; % no extra bits are needed to achieve phi_error_max, however use e.g. 8 extra bits to see phi_quant approach phi_linear
%phi0_extra_w = 8; %phi0_extra_w = 8;
nof_N_int = 1; % default 1 for T_update interval equal to T_int, use > 1 to try effect on phi_error_max of longer update intervals nof_N_int = 1; % default 1 for T_update interval equal to T_int, use > 1 to try effect on phi_error_max of longer update intervals
hdl_N_int = 1; % update interval as assumed for dimensioning the PT function, choose nof_N_int > hdl_N_int to check what
% happens when the update rate is less than designed for in HDL
% - Optional PT frequency shift % - Optional PT frequency shift
N_chan = 64; % number of fine channels per subband N_chan = 64; % number of fine channels per subband
...@@ -129,8 +131,8 @@ g_theta0 = -90; % choose start observation angle in degrees (-90 is ...@@ -129,8 +131,8 @@ g_theta0 = -90; % choose start observation angle in degrees (-90 is
% - Optional scaling % - Optional scaling
scale = 'no_scale '; % choose this to get parameter widths for PT that can track the earth rotation (24h circle) scale = 'no_scale '; % choose this to get parameter widths for PT that can track the earth rotation (24h circle)
scale = 'satellite'; % choose this to get parameter widths for PT that can track an orbiting satellite (1.5 hour orbit) %scale = 'satellite'; % choose this to get parameter widths for PT that can track an orbiting satellite (1.5 hour orbit)
scale = 'halfday '; % choose this to speed up the simulation of PT over half a day (theta0 = -90 to +90 degrees), this data is suitable for HDL reference %scale = 'halfday '; % choose this to speed up the simulation of PT over half a day (theta0 = -90 to +90 degrees), this data is suitable for HDL reference
% ------------------------------------------------------------------------- % -------------------------------------------------------------------------
% Model % Model
...@@ -189,8 +191,9 @@ T_linear = sqrt(T_fine / w_e); ...@@ -189,8 +191,9 @@ T_linear = sqrt(T_fine / w_e);
% Time axis % Time axis
N_int = 800000; N_int = 800000;
N_update = N_int * nof_N_int; N_update = N_int * nof_N_int;
T_update = N_update / f_sub / scale_T_update; % choose update interval equal to integration interval T_update = N_update / f_sub / scale_T_update; % choose update interval equal to number of integration intervals
nof_t_sub = round(N_update / scale_T_update); % number of subband time samples per update interval nof_t_sub = round(N_update / scale_T_update); % number of subband time samples per update interval
hdl_t_sub = round(N_update * hdl_N_int / nof_N_int / scale_T_update); % number of subband time samples per update interval as designed for in HDL
t_i = (0:nof_t_sub-1); t_i = (0:nof_t_sub-1);
t_u = t_i/f_sub; t_u = t_i/f_sub;
...@@ -241,12 +244,13 @@ M_phi = 2^phi_w; % range M_ is 2^_w, range [0:M_phi ...@@ -241,12 +244,13 @@ M_phi = 2^phi_w; % range M_ is 2^_w, range [0:M_phi
phi0_w = phi_w + phi0_extra_w; % width _w is nof bits phi0_w = phi_w + phi0_extra_w; % width _w is nof bits
M_phi0_extra = 2^phi0_extra_w; % range M_ is 2^_w M_phi0_extra = 2^phi0_extra_w; % range M_ is 2^_w
M_phi0 = 2^phi0_w; M_phi0 = 2^phi0_w;
phi0_error_max = 360 / M_phi0;
% - input phase step coefficient phi1 % - input phase step coefficient phi1
d0_max = B / c; d0_max = B / c;
d1_max = w_e * d0_max; d1_max = w_e * d0_max;
phi1_max = g_RF * d1_max * T_sub; phi1_max = g_RF * d1_max * T_sub;
phi1_interpolate_w = ceil(log2(nof_t_sub/phi_error_max)); % nof bits to preserve phi_error_max after adding nof_t_sub phi1_interpolate_w = ceil(log2(hdl_t_sub/phi_error_max)); % nof bits to preserve phi_error_max after adding nof_t_sub
phi1_fraction_w = phi0_extra_w + phi1_interpolate_w; % nof bits to preserve phi_error_max after adding nof_t_sub and phi0_extra_w phi1_fraction_w = phi0_extra_w + phi1_interpolate_w; % nof bits to preserve phi_error_max after adding nof_t_sub and phi0_extra_w
phi1_w = phi_w + phi1_fraction_w; % width _w is nof bits phi1_w = phi_w + phi1_fraction_w; % width _w is nof bits
phi1_backoff_w = floor(log2(360 / phi1_max)) - 1; % -1 for sign bit of phase step phi1 phi1_backoff_w = floor(log2(360 / phi1_max)) - 1; % -1 for sign bit of phase step phi1
...@@ -257,10 +261,10 @@ M_phi1_step = 2^phi1_step_w; ...@@ -257,10 +261,10 @@ M_phi1_step = 2^phi1_step_w;
% - input frequency phase shift1 % - input frequency phase shift1
if f_shift ~= 0 if f_shift ~= 0
if abs(f_sub/f_shift - round(f_sub/f_shift))> 0.001/nof_t_sub if abs(f_sub/f_shift - round(f_sub/f_shift))> 0.001/hdl_t_sub
sprintf('Note: f_sub should be an integer multiple of f_shift, else hdl_phi0_q must adjust for shift0_q as well !!!\n') sprintf('Note: f_sub should be an integer multiple of f_shift, else hdl_phi0_q must adjust for shift0_q as well !!!\n')
end end
if mod(nof_t_sub, N_shift) > 0.001/nof_t_sub if mod(hdl_t_sub, N_shift) > 0.001/hdl_t_sub
sprintf('Note: T_update should be an integer multiple of T_shift, else hdl_phi0_q must adjust for shift0_q as well !!!\n') sprintf('Note: T_update should be an integer multiple of T_shift, else hdl_phi0_q must adjust for shift0_q as well !!!\n')
end end
end end
...@@ -284,10 +288,12 @@ sprintf (['Scale up factor for earth rotation rate = %d\n', ... ...@@ -284,10 +288,12 @@ sprintf (['Scale up factor for earth rotation rate = %d\n', ...
'Linear update interval = %7.5f [s]\n', ... 'Linear update interval = %7.5f [s]\n', ...
'Nof update intervals = %d\n', ... 'Nof update intervals = %d\n', ...
'Nof subband time samples per update interval = %d\n', ... 'Nof subband time samples per update interval = %d\n', ...
'Nof subband time samples per update interval HDL = %d\n', ...
'Nof subband time samples in total simulation = %d\n', ... 'Nof subband time samples in total simulation = %d\n', ...
'Frequency shift step shift1 = %f [degrees]\n', ... 'Frequency shift step shift1 = %f [degrees]\n', ...
'Maximum phase step phi1 = %f [degrees]\n', ... 'Maximum phase step phi1 = %f [degrees]\n', ...
'Maximum PT phase error = %7.3f [degrees]\n', ... 'Maximum PT phase error specified = %7.3f [degrees]\n', ...
'Maximum PT phase error HDL = %7.3f [degrees]\n', ...
'Nof bits for 360 degrees input phase phi0 = %d\n', ... 'Nof bits for 360 degrees input phase phi0 = %d\n', ...
'Nof bits for input interpolation interval = %d\n', ... 'Nof bits for input interpolation interval = %d\n', ...
'Nof bits for input phase step phi1 = %d\n', ... 'Nof bits for input phase step phi1 = %d\n', ...
...@@ -298,8 +304,8 @@ sprintf (['Scale up factor for earth rotation rate = %d\n', ... ...@@ -298,8 +304,8 @@ sprintf (['Scale up factor for earth rotation rate = %d\n', ...
scale_w_e, scale_T_update, scale_f, scale_B, T_halfday, ... scale_w_e, scale_T_update, scale_f, scale_B, T_halfday, ...
T_sim, f_RF/1e6 , f_sub, f_shift, Td*1e9, k_max, ... T_sim, f_RF/1e6 , f_sub, f_shift, Td*1e9, k_max, ...
f_fringe_max , T_linear, T_update, ... f_fringe_max , T_linear, T_update, ...
nof_update, nof_t_sub, T_sim_sub, ... nof_update, nof_t_sub, hdl_t_sub, T_sim_sub, ...
shift1, phi1_max, phi_error_max, ... shift1, phi1_max, phi_error_max, phi0_error_max, ...
phi0_w, phi1_interpolate_w, phi1_step_w, phi1_w, phi1_w, phi1_fraction_w, phi_w) phi0_w, phi1_interpolate_w, phi1_step_w, phi1_w, phi1_w, phi1_fraction_w, phi_w)
% Simulate the phase tracking (PT) % Simulate the phase tracking (PT)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment