Exemple #1
0
def perform_noise_test(plotname, fignum):

    fignum = fignum + 1

    info = str(fignum).zfill(2) + '___' + plotname
    plotname = info + '.png'

    # sample noise
    nmrObj.noise(samp_freq, samples)

    # process the data
    if en_remote_computing:  # copy remote files to local directory
        cp_rmt_file(nmrObj.scp, nmrObj.server_data_folder,
                    nmrObj.client_data_folder, "current_folder.txt")
    meas_folder = parse_simple_info(data_folder, 'current_folder.txt')

    if en_remote_computing:  # copy remote folder to local directory
        cp_rmt_folder(nmrObj.scp, nmrObj.server_data_folder,
                      nmrObj.client_data_folder, meas_folder[0])
        exec_rmt_ssh_cmd_in_datadir(
            nmrObj.ssh, "rm -rf " + meas_folder[0],
            nmrObj.server_data_folder)  # delete the file in the server
    # nstd, nmean = compute_stats( min_freq, max_freq, data_folder, meas_folder[0], plotname, en_fig )  # real scan
    nstd, nmean = compute_in_bw_noise(conf.meas_bw_kHz, conf.Df_MHz, min_freq,
                                      max_freq, data_folder, meas_folder[0],
                                      plotname, en_fig)
    f.write("std: %08.3f\tmean: %08.3f \t-> %s\n" % (nstd, nmean, info))

    shutil.move(data_folder + '/' + meas_folder[0],
                swfolder + '/' + info)  # move the data folder
    shutil.move(swfolder + '/' + info + '/' + plotname,
                swfolder + '/' + plotname)  # move the data folder

    return fignum
Exemple #2
0
def analyze(nmrObj, tuning_freq, sta_freq, sto_freq, spac_freq, samp_freq,
            fftpts, fftcmd, fftvalsub, continuous, en_fig):

    timeObj = time_meas(False)
    fig_num = 1

    while True:

        Vbias, Vvarac = find_Vbias_Vvarac_from_table(nmrObj.client_path,
                                                     tuning_freq,
                                                     nmrObj.S21_table)
        nmrObj.setPreampTuning(Vbias, Vvarac)
        Cpar, Cser = find_Cpar_Cser_from_table(nmrObj.client_path, tuning_freq,
                                               nmrObj.S11_table)
        # nmrObj.setMatchingNetwork( Cpar, Cser )

        timeObj.setTimeSta()
        # nmrObj.pamp_char_async ( sta_freq, sto_freq, spac_freq, samp_freq )
        nmrObj.pamp_char_sync(sta_freq, sto_freq, spac_freq, fftpts, fftcmd,
                              fftvalsub)
        timeObj.setTimeSto()
        timeObj.reportTimeRel("pamp_char_sync")

        timeObj.setTimeSta()

        if nmrObj.en_remote_computing:  # copy remote files to local directory
            cp_rmt_file(nmrObj.scp, nmrObj.server_data_folder,
                        nmrObj.client_data_folder, "current_folder.txt")

        meas_folder = parse_simple_info(nmrObj.data_folder,
                                        'current_folder.txt')

        if nmrObj.en_remote_computing:  # copy remote folder to local directory
            cp_rmt_folder(nmrObj.scp, nmrObj.server_data_folder,
                          nmrObj.client_data_folder, meas_folder[0])
            exec_rmt_ssh_cmd_in_datadir(
                nmrObj.ssh, "rm -rf " + meas_folder[0],
                nmrObj.server_data_folder)  # delete the file in the server

        # maxS21, maxS21_freq, _ = compute_gain_async( nmrObj, data_folder, meas_folder[0], en_fig, fig_num )
        # maxS21, maxS21_freq, _ = compute_gain_sync( nmrObj, nmrObj.data_folder, meas_folder[0], en_fig, fig_num )
        maxS21, maxS21_freq, _ = compute_gain_fft_sync(nmrObj,
                                                       nmrObj.data_folder,
                                                       meas_folder[0], en_fig,
                                                       fig_num)
        # print( 'maxS21={0:0.2f} maxS21_freq={1:0.2f}'.format( maxS21, maxS21_freq ) )
        print(
            'maxS21=%0.2f maxS21_freq=%0.2f Vbias=%0.2fV Vvarac=%0.2fV Cpar=%d Cser=%d'
            % (maxS21, maxS21_freq, Vbias, Vvarac, Cpar, Cser))

        timeObj.setTimeSto()
        timeObj.reportTimeRel("processing time")

        if (not continuous):
            break
