mirror of
https://github.com/30hours/blah2.git
synced 2024-11-08 12:25:42 +00:00
Add SDRplay params to config file
This commit is contained in:
parent
0087258f3d
commit
904a8381f8
3 changed files with 24 additions and 21 deletions
|
@ -70,7 +70,17 @@ std::unique_ptr<Source> Capture::factory_source(const std::string& type, c4::yml
|
||||||
// SDRplay RSPduo
|
// SDRplay RSPduo
|
||||||
if (type == VALID_TYPE[0])
|
if (type == VALID_TYPE[0])
|
||||||
{
|
{
|
||||||
return std::make_unique<RspDuo>(type, fc, fs, path, &saveIq);
|
int agcSetPoint, bandwidthNumber, gainReduction, lnaState;
|
||||||
|
bool dabNotch, rfNotch;
|
||||||
|
config["agcSetPoint"] >> agcSetPoint;
|
||||||
|
config["bandwidthNumber"] >> bandwidthNumber;
|
||||||
|
config["gainReduction"] >> gainReduction;
|
||||||
|
config["lnaState"] >> lnaState;
|
||||||
|
config["dabNotch"] >> dabNotch;
|
||||||
|
config["rfNotch"] >> rfNotch;
|
||||||
|
return std::make_unique<RspDuo>(type, fc, fs, path, &saveIq,
|
||||||
|
agcSetPoint, bandwidthNumber, gainReduction, lnaState,
|
||||||
|
dabNotch, rfNotch);
|
||||||
}
|
}
|
||||||
// Usrp
|
// Usrp
|
||||||
else if (type == VALID_TYPE[1])
|
else if (type == VALID_TYPE[1])
|
||||||
|
|
|
@ -14,13 +14,9 @@
|
||||||
|
|
||||||
// class static constants
|
// class static constants
|
||||||
const double RspDuo::MAX_FREQUENCY_NR = 2000000000;
|
const double RspDuo::MAX_FREQUENCY_NR = 2000000000;
|
||||||
const int RspDuo::DEF_AGC_BANDWIDTH_NR = 50; // default agc bandwidth
|
|
||||||
const int RspDuo::MIN_AGC_SET_POINT_NR = -72; // min agc set point
|
const int RspDuo::MIN_AGC_SET_POINT_NR = -72; // min agc set point
|
||||||
const int RspDuo::DEF_AGC_SET_POINT_NR = -60; // default agc set point
|
|
||||||
const int RspDuo::MIN_GAIN_REDUCTION_NR = 20; // min gain reduction
|
const int RspDuo::MIN_GAIN_REDUCTION_NR = 20; // min gain reduction
|
||||||
const int RspDuo::DEF_GAIN_REDUCTION_NR = 40; // default gain reduction
|
|
||||||
const int RspDuo::MAX_GAIN_REDUCTION_NR = 60; // max gain reduction
|
const int RspDuo::MAX_GAIN_REDUCTION_NR = 60; // max gain reduction
|
||||||
const int RspDuo::DEF_LNA_STATE_NR = 4; // default lna state
|
|
||||||
const int RspDuo::MAX_LNA_STATE_NR = 9; // max lna state
|
const int RspDuo::MAX_LNA_STATE_NR = 9; // max lna state
|
||||||
const int RspDuo::DEF_SAMPLE_RATE_NR = 2000000; // default sample rate
|
const int RspDuo::DEF_SAMPLE_RATE_NR = 2000000; // default sample rate
|
||||||
|
|
||||||
|
@ -47,7 +43,10 @@ IqData *buffer2;
|
||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
RspDuo::RspDuo(std::string _type, uint32_t _fc,
|
RspDuo::RspDuo(std::string _type, uint32_t _fc,
|
||||||
uint32_t _fs, std::string _path, bool *_saveIq)
|
uint32_t _fs, std::string _path, bool *_saveIq,
|
||||||
|
int _agcSetPoint, int _bandwidthNumber,
|
||||||
|
int _gainReduction, int _lnaState,
|
||||||
|
bool _dabNotch, bool _rfNotch)
|
||||||
: Source(_type, _fc, _fs, _path, _saveIq)
|
: Source(_type, _fc, _fs, _path, _saveIq)
|
||||||
{
|
{
|
||||||
std::unordered_map<int, int> decimationMap = {
|
std::unordered_map<int, int> decimationMap = {
|
||||||
|
@ -60,14 +59,14 @@ RspDuo::RspDuo(std::string _type, uint32_t _fc,
|
||||||
};
|
};
|
||||||
nDecimation = decimationMap[fs];
|
nDecimation = decimationMap[fs];
|
||||||
usb_bulk_fg = false;
|
usb_bulk_fg = false;
|
||||||
agc_bandwidth_nr = DEF_AGC_BANDWIDTH_NR;
|
|
||||||
agc_set_point_nr = DEF_AGC_SET_POINT_NR;
|
|
||||||
gain_reduction_nr = DEF_GAIN_REDUCTION_NR;
|
|
||||||
lna_state_nr = DEF_LNA_STATE_NR;
|
|
||||||
rf_notch_fg = false;
|
|
||||||
dab_notch_fg = false;
|
|
||||||
capture_fg = saveIq;
|
capture_fg = saveIq;
|
||||||
saveIqFileLocal = &saveIqFile;
|
saveIqFileLocal = &saveIqFile;
|
||||||
|
agc_bandwidth_nr = _bandwidthNumber;
|
||||||
|
agc_set_point_nr = _agcSetPoint;
|
||||||
|
gain_reduction_nr = _gainReduction;
|
||||||
|
lna_state_nr = _lnaState;
|
||||||
|
rf_notch_fg = _rfNotch;
|
||||||
|
dab_notch_fg = _dabNotch;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RspDuo::start()
|
void RspDuo::start()
|
||||||
|
|
|
@ -50,20 +50,12 @@ private:
|
||||||
|
|
||||||
/// @brief Maximum frequency (Hz).
|
/// @brief Maximum frequency (Hz).
|
||||||
static const double MAX_FREQUENCY_NR;
|
static const double MAX_FREQUENCY_NR;
|
||||||
/// @brief Default AGC bandwidth.
|
|
||||||
static const int DEF_AGC_BANDWIDTH_NR;
|
|
||||||
/// @brief Minimum AGC set point.
|
/// @brief Minimum AGC set point.
|
||||||
static const int MIN_AGC_SET_POINT_NR;
|
static const int MIN_AGC_SET_POINT_NR;
|
||||||
/// @brief Default AGC set point.
|
|
||||||
static const int DEF_AGC_SET_POINT_NR;
|
|
||||||
/// @brief Minimum gain reduction.
|
/// @brief Minimum gain reduction.
|
||||||
static const int MIN_GAIN_REDUCTION_NR;
|
static const int MIN_GAIN_REDUCTION_NR;
|
||||||
/// @brief Default gain reduction.
|
|
||||||
static const int DEF_GAIN_REDUCTION_NR;
|
|
||||||
/// @brief Maximum gain reduction.
|
/// @brief Maximum gain reduction.
|
||||||
static const int MAX_GAIN_REDUCTION_NR;
|
static const int MAX_GAIN_REDUCTION_NR;
|
||||||
/// @brief Default LNA state.
|
|
||||||
static const int DEF_LNA_STATE_NR;
|
|
||||||
/// @brief Max LNA state.
|
/// @brief Max LNA state.
|
||||||
static const int MAX_LNA_STATE_NR;
|
static const int MAX_LNA_STATE_NR;
|
||||||
/// @brief Default sample rate.
|
/// @brief Default sample rate.
|
||||||
|
@ -164,7 +156,9 @@ public:
|
||||||
/// @param path Path to save IQ data.
|
/// @param path Path to save IQ data.
|
||||||
/// @return The object.
|
/// @return The object.
|
||||||
RspDuo(std::string type, uint32_t fc, uint32_t fs,
|
RspDuo(std::string type, uint32_t fc, uint32_t fs,
|
||||||
std::string path, bool *saveIq);
|
std::string path, bool *saveIq, int agcSetPoint,
|
||||||
|
int bandwidthNumber, int gainReduction,
|
||||||
|
int lnaState, bool dabNotch, bool rfNotch);
|
||||||
|
|
||||||
/// @brief Implement capture function on RSPduo.
|
/// @brief Implement capture function on RSPduo.
|
||||||
/// @param buffer1 Pointer to reference buffer.
|
/// @param buffer1 Pointer to reference buffer.
|
||||||
|
|
Loading…
Reference in a new issue