Upstream version 2.06 (alpha)

pull/2/head
Stelios Bounanos 2007-12-09 16:44:10 +00:00
rodzic 131f09c388
commit 17e5dc5c28
12 zmienionych plików z 55 dodań i 52 usunięć

Wyświetl plik

@ -4,7 +4,7 @@
# Copyright (C) 2007 Stelios Bounanos, M0GLD (m0gld AT enotty DOT net)
AC_PREREQ(2.61)
AC_INIT([fldigi], [2.05], [w1hkj AT w1hkj DOT com])
AC_INIT([fldigi], [2.06], [w1hkj AT w1hkj DOT com])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([-Wall foreign 1.9.6])
AM_MAINTAINER_MODE
@ -26,6 +26,7 @@ AC_C_CONST
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_C_RESTRICT
AC_TYPE_SIZE_T

Wyświetl plik

@ -92,7 +92,6 @@ cw::cw() : modem()
frequency = progdefaults.CWsweetspot;
tx_frequency = get_txfreq_woffset();
risetime = progdefaults.CWrisetime;
// keyshape = new double[KNUM];
samplerate = CWSampleRate;
fragmentsize = CWMaxSymLen;

Wyświetl plik

@ -156,7 +156,6 @@ rtty::rtty(trx_mode tty_mode)
hilbert = new C_FIR_filter();
hilbert->init_hilbert(37, 1);
// wfid = new id(this);
restart();
}

Wyświetl plik

@ -18,6 +18,7 @@
//===========================================================================
#include <config.h>
#include <cassert>
#include "fft.h"
@ -29,9 +30,9 @@ Cfft::Cfft(int n)
int tablesize = (int)(sqrt(n*1.0)+0.5) + 2;
fftlen = n;
fftsiz = 2 * n;
ip = new int[tablesize];
w = new double[fftlen];
fftwin = new double[fftlen*2];
assert (ip = new int[tablesize]);
assert (w = new double[fftlen]);
assert (fftwin = new double[fftlen*2]);
makewt();
makect();
wintype = FFT_NONE;
@ -51,11 +52,11 @@ void Cfft::resize(int n)
fftlen = n;
fftsiz = 2 * n;
if (ip) delete [] ip;
ip = new int[tablesize];
assert (ip = new int[tablesize]);
if (w) delete [] w;
w = new double[fftlen];
assert (w = new double[fftlen]);
if (fftwin) delete [] fftwin;
fftwin = new double[fftlen*2];
assert (fftwin = new double[fftlen*2]);
makewt();
makect();
wintype = FFT_NONE;

Wyświetl plik