Exemple #3
0
def analyze( nmrObj, extSet, cparVal, cserVal, freqSta, freqSto, freqSpa, freqSamp , fftpts, fftcmd, ftvalsub, S11mV_ref, useRef , en_fig ):
    # useRef: use the pregenerated S11mV_ref as a reference to compute
    # reflection. If this option is 0, then the compute_wobble will instead
    # generated S11 in mV format instead of dB format

    fig_num = 1

    # change matching network values (twice because sometimes it doesnt' work
    # once due to transient
    if ( not extSet ):  # if extSet is used, matching network should be programmed from external source (e.g. C executable), otherwise set the value from here
        nmrObj.setMatchingNetwork( cparVal, cserVal )
        # nmrObj.setMatchingNetwork( cparVal, cserVal )

    timeObj = time_meas( False )
    timeObj.setTimeSta()
    # do measurement
    if (wobble_mode == 0 or wobble_mode == 1):
        nmrObj.wobble_sync( freqSta, freqSto, freqSpa , fftpts, fftcmd, ftvalsub )
    elif (wobble_mode == 2):
        nmrObj.wobble_async( freqSta, freqSto, freqSpa, freqSamp )
    timeObj.setTimeSto()
    timeObj.reportTimeRel( "wobble_sync" )

    # disable all to save power
    # nmrObj.deassertAll()

    timeObj.setTimeSta()
    # compute the generated data
    if  nmrObj.en_remote_computing:  # copy remote files to local directory
        cp_rmt_file( nmrObj.scp, nmrObj.server_data_folder, nmrObj.client_data_folder, "current_folder.txt" )
    meas_folder = parse_simple_info( nmrObj.data_folder, 'current_folder.txt' )
    if  nmrObj.en_remote_computing:  # copy remote folder to local directory
        cp_rmt_folder( nmrObj.scp, nmrObj.server_data_folder, nmrObj.client_data_folder, meas_folder[0] )
        exec_rmt_ssh_cmd_in_datadir( nmrObj.ssh, "rm -rf " + meas_folder[0], nmrObj.server_data_folder )  # delete the file in the server
    timeObj.setTimeSto()
    timeObj.reportTimeRel( "transfer_data" )

    timeObj.setTimeSta()
    if (wobble_mode == 0):
        S11, S11_fmin, S11_fmax, S11_bw, minS11, minS11_freq = compute_wobble_fft_sync( nmrObj, nmrObj.data_folder, meas_folder[0], -10, S11mV_ref, useRef, en_fig, fig_num )
    elif (wobble_mode == 1):
        S11, S11_fmin, S11_fmax, S11_bw, minS11, minS11_freq, freq0, Z11_imag0 = compute_wobble_sync( nmrObj, nmrObj.data_folder, meas_folder[0], -10, S11mV_ref, useRef, en_fig, fig_num )
    elif (wobble_mode == 2):
        S11, S11_fmin, S11_fmax, S11_bw, minS11, minS11_freq = compute_wobble_async( nmrObj, nmrObj.data_folder, meas_folder[0], -10, S11mV_ref, useRef, en_fig, fig_num )

    print( '\t\tfmin={:0.3f} fmax={:0.3f} bw={:0.3f} minS11={:0.2f} minS11_freq={:0.3f} cparVal={:d} cserVal={:d}'.format( 
        S11_fmin, S11_fmax, S11_bw, minS11, minS11_freq, cparVal, cserVal ) )

    timeObj.setTimeSto()
    timeObj.reportTimeRel( "data processing" )

    return S11, S11_fmin, S11_fmax, S11_bw, minS11, minS11_freq
