Added two SP settings.

This commit is contained in:
jupfi 2023-12-10 08:18:47 +01:00
parent 58c94b6525
commit 222e5fe252
2 changed files with 17 additions and 3 deletions

View file

@ -84,11 +84,18 @@ class LimeNQRController(BaseSpectrometerController):
tdx = lime.HDF.tdx[evidx] - lime.HDF.tdx[evidx][0]
tdy = lime.HDF.tdy[evidx] / lime.nav
fft_shift = self.module.model.get_setting_by_name(self.module.model.FFT_SHIFT).value
if fft_shift:
fft_shift = self.module.model.if_frequency
else:
fft_shift = 0
measurement_data = Measurement(
tdx,
tdy,
self.module.model.target_frequency,
# frequency_shift=self.module.model.if_frequency,
frequency_shift=fft_shift,
)
# Emit the data to the nqrduck core
@ -120,7 +127,7 @@ class LimeNQRController(BaseSpectrometerController):
# Careful this doesn't only set the IF frequency but the local oscillator frequency
elif setting.name == self.module.model.IF_FREQUENCY:
lime.lof = (
self.module.model.target_frequency
self.module.model.target_frequency - setting.get_setting()
)
self.module.model.if_frequency = setting.get_setting()
elif setting.name == self.module.model.ACQUISITION_TIME:
@ -330,7 +337,8 @@ class LimeNQRController(BaseSpectrometerController):
Returns:
tuple: A tuple containing the start and stop time of the RX event in µs"""
# This is a correction factor for the RX event. The offset of the first pulse is 2.2µs longer than from the specified samples.
CORRECTION_FACTOR = 2.4e-6
#CORRECTION_FACTOR = 2.4e-6
CORRECTION_FACTOR = self.module.model.get_setting_by_name(self.module.model.RX_OFFSET).value
events = self.module.model.pulse_programmer.model.pulse_sequence.events
previous_events_duration = 0

View file

@ -28,12 +28,15 @@ class LimeNQRModel(BaseSpectrometerModel):
RX_I_GAIN_CORRECTION = "RX I Gain correction"
RX_Q_GAIN_CORRECTION = "RX Q Gain correction"
RX_PHASE_ADJUSTMENT = "RX phase adjustment"
RX_OFFSET = "RX offset"
FFT_SHIFT = "FFT shift"
# Constants for the Categories of the settings
ACQUISITION = "Acquisition"
GATE_SETTINGS = "Gate Settings"
RX_TX_SETTINGS = "RX/TX Settings"
CALIBRATION = "Calibration"
SIGNAL_PROCESSING = "Signal Processing"
# Pulse parameter constants
TX = "TX"
@ -71,6 +74,9 @@ class LimeNQRModel(BaseSpectrometerModel):
self.add_setting(self.RX_I_GAIN_CORRECTION, 2047, "RX I Gain correction", self.CALIBRATION)
self.add_setting(self.RX_Q_DC_CORRECTION, 2047, "TX Q Gain correction", self.CALIBRATION)
self.add_setting(self.RX_PHASE_ADJUSTMENT, 0, "TX phase adjustment", self.CALIBRATION)
# Signal Processing settings
self.add_setting(self.RX_OFFSET, 2.4e-6, "The offset of the RX event, this changes all the time", self.SIGNAL_PROCESSING)
self.add_setting(self.FFT_SHIFT, False, "FFT shift", self.SIGNAL_PROCESSING)
# Pulse parameter options
self.add_pulse_parameter_option(self.TX, TXPulse)