From 8534a00e706635e4fabaa2617ded502c82019416 Mon Sep 17 00:00:00 2001 From: manjaro-xfce Date: Sun, 27 Mar 2022 22:15:07 +0800 Subject: [PATCH] SDR Testing --- sdr_deepdetect/sdd_emitter/main.cpp | 13 +++++++++---- sdr_deepdetect/waveform.h | 6 +++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/sdr_deepdetect/sdd_emitter/main.cpp b/sdr_deepdetect/sdd_emitter/main.cpp index 59f9fe2..139a487 100644 --- a/sdr_deepdetect/sdd_emitter/main.cpp +++ b/sdr_deepdetect/sdd_emitter/main.cpp @@ -31,9 +31,9 @@ int runSend() const char * gainName = "PGA"; //Sample rate in Hz double sprate = SIGRATE ; - double tx_freq = 200.0e6; + double tx_freq = 100.8e6; double tx_sprate = sprate; - double tx_gain = 70; + double tx_gain = 80; double tx_bw = sprate; //发射信号。MIMO时,可以指定0,1 size_t tx_channel[] = {0}; @@ -115,6 +115,7 @@ int runSend() fprintf(stderr, "Press Ctrl+C to stop streaming.\n"); fprintf(stderr, "Input :"); + long long ctv = 0; // Actual streaming, TX Threading time_t tm_idle = time(0); while (!stop_signal_called) { @@ -178,11 +179,15 @@ int runSend() 1, &num_samps_sent)); total_sent += num_samps_sent; } - if (tm_idle + 10 < time(0)) + if (tm_idle + 1 < time(0)) { + ++ctv; tm_idle = time(0); char buf_tm[256]; - sprintf(buf_tm,"Time=%lld\n",tm_idle); + if (ctv % 10==0) + sprintf(buf_tm,"Time=%lld\n",tm_idle); + else + sprintf(buf_tm,"%lld\r",ctv); int sl = strlen(buf_tm); mtx_data.lock(); std::copy(buf_tm,buf_tm+sl,std::back_inserter(lst_data)); diff --git a/sdr_deepdetect/waveform.h b/sdr_deepdetect/waveform.h index 785fcc3..6200c8c 100644 --- a/sdr_deepdetect/waveform.h +++ b/sdr_deepdetect/waveform.h @@ -2,10 +2,10 @@ #define WAVEFORM_H typedef short SPTYPE; #define MODRATE_N 1 -#define C_AMP 32767 -#define SPREAD_RAT 800 +#define C_AMP 8192 +#define SPREAD_RAT 512 #define WAVSIZE SPREAD_RAT*MODRATE_N -#define SIGRATE 250000 +#define SIGRATE 200001 extern SPTYPE wav_spread[2][WAVSIZE][2]; extern float wav_xorr[2][WAVSIZE][2]; void init_wavform(); -- GitLab