Exemple #4
0
def analyze( nmrObj , Vbias, Vvarac, freqSta, freqSto , freqSpa, freqSamp, fftpts, fftcmd, fftvalsub, continuous, en_fig ):

    fig_num = 1

    while True:

        # set the preamp tuning
        nmrObj.setPreampTuning( Vbias, Vvarac )
        
        if (mode == 0 or mode == 1):
            nmrObj.pamp_char_sync ( freqSta, freqSto, freqSpa, fftpts, fftcmd, fftvalsub )
        elif (mode == 2):
            nmrObj.pamp_char_async ( freqSta, freqSto, freqSpa, freqSamp )

        if  nmrObj.en_remote_computing:  # copy remote files to local directory
            cp_rmt_file( nmrObj.scp, nmrObj.server_data_folder, nmrObj.client_data_folder, "current_folder.txt" )

        meas_folder = parse_simple_info( nmrObj.data_folder, 'current_folder.txt' )
        # meas_folder[0] = "nmr_wobb_2018_06_25_12_44_48"

        if  nmrObj.en_remote_computing:  # copy remote folder to local directory
            cp_rmt_folder( nmrObj.scp, nmrObj.server_data_folder, nmrObj.client_data_folder, meas_folder[0] )
            exec_rmt_ssh_cmd_in_datadir( nmrObj.ssh, "rm -rf " + meas_folder[0], nmrObj.server_data_folder )  # delete the file in the server


        if (mode == 0):
            maxS21, maxS21_freq, S21mV = compute_gain_fft_sync( nmrObj, nmrObj.data_folder, meas_folder[0], en_fig, fig_num )
        elif (mode == 1): # UNTESTED
            maxS21, maxS21_freq, _ = compute_gain_sync( nmrObj, data_folder, meas_folder[0], en_fig, fig_num )
        elif (mode == 2):
            maxS21, maxS21_freq, S21mV = compute_gain_async( nmrObj, nmrObj.data_folder, meas_folder[0], en_fig, fig_num )
        
        print( "maxS21_fft=%0.2fdBmV maxS21_freq=%0.2fMHz Vbias=%0.2fV Vvarac=%0.2fV" % ( 
             maxS21, maxS21_freq, Vbias, Vvarac ) )

        if ( not continuous ):
            break;

    return maxS21, maxS21_freq, S21mV
