Skip to content

Commit

Permalink
almost ready
Browse files Browse the repository at this point in the history
  • Loading branch information
JvanKatwijk committed Nov 29, 2024
1 parent 4acadbf commit bc132da
Show file tree
Hide file tree
Showing 28 changed files with 1,538 additions and 261 deletions.
8 changes: 8 additions & 0 deletions includes/dab-constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ enum AudioFlags : uint32_t {
AFL_PS_USED = 0x2
};

typedef struct {
uint8_t mainId;
uint8_t subId;
float strength;
float phase;
bool norm;
} tiiResult;

#define SINGLE_SCAN 0
#define SCAN_SINGLE 0
#define SCAN_TO_DATA 1
Expand Down
7 changes: 3 additions & 4 deletions includes/ofdm/ofdm-decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@ Q_OBJECT

std::vector<float> offsetVector;
std::vector<float> amplitudeVector;
std::vector<float> meanLevelPerBin;
std::vector<float> meanSigmaSqPerBin;
std::vector<float> meanPowerPerBin;
std::vector<float> meanNullPower;
std::vector<float> avgSigmaSqPerBin;
std::vector<float> avgPowerPerBin;
std::vector<float> avgNullPower;

float sum;
// phaseTable *phasetable;
Expand Down
60 changes: 60 additions & 0 deletions includes/ofdm/tii-detector-1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#
/*
* Copyright (C) 2016 .. 2023
* Jan van Katwijk ([email protected])
* Lazy Chair Computing
*
* This file is part of Qt-DAB
*
* Qt-DAB is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Qt-DAB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Qt-DAB; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#pragma once

#include <cstdint>
#include "dab-params.h"
#include <complex>
#include <vector>
#include "dab-constants.h"
#include "fft-handler.h"
class QSettings;

class TII_Detector_A {
public:
TII_Detector_A (uint8_t dabMode, QSettings *);
~TII_Detector_A ();
void reset ();
void setMode (bool);
void addBuffer (std::vector<Complex>);
std::vector<tiiResult> processNULL (bool);

private:
QSettings *dabSettings;
dabParams params;
int16_t T_u;
int16_t carriers;
fftHandler my_fftHandler;
void resetBuffer ();
void collapse (Complex *, Complex *, Complex *);

bool collisions = false;
uint8_t invTable [256];
Complex decodedBuffer[768];

std::vector<Complex > theBuffer;
std::vector<DABFLOAT> window;
};


61 changes: 61 additions & 0 deletions includes/ofdm/tii-detector-2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#
/*
* Copyright (C) 2016 .. 2023
* Jan van Katwijk ([email protected])
* Lazy Chair Computing
*
* This file is part of Qt-DAB
*
* Qt-DAB is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Qt-DAB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Qt-DAB; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#pragma once

#include <cstdint>
#include "dab-params.h"
#include <complex>
#include <vector>
#include "dab-constants.h"
#include "fft-handler.h"
class QSettings;

class TII_Detector_B {
public:
TII_Detector_B (uint8_t dabMode, QSettings *);
~TII_Detector_B ();
void reset ();
void setMode (bool);
void addBuffer (std::vector<Complex>);
std::vector<tiiResult> processNULL (bool);

private:
QSettings *dabSettings;
dabParams params;
int16_t T_u;
int16_t carriers;
fftHandler my_fftHandler;
void resetBuffer ();
void collapse (std::vector<Complex> &inVec, float *outVec);

bool collisions = false;
uint8_t invTable [256];
Complex decodedBuffer[768];

bool detectMode_new;
std::vector<Complex > theBuffer;
std::vector<DABFLOAT> window;
};


File renamed without changes.
23 changes: 18 additions & 5 deletions includes/support/cacheElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,28 @@ class cacheElement {
QString country;
QString channel;
QString ensemble;
QString location;
uint16_t Eid;
int8_t mainId;
int8_t subId;
QString transmitterName;
float latitude;
float longitude;
float power;
float altitude;
float height;
QString polarization;
float frequency;
QString direction;
//
// There are values differing per instance of the
// same transmitter
float strength;
float distance;
float azimuth;

cacheElement () {
valid = false;
valid = false;
country = "not known";
channel = "";
ensemble = "";
Expand All @@ -56,18 +68,19 @@ class cacheElement {
longitude = 0;
power = 0;
height = 0;
power = 0;
polarization = "";
frequency = 0;
direction = "";
}
~cacheElement () {}
};


struct transmitterDesc {
int tiiValue;
bool isValid;
bool isStrongest;
bool isFurthest;
cacheElement theTransmitter;
float distance;
float corner;

};

1 change: 1 addition & 0 deletions includes/support/findfilenames.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const QString findskipFile_fileName ();
QString findMaps_fileName ();
QString find_eti_fileName (const QString &, const QString &);
QString find_xmlName (const QString &, const QString &);
QString finddxDump_fileName (const QString &);
private:
QString outputDialog (QString saveDir,
const QString &channel,
Expand Down
54 changes: 28 additions & 26 deletions includes/support/http-handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,48 +33,50 @@
#include <QString>
#include <QSettings>
#include "tii-mapper.h"
#include "cacheElement.h"
class RadioInterface;

typedef struct {
uint8_t type;
position coords;
QString transmitterName;
QString channelName;
QString dateTime;
int tiiValue;
int snr;
int distance;
int azimuth;
float power;
float height;
uint8_t type;
position coords;
QString transmitterName;
QString channelName;
QString dateTime;
QString ensemble;
QString polarization;
QString direction;
uint16_t Eid;
uint8_t mainId;
uint8_t subId;
int snr;
int distance;
int azimuth;
float power;
float altitude;
float height;
} httpData;

class httpHandler: public QObject {
Q_OBJECT
public:
httpHandler (RadioInterface *,
const QString &mapPort,
const QString &browserAddress,
const QString &mapPort,
const QString &browserAddress,
position address,
const QString &saveName,
bool autoBrowse,
QSettings *setings = nullptr);
const QString &saveName,
bool autoBrowse,
QSettings *settings = nullptr);
~httpHandler ();
void start ();
void stop ();
void run ();
void putData (uint8_t, position);
void putData (uint8_t type,
position target,
QString transmittername,
QString channelName,
QString dateTime,
int ttiValue,
int snr,
int distance,
int azimuth,
float power,
float height);
struct transmitterDesc *theTr,
const QString & theTime,
const QString & channelName,
float snr);

private:
QSettings *dabSettings;
FILE *saveFile;
Expand Down
Loading

0 comments on commit bc132da

Please sign in to comment.