Additional subtle changes include adjusted wait periods.

Removed filtering and up/downsampling.
This commit is contained in:
Markus Rosenstihl 2024-02-27 17:05:01 +01:00
parent caf19bc468
commit 0d25b17c60
3 changed files with 17 additions and 58 deletions

View File

@ -124,8 +124,9 @@ def satrec_experiment(pars, run):
PH3 = pars['PH3'][run%len(pars['PH3'])]
PH2 = pars['PH2'][run%len(pars['PH2'])]
PHA = pars['PHA']
# set variable delay list for saturation pulses:
SI = pars["SI"]
SW = pars["SW"]
# set variable delay list for saturation pulses:
vdlist = log_range(D2, D1, NECH-1)
# run the pulse sequence:
@ -141,13 +142,13 @@ def satrec_experiment(pars, run):
e.set_phase(PH3) # set phase for measuring pulse
# recovery:
e.wait(TAU) # recovery time
e.wait(TAU-5e-7) # recovery time
# detection:
e.ttl_pulse(TXEnableDelay, value=TXEnableValue) # enable RF amplifier
e.ttl_pulse(P90, value=TXEnableValue|TXPulseValue) # apply 90-degree pulse
e.set_phase(PHA) # set phase for receiver
e.wait(DEAD1) # wait for coil ringdown
e.wait(DEAD1-5e-7) # wait for coil ringdown
e.record(SI, SW, sensitivity=ADCSensitivity) # acquire signal
# write experiment parameters:

View File

@ -11,17 +11,16 @@ def experiment(): # saturation-recovery with soild-echo detection
pars = {}
pars['P90'] = 2.3e-6 # 90-degree pulse length (s)
pars['SF'] = 46.7e6 # spectrometer frequency (Hz)
pars['O1'] = 5.6e3 # offset from SF (Hz)
pars['SW'] = 10e6 # spectral window (Hz)
pars['SI'] = 1*1024 # number of acquisition points
pars['NS'] = 16 # number of scans
pars['DS'] = 0 # number of dummy scans
pars['TAU'] = 1 # delay for recovery (s)
pars['D3'] = 20e-6 # echo delay (s)
pars['D4'] = 0 # echo pre-aquisition delay (s)
pars['D4'] = 0 # pre-aquisition delay (s), use negative values
pars['PHA'] = -30 # receiver phase (degree)
# -*- these ain't variable: -*-
pars['NECH'] = 40 # number of saturation pulses
pars['NECH'] = 7 # number of saturation pulses
pars['D1'] = 100e-3 # starting interval in saturation sequence (s)
pars['D2'] = 1e-4 # end interval in saturation sequence (s)
pars['DATADIR'] = '/home/fprak/Students/' # data directory
@ -48,8 +47,7 @@ def experiment(): # saturation-recovery with soild-echo detection
raise Exception("Pulse too long!!!")
if pars['NS']%8 != 0:
pars['NS'] = int(round(pars['NS'] / 8) + 1) * 8
print 'Number of scans changed to ',pars['NS'],' due to phase cycling'
print 'Number of scans should be ',pars['NS'],' due to phase cycling'
if pars['D1'] < pars['D2']:
raise Exception("D1 must be greater than D2!")
@ -120,7 +118,6 @@ def satrec2_experiment(pars, run):
# read in variables:
P90 = pars['P90']
SF = pars['SF']
O1 = pars['O1']
NECH = pars['NECH']
D1 = pars['D1']
D2 = pars['D2']
@ -132,21 +129,16 @@ def satrec2_experiment(pars, run):
PH4 = pars['PH4'][run%len(pars['PH4'])]
PH2 = pars['PH2'][run%len(pars['PH2'])]
PHA = pars['PHA']
SI = pars['SI']
SW = pars['SW']
# set variable delay list for saturation pulses:
vdlist = log_range(D2, D1, NECH-1)
# set sampling parameters:
SI = pars['SI']
SW = pars['SW']
while SW <= 10e6 and SI < 256*1024:
SI *= 2
SW *= 2
# the pulse sequence:
# the pulse sequence:
# saturation:
e.set_frequency(SF+O1, phase=PH1) # set frequency and phase for saturation pulses
e.set_frequency(SF, phase=PH1) # set frequency and phase for saturation pulses
e.ttl_pulse(TXEnableDelay, value=TXEnableValue) # enable RF amplifier
e.ttl_pulse(P90, value=TXEnableValue|TXPulseValue) # apply 90-degree pulse
for delay in vdlist[::-1]:
@ -154,19 +146,19 @@ def satrec2_experiment(pars, run):
e.ttl_pulse(TXEnableDelay, value=TXEnableValue) # enable RF amplifier
e.ttl_pulse(P90, value=TXEnableValue|TXPulseValue) # apply 90-degree pulse
# recovery:
e.wait(TAU) # wait for tau
e.set_phase(PH3) # set phase for next pulse
# recovery:
e.wait(TAU-5e-7) # wait for tau
# echo detection:
e.ttl_pulse(TXEnableDelay, value=TXEnableValue) # enable RF amplifier
e.ttl_pulse(P90, value=TXEnableValue|TXPulseValue) # apply 90-degree pulse
e.wait(D3-P90-TXEnableDelay) # echo delay
e.set_phase(PH4) # set phase for next pulse
e.wait(D3-P90-TXEnableDelay-5e-7) # echo delay
e.ttl_pulse(TXEnableDelay, value=TXEnableValue) # enable RF amplifier
e.ttl_pulse(P90, value=TXEnableValue|TXPulseValue) # apply 90-degree pulse
e.set_phase(PHA) # set phase for receiver
e.wait(D3-P90/2+D4) # echo delay
e.wait(D3-P90/2+D4-5e-7) # echo delay
e.record(SI, SW, sensitivity=ADCSensitivity) # acquisition
# write experiment attributes:

View File

@ -29,40 +29,6 @@ def result():
# get actual sampling rate of timesignal:
sampling_rate = timesignal.get_sampling_rate()
# get user-defined spectrum width:
spec_width = pars['SW']
# specify cutoff frequency, in relative units:
cutoff = spec_width / sampling_rate
if cutoff < 1: # no filter applied otherwise
# number of filter's coefficients:
numtaps = 29
# use firwin to create a lowpass FIR filter:
fir_coeff = firwin(numtaps, cutoff)
# downsize x according to user-defined spectral window:
skip = int(sampling_rate / spec_width)
timesignal.x = timesignal.x[::skip]
for i in range(2):
# apply the filter to ith channel:
timesignal.y[i] = lfilter(fir_coeff, 1.0, timesignal.y[i])
# zeroize first N-1 "corrupted" samples:
timesignal.y[i][:numtaps-1] = 0.0
# circular left shift of y:
timesignal.y[i] = roll(timesignal.y[i], -(numtaps-1))
# downsize y to user-defined number of samples (SI):
timesignal.y[i] = timesignal.y[i][::skip]
# update the sampling_rate attribute of the signal's:
timesignal.set_sampling_rate(spec_width)
# ----------------------------------------------------
# rotate timesignal according to current receiver's phase: