Other Parts Discussed in Thread: AWRL1432
Hi,
I use mmwave studio+DCA1000 capture adc data. Radar Target Simulator set a target at 20m and 5m/s, but after studio post processing, target velocity is not 5m/s, why is this happening?
And the ADC data looks strange, is it a problem with the waveform configuration?
lua script for capture adc data
-- Chirp mode setup and RX data capture/postproc local num_rx_channels = 3 -- TX/RX channel config xw_status=mws.fecRfPwrOnOff(0,{h_RxChCtrlBitMask=(2^num_rx_channels)-1,h_TxChCtrlBitMask=3,c_MiscCtrl=1,h_Reserved1=0,w_Reserved2=0}) assert(xw_status == 0, "ERROR: API failed") -- RF Factory Cal to set RX gain, TX backoff local rx_gain_db = 38 local rf_fact_cal_start_freq_mhz = 77000 local cali_slope_MHzpus = 2.2 --Use 87 for a 4G BW. local Tx_BO = 0 xw_status, w_freqCode = mws.sensConvFreqToCode(0, 0, 1, rf_fact_cal_start_freq_mhz) assert(xw_status == 0, "ERROR: API failed") xw_status, w_slopeCode = mws.sensConvSlopeToCode(0,1,cali_slope_MHzpus) assert(xw_status == 0, "ERROR: API failed") -- -- VCO & LO dist factory cal + Tx/Rx Factory Cal xw_status, response=mws.fecRfBootCal(0,{h_CalCtrlBitMask=238,c_MiscCalCtrl=0,c_CalRxGainSel=rx_gain_db,c_CalTxBackOffSel0=Tx_BO,c_CalTxBackOffSel1=Tx_BO,c_CalTxBackOffSel2=0,c_CalTxBackOffSel3=0,h_CalRfFreq=w_freqCode,xh_CalRfSlope=w_slopeCode,c_TxPwrCalTxEnaMask0=3,c_TxPwrCalTxEnaMask1=1,c_TxPwrCalTxEnaMask2=0,c_TxPwrCalTxEnaMask3=0}) assert(xw_status == 0, "ERROR: API failed") -- Run Cal : setting Tx power and Rx gain cal to default LUT values, overriding rx_gain_db & Tx_BO above xw_status, response=mws.fecRfRuntimeCal(0,{h_CalCtrlBitMask=206,h_Reserved0=0,c_TempBinIndex=8}) assert(xw_status == 0, "ERROR: API failed") -- Chirp/profile common configuration local rf_start_freq_mhz = 77000 local num_samples_per_chirp = 512 local slope_MHzpus = 4.59 local Sampling_Rate_Decimator = 16 -- 100/Sampling_Rate_Decimator is the Sampling Rate, local ramp_end_time_us = 96.6 local idle_time_us = 7 local tx_start_time_us = 1 local adc_start_time_us = 0 local Num_Skip_Samples = 63 local MIMO_mode = 4 -- 0, manual 1:tdm-mimo, 4: BPM-MIMO local Tx_enable = 3 -- 1: Tx 1 enable, 2: Tx2 enable, 3: Tx1 & Tx2 enable. local hpf_sel = 1 -- HPF corner frequency 0: 175KHz; 1: 350KHz; 2:700KHz; 3: 1400KHz local hpf_fast_init_duration_us = 1.5 --local HPF_Fast_Init_Enable = 1 --local CRD_en = 1 -- 0 or 1 only --local CRD_dith_en = 1 -- 0 or 1 only local MiscSetting = 0 --(1- HPF_Fast_Init_Enable)+(1-CRD_en)*2 + (1-CRD_dith_en)*4 -- 0: CRD Enable/dither dis 2: CRD disable local CRD_Slope = 0x277 -- = totalBandInKHz/min(6, (idleTimeInus-1))/457.763 xw_status, hpf_fast_init_duration_code = mws.sensConvTimeToCode(0,0,hpf_fast_init_duration_us) assert(xw_status == 0, "ERROR: API failed") xw_status, ramp_end_time_code = mws.sensConvTimeToCode(0,0,ramp_end_time_us) assert(xw_status == 0, "ERROR: API failed") xw_status, w_timeCode = mws.sensConvTimeToCode(0,1,10) assert(xw_status == 0, "ERROR: API failed") xw_status=mws.sensChirpPfComnCfg(0,{c_DigOutputSampRate=Sampling_Rate_Decimator,c_DigOutputBitsSel=0,c_DfeFirSel=0,c_VcoMultiChipMode=0,h_NumOfAdcSamples=num_samples_per_chirp,c_ChirpTxMimoPatSel=MIMO_mode,c_MiscSettings=MiscSetting,c_HpfFastInitDuration=hpf_fast_init_duration_code,h_CrdNSlopeMag=CRD_Slope,h_ChirpRampEndTime=ramp_end_time_code,c_ChirpRxHpfSel=hpf_sel}) assert(xw_status == 0, "ERROR: API failed") -- Chirp/profile timing configuration xw_status, idle_time_code = mws.sensConvTimeToCode(0,0,idle_time_us) assert(xw_status == 0, "ERROR: API failed") xw_status, adc_start_time_code = mws.sensConvTimeToCode(0,0,adc_start_time_us) assert(xw_status == 0, "ERROR: API failed") adc_start_time_code = adc_start_time_code + 1024*Num_Skip_Samples print("================") print(adc_start_time_code) xw_status, tx_start_time_code = mws.sensConvTimeToCode(0,0,tx_start_time_us) assert(xw_status == 0, "ERROR: API failed") xw_status, w_slopeCode = mws.sensConvSlopeToCode(0,1,slope_MHzpus) assert(xw_status == 0, "ERROR: API failed") xw_status, w_freqCode = mws.sensConvFreqToCode(0, 0, 1, rf_start_freq_mhz) assert(xw_status == 0, "ERROR: API failed") xw_status=mws.sensChirpPfTimeCfg(0,{h_ChirpIdleTime=idle_time_code,h_ChirpAdcStartTime=adc_start_time_code,xh_ChirpTxStartTime=tx_start_time_code,xh_ChirpRfFreqSlope=w_slopeCode,w_ChirpRfFreqStart=w_freqCode,h_ChirpTxEnSel=Tx_enable,h_ChirpTxBpmEnSel=0,w_Reserved1=0,w_Reserved2=0,w_Reserved3=0,w_Reserved4=0,w_Reserved5=0}) assert(xw_status == 0, "ERROR: API failed") -- Frame configuration local burst_period_us = 305 -- need to >= (num_chirp_per_burst * (idleTime + RampTime) + 100us) local num_burst_per_frame = 64 local num_chirp_per_burst = 2 local num_frames = 20 xw_status, burst_period_code = mws.sensConvTimeToCode(0,0,burst_period_us) assert(xw_status == 0, "ERROR: API failed") local frame_period_us = 100000 xw_status, w_ftPeriodCode = mws.sensConvFtPeriodToCode(0, 10240, frame_period_us) assert(xw_status == 0, "ERROR: API failed") xw_status=mws.sensFrameCfg(0,{h_NumOfChirpsInBurst=num_chirp_per_burst,c_NumOfChirpsAccum=0,w_BurstPeriodicity=burst_period_code,h_NumOfBurstsInFrame=num_burst_per_frame,w_FramePeriodicity=w_ftPeriodCode,h_NumOfFrames=num_frames,w_FrameEvent0TimeCfg=0,w_FrameEvent1TimeCfg=0}) assert(xw_status == 0, "ERROR: API failed") -- Enable RDIF xw_status=mws.fecRdifctrl(0,{c_RdifEnable=10,c_RdifCfg=40,h_RdifSampleCount=num_samples_per_chirp,c_TestPatternEn=0,c_LaneRateCfg=0,h_Reserved2=0,h_TestPatrnInitCodeCh0=20,h_TestPatrnInitCodeCh1=20,h_TestPatrnInitCodeCh2=20,h_Reserved3=0,h_TestPatrnIncrCodeCh0=20,h_TestPatrnIncrCodeCh1=20,h_TestPatrnIncrCodeCh2=20,h_Reserved4=0,w_Reserved5=0}) assert(xw_status == 0, "ERROR: API failed") --mws.Calling_WriteAddr_Single(0x51000020,0x0) -- Sets Frac ADC and skip sample to 0 -> ADC start time = 0 -- ******************* CAPTURE SEQUENCE STARTS HERE *********************** -- Remove old ADC bin file if it exists (DCA1000 adds "_Raw_0" to filename) local adc_bin_file_directory = RSTD.GetWorkingDirectory() .. [[\..\PostProc\]] local adc_bin_file = adc_bin_file_directory .. [[adc_data1.bin]] os.remove(adc_bin_file_directory .. [[adc_data_Raw_0.bin]]) -- Arm DCA1000 for capture (using "Infinite" stop mode which will stop capture automatically once data from device stops) xw_status=mws.captureCardStartRecord(adc_bin_file, 1, 1, 4096) assert(xw_status == 0, "ERROR: API failed") p(1000) -- Trigger start of framing xw_status=mws.sensorStart(0,{c_FrameTrigMode=0,c_ChirpStartSigLbEn=0,c_FrameLivMonEn=0,c_Reserved=0,w_FrameTrigTimerVal=0,w_Reserved1=0}) assert(xw_status == 0, "ERROR: API failed") -- <<< CAPTURE HAPPENS HERE >>> -- Wait 4 sec print("Waiting 4 sec") p(4000) -- ******************* CAPTURE SEQUENCE ENDS HERE *********************** -- Start Matlab Postproc xw_status = mws.StartMatlabPostProc(adc_bin_file, 0) assert(xw_status == 0, "ERROR: API failed")