mirror of https://github.com/hmatuschek/libsdr
Fixed POCSAG decoding
parent
0ad4ec8634
commit
00c21e6b6e
@ -1,81 +0,0 @@
|
||||
#include "baseband.hh"
|
||||
#include "autocast.hh"
|
||||
#include "demod.hh"
|
||||
#include "portaudio.hh"
|
||||
#include "wavfile.hh"
|
||||
#include "gui/gui.hh"
|
||||
#include "psk31.hh"
|
||||
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
#include <csignal>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMainWindow>
|
||||
#include <QThread>
|
||||
|
||||
using namespace sdr;
|
||||
|
||||
static void __sigint_handler(int signo) {
|
||||
// On SIGINT -> stop queue properly
|
||||
Queue::get().stop();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (2 != argc) {
|
||||
std::cerr << "Usage: sdr_psk31 FILENAME" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
sdr::Logger::get().addHandler(
|
||||
new sdr::StreamLogHandler(std::cerr, sdr::LOG_DEBUG));
|
||||
|
||||
// Register handler:
|
||||
signal(SIGINT, __sigint_handler);
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QMainWindow *win = new QMainWindow();
|
||||
gui::Spectrum *spec = new gui::Spectrum(2, 1024, 5);
|
||||
gui::SpectrumView *spec_view = new gui::SpectrumView(spec);
|
||||
spec_view->setMindB(-60);
|
||||
win->setCentralWidget(spec_view);
|
||||
win->setMinimumSize(640, 240);
|
||||
win->show();
|
||||
|
||||
PortAudio::init();
|
||||
Queue &queue = Queue::get();
|
||||
|
||||
WavSource src(argv[1]);
|
||||
AutoCast< std::complex<int16_t> > cast;
|
||||
IQBaseBand<int16_t> baseband(0, 2144., 200.0, 63, 1);
|
||||
baseband.setCenterFrequency(2144.0);
|
||||
BPSK31<int16_t> demod;
|
||||
PortSink sink;
|
||||
Varicode decode;
|
||||
DebugDump<uint8_t> dump;
|
||||
|
||||
src.connect(&cast, true);
|
||||
cast.connect(&baseband, true);
|
||||
baseband.connect(spec);
|
||||
baseband.connect(&sink);
|
||||
baseband.connect(&demod);
|
||||
demod.connect(&decode, true);
|
||||
decode.connect(&dump, true);
|
||||
|
||||
queue.addIdle(&src, &WavSource::next);
|
||||
//queue.addIdle(&src, &IQSigGen<double>::next);
|
||||
|
||||
queue.start();
|
||||
app.exec();
|
||||
queue.stop();
|
||||
queue.wait();
|
||||
|
||||
PortAudio::terminate();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1,82 +0,0 @@
|
||||
#include "sdr.hh"
|
||||
#include "rtlsource.hh"
|
||||
#include "baseband.hh"
|
||||
#include "autocast.hh"
|
||||
#include "gui/gui.hh"
|
||||
#include "logger.hh"
|
||||
#include <signal.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMainWindow>
|
||||
#include <QThread>
|
||||
|
||||
using namespace sdr;
|
||||
|
||||
static void __sigint_handler(int signo) {
|
||||
// On SIGINT -> stop queue properly
|
||||
Queue::get().stop();
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc < 2) {
|
||||
std::cerr << "USAGE: sdr_rds FREQUENCY" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
double freq = atof(argv[1]);
|
||||
|
||||
PortAudio::init();
|
||||
Queue &queue = Queue::get();
|
||||
|
||||
// Register handler:
|
||||
signal(SIGINT, __sigint_handler);
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QMainWindow *win = new QMainWindow();
|
||||
gui::Spectrum *spec = new gui::Spectrum(2, 1024, 5);
|
||||
gui::SpectrumView *spec_view = new gui::SpectrumView(spec);
|
||||
spec_view->setMindB(-200);
|
||||
win->setCentralWidget(spec_view);
|
||||
win->setMinimumSize(640, 240);
|
||||
|
||||
win->show();
|
||||
|
||||
sdr::Logger::get().addHandler(new sdr::StreamLogHandler(std::cerr, sdr::LOG_DEBUG));
|
||||
|
||||
// Assemble processing chain
|
||||
//RTLSource src(freq, 1e6);
|
||||
WavSource src(argv[1]);
|
||||
AutoCast< std::complex<int16_t> > cast;
|
||||
IQBaseBand<int16_t> baseband(0, 200e3, 16, 5);
|
||||
FMDemod<int16_t, int16_t> demod;
|
||||
BaseBand<int16_t> mono(0, 15e3, 16, 6);
|
||||
BaseBand<int16_t> pilot(19e3, 5e2, 16, 84);
|
||||
BaseBand<int16_t> rds(57e3, 3e3, 16, 84);
|
||||
PortSink sink;
|
||||
|
||||
src.connect(&cast, true);
|
||||
cast.connect(&baseband, true);
|
||||
//src.connect(&baseband, true);
|
||||
baseband.connect(&demod, true);
|
||||
demod.connect(&mono);
|
||||
demod.connect(&pilot);
|
||||
demod.connect(&rds);
|
||||
|
||||
mono.connect(&sink);
|
||||
mono.connect(spec);
|
||||
|
||||
//queue.addStart(&src, &RTLSource::start);
|
||||
//queue.addStop(&src, &RTLSource::stop);
|
||||
queue.addIdle(&src, &WavSource::next);
|
||||
|
||||
queue.start();
|
||||
app.exec();
|
||||
queue.stop();
|
||||
queue.wait();
|
||||
|
||||
PortAudio::terminate();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1,64 +0,0 @@
|
||||
#include "sdr.hh"
|
||||
#include "rtlsource.hh"
|
||||
#include "baseband.hh"
|
||||
#include "utils.hh"
|
||||
#include "gui/gui.hh"
|
||||
#include <signal.h>
|
||||
#include "portaudio.hh"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMainWindow>
|
||||
#include <QThread>
|
||||
|
||||
using namespace sdr;
|
||||
|
||||
static void __sigint_handler(int signo) {
|
||||
// On SIGINT -> stop queue properly
|
||||
Queue::get().stop();
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Queue &queue = Queue::get();
|
||||
|
||||
// Register handler:
|
||||
signal(SIGINT, __sigint_handler);
|
||||
|
||||
PortAudio::init();
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QMainWindow *win = new QMainWindow();
|
||||
gui::Spectrum *spec = new gui::Spectrum(2, 1024, 5);
|
||||
gui::WaterFallView *spec_view = new gui::WaterFallView(spec);
|
||||
win->setCentralWidget(spec_view);
|
||||
win->setMinimumSize(640, 240);
|
||||
|
||||
win->show();
|
||||
|
||||
// Assemble processing chain
|
||||
PortSource< int16_t > src(44100.0, 2048);
|
||||
AGC<int16_t> agc;
|
||||
//IQBaseBand<int16_t> baseband(0, 500e3, 8, 5);
|
||||
//AMDemod<int16_t> demod;
|
||||
PortSink sink;
|
||||
|
||||
src.connect(&agc, true);
|
||||
agc.connect(&sink, true);
|
||||
//baseband.connect(&demod);
|
||||
//demod.connect(&sink, true);
|
||||
src.connect(spec);
|
||||
|
||||
queue.addIdle(&src, &PortSource< int16_t >::next);
|
||||
|
||||
queue.start();
|
||||
app.exec();
|
||||
|
||||
queue.stop();
|
||||
queue.wait();
|
||||
|
||||
PortAudio::terminate();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in New Issue