Exemple #5
0
def analyze( nmrObj, samp_freq, samples, min_freq, max_freq, tuning_freq, meas_bw_kHz, continuous, en_fig ):

    # load parameters from table
    Cpar, Cser = find_Cpar_Cser_from_table ( nmrObj.client_path , tuning_freq, nmrObj.S11_table )
    Vbias, Vvarac = find_Vbias_Vvarac_from_table ( nmrObj.client_path , tuning_freq, nmrObj.S21_table )
    nmrObj.setPreampTuning( Vbias, Vvarac )  # try -2.7, -1.8 if fail
    # nmrObj.setMatchingNetwork( Cpar, Cser )  # 4.25 MHz AFE
    nmrObj.setMatchingNetwork( 2190, 484 )  # 4.25 MHz AFE
    
    # load parameters from config file
    # nmrObj.setPreampTuning( conf.vbias, conf.vvarac )  # try -2.7, -1.8 if fail
    # nmrObj.setMatchingNetwork( conf.cpar, conf.cser )  # 4.25 MHz AFE
    
    nmrObj.assertControlSignal( nmrObj.RX_FL_msk | nmrObj.RX_FH_msk | nmrObj.RX_SEL1_msk | nmrObj.RX2_L_msk | nmrObj.RX2_H_msk | nmrObj.RX1_1L_msk | nmrObj.RX1_1H_msk | nmrObj.PAMP_IN_SEL2_msk )
    # nmrObj.deassertControlSignal( nmrObj.RX_FH_msk | nmrObj.RX2_L_msk | nmrObj.RX_FH_msk )
    nmrObj.deassertControlSignal( nmrObj.RX_FL_msk )
    # nmrObj.deassertControlSignal( nmrObj.RX1_1H_msk | nmrObj.RX2_H_msk | nmrObj.RX_FH_msk )
    # nmrObj.assertControlSignal( nmrObj.RX1_2L_msk | nmrObj.RX_SEL2_msk | nmrObj.RX_FL_msk ) # for finding FFT wobble function ADC subtraction value

    while True:
        nmrObj.noise( samp_freq, samples )

        if  nmrObj.en_remote_computing:  # copy remote files to local directory
            cp_rmt_file( nmrObj.scp, nmrObj.server_data_folder, nmrObj.client_data_folder, "current_folder.txt" )

        # process the data
        meas_folder = parse_simple_info( nmrObj.data_folder, 'current_folder.txt' )

        if  nmrObj.en_remote_computing:  # copy remote folder to local directory
            cp_rmt_folder( nmrObj.scp, nmrObj.server_data_folder, nmrObj.client_data_folder, meas_folder[0] )
            exec_rmt_ssh_cmd_in_datadir( nmrObj.ssh, "rm -rf " + meas_folder[0], nmrObj.server_data_folder )  # delete the file in the server

        # compute_stats( min_freq, max_freq, data_folder, meas_folder[0], 'noise_plot.png', en_fig )
        compute_in_bw_noise( meas_bw_kHz, tuning_freq, min_freq, max_freq, nmrObj.data_folder, meas_folder[0], 'noise_plot.png', en_fig )

        if ( not continuous ):
            break
Exemple #6
0
nmrObj.deassertControlSignal(nmrObj.PSU_15V_TX_P_EN_msk
                             | nmrObj.PSU_15V_TX_N_EN_msk
                             | nmrObj.PSU_5V_TX_N_EN_msk
                             | nmrObj.PSU_5V_ADC_EN_msk
                             | nmrObj.PSU_5V_ANA_P_EN_msk
                             | nmrObj.PSU_5V_ANA_N_EN_msk)

if (process_data):

    # compute the generated data
    if en_remote_computing:  # copy remote files to local directory
        cp_rmt_file(nmrObj.scp, nmrObj.server_data_folder,
                    nmrObj.client_data_folder, "current_folder.txt")
    meas_folder = parse_simple_info(nmrObj.data_folder, 'current_folder.txt')

    if en_remote_computing:  # copy remote folder to local directory
        cp_rmt_folder(nmrObj.scp, nmrObj.server_data_folder,
                      nmrObj.client_data_folder, meas_folder[0])
        exec_rmt_ssh_cmd_in_datadir(
            nmrObj.ssh, "rm -rf " + meas_folder[0],
            nmrObj.server_data_folder)  # delete the file in the server
    (a, a_integ, a0, snr, T2, noise, res, theta, data_filt, echo_avg, Df,
     t_echospace) = compute_iterate(nmrObj, nmrObj.data_folder, meas_folder[0],
                                    0, 0, 0, direct_read, datain, en_fig,
                                    dconv_lpf_ord, dconv_lpf_cutoff_kHz)

if (meas_time):
    elapsed_time = time.time() - start_time
    print("data processing time: %.3f" % (elapsed_time))
    start_time = time.time()
