Skip to content
Snippets Groups Projects

Use c_wg_phase_offset to keep c_wg_sst_margin = 0.01 for wg_ampl = 0.001.

Merged Eric Kooistra requested to merge L2SDP-1011c into master
1 file
+ 19
7
Compare changes
  • Side-by-side
  • Inline
@@ -287,7 +287,7 @@ class SstStatisticStream:
@@ -287,7 +287,7 @@ class SstStatisticStream:
record_time = 2.0 if recv_time < 2.0 else recv_time + 1.0
record_time = 2.0 if recv_time < 2.0 else recv_time + 1.0
self.stream_control.record_time(record_time)
self.stream_control.record_time(record_time)
self.logger.info("Received %d BSN's", self.stream_reader.data.nof_received_bsn())
self.logger.info("Received %d BSN's", self.stream_reader.data.nof_received_bsn())
# now analyse the data
# now analyse the data
success = True
success = True
self.next_packet_nr = 0
self.next_packet_nr = 0
@@ -324,7 +324,7 @@ class SstStatisticStream:
@@ -324,7 +324,7 @@ class SstStatisticStream:
except BaseException as err:
except BaseException as err:
if handle_exception(err) == 1:
if handle_exception(err) == 1:
return
return
if n_valid_packets == 0:
if n_valid_packets == 0:
success = False
success = False
@@ -363,9 +363,21 @@ class SstStatisticStream:
@@ -363,9 +363,21 @@ class SstStatisticStream:
# wg_ampl = 0.1 # SST SB-102 = 8300194881257
# wg_ampl = 0.1 # SST SB-102 = 8300194881257
# wg_ampl = 1.0 # SST SB-102 = 830172237735488
# wg_ampl = 1.0 # SST SB-102 = 830172237735488
 
# Maximum difference in measured and expected SST value at subband wg_sub
 
c_wg_sst_margin = 0.01
 
 
# For smallest wg_ampl = 0.001 the exact SST level depends more on the WG phase, due
 
# to quantization noise. For wg_phase = 0.0 the c_wg_sst_margin = 0.01 is still
 
# suitable, provided that the WG phase is adjusted for the shiftram latency to
 
# effectively keep wg_phase = 0.0.
 
# If the c_wg_phase_offset = 0, then c_wg_sst_margin = 0.02 would be needed to verify
 
# the SST result when wg_ampl = 0.001.
 
c_sdp_shiftram_latency = 3.0
 
c_wg_phase_offset = 360.0 * c_sdp_shiftram_latency * (wg_sub / C_SDP.N_fft)
 
success = True
success = True
for wg_ampl in [1.0, 0.1, 0.01, 0.001]:
for wg_ampl in [1.0, 0.1, 0.01, 0.001]:
wg_phase = 0.0
wg_phase = 0.0 + c_wg_phase_offset
wg_freq = wg_sub * C_SDP.f_sub # WG sinus subband frequency in Hz
wg_freq = wg_sub * C_SDP.f_sub # WG sinus subband frequency in Hz
# Determine expect SST level at WG frequency subband
# Determine expect SST level at WG frequency subband
@@ -380,7 +392,7 @@ class SstStatisticStream:
@@ -380,7 +392,7 @@ class SstStatisticStream:
wg.set_sinus(wg_ampl, wg_phase, wg_freq)
wg.set_sinus(wg_ampl, wg_phase, wg_freq)
wg.enable()
wg.enable()
time.sleep(7.0)
time.sleep(7.0)
# first read in the data.
# first read in the data.
if self.stream_control.record_n_bsn(n_bsn=3):
if self.stream_control.record_n_bsn(n_bsn=3):
self.logger.info("Received %d BSN's:", self.stream_reader.data.nof_received_bsn())
self.logger.info("Received %d BSN's:", self.stream_reader.data.nof_received_bsn())
@@ -391,7 +403,7 @@ class SstStatisticStream:
@@ -391,7 +403,7 @@ class SstStatisticStream:
# now analyse the data
# now analyse the data
bsn = self.stream_reader.data.get_all_bsn()[1]
bsn = self.stream_reader.data.get_all_bsn()[1]
self.logger.info(f"Test SST at BSN {bsn} for WG ampl {wg_ampl}")
self.logger.info(f"Test SST at BSN {bsn} for WG ampl {wg_ampl}")
# get list of all s_ant signal input indices of rx packets in the integration interval
# get list of all s_ant signal input indices of rx packets in the integration interval
all_index = list(self.stream_reader.data.get_all_index(bsn))
all_index = list(self.stream_reader.data.get_all_index(bsn))
@@ -406,7 +418,7 @@ class SstStatisticStream:
@@ -406,7 +418,7 @@ class SstStatisticStream:
# at WG subband index and near zero for all other subbands
# at WG subband index and near zero for all other subbands
sst_relative = sst_value / exp_sub_sst
sst_relative = sst_value / exp_sub_sst
if sub == wg_sub:
if sub == wg_sub:
if sst_relative < 0.99 or sst_relative > 1.01:
if sst_relative < 1.0 - c_wg_sst_margin or sst_relative > 1.0 + c_wg_sst_margin:
self.logger.error(
self.logger.error(
f"si-{si}, sub-{sub} SST value={sst_value} at WG freq differs too much from expected (sst_relative = {sst_relative})"
f"si-{si}, sub-{sub} SST value={sst_value} at WG freq differs too much from expected (sst_relative = {sst_relative})"
)
)
@@ -417,7 +429,7 @@ class SstStatisticStream:
@@ -417,7 +429,7 @@ class SstStatisticStream:
f"si-{si}, sub-{sub} SST value={sst_value} differs too much from zero (sst_relative = {sst_relative})"
f"si-{si}, sub-{sub} SST value={sst_value} differs too much from zero (sst_relative = {sst_relative})"
)
)
success = False
success = False
wg.disable()
wg.disable()
self.stream_control.stream_off()
self.stream_control.stream_off()
print_result("test_data", success)
print_result("test_data", success)
Loading