mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-03-26 17:45:28 +01:00
Fixed FIR bug with the pluto module
This commit is contained in:
parent
e06ed84330
commit
eac0a7a13f
@ -21,6 +21,7 @@ if (MSVC)
|
|||||||
target_include_directories(sdrpp_core PUBLIC "C:/Program Files/PothosSDR/include/")
|
target_include_directories(sdrpp_core PUBLIC "C:/Program Files/PothosSDR/include/")
|
||||||
|
|
||||||
target_link_libraries(plutosdr_source PUBLIC libiio)
|
target_link_libraries(plutosdr_source PUBLIC libiio)
|
||||||
|
target_link_libraries(plutosdr_source PUBLIC libad9361)
|
||||||
else (MSVC)
|
else (MSVC)
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include <core.h>
|
#include <core.h>
|
||||||
#include <gui/style.h>
|
#include <gui/style.h>
|
||||||
#include <iio.h>
|
#include <iio.h>
|
||||||
|
#include <ad9361.h>
|
||||||
|
|
||||||
#define CONCAT(a, b) ((std::string(a) + b).c_str())
|
#define CONCAT(a, b) ((std::string(a) + b).c_str())
|
||||||
|
|
||||||
@ -84,11 +85,16 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Configure pluto
|
// Configure pluto
|
||||||
iio_channel_attr_write_longlong(iio_device_find_channel(_this->phy, "altvoltage0", true), "frequency", _this->freq); // Freq
|
iio_channel_attr_write_bool(iio_device_find_channel(_this->phy, "altvoltage1", true), "powerdown", true);
|
||||||
iio_channel_attr_write_longlong(iio_device_find_channel(_this->phy, "voltage0", false), "sampling_frequency", _this->sampleRate); // Sample rate
|
iio_channel_attr_write_bool(iio_device_find_channel(_this->phy, "altvoltage0", true), "powerdown", false);
|
||||||
iio_channel_attr_write(iio_device_find_channel(_this->phy, "voltage0", false), "gain_control_mode", "manual"); // manual gain
|
|
||||||
iio_channel_attr_write_longlong(iio_device_find_channel(_this->phy, "voltage0", false), "hardwaregain", _this->gain); // gain
|
|
||||||
|
|
||||||
|
iio_channel_attr_write(iio_device_find_channel(_this->phy, "voltage0", false), "rf_port_select", "A_BALANCED");
|
||||||
|
iio_channel_attr_write_longlong(iio_device_find_channel(_this->phy, "altvoltage0", true), "frequency", round(_this->freq)); // Freq
|
||||||
|
iio_channel_attr_write_longlong(iio_device_find_channel(_this->phy, "voltage0", false), "sampling_frequency", round(_this->sampleRate)); // Sample rate
|
||||||
|
iio_channel_attr_write(iio_device_find_channel(_this->phy, "voltage0", false), "gain_control_mode", gainModes[_this->gainMode]); // manual gain
|
||||||
|
iio_channel_attr_write_longlong(iio_device_find_channel(_this->phy, "voltage0", false), "hardwaregain", round(_this->gain)); // gain
|
||||||
|
ad9361_set_bb_rate(_this->phy, round(_this->sampleRate));
|
||||||
|
|
||||||
_this->running = true;
|
_this->running = true;
|
||||||
_this->workerThread = std::thread(worker, _this);
|
_this->workerThread = std::thread(worker, _this);
|
||||||
spdlog::info("PlutoSDRSourceModule '{0}': Start!", _this->name);
|
spdlog::info("PlutoSDRSourceModule '{0}': Start!", _this->name);
|
||||||
@ -115,11 +121,11 @@ private:
|
|||||||
|
|
||||||
static void tune(double freq, void* ctx) {
|
static void tune(double freq, void* ctx) {
|
||||||
PlutoSDRSourceModule* _this = (PlutoSDRSourceModule*)ctx;
|
PlutoSDRSourceModule* _this = (PlutoSDRSourceModule*)ctx;
|
||||||
|
_this->freq = freq;
|
||||||
if (_this->running) {
|
if (_this->running) {
|
||||||
// SET PLUTO FREQ HERE
|
// SET PLUTO FREQ HERE
|
||||||
iio_channel_attr_write_longlong(iio_device_find_channel(_this->phy, "altvoltage0", true), "frequency", _this->freq);
|
iio_channel_attr_write_longlong(iio_device_find_channel(_this->phy, "altvoltage0", true), "frequency", round(_this->freq));
|
||||||
}
|
}
|
||||||
_this->freq = freq;
|
|
||||||
spdlog::info("PlutoSDRSourceModule '{0}': Tune: {1}!", _this->name, freq);
|
spdlog::info("PlutoSDRSourceModule '{0}': Tune: {1}!", _this->name, freq);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,25 +136,37 @@ private:
|
|||||||
ImGui::Text("IP");
|
ImGui::Text("IP");
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
||||||
ImGui::InputText("", &_this->ip[3], 16);
|
ImGui::InputText(CONCAT("##_pluto_ip_", _this->name), &_this->ip[3], 16);
|
||||||
|
|
||||||
// SELECT PLUTO HERE
|
ImGui::Text("Samplerate");
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
||||||
|
if (_this->running) { style::beginDisabled(); }
|
||||||
|
if (ImGui::InputFloat(CONCAT("##_samplerate_select_", _this->name), &_this->sampleRate, 1, 1000, 0)) {
|
||||||
|
core::setInputSampleRate(_this->sampleRate);
|
||||||
|
}
|
||||||
|
if (_this->running) { style::endDisabled(); }
|
||||||
|
|
||||||
ImGui::Text("Gain Mode");
|
ImGui::Text("Gain Mode");
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
||||||
if (ImGui::Combo("", &_this->gainMode, gainModesTxt)) {
|
if (ImGui::Combo(CONCAT("##_gainmode_select_", _this->name), &_this->gainMode, gainModesTxt)) {
|
||||||
|
if (_this->running) {
|
||||||
|
iio_channel_attr_write(iio_device_find_channel(_this->phy, "voltage0", false), "gain_control_mode", gainModes[_this->gainMode]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Text("PGA Gain");
|
ImGui::Text("PGA Gain");
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
||||||
|
if (_this->gainMode) { style::beginDisabled(); }
|
||||||
if (ImGui::SliderFloat(CONCAT("##_gain_select_", _this->name), &_this->gain, 0, 76)) {
|
if (ImGui::SliderFloat(CONCAT("##_gain_select_", _this->name), &_this->gain, 0, 76)) {
|
||||||
if (_this->running) {
|
if (_this->running) {
|
||||||
// SET PLUTO GAIN HERE
|
// SET PLUTO GAIN HERE
|
||||||
iio_channel_attr_write_longlong(iio_device_find_channel(_this->phy, "voltage0", false),"hardwaregain", _this->gain);
|
iio_channel_attr_write_longlong(iio_device_find_channel(_this->phy, "voltage0", false),"hardwaregain", round(_this->gain));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (_this->gainMode) { style::endDisabled(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
static void worker(void* ctx) {
|
static void worker(void* ctx) {
|
||||||
@ -190,13 +208,14 @@ private:
|
|||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
dsp::stream<dsp::complex_t> stream;
|
dsp::stream<dsp::complex_t> stream;
|
||||||
double sampleRate;
|
float sampleRate;
|
||||||
SourceManager::SourceHandler handler;
|
SourceManager::SourceHandler handler;
|
||||||
std::thread workerThread;
|
std::thread workerThread;
|
||||||
struct iio_context *ctx = NULL;
|
struct iio_context *ctx = NULL;
|
||||||
struct iio_device *phy = NULL;
|
struct iio_device *phy = NULL;
|
||||||
struct iio_device *dev = NULL;
|
struct iio_device *dev = NULL;
|
||||||
bool running = false;
|
bool running = false;
|
||||||
|
bool ipMode = true;
|
||||||
double freq;
|
double freq;
|
||||||
char ip[1024] = "ip:192.168.2.1";
|
char ip[1024] = "ip:192.168.2.1";
|
||||||
int port = 1234;
|
int port = 1234;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
SDR++ is a cross-platform and open source SDR software with the aim of being bloat free and simple to use.
|
SDR++ is a cross-platform and open source SDR software with the aim of being bloat free and simple to use.
|
||||||
|
|
||||||
## Current Features
|
## Current Features
|
||||||
|
|
||||||
* Uses SoapySDR for wide hardware support
|
* Uses SoapySDR for wide hardware support
|
||||||
* Hardware accelerated graphics (OpenGL + ImGui)
|
* Hardware accelerated graphics (OpenGL + ImGui)
|
||||||
* SIMD accelerated DSP (parts of the DSP are still missing)
|
* SIMD accelerated DSP (parts of the DSP are still missing)
|
||||||
@ -10,12 +11,14 @@ SDR++ is a cross-platform and open source SDR software with the aim of being blo
|
|||||||
* Full waterfall update when possible. Makes browsing signals easier and more pleasant
|
* Full waterfall update when possible. Makes browsing signals easier and more pleasant
|
||||||
|
|
||||||
## Comming soon
|
## Comming soon
|
||||||
|
|
||||||
* Multi-VFO
|
* Multi-VFO
|
||||||
* Plugins
|
* Plugins
|
||||||
* Digital demodulators and decoders
|
* Digital demodulators and decoders
|
||||||
* Quick replay (replay last n seconds, cool if you missed a short signal)
|
* Quick replay (replay last n seconds, cool if you missed a short signal)
|
||||||
|
|
||||||
## Small things to add
|
## Small things to add
|
||||||
|
|
||||||
* Switchable bandwidth for demodulators
|
* Switchable bandwidth for demodulators
|
||||||
* Switchable audio output device and sample rate
|
* Switchable audio output device and sample rate
|
||||||
* Recording
|
* Recording
|
||||||
@ -29,6 +32,7 @@ SDR++ is a cross-platform and open source SDR software with the aim of being blo
|
|||||||
* Input filter bandwidth option
|
* Input filter bandwidth option
|
||||||
|
|
||||||
## Known issues (please check before reporting)
|
## Known issues (please check before reporting)
|
||||||
|
|
||||||
* Random crashes (yikes)
|
* Random crashes (yikes)
|
||||||
* Gains aren't stepped
|
* Gains aren't stepped
|
||||||
* The default gains might contain a bogus value before being adjusted
|
* The default gains might contain a bogus value before being adjusted
|
||||||
@ -38,6 +42,7 @@ SDR++ is a cross-platform and open source SDR software with the aim of being blo
|
|||||||
|
|
||||||
# Building on Windows
|
# Building on Windows
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
* cmake
|
* cmake
|
||||||
* vcpkg (for the packages listed below)
|
* vcpkg (for the packages listed below)
|
||||||
* fftw3
|
* fftw3
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"Radio": {
|
"Radio": {
|
||||||
"device": "Speakers (Realtek High Definiti",
|
"device": "Speakers (Realtek High Definiti",
|
||||||
"sampleRate": 48000.0,
|
"sampleRate": 48000.0,
|
||||||
"volume": 0.3777777850627899
|
"volume": 0.546875
|
||||||
},
|
},
|
||||||
"Radio 1": {
|
"Radio 1": {
|
||||||
"device": "Speakers (Realtek High Definition Audio)",
|
"device": "Speakers (Realtek High Definition Audio)",
|
||||||
@ -20,7 +20,7 @@
|
|||||||
"bandPlanEnabled": true,
|
"bandPlanEnabled": true,
|
||||||
"defaultSink": "Audio",
|
"defaultSink": "Audio",
|
||||||
"fftHeight": 296,
|
"fftHeight": 296,
|
||||||
"frequency": 99000000,
|
"frequency": 1090020000,
|
||||||
"max": 0.0,
|
"max": 0.0,
|
||||||
"maximized": false,
|
"maximized": false,
|
||||||
"menuOrder": [
|
"menuOrder": [
|
||||||
@ -33,7 +33,7 @@
|
|||||||
"Display"
|
"Display"
|
||||||
],
|
],
|
||||||
"menuWidth": 300,
|
"menuWidth": 300,
|
||||||
"min": -69.11764526367188,
|
"min": -70.5882339477539,
|
||||||
"showWaterfall": true,
|
"showWaterfall": true,
|
||||||
"source": "",
|
"source": "",
|
||||||
"sourceSettings": {},
|
"sourceSettings": {},
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
"gains": {
|
"gains": {
|
||||||
"PGA": 0.0
|
"PGA": 0.0
|
||||||
},
|
},
|
||||||
"sampleRate": 4000000.0
|
"sampleRate": 8000000.0
|
||||||
},
|
},
|
||||||
"AirSpy HF+ [c852435de0224af7]": {
|
"AirSpy HF+ [c852435de0224af7]": {
|
||||||
"gains": {
|
"gains": {
|
||||||
"LNA": 6.0,
|
"LNA": 5.989999771118164,
|
||||||
"RF": 0.0
|
"RF": 6.0
|
||||||
},
|
},
|
||||||
"sampleRate": 768000.0
|
"sampleRate": 768000.0
|
||||||
},
|
},
|
||||||
@ -22,17 +22,17 @@
|
|||||||
},
|
},
|
||||||
"Generic RTL2832U OEM :: 00000001": {
|
"Generic RTL2832U OEM :: 00000001": {
|
||||||
"gains": {
|
"gains": {
|
||||||
"TUNER": 7.244999885559082
|
"TUNER": 0.0
|
||||||
},
|
},
|
||||||
"sampleRate": 250000.0
|
"sampleRate": 2560000.0
|
||||||
},
|
},
|
||||||
"HackRF One #0 901868dc282c8f8b": {
|
"HackRF One #0 901868dc282c8f8b": {
|
||||||
"gains": {
|
"gains": {
|
||||||
"AMP": 0.0,
|
"AMP": 0.0,
|
||||||
"LNA": 24.711999893188477,
|
"LNA": 24.711999893188477,
|
||||||
"VGA": 16.02899932861328
|
"VGA": 21.749000549316406
|
||||||
},
|
},
|
||||||
"sampleRate": 8000000.0
|
"sampleRate": 2000000.0
|
||||||
},
|
},
|
||||||
"Microphone (Realtek High Definition Audio)": {
|
"Microphone (Realtek High Definition Audio)": {
|
||||||
"sampleRate": 96000.0
|
"sampleRate": 96000.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user