Compare commits

...

3 Commits

Author SHA1 Message Date
Sebastien Bourdeauducq 9ec7c5e794 fix wiggle 2020-08-12 13:06:46 +08:00
Sebastien Bourdeauducq ec700a111b fix biastee 2020-08-12 13:06:38 +08:00
Sebastien Bourdeauducq c12a0cd27a improve text justification 2020-08-12 13:06:11 +08:00
5 changed files with 6 additions and 5 deletions

1
bladerf.conf Normal file
View File

@ -0,0 +1 @@
biastee_rx on

1
dmi.py
View File

@ -30,6 +30,7 @@ def main():
for channel in range(2):
sdr.setSampleRate(SoapySDR.SOAPY_SDR_RX, channel, freq_sample)
sdr.setFrequency(SoapySDR.SOAPY_SDR_RX, channel, freq_base)
sdr.setGain(SoapySDR.SOAPY_SDR_RX, channel, 57.0)
buf_sdr = BufferedSDR(sdr, [0, 1], block_size, 32)
buf_sdr.start()

View File

@ -36,9 +36,9 @@ class MainWindow(pg.GraphicsLayoutWidget):
self.freq_base = freq_base
self.block_size = block_size
self.text_ref = pg.LabelItem(size="24pt")
self.text_ref = pg.LabelItem(size="24pt", justify="left")
self.addItem(self.text_ref, row=0, col=0)
self.text_locked = pg.LabelItem(size="24pt")
self.text_locked = pg.LabelItem(size="24pt", justify="right")
self.addItem(self.text_locked, row=0, col=1)
self.update_ref(None, None, False)

View File

@ -138,7 +138,7 @@ class Stabilizer:
else:
freq = None
tuning = 0.0
max_tuning_abs = 0.5 - self.wiggle
max_tuning_abs = 0.5 - self.wiggle_amplitude - 1e-9
tuning = max(min(tuning, max_tuning_abs), -max_tuning_abs)
if success:
@ -152,7 +152,7 @@ class Stabilizer:
self.unlock_counter += 1
if not success and (self.unlock_counter > self.unlock_counter_threshold):
print("wiggle")
self.wiggle = self.wiggle_amplitude*2.0*(np.random.random() - 0.5)
self.wiggle = self.wiggle_amplitude*np.random.uniform(-1.0, 1.0)
self.unlock_counter = 0
self.cb(spectrum, freq, self.locked(), tuning + self.wiggle)

View File

@ -40,7 +40,6 @@ in
'';
shellHook = ''
${pkgs.libbladeRF}/bin/bladeRF-cli -l ${bitstream}
${pkgs.libbladeRF}/bin/bladeRF-cli -e "set biastee rx on"
'';
QT_QPA_PLATFORM = "wayland";
}