Exemple #7
0
def nmr_t2_auto ( cpmg_freq, pulse1_us, pulse2_us, echo_spacing_us, scan_spacing_us, samples_per_echo, echoes_per_scan, init_adc_delay_compensation, number_of_iteration, ph_cycl_en, dconv_lpf_ord, dconv_lpf_cutoff_Hz, client_data_folder ):

    # configurations
    en_fig = 1  # enable figure
    direct_read = 0  # perform direct read from SDRAM. use with caution above!
    process_data = 1  # process data within the SoC
    en_remote_dbg = False
    en_remote_computing = True
    pulse1_dtcl = 0.5  # useless with current code
    pulse2_dtcl = 0.5  # useless with current code
    pulse180_t1_int = 0
    delay180_t1_int = 0
    tx_sd_msk = 1  # 1 to shutdown tx opamp during reception, or 0 to keep it powered up during reception
    en_dconv = 0  # enable downconversion in the fpga
    dconv_fact = 4  # downconversion factor. minimum of 4.
    echo_skip = 1  # echo skip factor. set to 1 for the ADC to capture all echoes

    # instantiate nmr object
    nmrObj = tunable_nmr_system_2018( client_data_folder, en_remote_dbg, en_remote_computing )

    # system setup
    nmrObj.initNmrSystem()  # necessary to set the GPIO initial setting. Also fix the
    nmrObj.assertControlSignal( nmrObj.PSU_15V_TX_P_EN_msk | nmrObj.PSU_15V_TX_N_EN_msk | nmrObj.PSU_5V_TX_N_EN_msk |
                               nmrObj.PSU_5V_ADC_EN_msk | nmrObj.PSU_5V_ANA_P_EN_msk |
                               nmrObj.PSU_5V_ANA_N_EN_msk )
    # nmrObj.deassertControlSignal(
    #    nmrObj.PSU_15V_TX_P_EN_msk | nmrObj.PSU_15V_TX_N_EN_msk)

    Vbias, Vvarac = find_Vbias_Vvarac_from_table ( nmrObj.client_path , cpmg_freq, nmrObj.S21_table )
    nmrObj.setPreampTuning( Vbias, Vvarac )
    Cpar, Cser = find_Cpar_Cser_from_table ( nmrObj.client_path , cpmg_freq, nmrObj.S11_table )
    nmrObj.setMatchingNetwork( Cpar, Cser )
    nmrObj.setMatchingNetwork( Cpar, Cser )

    # setting for WMP
    nmrObj.assertControlSignal( 
            nmrObj.RX1_1L_msk | nmrObj.RX1_1H_msk | nmrObj.RX2_L_msk | nmrObj.RX2_H_msk | nmrObj.RX_SEL1_msk | nmrObj.RX_FL_msk | nmrObj.RX_FH_msk | nmrObj.PAMP_IN_SEL2_msk )
    nmrObj.deassertControlSignal( nmrObj.RX1_1H_msk | nmrObj.RX_FH_msk )  # setting for UF
    # nmrObj.deassertControlSignal( nmrObj.RX_FL_msk ) # setting for WMP

    if ( direct_read ):
        datain = nmrObj.cpmgSequenceDirectRead( cpmg_freq, pulse1_us, pulse2_us, pulse1_dtcl, pulse2_dtcl, echo_spacing_us, scan_spacing_us, samples_per_echo,
                                               echoes_per_scan, init_adc_delay_compensation, number_of_iteration, ph_cycl_en,
                                               pulse180_t1_int, delay180_t1_int, tx_sd_msk )
    else:
        nmrObj.cpmgSequence( cpmg_freq, pulse1_us, pulse2_us, pulse1_dtcl, pulse2_dtcl, echo_spacing_us, scan_spacing_us, samples_per_echo,
                            echoes_per_scan, init_adc_delay_compensation, number_of_iteration,
                            ph_cycl_en, pulse180_t1_int, delay180_t1_int, tx_sd_msk, en_dconv, dconv_fact, echo_skip )
        datain = []  # set datain to 0 because the data will be read from file instead

    nmrObj.deassertControlSignal( 
            nmrObj.RX1_1H_msk | nmrObj.RX1_1L_msk | nmrObj.RX2_L_msk | nmrObj.RX2_H_msk | nmrObj.RX_SEL1_msk | nmrObj.RX_FL_msk | nmrObj.RX_FH_msk | nmrObj.PAMP_IN_SEL2_msk )

    nmrObj.setMatchingNetwork( 0, 0 )
    nmrObj.setPreampTuning( 0, 0 )
    nmrObj.deassertControlSignal( nmrObj.PSU_15V_TX_P_EN_msk | nmrObj.PSU_15V_TX_N_EN_msk | nmrObj.PSU_5V_TX_N_EN_msk |
                                 nmrObj.PSU_5V_ADC_EN_msk | nmrObj.PSU_5V_ANA_P_EN_msk | nmrObj.PSU_5V_ANA_N_EN_msk )
    
    

    if ( process_data ):

        # compute the generated data
        if  en_remote_computing:  # copy remote files to local directory
            cp_rmt_file( nmrObj.scp, nmrObj.server_data_folder, nmrObj.client_data_folder, "current_folder.txt" )
        meas_folder = parse_simple_info( nmrObj.data_folder, 'current_folder.txt' )

        if  en_remote_computing:  # copy remote folder to local directory
            cp_rmt_folder( nmrObj.scp, nmrObj.server_data_folder, nmrObj.client_data_folder, meas_folder[0] )
            exec_rmt_ssh_cmd_in_datadir( nmrObj.ssh, "rm -rf " + meas_folder[0], nmrObj.server_data_folder )  # delete the file in the server
        ( a, a_integ, a0, snr, T2, noise, res, theta, data_filt, echo_avg, Df, t_echospace ) = compute_iterate( nmrObj,
            nmrObj.data_folder, meas_folder[0], 0, 0, 0, direct_read, datain, en_fig , dconv_lpf_ord, dconv_lpf_cutoff_Hz )
        
    nmrObj.deassertAll()
    nmrObj.exit()
