2016-06-11 21:34:36 +00:00
|
|
|
/*
|
|
|
|
This file is part of program wsprd, a detector/demodulator/decoder
|
|
|
|
for the Weak Signal Propagation Reporter (WSPR) mode.
|
|
|
|
|
|
|
|
File name: wsprd.c
|
|
|
|
|
|
|
|
Copyright 2001-2015, Joe Taylor, K1JT
|
|
|
|
|
|
|
|
Much of the present code is based on work by Steven Franke, K9AN,
|
|
|
|
which in turn was based on earlier work by K1JT.
|
|
|
|
|
|
|
|
Copyright 2014-2015, Steven Franke, K9AN
|
|
|
|
|
2017-06-23 16:34:23 +00:00
|
|
|
Minor modifications
|
|
|
|
|
|
|
|
Copyright 2016, Guenael Jouchet, VA2GKA
|
|
|
|
|
2016-06-11 21:34:36 +00:00
|
|
|
License: GNU GPL v3
|
|
|
|
|
|
|
|
This program 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 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/* Option & config of decoder (Shared with the wsprd code) */
|
|
|
|
struct decoder_options {
|
2021-12-17 23:47:21 +00:00
|
|
|
uint32_t freq; // Dial frequency
|
|
|
|
char rcall[13]; // Callsign of the RX station
|
|
|
|
char rloc[7]; // Locator of the RX station
|
|
|
|
uint32_t quickmode; // Decoder option & tweak
|
|
|
|
uint32_t usehashtable; // ''
|
|
|
|
uint32_t npasses; // ''
|
|
|
|
uint32_t subtraction; // ''
|
2016-06-11 21:34:36 +00:00
|
|
|
};
|
|
|
|
|
2021-12-22 05:43:49 +00:00
|
|
|
struct cand {
|
|
|
|
float freq;
|
|
|
|
float snr;
|
|
|
|
int shift;
|
|
|
|
float drift;
|
|
|
|
float sync;
|
|
|
|
};
|
|
|
|
|
2016-06-11 21:34:36 +00:00
|
|
|
struct decoder_results {
|
2021-12-17 23:47:21 +00:00
|
|
|
double freq;
|
|
|
|
float sync;
|
|
|
|
float snr;
|
|
|
|
float dt;
|
|
|
|
float drift;
|
|
|
|
int32_t jitter;
|
|
|
|
char message[23];
|
|
|
|
char call[13];
|
|
|
|
char loc[7];
|
|
|
|
char pwr[3];
|
2016-06-11 21:34:36 +00:00
|
|
|
uint32_t cycles;
|
|
|
|
};
|
|
|
|
|
|
|
|
void sync_and_demodulate(float *id, float *qd, long np,
|
2021-12-22 05:43:49 +00:00
|
|
|
unsigned char *symbols, float *f1, int ifmin, int ifmax, float fstep,
|
|
|
|
int *shift1, int lagmin, int lagmax, int lagstep,
|
|
|
|
float *drift1, int symfac, float *sync, int mode);
|
2016-06-11 21:34:36 +00:00
|
|
|
void subtract_signal(float *id, float *qd, long np,
|
2021-12-22 05:43:49 +00:00
|
|
|
float f0, int shift0, float drift0, unsigned char *channel_symbols);
|
2016-06-11 21:34:36 +00:00
|
|
|
void subtract_signal2(float *id, float *qd, long np,
|
2021-12-22 05:43:49 +00:00
|
|
|
float f0, int shift0, float drift0, unsigned char *channel_symbols);
|
2016-06-25 00:58:12 +00:00
|
|
|
int32_t wspr_decode(float *idat, float *qdat, uint32_t npoints,
|
|
|
|
struct decoder_options options, struct decoder_results *decodes,
|
|
|
|
int32_t *n_results);
|