Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Precise committed Feb 14, 2024
2 parents 418266a + 650a619 commit a52b634
Show file tree
Hide file tree
Showing 14 changed files with 164 additions and 378 deletions.
65 changes: 60 additions & 5 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
run: 7z x libusb.7z -olibusb_old ; rm "C:/Program Files/PothosSDR/bin/libusb-1.0.dll" ; cp "libusb_old/MS64/dll/libusb-1.0.dll" "C:/Program Files/PothosSDR/bin/" ; rm "C:/Program Files/PothosSDR/lib/libusb-1.0.lib" ; cp "libusb_old/MS64/dll/libusb-1.0.lib" "C:/Program Files/PothosSDR/lib/"

- name: Download SDRPlay API
run: Invoke-WebRequest -Uri "https://drive.google.com/uc?id=12UHPMwkfa67A11QZDmpCT4iwHnyJHWuu&confirm=t" -OutFile ${{runner.workspace}}/SDRPlay.zip
run: Invoke-WebRequest -Uri "https://www.sdrpp.org/SDRplay.zip" -OutFile ${{runner.workspace}}/SDRplay.zip

- name: Install SDRPlay API
run: 7z x ${{runner.workspace}}/SDRPlay.zip -o"C:/Program Files/"
run: 7z x ${{runner.workspace}}/SDRplay.zip -o"C:/Program Files/"

- name: Download codec2
run: git clone https://github.com/AlexandreRouma/codec2
Expand Down Expand Up @@ -84,8 +84,8 @@ jobs:
name: sdrpp_windows_x64
path: ${{runner.workspace}}/sdrpp_windows_x64.zip

build_macos:
runs-on: macos-latest
build_macos_intel:
runs-on: macos-12

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -138,6 +138,60 @@ jobs:
name: sdrpp_macos_intel
path: ${{runner.workspace}}/sdrpp_macos_intel.zip

build_macos_arm:
runs-on: macos-14

steps:
- uses: actions/checkout@v4

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Update brew repositories
run: brew update

- name: Install dependencies
run: brew install pkg-config libusb fftw glfw airspy airspyhf portaudio hackrf libbladerf codec2 zstd autoconf automake libtool && pip3 install mako

- name: Install volk
run: git clone --recursive https://github.com/gnuradio/volk && cd volk && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../

- name: Install SDRplay API
run: wget https://www.sdrplay.com/software/SDRplayAPI-macos-installer-universal-3.12.1.pkg && sudo installer -pkg SDRplayAPI-macos-installer-universal-3.12.1.pkg -target /

- name: Install libiio
run: wget https://github.com/analogdevicesinc/libiio/archive/refs/tags/v0.25.zip && 7z x v0.25.zip && cd libiio-0.25 && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../

- name: Install libad9361
run: git clone https://github.com/analogdevicesinc/libad9361-iio && cd libad9361-iio && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../

- name: Install LimeSuite
run: git clone https://github.com/myriadrf/LimeSuite && cd LimeSuite && mkdir builddir && cd builddir && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../

# - name: Install libperseus
# run: git clone https://github.com/Microtelecom/libperseus-sdr && cd libperseus-sdr && autoreconf -i && ./configure --prefix=/usr/local && make && make install && cd ..

- name: Install modified librtlsdr
run: git clone https://github.com/Mr-Precise/rtl-sdr && cd rtl-sdr && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 LIBRARY_PATH=$(pkg-config --libs-only-L libusb-1.0 | sed 's/\-L//') && sudo make install && cd ../../

- name: Prepare CMake
working-directory: ${{runner.workspace}}/build
run: cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=ON -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF -DOPT_BUILD_PERSEUS_SOURCE=OFF -DOPT_BUILD_AUDIO_SOURCE=OFF -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release

- name: Build
working-directory: ${{runner.workspace}}/build
run: make VERBOSE=1 -j3

- name: Create Archive
working-directory: ${{runner.workspace}}
run: cd $GITHUB_WORKSPACE && sh make_macos_bundle.sh ${{runner.workspace}}/build ./SDR++.app && zip -r ${{runner.workspace}}/sdrpp_macos_arm.zip SDR++.app

- name: Save Archive
uses: actions/upload-artifact@v4
with:
name: sdrpp_macos_arm
path: ${{runner.workspace}}/sdrpp_macos_arm.zip