Exemple #8
0
Cpar, Cser = find_Cpar_Cser_from_table ( nmrObj.client_path , cpmg_freq, S11_table )
Vbias, Vvarac = find_Vbias_Vvarac_from_table ( nmrObj.client_path , cpmg_freq, S21_table )
nmrObj.setPreampTuning( Vbias, Vvarac )
nmrObj.setMatchingNetwork( Cpar, Cser )
nmrObj.setMatchingNetwork( Cpar, Cser )

nmrObj.assertControlSignal( 
        nmrObj.RX1_1L_msk | nmrObj.RX1_1H_msk | nmrObj.RX2_L_msk | nmrObj.RX2_H_msk | nmrObj.RX_SEL1_msk | nmrObj.RX_FL_msk | nmrObj.RX_FH_msk | nmrObj.PAMP_IN_SEL2_msk )
# nmrObj.deassertControlSignal( nmrObj.RX1_1L_msk | nmrObj.RX2_L_msk | nmrObj.RX_FL_msk )
nmrObj.deassertControlSignal( nmrObj.RX_FL_msk )

while True:
    nmrObj.fid( cpmg_freq, pulse2_us, pulse2_dtcl,
               scan_spacing_us, samples_per_echo, number_of_iteration, tx_opa_sd )

    # compute the generated data
    if  en_remote_computing:  # copy remote files to local directory
        cp_rmt_file( nmrObj, server_data_folder, client_data_folder, "current_folder.txt" )
    meas_folder = parse_simple_info( data_folder, 'current_folder.txt' )

    if  en_remote_computing:  # copy remote folder to local directory
        cp_rmt_folder( nmrObj, server_data_folder, client_data_folder, meas_folder[0] )
        exec_rmt_ssh_cmd_in_datadir( nmrObj, "rm -rf " + meas_folder[0] )  # delete the file in the server
    compute_stats( min_freq, max_freq, data_folder, meas_folder[0], 'fid_plot.png', en_fig )

nmrObj.deassertAll()
nmrObj.setMatchingNetwork( 0, 0 )  # 4.25 MHz AFE
nmrObj.setMatchingNetwork( 0, 0 )

