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

Also verify expected SST level.

parent e13b6b5f
Branches
No related tags found
1 merge request!231Use applications/lofar2/model/pfs_coeff_final.m to create FIR coefficients for...
...@@ -173,6 +173,7 @@ ARCHITECTURE tb OF tb_verify_pfb_wg IS ...@@ -173,6 +173,7 @@ ARCHITECTURE tb OF tb_verify_pfb_wg IS
-- Determine bypass PFIR for PFB2, using g_fil_coefs_file_prefix setting for WPFB -- Determine bypass PFIR for PFB2, using g_fil_coefs_file_prefix setting for WPFB
CONSTANT c_pfs_bypass : BOOLEAN := g_fil_coefs_file_prefix = "data/run_pfir_coeff_m_bypass_16taps_1024points_16b_1wb"; CONSTANT c_pfs_bypass : BOOLEAN := g_fil_coefs_file_prefix = "data/run_pfir_coeff_m_bypass_16taps_1024points_16b_1wb";
CONSTANT c_pfs_lofar1 : BOOLEAN := g_fil_coefs_file_prefix = "data/Coeffs16384Kaiser-quant_1wb";
-- Determine PFIR coefficient width for WPFB and PFB2 -- Determine PFIR coefficient width for WPFB and PFB2
CONSTANT c_pfir_coef_w : NATURAL := sel_a_b(g_sel_pfb="WPFB", g_fil_coef_dat_w, 16); CONSTANT c_pfir_coef_w : NATURAL := sel_a_b(g_sel_pfb="WPFB", g_fil_coef_dat_w, 16);
...@@ -275,11 +276,16 @@ ARCHITECTURE tb OF tb_verify_pfb_wg IS ...@@ -275,11 +276,16 @@ ARCHITECTURE tb OF tb_verify_pfb_wg IS
-- SST -- SST
-- Expected subband amplitude gain relative to input WG amplitude -1 for divide by 2 in two real input separate (Ampl --> Ampl/2) -- Expected subband amplitude gain relative to input WG amplitude -1 for divide by 2 in two real input separate (Ampl --> Ampl/2)
-- . assume fir_filter_dc_gain ~= 1.0, like with c_wpfb_lofar1_fir_filter_dc_gain 0.994817 -- . default assume c_fir_filter_dc_gain ~= 1.0, like with c_fil_lofar1_fir_filter_dc_gain = 0.994817
CONSTANT c_pfb_sub_scaling : REAL := func_wpfb_subband_gain(c_wpfb); CONSTANT c_fir_filter_dc_gain : REAL := sel_a_b(c_pfs_lofar1, c_fil_lofar1_fir_filter_dc_gain, 1.0);
CONSTANT c_pfb_sub_scaling : REAL := func_wpfb_subband_gain(c_wpfb, c_fir_filter_dc_gain);
CONSTANT c_exp_sub_a_ampl : REAL := c_wg_ampl_a * c_pfb_sub_scaling; CONSTANT c_exp_sub_a_ampl : REAL := c_wg_ampl_a * c_pfb_sub_scaling;
CONSTANT c_exp_sub_b_ampl : REAL := c_wg_ampl_a * c_pfb_sub_scaling; CONSTANT c_exp_sub_b_ampl : REAL := c_wg_ampl_b * c_pfb_sub_scaling;
-- Use 1 as integration interval, because measured sst_wg_power_a,b is normalized for c_N_blk
CONSTANT c_exp_sst_a : REAL := func_wpfb_sst_level(c_exp_sub_a_ampl, 1);
CONSTANT c_exp_sst_b : REAL := func_wpfb_sst_level(c_exp_sub_b_ampl, 1);
-- TB -- TB
SIGNAL bs_end : STD_LOGIC := '0'; SIGNAL bs_end : STD_LOGIC := '0';
...@@ -1031,6 +1037,7 @@ BEGIN ...@@ -1031,6 +1037,7 @@ BEGIN
print_str(""); print_str("");
print_str("Powers:"); print_str("Powers:");
print_str(". sst_wg_power_a = " & real_to_str(sst_wg_power_a, 15, 3) & " = " & real_to_str(sst_wg_power_a_dB, 7, 2) & " [dB]"); print_str(". sst_wg_power_a = " & real_to_str(sst_wg_power_a, 15, 3) & " = " & real_to_str(sst_wg_power_a_dB, 7, 2) & " [dB]");
print_str(". sst_wg_power_a/c_exp_sst_a = " & real_to_str(sst_wg_power_a/c_exp_sst_a, 10, 6));
print_str(". sst_noise_a = " & real_to_str(sst_noise_a, 15, 3) & " = " & real_to_str(sst_noise_a_dB, 7, 2) & " [dB]"); print_str(". sst_noise_a = " & real_to_str(sst_noise_a, 15, 3) & " = " & real_to_str(sst_noise_a_dB, 7, 2) & " [dB]");
print_str(". sst_noise_b = " & real_to_str(sst_noise_b, 15, 3) & " = " & real_to_str(sst_noise_b_dB, 7, 2) & " [dB]"); -- FFT cross talk power from a to b (if g_amplitude_b = 0) print_str(". sst_noise_b = " & real_to_str(sst_noise_b, 15, 3) & " = " & real_to_str(sst_noise_b_dB, 7, 2) & " [dB]"); -- FFT cross talk power from a to b (if g_amplitude_b = 0)
print_str(""); print_str("");
...@@ -1074,6 +1081,7 @@ BEGIN ...@@ -1074,6 +1081,7 @@ BEGIN
print_str(". fil_phase_Ts_b = " & real_to_str(fil_phase_Ts_b, 10, 3)); print_str(". fil_phase_Ts_b = " & real_to_str(fil_phase_Ts_b, 10, 3));
print_str("Powers:"); print_str("Powers:");
print_str(". sst_wg_power_b = " & real_to_str(sst_wg_power_b, 15, 3) & " = " & real_to_str(sst_wg_power_b_dB, 7, 2) & " [dB]"); print_str(". sst_wg_power_b = " & real_to_str(sst_wg_power_b, 15, 3) & " = " & real_to_str(sst_wg_power_b_dB, 7, 2) & " [dB]");
print_str(". sst_wg_power_b/c_exp_sst_b = " & real_to_str(sst_wg_power_b/c_exp_sst_b, 10, 6));
print_str(". sst_noise_b = " & real_to_str(sst_noise_b, 15, 3) & " = " & real_to_str(sst_noise_b_dB, 7, 2) & " [dB]"); print_str(". sst_noise_b = " & real_to_str(sst_noise_b, 15, 3) & " = " & real_to_str(sst_noise_b_dB, 7, 2) & " [dB]");
print_str(". sst_noise_a = " & real_to_str(sst_noise_a, 15, 3) & " = " & real_to_str(sst_noise_a_dB, 7, 2) & " [dB]"); -- FFT cross talk power from b to a (if g_amplitude_a = 0) print_str(". sst_noise_a = " & real_to_str(sst_noise_a, 15, 3) & " = " & real_to_str(sst_noise_a_dB, 7, 2) & " [dB]"); -- FFT cross talk power from b to a (if g_amplitude_a = 0)
print_str(""); print_str("");
...@@ -1097,6 +1105,8 @@ BEGIN ...@@ -1097,6 +1105,8 @@ BEGIN
ASSERT almost_equal(fir_ampl_a, fil_ampl_a, 10.0) REPORT "Wrong estimated amplitude for FIR filter output a, " & real_to_str(fir_ampl_a, 7, 0) & " /~= " & real_to_str(fil_ampl_a, 7, 0) SEVERITY ERROR; ASSERT almost_equal(fir_ampl_a, fil_ampl_a, 10.0) REPORT "Wrong estimated amplitude for FIR filter output a, " & real_to_str(fir_ampl_a, 7, 0) & " /~= " & real_to_str(fil_ampl_a, 7, 0) SEVERITY ERROR;
ASSERT almost_equal(sub_a_ampl/cw_ampl_a/c_pfb_sub_scaling, 1.0, 0.01) ASSERT almost_equal(sub_a_ampl/cw_ampl_a/c_pfb_sub_scaling, 1.0, 0.01)
REPORT "Wrong measured scaling for PFB subband output a, " & real_to_str(sub_a_ampl/cw_ampl_a, 7, 0) & " /~= " & real_to_str(c_pfb_sub_scaling, 7, 0) SEVERITY ERROR; REPORT "Wrong measured scaling for PFB subband output a, " & real_to_str(sub_a_ampl/cw_ampl_a, 7, 0) & " /~= " & real_to_str(c_pfb_sub_scaling, 7, 0) SEVERITY ERROR;
ASSERT almost_equal(sst_wg_power_a/c_exp_sst_a, 1.0, 0.01)
REPORT "Wrong measured scaling for PFB SST output a, " & real_to_str(sst_wg_power_a/c_exp_sst_a, 7, 0) & " /~= 1.0" SEVERITY ERROR;
END IF; END IF;
tb_end <= '1'; tb_end <= '1';
WAIT; WAIT;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment