Skip to content

Commit a52b634

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 418266a + 650a619 commit a52b634

File tree

14 files changed

+164
-378
lines changed

14 files changed

+164
-378
lines changed

.github/workflows/build_all.yml

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
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/"
3838

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

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

4545
- name: Download codec2
4646
run: git clone https://github.com/AlexandreRouma/codec2
@@ -84,8 +84,8 @@ jobs:
8484
name: sdrpp_windows_x64
8585
path: ${{runner.workspace}}/sdrpp_windows_x64.zip
8686

87-
build_macos:
88-
runs-on: macos-latest
87+
build_macos_intel:
88+
runs-on: macos-12
8989

9090
steps:
9191
- uses: actions/checkout@v4
@@ -138,6 +138,60 @@ jobs:
138138
name: sdrpp_macos_intel
139139
path: ${{runner.workspace}}/sdrpp_macos_intel.zip
140140

141+
build_macos_arm:
142+
runs-on: macos-14
143+
144+
steps:
145+
- uses: actions/checkout@v4
146+
147+
- name: Create Build Environment
148+
run: cmake -E make_directory ${{runner.workspace}}/build
149+
150+
- name: Update brew repositories
151+
run: brew update
152+
153+
- name: Install dependencies
154+
run: brew install pkg-config libusb fftw glfw airspy airspyhf portaudio hackrf libbladerf codec2 zstd autoconf automake libtool && pip3 install mako
155+
156+
- name: Install volk
157+
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 ../../
158+
159+
- name: Install SDRplay API
160+
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 /
161+
162+
- name: Install libiio
163+
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 ../../
164+
165+
- name: Install libad9361
166+
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 ../../
167+
168+
- name: Install LimeSuite
169+
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 ../../
170+
171+
# - name: Install libperseus
172+
# run: git clone https://github.com/Microtelecom/libperseus-sdr && cd libperseus-sdr && autoreconf -i && ./configure --prefix=/usr/local && make && make install && cd ..
173+
174+
- name: Install modified librtlsdr
175+
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 ../../
176+
177+
- name: Prepare CMake
178+
working-directory: ${{runner.workspace}}/build
179+
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
180+
181+
- name: Build
182+
working-directory: ${{runner.workspace}}/build
183+
run: make VERBOSE=1 -j3
184+
185+
- name: Create Archive
186+
working-directory: ${{runner.workspace}}
187+
run: cd $GITHUB_WORKSPACE && sh make_macos_bundle.sh ${{runner.workspace}}/build ./SDR++.app && zip -r ${{runner.workspace}}/sdrpp_macos_arm.zip SDR++.app
188+
189+
- name: Save Archive
190+
uses: actions/upload-artifact@v4
191+
with:
192+
name: sdrpp_macos_arm
193+
path: ${{runner.workspace}}/sdrpp_macos_arm.zip
194+
141195
build_debian_buster:
142196
runs-on: ubuntu-latest
143197

@@ -320,7 +374,7 @@ jobs:
320374
path: ${{runner.workspace}}/sdrpp.apk
321375

322376
create_full_archive:
323-
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']
377+
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']
324378
runs-on: ubuntu-latest
325379

326380
steps:
@@ -332,6 +386,7 @@ jobs:
332386
mkdir sdrpp_all &&
333387
mv sdrpp_windows_x64/sdrpp_windows_x64.zip sdrpp_all/ &&
334388
mv sdrpp_macos_intel/sdrpp_macos_intel.zip sdrpp_all/ &&
389+
mv sdrpp_macos_arm/sdrpp_macos_arm.zip sdrpp_all/ &&
335390
mv sdrpp_debian_buster_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_debian_buster_amd64.deb &&
336391
mv sdrpp_debian_bullseye_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_debian_bullseye_amd64.deb &&
337392
mv sdrpp_debian_bookworm_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_debian_bookworm_amd64.deb &&

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ option(OPT_BUILD_FILE_SOURCE "Wav file source" ON)
1717
option(OPT_BUILD_HACKRF_SOURCE "Build HackRF Source Module (Dependencies: libhackrf)" ON)
1818
option(OPT_BUILD_HERMES_SOURCE "Build Hermes Source Module (no dependencies required)" ON)
1919
option(OPT_BUILD_LIMESDR_SOURCE "Build LimeSDR Source Module (Dependencies: liblimesuite)" OFF)
20-
option(OPT_BUILD_NETWORK_SOURCE "Build Network Source Module (no dependencies required)" on)
20+
option(OPT_BUILD_NETWORK_SOURCE "Build Network Source Module (no dependencies required)" ON)
2121
option(OPT_BUILD_PERSEUS_SOURCE "Build Perseus Source Module (Dependencies: libperseus-sdr)" OFF)
2222
option(OPT_BUILD_PLUTOSDR_SOURCE "Build PlutoSDR Source Module (Dependencies: libiio, libad9361)" ON)
2323
option(OPT_BUILD_RFSPACE_SOURCE "Build RFspace Source Module (no dependencies required)" ON)
@@ -287,7 +287,12 @@ if (OPT_BUILD_SCHEDULER)
287287
add_subdirectory("misc_modules/scheduler")
288288
endif (OPT_BUILD_SCHEDULER)
289289