Exemple #9
0
def nmr_t2_multifreq_auto ( cpmg_freq_list, pulse1_us, pulse2_us, echo_spacing_us, scan_spacing_us, multiscan_spacing_us, samples_per_echo, echoes_per_scan, init_adc_delay_compensation, number_of_iteration, ph_cycl_en, dconv_lpf_ord, dconv_lpf_cutoff_Hz, client_data_folder ):

    # configurations
    en_fig = 0  # enable figure
    direct_read = 0  # perform direct read from SDRAM. use with caution above!
    process_data = 1  # process data within the SoC
    en_remote_dbg = False
    en_remote_computing = True
    pulse1_dtcl = 0.5  # useless with current code
    pulse2_dtcl = 0.5  # useless with current code
    pulse180_t1_int = 0
    delay180_t1_int = 0
    tx_sd_msk = 1  # 1 to shutdown tx opamp during reception, or 0 to keep it powered up during reception
    en_dconv = 0  # enable downconversion in the fpga
    dconv_fact = 4  # downconversion factor. minimum of 4.
    echo_skip = 1  # echo skip factor. set to 1 for the ADC to capture all echoes

    # additional configurations
    timeObj = time_meas( True )

    # error checker
    if ( not ( len( cpmg_freq_list ) % 2 ) ):
        print( "ERROR: please use odd n number for total different frequencies used inside cpmg_freq_list to ensure phase cycling works correctly." )
        quit()

    # instantiate nmr object
    nmrObj = tunable_nmr_system_2018( client_data_folder, en_remote_dbg, en_remote_computing )

    # system setup
    nmrObj.initNmrSystem()  # necessary to set the GPIO initial setting. Also fix the
    nmrObj.assertControlSignal( nmrObj.PSU_15V_TX_P_EN_msk | nmrObj.PSU_15V_TX_N_EN_msk | nmrObj.PSU_5V_TX_N_EN_msk |
                               nmrObj.PSU_5V_ADC_EN_msk | nmrObj.PSU_5V_ANA_P_EN_msk |
                               nmrObj.PSU_5V_ANA_N_EN_msk )
    # nmrObj.deassertControlSignal(
    #    nmrObj.PSU_15V_TX_P_EN_msk | nmrObj.PSU_15V_TX_N_EN_msk)

    Vbias, Vvarac = find_Vbias_Vvarac_from_table ( nmrObj.client_path , cpmg_freq_list[0], nmrObj.S21_table )
    nmrObj.setPreampTuning( Vbias, Vvarac )
    Cpar, Cser = find_Cpar_Cser_from_table ( nmrObj.client_path , cpmg_freq_list[0], nmrObj.S11_table )
    nmrObj.setMatchingNetwork( Cpar, Cser )
    nmrObj.setMatchingNetwork( Cpar, Cser )

    vbias_list = np.zeros( len( cpmg_freq_list ), dtype = float )
    vvarac_list = np.zeros( len( cpmg_freq_list ), dtype = float )
    c_series_list = np.zeros( len( cpmg_freq_list ), dtype = int )
    c_shunt_list = np.zeros( len( cpmg_freq_list ), dtype = int )
    for i in range ( 0, len( cpmg_freq_list ) ):
        Vbias, Vvarac = find_Vbias_Vvarac_from_table ( nmrObj.client_path , cpmg_freq_list[i], nmrObj.S21_table )
        Cpar, Cser = find_Cpar_Cser_from_table ( nmrObj.client_path , cpmg_freq_list[i], nmrObj.S11_table )
        vbias_list[i] = Vbias
        vvarac_list[i] = Vvarac
        c_series_list[i] = Cser
        c_shunt_list[i] = Cpar

    # setting for WMP
    nmrObj.assertControlSignal( 
            nmrObj.RX1_1L_msk | nmrObj.RX1_1H_msk | nmrObj.RX2_L_msk | nmrObj.RX2_H_msk | nmrObj.RX_SEL1_msk | nmrObj.RX_FL_msk | nmrObj.RX_FH_msk | nmrObj.PAMP_IN_SEL2_msk )
    nmrObj.deassertControlSignal( nmrObj.RX1_1H_msk | nmrObj.RX_FH_msk )  # setting for UF
    # nmrObj.deassertControlSignal( nmrObj.RX_FL_msk ) # setting for WMP

    timeObj.setTimeSta()
    # nmrObj.cpmgSequence( cpmg_freq, pulse1_us, pulse2_us, pulse1_dtcl, pulse2_dtcl, echo_spacing_us, scan_spacing_us, samples_per_echo, echoes_per_scan, init_adc_delay_compensation, number_of_iteration, ph_cycl_en, pulse180_t1_int, delay180_t1_int, tx_sd_msk, en_dconv, dconv_fact, echo_skip )
    # nmrObj.cpmgSequence( cpmg_freq, pulse1_us, pulse2_us, pulse1_dtcl, pulse2_dtcl, echo_spacing_us, scan_spacing_us,                       samples_per_echo, echoes_per_scan, init_adc_delay_compensation, number_of_iteration, ph_cycl_en, pulse180_t1_int, delay180_t1_int, tx_sd_msk, en_dconv, dconv_fact, echo_skip )
    nmrObj.cpmgSequenceMultifreq( pulse1_us, pulse2_us, pulse1_dtcl, pulse2_dtcl, echo_spacing_us, scan_spacing_us, multiscan_spacing_us, samples_per_echo, echoes_per_scan, init_adc_delay_compensation, number_of_iteration, ph_cycl_en, pulse180_t1_int, delay180_t1_int, tx_sd_msk, en_dconv, dconv_fact, echo_skip, cpmg_freq_list, c_series_list, c_shunt_list, vbias_list, vvarac_list )
    datain = []  # set datain to 0 because the data will be read from file instead
    timeObj.setTimeSto()
    timeObj.reportTimeRel( "cpmgSequenceMultifreq" )

    nmrObj.deassertControlSignal( 
            nmrObj.RX1_1H_msk | nmrObj.RX1_1L_msk | nmrObj.RX2_L_msk | nmrObj.RX2_H_msk | nmrObj.RX_SEL1_msk | nmrObj.RX_FL_msk | nmrObj.RX_FH_msk | nmrObj.PAMP_IN_SEL2_msk )

    nmrObj.setMatchingNetwork( 0, 0 )
    nmrObj.setPreampTuning( 0, 0 )
    nmrObj.deassertControlSignal( nmrObj.PSU_15V_TX_P_EN_msk | nmrObj.PSU_15V_TX_N_EN_msk | nmrObj.PSU_5V_TX_N_EN_msk |
                                 nmrObj.PSU_5V_ADC_EN_msk | nmrObj.PSU_5V_ANA_P_EN_msk | nmrObj.PSU_5V_ANA_N_EN_msk )

    if ( process_data ):
        # compute the generated data
        if  en_remote_computing:  # copy remote files to local directory
            cp_rmt_file( nmrObj.scp, nmrObj.server_data_folder, nmrObj.client_data_folder, "current_folder.txt" )
        meas_folder = parse_simple_info( nmrObj.data_folder, 'current_folder.txt' )

        for i in range ( 0, len( cpmg_freq_list ) ):

            meas_folder[0] = meas_folder[0][:len( meas_folder[0] ) - 3] + "%03d" % i  # change the meas_folder name to different folder names generated by the C programming. 25 is the character count before the last 3 digit number.

            if  en_remote_computing:  # copy remote folder to local directory
                cp_rmt_folder( nmrObj.scp, nmrObj.server_data_folder, nmrObj.client_data_folder, meas_folder[0] )
                exec_rmt_ssh_cmd_in_datadir( nmrObj.ssh, "rm -rf " + meas_folder[0], nmrObj.server_data_folder )  # delete the file in the server
            ( a, a_integ, a0, snr, T2, noise, res, theta, data_filt, echo_avg, Df, t_echospace ) = compute_iterate( nmrObj,
                nmrObj.data_folder, meas_folder[0], 0, 0, 0, direct_read, datain, en_fig , dconv_lpf_ord, dconv_lpf_cutoff_Hz )