build_debian_buster:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -320,7 +374,7 @@ jobs:
path: ${{runner.workspace}}/sdrpp.apk

create_full_archive:
needs: ['build_windows', 'build_macos', 'build_debian_buster', 'build_debian_bullseye', 'build_debian_bookworm', 'build_debian_sid', 'build_ubuntu_focal', 'build_ubuntu_jammy', 'build_ubuntu_mantic', 'build_android']
needs: ['build_windows', 'build_macos_intel', 'build_macos_arm', 'build_debian_buster', 'build_debian_bullseye', 'build_debian_bookworm', 'build_debian_sid', 'build_ubuntu_focal', 'build_ubuntu_jammy', 'build_ubuntu_mantic', 'build_android']
runs-on: ubuntu-latest

steps:
Expand All @@ -332,6 +386,7 @@ jobs:
mkdir sdrpp_all &&
mv sdrpp_windows_x64/sdrpp_windows_x64.zip sdrpp_all/ &&
mv sdrpp_macos_intel/sdrpp_macos_intel.zip sdrpp_all/ &&
mv sdrpp_macos_arm/sdrpp_macos_arm.zip sdrpp_all/ &&
mv sdrpp_debian_buster_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_debian_buster_amd64.deb &&
mv sdrpp_debian_bullseye_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_debian_bullseye_amd64.deb &&
mv sdrpp_debian_bookworm_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_debian_bookworm_amd64.deb &&
Expand Down
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ option(OPT_BUILD_FILE_SOURCE "Wav file source" ON)
option(OPT_BUILD_HACKRF_SOURCE "Build HackRF Source Module (Dependencies: libhackrf)" ON)
option(OPT_BUILD_HERMES_SOURCE "Build Hermes Source Module (no dependencies required)" ON)
option(OPT_BUILD_LIMESDR_SOURCE "Build LimeSDR Source Module (Dependencies: liblimesuite)" OFF)
option(OPT_BUILD_NETWORK_SOURCE "Build Network Source Module (no dependencies required)" on)
option(OPT_BUILD_NETWORK_SOURCE "Build Network Source Module (no dependencies required)" ON)
option(OPT_BUILD_PERSEUS_SOURCE "Build Perseus Source Module (Dependencies: libperseus-sdr)" OFF)
option(OPT_BUILD_PLUTOSDR_SOURCE "Build PlutoSDR Source Module (Dependencies: libiio, libad9361)" ON)
option(OPT_BUILD_RFSPACE_SOURCE "Build RFspace Source Module (no dependencies required)" ON)
Expand Down Expand Up @@ -287,7 +287,12 @@ if (OPT_BUILD_SCHEDULER)
add_subdirectory("misc_modules/scheduler")
endif (OPT_BUILD_SCHEDULER)

add_executable(sdrpp "src/main.cpp" "win32/resources.rc")
if (MSVC)
add_executable(sdrpp "src/main.cpp" "win32/resources.rc")
else ()
add_executable(sdrpp "src/main.cpp")
endif ()

target_link_libraries(sdrpp PRIVATE sdrpp_core)