290-
add_executable(sdrpp "src/main.cpp" "win32/resources.rc")
290+
if (MSVC)
291+
add_executable(sdrpp "src/main.cpp" "win32/resources.rc")
292+
else ()
293+
add_executable(sdrpp "src/main.cpp")
294+
endif ()
295+
291296
target_link_libraries(sdrpp PRIVATE sdrpp_core)
292297

293298
# Compiler arguments

core/src/credits.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ namespace sdrpp_credits {
4141
"CaribouLabs",
4242
"Ettus Research",
4343
"Howard Su",
44+
"MicroPhase",
4445
"MyriadRF",
4546
"Nuand",
4647
"RFspace",
@@ -54,6 +55,7 @@ namespace sdrpp_credits {
5455
"Croccydile",
5556
"Dale L Puckett (K0HYD)",
5657
"Daniele D'Agnelli",
58+
"David Taylor (GM8ARV)",
5759
"D. Jones",
5860
"Dexruus",
5961
"EB3FRN",
@@ -81,6 +83,7 @@ namespace sdrpp_credits {
8183
"Syne Ardwin (WI9SYN)",
8284
"W4IPA",
8385
"William Arcand (W1WRA)",
86+
"William Pitchford",
8487
"Yves Rougy",
8588
"Zipper"
8689
};

core/src/dsp/compression/sample_stream_compressor.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ namespace dsp::compression {
1212

1313
void init(stream<complex_t>* in, PCMType pcmType) {
1414
_pcmType = pcmType;
15+
16+
// Set the output buffer size to the max size of a complex buffer + 8 bytes for the header
17+
out.setBufferSize(STREAM_BUFFER_SIZE*sizeof(complex_t) + 8);
18+
1519
base_type::init(in);
1620
}
1721

core/src/server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ namespace server {
230230
// Compress data if needed and fill out header fields
231231
if (compression) {
232232
bb_pkt_hdr->type = PACKET_TYPE_BASEBAND_COMPRESSED;
233-
bb_pkt_hdr->size = sizeof(PacketHeader) + (uint32_t)ZSTD_compressCCtx(cctx, &bbuf[sizeof(PacketHeader)], SERVER_MAX_PACKET_SIZE, data, count, 1);
233+
bb_pkt_hdr->size = sizeof(PacketHeader) + (uint32_t)ZSTD_compressCCtx(cctx, &bbuf[sizeof(PacketHeader)], SERVER_MAX_PACKET_SIZE-sizeof(PacketHeader), data, count, 1);
234234
}
235235
else {
236236
bb_pkt_hdr->type = PACKET_TYPE_BASEBAND;

decoder_modules/atv_decoder/src/main.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,19 @@ class ATVDecoderModule : public ModuleManager::Instance {
139139
_this->pll.process(720, _this->fir.out.writeBuf, _this->pll.out.writeBuf, ((_this->ypos%2)==1) ^ _this->evenFrame);
140140

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

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

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

156157
// Vertical scan logic

decoder_modules/pager_decoder/src/pocsag/decoder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
class POCSAGDecoder : public Decoder {
1515
public:
16-
POCSAGDecoder(const std::string& name, VFOManager::VFO* vfo) : diag(0.6, 544) {
16+
POCSAGDecoder(const std::string& name, VFOManager::VFO* vfo) : diag(0.6, BAUDRATE) {
1717
this->name = name;
1818
this->vfo = vfo;
1919

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

decoder_modules/pager_decoder/src/pocsag/dsp.h

Lines changed: 4 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -11,89 +11,6 @@
1111
#include <dsp/digital/binary_slicer.h>
1212
#include <dsp/routing/doubler.h>
1313

14-
#include "packet_clock_sync.h"
15-
16-
inline float PATTERN_DSDSDZED[] = {
17-
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
18-
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
19-
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 1.00000000e+00,
20-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
21-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
22-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
23-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
24-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
25-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
26-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
27-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
28-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
29-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 8.00000000e-01,
30-
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
31-
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
32-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
33-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
34-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -8.00000000e-01,
35-
-6.00000000e-01, -4.00000000e-01, -2.00000000e-01, -2.77555756e-17,
36-
2.00000000e-01, 4.00000000e-01, 6.00000000e-01, 8.00000000e-01,
37-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
38-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
39-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 8.00000000e-01,
40-
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
41-
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
42-
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
43-
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
44-
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 8.00000000e-01,
45-
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
46-
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
47-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
48-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
49-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -8.00000000e-01,
50-
-6.00000000e-01, -4.00000000e-01, -2.00000000e-01, -2.77555756e-17,
51-
2.00000000e-01, 4.00000000e-01, 6.00000000e-01, 8.00000000e-01,
52-
1.00000000e+00, 8.00000000e-01, 6.00000000e-01, 4.00000000e-01,
53-
2.00000000e-01, 2.77555756e-17, -2.00000000e-01, -4.00000000e-01,
54-
-6.00000000e-01, -8.00000000e-01, -1.00000000e+00, -1.00000000e+00,
55-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
56-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
57-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
58-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
59-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
60-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
61-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
62-
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
63-
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
64-
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 8.00000000e-01,
65-
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
66-
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
67-
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
68-
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
69-
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 8.00000000e-01,
70-
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
71-
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
72-
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
73-
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
74-
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 1.00000000e+00,
75-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
76-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
77-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
78-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
79-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 8.00000000e-01,
80-
6.00000000e-01, 4.00000000e-01, 2.00000000e-01, 2.77555756e-17,
81-
-2.00000000e-01, -4.00000000e-01, -6.00000000e-01, -8.00000000e-01,
82-
-1.00000000e+00, -8.00000000e-01, -6.00000000e-01, -4.00000000e-01,
83-
-2.00000000e-01, -2.77555756e-17, 2.00000000e-01, 4.00000000e-01,
84-
6.00000000e-01, 8.00000000e-01, 1.00000000e+00, 1.00000000e+00,
85-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
86-
1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
87-
1.00000000e+00, 8.00000000e-01, 6.00000000e-01, 4.00000000e-01,
88-
2.00000000e-01, 2.77555756e-17, -2.00000000e-01, -4.00000000e-01,
89-
-6.00000000e-01, -8.00000000e-01, -1.00000000e+00, -1.00000000e+00,
90-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
91-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
92-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
93-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
94-
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00
95-
};
96-
9714
class POCSAGDSP : public dsp::Processor<dsp::complex_t, uint8_t> {
9815
using base_type = dsp::Processor<dsp::complex_t, uint8_t>;
9916
public:
@@ -106,16 +23,12 @@ class POCSAGDSP : public dsp::Processor<dsp::complex_t, uint8_t> {
10623

10724
// Configure blocks
10825
demod.init(NULL, -4500.0, samplerate);
109-
//dcBlock.init(NULL, 0.001); // NOTE: DC blocking causes issues because no scrambling, think more about it
11026
float taps[] = { 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f };
11127
shape = dsp::taps::fromArray<float>(10, taps);
11228
fir.init(NULL, shape);
113-
//recov.init(NULL, samplerate/baudrate, 1e-4, 1.0, 0.05);
114-
115-
cs.init(NULL, PATTERN_DSDSDZED, sizeof(PATTERN_DSDSDZED)/sizeof(float), 544, 10);
29+
recov.init(NULL, samplerate/baudrate, 1e-4, 1.0, 0.05);
11630

11731
// Free useless buffers
118-
// dcBlock.out.free();
11932
fir.out.free();
12033
recov.out.free();
12134

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

12639
int process(int count, dsp::complex_t* in, float* softOut, uint8_t* out) {
12740
count = demod.process(count, in, demod.out.readBuf);
128-
//count = dcBlock.process(count, demod.out.readBuf, demod.out.readBuf);
12941
count = fir.process(count, demod.out.readBuf, demod.out.readBuf);
130-
//count = recov.process(count, demod.out.readBuf, softOut);
131-
132-
count = cs.process(count, demod.out.readBuf, softOut);
133-
134-
//dsp::digital::BinarySlicer::process(count, softOut, out);
42+
count = recov.process(count, demod.out.readBuf, softOut);
43+
dsp::digital::BinarySlicer::process(count, softOut, out);
13544
return count;
13645
}
13746

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

14857
base_type::_in->flush();
149-
//if (!base_type::out.swap(count)) { return -1; }
150-
58+
if (!base_type::out.swap(count)) { return -1; }
15159
if (count) { if (!soft.swap(count)) { return -1; } }
152-
15360
return count;
15461
}
15562

15663
dsp::stream<float> soft;
15764

15865
private:
15966
dsp::demod::Quadrature demod;
160-
//dsp::correction::DCBlocker<float> dcBlock;
16167
dsp::tap<float> shape;
16268
dsp::filter::FIR<float, float> fir;
16369
dsp::clock_recovery::MM<float> recov;
16470

165-
dsp::PacketClockSync cs;
166-
16771
};

0 commit comments

Comments
 (0)