@ -14,6 +14,7 @@
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include "fftfilt.h"
@ -21,12 +22,12 @@
fftfilt::fftfilt(double f1, double f2, int len)
{
filterlen = len;
fft = new Cfft(filterlen);
ift = new Cfft(filterlen);
assert (fft = new Cfft(filterlen));
assert (ift = new Cfft(filterlen));
ovlbuf = new complex[filterlen/2];
filter = new complex[filterlen];
filtdata = new complex[filterlen];
assert (ovlbuf = new complex[filterlen/2]);
assert (filter = new complex[filterlen]);
assert (filtdata = new complex[filterlen]);
for (int i = 0; i < filterlen; i++)
filter[i].re = filter[i].im =
@ -53,7 +54,8 @@ void fftfilt::create_filter(double f1, double f2)
{
int len = filterlen / 2 + 1;
double t, h, x, it;
Cfft *tmpfft = new Cfft(filterlen);
Cfft *tmpfft;
assert (tmpfft = new Cfft(filterlen));
// initialize the filter to zero
for (int i = 0; i < filterlen; i++)

Wyświetl plik

@ -32,6 +32,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cassert>
#include "filters.h"
@ -74,11 +75,11 @@ void C_FIR_filter::init(int len, int dec, double *itaps, double *qtaps) {
ibuffer[i] = qbuffer[i] = 0.0;
if (itaps) {
ifilter = new double[len];
assert (ifilter = new double[len]);
for (int i = 0; i < len; i++) ifilter[i] = itaps[i];
}
if (qtaps) {
qfilter = new double[len];
assert (qfilter = new double[len]);
for (int i = 0; i < len; i++) qfilter[i] = qtaps[i];
}
@ -97,7 +98,7 @@ double * C_FIR_filter::bp_FIR(int len, int hilbert, double f1, double f2)
double *fir;
double t, h, x;
fir = new double[len];
assert (fir = new double[len]);
for (int i = 0; i < len; i++) {
t = i - (len - 1.0) / 2.0;
@ -263,7 +264,7 @@ int C_FIR_filter::Qrun (double &in, double &out) {
Cmovavg::Cmovavg (int filtlen)
{
len = filtlen;
in = new double[len];
assert (in = new double[len]);
empty = true;
}
@ -274,6 +275,9 @@ Cmovavg::~Cmovavg()
double Cmovavg::run(double a)
{
if (!in) {
return a;
}
if (empty) {
empty = false;
for (int i = 0; i < len; i++) {
@ -292,8 +296,8 @@ double Cmovavg::run(double a)
void Cmovavg::setLength(int filtlen)
{
if (filtlen > len) {
delete [] in;
in = new double[filtlen];
if (in) delete [] in;
assert (in = new double[filtlen]);
}
len = filtlen;
empty = true;
@ -401,9 +405,9 @@ void Cmovavg::reset()
sfft::sfft(int len, int _first, int _last)
{
vrot = new complex[len];
delay = new complex[len];
bins = new complex[len];
assert (vrot = new complex[len]);
assert (delay = new complex[len]);
assert (bins = new complex[len]);
fftlen = len;
first = _first;
last = _last;

Wyświetl plik

@ -28,6 +28,7 @@
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <cassert>
#include "viterbi.h"
#include "misc.h"
@ -40,7 +41,7 @@ viterbi::viterbi(int k, int poly1, int poly2)
_chunksize = 8;
nstates = 1 << (k - 1);
output = new int[outsize];
assert (output = new int[outsize]);
for (int i = 0; i < outsize; i++) {
output[i] = parity(poly1 & i) | (parity(poly2 & i) << 1);
@ -49,8 +50,8 @@ viterbi::viterbi(int k, int poly1, int poly2)
// printf("\n");
for (int i = 0; i < PATHMEM; i++) {
metrics[i] = new int[nstates];
history[i] = new int[nstates];
assert (metrics[i] = new int[nstates]);
assert (history[i] = new int[nstates]);
sequence[i] = 0;
for (int j = 0; j < nstates; j++)
metrics[i][j] = history[i][j] = 0;
@ -205,7 +206,7 @@ encoder::encoder(int k, int poly1, int poly2)
{
int size = 1 << k; /* size of the output table */
output = new int[size];
assert (output = new int[size]);
// output contains 2 bits in positions 0 and 1 describing the state machine
// for each bit delay, ie: for k = 7 there are 128 possible state pairs.
// the modulo-2 addition for polynomial 1 is in bit 0

Wyświetl plik

@ -179,22 +179,6 @@ protected:
int bkspaces;
};
///
/// A lock class meant to be instantiated on the stack to acquire a lock which
/// is released when the object goes out of scope.
/// The no-arg ctor calls Fl::lock(), and the Fl_Mutex* ctor locks that mutex.
///
class autolock
{
public:
autolock() : m(0) { FL_LOCK(); }
autolock(Fl_Mutex *m_) : m(m_) { fl_lock(m); }
~autolock() { if (m) fl_unlock(m); else FL_UNLOCK(); }
private:
autolock(const autolock &a); // no copying
autolock& operator=(const autolock&); // no copying
Fl_Mutex *m;
};
/// A version of Fl_Tile that runs check callbacks and moves the boundary
/// between its child widgets only all resize checks return true.

Wyświetl plik

@ -26,6 +26,12 @@
#ifndef _GLOBALS_H
#define _GLOBALS_H
#include <stdint.h>
#include <stdint.h>
#include <cstdlib>
enum state_t {
STATE_PAUSE = 0,
STATE_RX,
@ -89,7 +95,8 @@ enum {
NUM_MODES
};
typedef int trx_mode;
typedef intptr_t trx_mode;
struct mode_info_t {
trx_mode mode;

Wyświetl plik

@ -122,7 +122,7 @@ void putadif(int num, const char *s)
strcpy(tempfld, s);
if (strlen(tempfld) > fields[num].size)
tempfld[fields[num].size -1] = 0;
sprintf(tempstr, "<%s:%d>%s", fields[num].name, strlen(tempfld), tempfld);
sprintf(tempstr, "<%s:%zu>%s", fields[num].name, strlen(tempfld), tempfld);
adif.append(tempstr);
}

Wyświetl plik

@ -44,6 +44,9 @@ extern waterfall *wf;
#define DCDOFF 32
// Change the following for DCD low pass filter adjustment
#define SQLCOEFF 0.01
//=====================================================================
#define K 5
@ -383,8 +386,10 @@ void psk::rx_symbol(complex symbol)
n = 2;
}
// simple low pass filter for quality of signal
quality.re = 0.02 * cos(n * phase) + 0.98 * quality.re;
quality.im = 0.02 * sin(n * phase) + 0.98 * quality.im;
// quality.re = 0.02 * cos(n * phase) + 0.98 * quality.re;
// quality.im = 0.02 * sin(n * phase) + 0.98 * quality.im;
quality.re = SQLCOEFF * cos(n * phase) + (1.0 - SQLCOEFF) * quality.re;
quality.im = SQLCOEFF * sin(n * phase) + (1.0 - SQLCOEFF) * quality.im;
metric = 100.0 * quality.norm();

Wyświetl plik

@ -178,10 +178,10 @@ void WFdisp::makeMarker() {
// clamp marker to image width
bw = marker_width;
int bw_lower = -bw, bw_upper = +bw;
if (bw_lower + carrierfreq+0.5 < 0)
bw_lower -= bw_lower + carrierfreq+0.5;
if (bw_upper + carrierfreq+0.5 > IMAGE_WIDTH)
bw_upper -= bw_upper + carrierfreq+0.5 - IMAGE_WIDTH;
if (bw_lower + static_cast<int>(carrierfreq+0.5) < 0)
bw_lower -= bw_lower + static_cast<int>(carrierfreq+0.5);
if (bw_upper + static_cast<int>(carrierfreq+0.5) > IMAGE_WIDTH)
bw_upper -= bw_upper + static_cast<int>(carrierfreq+0.5) - IMAGE_WIDTH;
for (int y = 0; y < WFMARKER - 2; y++) {
for (int i = bw_lower; i <= bw_upper ; i++) {
clrPos = clrM + i + y * IMAGE_WIDTH;