# Compiler arguments
Expand Down
3 changes: 3 additions & 0 deletions core/src/credits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ namespace sdrpp_credits {
"CaribouLabs",
"Ettus Research",
"Howard Su",
"MicroPhase",
"MyriadRF",
"Nuand",
"RFspace",
Expand All @@ -54,6 +55,7 @@ namespace sdrpp_credits {
"Croccydile",
"Dale L Puckett (K0HYD)",
"Daniele D'Agnelli",
"David Taylor (GM8ARV)",
"D. Jones",
"Dexruus",
"EB3FRN",
Expand Down Expand Up @@ -81,6 +83,7 @@ namespace sdrpp_credits {
"Syne Ardwin (WI9SYN)",
"W4IPA",
"William Arcand (W1WRA)",
"William Pitchford",
"Yves Rougy",
"Zipper"
};
Expand Down
4 changes: 4 additions & 0 deletions core/src/dsp/compression/sample_stream_compressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ namespace dsp::compression {

void init(stream<complex_t>* in, PCMType pcmType) {
_pcmType = pcmType;

// Set the output buffer size to the max size of a complex buffer + 8 bytes for the header
out.setBufferSize(STREAM_BUFFER_SIZE*sizeof(complex_t) + 8);

base_type::init(in);
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ namespace server {
// Compress data if needed and fill out header fields
if (compression) {
bb_pkt_hdr->type = PACKET_TYPE_BASEBAND_COMPRESSED;
bb_pkt_hdr->size = sizeof(PacketHeader) + (uint32_t)ZSTD_compressCCtx(cctx, &bbuf[sizeof(PacketHeader)], SERVER_MAX_PACKET_SIZE, data, count, 1);
bb_pkt_hdr->size = sizeof(PacketHeader) + (uint32_t)ZSTD_compressCCtx(cctx, &bbuf[sizeof(PacketHeader)], SERVER_MAX_PACKET_SIZE-sizeof(PacketHeader), data, count, 1);
}
else {
bb_pkt_hdr->type = PACKET_TYPE_BASEBAND;
Expand Down
19 changes: 10 additions & 9 deletions decoder_modules/atv_decoder/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,19 @@ class ATVDecoderModule : public ModuleManager::Instance {
_this->pll.process(720, _this->fir.out.writeBuf, _this->pll.out.writeBuf, ((_this->ypos%2)==1) ^ _this->evenFrame);

// Render line to the image without color
//int lypos = _this->ypos - 1;
//if (lypos < 0) { lypos = 624; }
//uint32_t* lastLine = &((uint32_t *)_this->img.buffer)[(lypos < 313) ? (lypos*720*2) : ((((lypos - 313)*2)+1)*720) ];
//uint32_t* currentLine = &((uint32_t *)_this->img.buffer)[(_this->ypos < 313) ? (_this->ypos*720*2) : ((((_this->ypos - 313)*2)+1)*720) ];
int lypos = _this->ypos - 1;
if (lypos < 0) { lypos = 624; }
uint32_t* lastLine = &((uint32_t *)_this->img.buffer)[(lypos < 313) ? (lypos*720*2) : ((((lypos - 313)*2)+1)*720) ];
uint32_t* currentLine = &((uint32_t *)_this->img.buffer)[(_this->ypos < 313) ? (_this->ypos*720*2) : ((((_this->ypos - 313)*2)+1)*720) ];

uint32_t* currentLine = &((uint32_t *)_this->img.buffer)[_this->ypos*720];
//uint32_t* currentLine = &((uint32_t *)_this->img.buffer)[_this->ypos*720];

for (int i = 0; i < count; i++) {
//float imval = std::clamp<float>((data[i] - _this->minLvl) * 255.0 / _this->spanLvl, 0, 255);
uint32_t re = std::clamp<float>((_this->pll.out.writeBuf[i].re - _this->minLvl) * 255.0 / _this->spanLvl, 0, 255);
uint32_t im = std::clamp<float>((_this->pll.out.writeBuf[i].im - _this->minLvl) * 255.0 / _this->spanLvl, 0, 255);
currentLine[i] = 0xFF000000 | (im << 8) | re;
int imval = std::clamp<float>((data[i] - _this->minLvl) * 255.0 / _this->spanLvl, 0, 255);
// uint32_t re = std::clamp<float>((_this->pll.out.writeBuf[i].re - _this->minLvl) * 255.0 / _this->spanLvl, 0, 255);
// uint32_t im = std::clamp<float>((_this->pll.out.writeBuf[i].im - _this->minLvl) * 255.0 / _this->spanLvl, 0, 255);
// currentLine[i] = 0xFF000000 | (im << 8) | re;
currentLine[i] = 0xFF000000 | (imval << 16) | (imval << 8) | imval;
}

// Vertical scan logic
Expand Down
4 changes: 2 additions & 2 deletions decoder_modules/pager_decoder/src/pocsag/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class POCSAGDecoder : public Decoder {
public:
POCSAGDecoder(const std::string& name, VFOManager::VFO* vfo) : diag(0.6, 544) {
POCSAGDecoder(const std::string& name, VFOManager::VFO* vfo) : diag(0.6, BAUDRATE) {
this->name = name;
this->vfo = vfo;

Expand All @@ -26,7 +26,7 @@ class POCSAGDecoder : public Decoder {
vfo->setBandwidthLimits(12500, 12500, true);
vfo->setSampleRate(SAMPLERATE, 12500);
dsp.init(vfo->output, SAMPLERATE, BAUDRATE);
reshape.init(&dsp.soft, 544, 0);
reshape.init(&dsp.soft, BAUDRATE, (BAUDRATE / 30.0) - BAUDRATE);
dataHandler.init(&dsp.out, _dataHandler, this);
diagHandler.init(&reshape.out, _diagHandler, this);

Expand Down
104 changes: 4 additions & 100 deletions decoder_modules/pager_decoder/src/pocsag/dsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,89 +11,6 @@
#include <dsp/digital/binary_slicer.h>
#include <dsp/routing/doubler.h>

#include "packet_clock_sync.h"

inline float PATTERN_DSDSDZED[] = {
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 8.00000000e-01,
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -8.00000000e-01,
-6.00000000e-01, -4.00000000e-01, -2.00000000e-01, -2.77555756e-17,
2.00000000e-01, 4.00000000e-01, 6.00000000e-01, 8.00000000e-01,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 8.00000000e-01,
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 8.00000000e-01,
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -8.00000000e-01,
-6.00000000e-01, -4.00000000e-01, -2.00000000e-01, -2.77555756e-17,
2.00000000e-01, 4.00000000e-01, 6.00000000e-01, 8.00000000e-01,
1.00000000e+00, 8.00000000e-01, 6.00000000e-01, 4.00000000e-01,
2.00000000e-01, 2.77555756e-17, -2.00000000e-01, -4.00000000e-01,
-6.00000000e-01, -8.00000000e-01, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 8.00000000e-01,
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 8.00000000e-01,
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 8.00000000e-01,
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 8.00000000e-01, 6.00000000e-01, 4.00000000e-01,
2.00000000e-01, 2.77555756e-17, -2.00000000e-01, -4.00000000e-01,
-6.00000000e-01, -8.00000000e-01, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00
};

class POCSAGDSP : public dsp::Processor<dsp::complex_t, uint8_t> {
using base_type = dsp::Processor<dsp::complex_t, uint8_t>;
public:
Expand All @@ -106,16 +23,12 @@ class POCSAGDSP : public dsp::Processor<dsp::complex_t, uint8_t> {

// Configure blocks
demod.init(NULL, -4500.0, samplerate);
//dcBlock.init(NULL, 0.001); // NOTE: DC blocking causes issues because no scrambling, think more about it
float taps[] = { 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f };
shape = dsp::taps::fromArray<float>(10, taps);
fir.init(NULL, shape);
//recov.init(NULL, samplerate/baudrate, 1e-4, 1.0, 0.05);

cs.init(NULL, PATTERN_DSDSDZED, sizeof(PATTERN_DSDSDZED)/sizeof(float), 544, 10);
recov.init(NULL, samplerate/baudrate, 1e-4, 1.0, 0.05);

// Free useless buffers
// dcBlock.out.free();
fir.out.free();
recov.out.free();

Expand All @@ -125,13 +38,9 @@ class POCSAGDSP : public dsp::Processor<dsp::complex_t, uint8_t> {

int process(int count, dsp::complex_t* in, float* softOut, uint8_t* out) {
count = demod.process(count, in, demod.out.readBuf);
//count = dcBlock.process(count, demod.out.readBuf, demod.out.readBuf);
count = fir.process(count, demod.out.readBuf, demod.out.readBuf);
//count = recov.process(count, demod.out.readBuf, softOut);

count = cs.process(count, demod.out.readBuf, softOut);

//dsp::digital::BinarySlicer::process(count, softOut, out);
count = recov.process(count, demod.out.readBuf, softOut);
dsp::digital::BinarySlicer::process(count, softOut, out);
return count;
}

Expand All @@ -146,22 +55,17 @@ class POCSAGDSP : public dsp::Processor<dsp::complex_t, uint8_t> {
count = process(count, base_type::_in->readBuf, soft.writeBuf, base_type::out.writeBuf);

base_type::_in->flush();
//if (!base_type::out.swap(count)) { return -1; }

if (!base_type::out.swap(count)) { return -1; }
if (count) { if (!soft.swap(count)) { return -1; } }

return count;
}

dsp::stream<float> soft;

private:
dsp::demod::Quadrature demod;
//dsp::correction::DCBlocker<float> dcBlock;
dsp::tap<float> shape;
dsp::filter::FIR<float, float> fir;
dsp::clock_recovery::MM<float> recov;

dsp::PacketClockSync cs;

};
Loading

0 comments on commit a52b634

Please sign in to comment.