kopia lustrzana https://github.com/ag1le/morse-wip
2014-JAN-19
Added morse class in bmorse.h Moved common structs into class variables so that I can instantiate multiple morse decoders, for each CW frequency in Morse Audio file Removed unnecessary static variables.master
rodzic
26dd10ba6f
commit
d8959c15cb
17
config.log
17
config.log
|
@ -792,3 +792,20 @@ target_alias=''
|
|||
#define _TANDEM_SOURCE 1
|
||||
|
||||
configure: exit 0
|
||||
|
||||
## ---------------------- ##
|
||||
## Running config.status. ##
|
||||
## ---------------------- ##
|
||||
|
||||
This file was extended by bmorse config.status 0.1.01, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES =
|
||||
CONFIG_HEADERS =
|
||||
CONFIG_LINKS =
|
||||
CONFIG_COMMANDS =
|
||||
$ ./config.status Makefile
|
||||
|
||||
on X301
|
||||
|
||||
config.status:882: creating Makefile
|
||||
|
|
|
@ -305,6 +305,12 @@ void process_data(double x)
|
|||
static real pmax, zout, spdhat, px;
|
||||
static int init = 1;
|
||||
static double agc_peak = 0.1;
|
||||
static morse* mp;
|
||||
|
||||
if (init) {
|
||||
mp = new morse();
|
||||
init = 0;
|
||||
}
|
||||
|
||||
if (params.amplify != 0.0)
|
||||
x = params.amplify * x;
|
||||
|
@ -331,12 +337,12 @@ void process_data(double x)
|
|||
init = 0;
|
||||
}
|
||||
|
||||
noise_(x, &rn, &zout);
|
||||
mp->noise_(x, &rn, &zout);
|
||||
|
||||
// if (zout > 1.0) zout = 1.0;
|
||||
// if (zout < 0.0) zout = 0.0;
|
||||
|
||||
retstat = proces_(&zout, &rn, &xhat, &px, &elmhat, &spdhat, &imax, &pmax, params.speed);
|
||||
retstat = mp->proces_(&zout, &rn, &xhat, &px, &elmhat, &spdhat, &imax, &pmax, params.speed);
|
||||
if (params.print_variables)
|
||||
printf("\n%d\t%d\t%d\t%d\t%f\t%f\t%f\t%f\t%f\t%f",(int)retstat,(int)imax,(int)elmhat,(int)xhat,x,px,pmax,spdhat,rn,zout);
|
||||
|
||||
|
@ -741,8 +747,7 @@ int main(int argc, const char* argv[])
|
|||
} ;
|
||||
|
||||
/* INITIALIZE DATA STRUCTURES */
|
||||
initl_();
|
||||
|
||||
|
||||
if(params.process_textfile)
|
||||
process_textfile((char *)argv[k-1]);
|
||||
else
|
||||
|
|
269
src/bmorse.h
269
src/bmorse.h
|
@ -26,30 +26,6 @@ typedef float real;
|
|||
typedef double doublereal;
|
||||
typedef int ftnlen;
|
||||
|
||||
extern int rcvr_(real *, real *);
|
||||
extern int noise_(double, real *, real *);
|
||||
extern int initl_(void);
|
||||
extern int stats_(real *, real *, real *, integer *, real *, real *, real *, real *, integer *);
|
||||
extern int bpfdet_(real *, real *);
|
||||
extern int simsgi_(real *, real *);
|
||||
extern int proces_(real *z, real *rn, integer *xhat, real *px, integer *elmhat, real *spdhat, integer *imax, real *pmax, int spd);
|
||||
extern int inputl_(void);
|
||||
extern int transl_(int *ltr);
|
||||
extern int trelis_(integer *isave, integer *pathsv, integer *lambda, integer *imax, integer *ipmax);
|
||||
|
||||
|
||||
extern int probp_(real *, real *, integer *, real *);
|
||||
extern int sprob_(real *, integer *, integer *, real *, integer *, real *, real *);
|
||||
extern int trprob_(integer *, integer *, real *, integer *, real *);
|
||||
extern int savep_(real *, integer *, integer *, integer *, integer *, real *, integer *, integer *, real *, integer *, integer *, real *);
|
||||
extern int likhd_(real *, real *, integer *, integer *, real *, integer *, real *, real *);
|
||||
extern int kalfil_(real *, integer *, real *, integer *, integer *, integer *, integer *, integer *, real *, integer *, real *, real *);
|
||||
extern int path_(integer *, integer *, real *, integer *, integer *, real *, integer *);
|
||||
extern doublereal spdtr_(integer *, integer *, integer *, integer *);
|
||||
extern int ptrans_(integer *, integer *, integer *, integer *, real *, real *, real *, integer *);
|
||||
extern doublereal xtrans_(integer *, real *, integer *);
|
||||
extern int model_(real *, integer *, integer *, integer *, integer *, real *, real *, real *);
|
||||
|
||||
#define FSAMPLE 4000.0 // Sampling Frequency FLDIGI=8000 MORSE.M =4000
|
||||
#define DECIMATE 20 // Decimation FLDIGI=40 MORSE.M=20
|
||||
#define SAMPLEDURATION (1000. * DECIMATE) / FSAMPLE // 1000*DECIMATE / FSAMPLE SHOULD BE 5 msec
|
||||
|
@ -80,39 +56,224 @@ typedef struct
|
|||
extern PARAMS params;
|
||||
|
||||
|
||||
/* Common Block Declarations */
|
||||
extern struct BLKSPD {
|
||||
real rtrans[10] /* was [5][2] */;
|
||||
integer mempr[36] /* was [6][6] */;
|
||||
} blkspd;
|
||||
|
||||
extern struct BLKRAT {
|
||||
integer memdel[36] /* was [6][6] */;
|
||||
} blkrat;
|
||||
|
||||
extern struct BLKLAM {
|
||||
integer ielmst[400], ilami[16], ilamx[6];
|
||||
} blklam;
|
||||
class morse {
|
||||
protected:
|
||||
int initl_(void);
|
||||
int likhd_(real *z, real *rn, integer *ip, integer *lambda, real *dur, integer *ilrate, real *p, real *lkhd);
|
||||
int path_(integer *ip, integer *lambda, real *dur, integer *ilrate, integer *lamsav, real *dursav, integer *ilrsav);
|
||||
doublereal spdtr_(integer *isrt, integer *ilrt, integer *iselm, integer *ilelm);
|
||||
int ptrans_(integer *kelem, integer *irate, integer *lambda, integer *ilrate, real *ptrx, real *psum, real *pin, integer *n);
|
||||
int trprob_(integer *ip, integer *lambda, real *dur, integer *ilrate, real *p);
|
||||
int transl_(int *ltr);
|
||||
int trelis_(integer *isave, integer *pathsv, integer *lambda, integer *imax, integer *ipmax);
|
||||
int kalfil_(real *z, integer *ip, real *rn, integer *ilx,
|
||||
integer *ixs, integer *kelem, integer *jnode, integer *israte, real *
|
||||
dur, integer *ilrate, real *pin, real *lkhdj);
|
||||
int savep_(real *p, integer *pathsv, integer *isave, integer
|
||||
*imax, integer *lamsav, real *dursav, integer *ilrsav, integer *
|
||||
lambda, real *dur, integer *ilrate, integer *sort, real *pmax);
|
||||
int model_(real *, integer *, integer *, integer *, integer *, real *, real *, real *);
|
||||
int probp_(real *, real *, integer *, real *);
|
||||
int sprob_(real *, integer *, integer *, real *, integer *, real *, real *);
|
||||
doublereal xtrans_(integer *, real *, integer *);
|
||||
|
||||
|
||||
extern struct BLKS {
|
||||
integer isx[6];
|
||||
} blks;
|
||||
|
||||
extern struct BLKELM {
|
||||
real elemtr[96] /* was [16][6] */;
|
||||
} blkelm;
|
||||
|
||||
extern struct BLKMEM {
|
||||
integer memfcn[2400] /* was [400][6] */;
|
||||
} blkmem;
|
||||
integer isx[6];
|
||||
real rtrans[2][5] /* was [5][2] */;
|
||||
integer mempr[6][6] /* was [6][6] */;
|
||||
integer memdel[6][6] /* was [6][6] */;
|
||||
integer memfcn[2400];
|
||||
real elemtr[6][16] /* was [16][6] */;
|
||||
|
||||
|
||||
extern struct BLKSV {
|
||||
real ykkip[25],
|
||||
pkkip[25],
|
||||
ykksv[750],
|
||||
pkksv[750];
|
||||
} blksv;
|
||||
integer ielmst[400];
|
||||
integer ilami[16];
|
||||
integer ilamx[6];
|
||||
|
||||
|
||||
real ykkip[25];
|
||||
real pkkip[25];
|
||||
real ykksv[750];
|
||||
real pkksv[750];
|
||||
|
||||
|
||||
public:
|
||||
morse()
|
||||
:
|
||||
isx { 1, 1, 0, 0, 0, 0 },
|
||||
rtrans {
|
||||
{ .1f, .2f, .4f, .2f, .1f},
|
||||
{ .15f, .2f, .3f, .2f, .15f}},
|
||||
mempr {
|
||||
{0, 0, 1, 2, 1, 2},
|
||||
{0, 0, 1, 2, 1, 2},
|
||||
{1, 1, 0, 0, 0, 0},
|
||||
{1, 1, 0, 0, 0, 0},
|
||||
{1, 1, 0, 0, 0, 0},
|
||||
{1, 1, 0, 0, 0, 0}},
|
||||
memdel {
|
||||
{0, 0, 2, 2, 5, 10},
|
||||
{0, 0, 2, 2, 5, 10},
|
||||
{2, 2, 0, 0, 0, 0},
|
||||
{2, 2, 0, 0, 0, 0},
|
||||
{2, 2, 0, 0, 0, 0},
|
||||
{2, 2, 0, 0, 0, 0}},
|
||||
elemtr {
|
||||
{.55f, .5f, .5f, .5f, .55f, .5f, .5f, .5f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f},
|
||||
{.45f, .5f, .5f, .5f, .45f, .5f, .5f, .5f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f},
|
||||
{0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, .581f, .54f, .923f, .923f, .923f, .923f, .95f, .95f},
|
||||
{0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, .335f, .376f, .062f, .062f, .062f, .062f, .04f, .04f},
|
||||
{0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, .069f, .069f, .012f, .012f, .012f, .012f, .009f, .009f},
|
||||
{0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, .015f, .015f, .003f, .003f, .003f, .003f, .001f, .001f} },
|
||||
memfcn {
|
||||
/*k=0*/ 9, 11, 13, 15, 9, 11, 13, 15, 9, 0, 11, 0, 13, 0, 15, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0},
|
||||
ilami { 3, 4, 5, 6, 3, 4, 5, 6, 1, 2, 1, 2, 1, 2, 1, 2},
|
||||
ilamx { 1, 1, 0, 0, 0, 0 },
|
||||
ykkip { .5f, .5f, .5f, .5f, .5f, .5f, .5f, .5f, .5f, .5f, .5f, .5f,
|
||||
.5f, .5f, .5f, .5f, .5f, .5f, .5f, .5f, .5f, .5f, .5f, .5f, .5f},
|
||||
pkkip { .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f,
|
||||
.1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f }
|
||||
{
|
||||
initl_();
|
||||
};
|
||||
~morse();
|
||||
|
||||
int noise_(double, real *, real *);
|
||||
int proces_(real *z, real *rn, integer *xhat, real *px, integer *elmhat, real *spdhat, integer *imax, real *pmax, int spd);
|
||||
};
|
||||
|
|
299
src/initl.cxx
299
src/initl.cxx
|
@ -23,310 +23,15 @@
|
|||
#include "bmorse.h"
|
||||
|
||||
|
||||
|
||||
/* Initialized data */
|
||||
|
||||
struct BLKLAM blklam = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
3, 4, 5, 6, 3, 4, 5, 6, 1, 2, 1, 2, 1, 2, 1, 2,
|
||||
1, 1, 0, 0, 0, 0 };
|
||||
|
||||
struct BLKRAT blkrat = {
|
||||
0, 0, 2, 2, 5, 10,
|
||||
0, 0, 2, 2, 5, 10,
|
||||
2, 2, 0, 0, 0, 0,
|
||||
2, 2, 0, 0, 0, 0,
|
||||
2, 2, 0, 0, 0, 0,
|
||||
2, 2, 0, 0, 0, 0 };
|
||||
|
||||
struct BLKELM blkelm = {
|
||||
.55f, .5f, .5f, .5f, .55f, .5f, .5f, .5f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f,
|
||||
.45f, .5f, .5f, .5f, .45f, .5f, .5f, .5f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f,
|
||||
0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, .581f, .54f, .923f, .923f, .923f, .923f, .95f, .95f,
|
||||
0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, .335f, .376f, .062f, .062f, .062f, .062f, .04f, .04f,
|
||||
0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, .069f, .069f, .012f, .012f, .012f, .012f, .009f, .009f,
|
||||
0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, .015f, .015f, .003f, .003f, .003f, .003f, .001f, .001f };
|
||||
|
||||
// used in spdtr.cxx - speed transition probabilities
|
||||
struct BLKSPD blkspd = {
|
||||
.1f, .2f, .4f, .2f, .1f,
|
||||
.15f, .2f, .3f, .2f, .15f,
|
||||
0,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.5f, .5f,
|
||||
.1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f,
|
||||
.1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f };
|
||||
|
||||
|
||||
/* Table of constant values */
|
||||
|
||||
static integer c__1 = 1;
|
||||
|
||||
/* Subroutine */ int initl_(void)
|
||||
int morse::initl_(void)
|
||||
{
|
||||
/* Format strings */
|
||||
static char fmt_30[] = "(8i3)";
|
||||
static char fmt_40[] = "(10x,6(i3,2x))";
|
||||
static char fmt_70[] = "(i2)";
|
||||
|
||||
/* System generated locals */
|
||||
// olist o__1;
|
||||
// alist al__1;
|
||||
|
||||
/* Builtin functions */
|
||||
// integer f_open(olist *), s_rsfe(cilist *), do_fio(integer *, char *, ftnlen), e_rsfe(void), f_end(alist*), s_wsfe(cilist *), e_wsfe(void);
|
||||
|
||||
/* Local variables */
|
||||
static integer i__, k, iarray[8];
|
||||
|
||||
/* Fortran I/O blocks */
|
||||
/* static cilist io___2 = { 0, 20, 0, fmt_30, 0 };
|
||||
static cilist io___5 = { 0, 20, 0, fmt_40, 0 };
|
||||
static cilist io___6 = { 0, 20, 0, fmt_70, 0 };
|
||||
*/
|
||||
|
||||
/* MEMORY FUNCTION */
|
||||
/* MEMFCN(400,6) - ACCESSED BY (LAMBDA, K) - LETTER STATE TABLE */
|
||||
/* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
|
||||
/* .^ .~ .w .p -^ -~ -w -p ^. ^- ~. ~- w. w- p. p- */
|
||||
/* K=1 DIT, K=2 DAH, K=3 E-SPC, K=4 CHR-SPC, K=5 WRD-SPC, K=6 PAUSE */
|
||||
/* . - ^ ~ w p */
|
||||
/* lmbd:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
|
||||
/* /'A','B','C','D','E','F','G','H','I','J','K','L','M'/ */
|
||||
/* 2 'N','O','P','Q','R','S','T','U','V','W','X','Y','Z', */
|
||||
/* 2 '1','2','3','4','5','6','7'/ */
|
||||
/* 2 '8','9','0',';',':','%','&',0,0,'^',',','AS','SN', */
|
||||
/* 2 0,0,0,0,'NR','NO','GA','OK','AR','SK',0,0,0,0, */
|
||||
/* 2 'IMI',0,0,0,0,'BT',0,0,0,'EEE'/ */
|
||||
/* PRINT 5, IALPH(1:36) */
|
||||
/* 5 FORMAT(1X,A36) */
|
||||
/* o__1.oerr = 0;
|
||||
o__1.ounit = 20;
|
||||
o__1.ofnmlen = 6;
|
||||
o__1.ofnm = "MORSEM";
|
||||
o__1.orl = 0;
|
||||
o__1.osta = 0;
|
||||
o__1.oacc = 0;
|
||||
o__1.ofm = 0;
|
||||
o__1.oblnk = 0;
|
||||
f_open(&o__1);
|
||||
for (i__ = 1; i__ <= 300; ++i__) {
|
||||
s_rsfe(&io___2);
|
||||
for (k = 1; k <= 8; ++k) {
|
||||
do_fio(&c__1, (char *)&iarray[k - 1], (ftnlen)sizeof(integer));
|
||||
}
|
||||
e_rsfe();
|
||||
*/
|
||||
/* PROCESS ONE ROW OF MORSEM FILE - IARRAY(8) */
|
||||
/* LTRMAP(1..16) = 3,4,5,6,3,4,5,6,1,2,1,2,1,2,1,2,0,... */
|
||||
/* IELMST(1..16) = LAST TWO ELEMENTS */
|
||||
/* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
|
||||
/* .^ .~ .w .p -^ -~ -w -p ^. ^- ~. ~- w. w- p. p- */
|
||||
/* for (k = 1; k <= 6; ++k) {
|
||||
|
||||
blkmem_1.memfcn[i__ + k * 400 - 401] = iarray[k + 1];
|
||||
}
|
||||
blktrn_1.ltrmap[i__ - 1] = iarray[0];
|
||||
blklam_1.ielmst[i__ - 1] = iarray[1];
|
||||
if (blklam_1.ielmst[i__ - 1] == 7 || blklam_1.ielmst[i__ - 1] == 3) {
|
||||
blktrn_1.iblank[i__ - 1] = 1;
|
||||
}
|
||||
if (blklam_1.ielmst[i__ - 1] == 8 || blklam_1.ielmst[i__ - 1] == 4) {
|
||||
blktrn_1.iblank[i__ - 1] = 2;
|
||||
}
|
||||
|
||||
}
|
||||
al__1.aerr = 0;
|
||||
al__1.aunit = 20;
|
||||
f_end(&al__1);
|
||||
o__1.oerr = 0;
|
||||
o__1.ounit = 20;
|
||||
o__1.ofnmlen = 6;
|
||||
o__1.ofnm = "OUTPUT";
|
||||
o__1.orl = 0;
|
||||
o__1.osta = 0;
|
||||
o__1.oacc = 0;
|
||||
o__1.ofm = 0;
|
||||
o__1.oblnk = 0;
|
||||
f_open(&o__1);
|
||||
for (i__ = 1; i__ <= 300; ++i__) {
|
||||
s_wsfe(&io___5);
|
||||
for (k = 1; k <= 6; ++k) {
|
||||
do_fio(&c__1, (char *)&blkmem_1.memfcn[i__ + k * 400 - 401], (
|
||||
ftnlen)sizeof(integer));
|
||||
}
|
||||
e_wsfe();
|
||||
|
||||
}
|
||||
al__1.aerr = 0;
|
||||
al__1.aunit = 20;
|
||||
f_end(&al__1);
|
||||
o__1.oerr = 0;
|
||||
o__1.ounit = 20;
|
||||
o__1.ofnmlen = 4;
|
||||
o__1.ofnm = "TEXT";
|
||||
o__1.orl = 0;
|
||||
o__1.osta = 0;
|
||||
o__1.oacc = 0;
|
||||
o__1.ofm = 0;
|
||||
o__1.oblnk = 0;
|
||||
f_open(&o__1);
|
||||
for (i__ = 1; i__ <= 108; ++i__) {
|
||||
s_rsfe(&io___6);
|
||||
do_fio(&c__1, (char *)&blktxt_1.itext[i__ - 1], (ftnlen)sizeof(
|
||||
integer));
|
||||
e_rsfe();
|
||||
|
||||
}
|
||||
al__1.aerr = 0;
|
||||
al__1.aunit = 20;
|
||||
f_end(&al__1);
|
||||
*/
|
||||
return 0;
|
||||
} /* initl_ */
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <stdio.h>
|
||||
|
||||
|
||||
int kalfil_(real *z, integer *ip, real *rn, integer *ilx,
|
||||
int morse::kalfil_(real *z, integer *ip, real *rn, integer *ilx,
|
||||
integer *ixs, integer *kelem, integer *jnode, integer *israte, real *
|
||||
dur, integer *ilrate, real *pin, real *lkhdj)
|
||||
{
|
||||
|
@ -76,8 +76,8 @@ int kalfil_(real *z, integer *ip, real *rn, integer *ilx,
|
|||
|
||||
/* GET PREVIOUS ESTIMATES FOR PATH IP */
|
||||
|
||||
ykk = blksv.ykkip[*ip - 1];
|
||||
pkk = blksv.pkkip[*ip - 1];
|
||||
ykk = ykkip[*ip - 1];
|
||||
pkk = pkkip[*ip - 1];
|
||||
|
||||
/* IMPLEMENT KALMAN FILTER FOR THIS TRANSITION */
|
||||
|
||||
|
@ -88,10 +88,10 @@ int kalfil_(real *z, integer *ip, real *rn, integer *ilx,
|
|||
g = ppred * hz * pzinv;
|
||||
pest = (1.f - g * hz) * ppred;
|
||||
zr = *z - hz * ypred;
|
||||
blksv.ykksv[*jnode - 1] = ypred + g * zr;
|
||||
blksv.pkksv[*jnode - 1] = pest;
|
||||
if (blksv.ykksv[*jnode - 1] <= .01f) {
|
||||
blksv.ykksv[*jnode - 1] = .01f;
|
||||
ykksv[*jnode - 1] = ypred + g * zr;
|
||||
pkksv[*jnode - 1] = pest;
|
||||
if (ykksv[*jnode - 1] <= .01f) {
|
||||
ykksv[*jnode - 1] = .01f;
|
||||
}
|
||||
/* Computing 2nd power */
|
||||
r1 = zr;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "bmorse.h"
|
||||
|
||||
|
||||
int likhd_(real *z, real *rn, integer *ip, integer *lambda,
|
||||
int morse::likhd_(real *z, real *rn, integer *ip, integer *lambda,
|
||||
real *dur, integer *ilrate, real *p, real *lkhd)
|
||||
{
|
||||
|
||||
|
@ -65,13 +65,13 @@ int likhd_(real *z, real *rn, integer *ip, integer *lambda,
|
|||
if (*lambda == 0) {
|
||||
goto L200;
|
||||
}
|
||||
kelem = blklam.ilami[blklam.ielmst[*lambda - 1] - 1];
|
||||
ilx = blklam.ilamx[kelem - 1];
|
||||
kelem = ilami[ielmst[*lambda - 1] - 1];
|
||||
ilx = ilamx[kelem - 1];
|
||||
/* FOR EACH STATE: */
|
||||
for (k = 1; k <= 6; ++k) {
|
||||
for (i = 1; i <= 5; ++i) {
|
||||
/* OBTAIN KEYSTATE, RATE STATE, STATE N, NEW NODE: */
|
||||
ixs = blks.isx[k - 1];
|
||||
ixs = isx[k - 1];
|
||||
israte = i;
|
||||
n = (i - 1) * 6 + k;
|
||||
j = (*ip - 1) * 30 + n;
|
||||
|
|
|
@ -30,17 +30,14 @@
|
|||
|
||||
static doublereal c_b5 = 10.;
|
||||
|
||||
int model_(real *dur, integer *ielm, integer *ilr, integer *
|
||||
int morse::model_(real *dur, integer *ielm, integer *ilr, integer *
|
||||
isr, integer *ixs, real *phi, real *qa, real *hz)
|
||||
{
|
||||
/* System generated locals */
|
||||
doublereal d1;
|
||||
|
||||
/* Builtin functions */
|
||||
// double exp(doublereal), pow_dd(doublereal *, doublereal *);
|
||||
|
||||
/* Local variables */
|
||||
static real r1, bauds, xsamp;
|
||||
real r1, bauds, xsamp;
|
||||
|
||||
|
||||
/* THIS SUBROUTINE COMPUTES THE PARAMETERS OF THE */
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "bmorse.h"
|
||||
|
||||
int noise_(double zin, real *rn, real *z)
|
||||
int morse::noise_(double zin, real *rn, real *z)
|
||||
{
|
||||
/* Initialized data */
|
||||
|
||||
|
|
12
src/path.cxx
12
src/path.cxx
|
@ -23,7 +23,7 @@
|
|||
#include "bmorse.h"
|
||||
|
||||
|
||||
int path_(integer *ip, integer *lambda, real *dur, integer *ilrate, integer *lamsav, real *dursav, integer *ilrsav)
|
||||
int morse::path_(integer *ip, integer *lambda, real *dur, integer *ilrate, integer *lamsav, real *dursav, integer *ilrsav)
|
||||
{
|
||||
/* Local variables */
|
||||
static integer i, j, k, n, ixl, ixs, ilelm;
|
||||
|
@ -69,22 +69,22 @@ int path_(integer *ip, integer *lambda, real *dur, integer *ilrate, integer *lam
|
|||
lamsav[j] = 0;
|
||||
goto L100;
|
||||
L50:
|
||||
lamsav[j] = blkmem.memfcn[*lambda + k * 400 - 401];
|
||||
lamsav[j] = memfcn[*lambda + k * 400 - 401];
|
||||
if (lamsav[j] == 0) {
|
||||
goto L100;
|
||||
}
|
||||
|
||||
/* NEW DURATION: */
|
||||
/* OBTAIN KEYSTATE OF SAVED PATH AND NEW STATE: */
|
||||
ilelm = blklam.ilami[blklam.ielmst[*lambda - 1] - 1];
|
||||
ixl = blklam.ilamx[ilelm - 1];
|
||||
ixs = blks.isx[k - 1];
|
||||
ilelm = ilami[ielmst[*lambda - 1] - 1];
|
||||
ixl = ilamx[ilelm - 1];
|
||||
ixs = isx[k - 1];
|
||||
|
||||
/* CALCULATE DURATION - ADD SAMPLE DURATION 5 ms FOR EACH VALID PATH */
|
||||
dursav[j] = *dur * (1 - ixs - ixl + (ixs << 1) * ixl) + params.sample_duration;
|
||||
|
||||
/* NEW DATA RATE: */
|
||||
ilrsav[j] = *ilrate + (i - 3) * blkrat.memdel[ilelm + k * 6 - 7];
|
||||
ilrsav[j] = *ilrate + (i - 3) * memdel[k-1][ilelm -1];
|
||||
L100:
|
||||
;
|
||||
}
|
||||
|
|
|
@ -22,14 +22,14 @@
|
|||
|
||||
#include "bmorse.h"
|
||||
|
||||
/* Subroutine */ int probp_(real *p, real *pin, integer *isave, real *lkhd)
|
||||
int morse::probp_(real *p, real *pin, integer *isave, real *lkhd)
|
||||
{
|
||||
/* System generated locals */
|
||||
integer i1;
|
||||
|
||||
/* Local variables */
|
||||
static integer i, j, n, ni;
|
||||
static real pmax, psav[750], psum;
|
||||
integer i, j, n, ni;
|
||||
real pmax, psav[750], psum;
|
||||
|
||||
|
||||
/* PROBP COMPUTES THE POSTERIOR PROBABILITY OF EACH NEW PATH */
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "bmorse.h"
|
||||
|
||||
int proces_(real *z, real *rn, integer *xhat, real *px, integer *elmhat, real *spdhat, integer *imax, real * pmax, int spd)
|
||||
int morse::proces_(real *z, real *rn, integer *xhat, real *px, integer *elmhat, real *spdhat, integer *imax, real * pmax, int spd)
|
||||
{
|
||||
/* Initialized data */
|
||||
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
|
||||
|
||||
|
||||
int ptrans_(integer *kelem, integer *irate, integer *lambda, integer *ilrate, real *ptrx, real *psum, real *pin, integer *n)
|
||||
int morse::ptrans_(integer *kelem, integer *irate, integer *lambda, integer *ilrate, real *ptrx, real *psum, real *pin, integer *n)
|
||||
{
|
||||
static real pelem, prate;
|
||||
real pelem, prate;
|
||||
|
||||
|
||||
/* THIS FUNCTION SUBROUTINE RETURNS THE PATH CONDITIONAL TRANSITION */
|
||||
|
@ -50,7 +50,7 @@ int ptrans_(integer *kelem, integer *irate, integer *lambda, integer *ilrate, re
|
|||
--pin;
|
||||
|
||||
/* Function Body */
|
||||
if (*kelem != blklam.ilami[blklam.ielmst[*lambda - 1] - 1]) {
|
||||
if (*kelem != ilami[ielmst[*lambda - 1] - 1]) {
|
||||
goto L100;
|
||||
}
|
||||
pin[*n] = *ptrx;
|
||||
|
@ -65,9 +65,9 @@ int ptrans_(integer *kelem, integer *irate, integer *lambda, integer *ilrate, re
|
|||
/* OBTAIN ELEM TRANS PROBS TABLE: */
|
||||
|
||||
L100:
|
||||
pelem = blkelm.elemtr[blklam.ielmst[*lambda - 1] + (*kelem << 4) - 17];
|
||||
pelem = elemtr[*kelem-1][ielmst[*lambda - 1]-1];
|
||||
/* NEXT COMPUTE ELEM-CONDITIONAL SPEED TRANS PROB: */
|
||||
prate = spdtr_(irate, ilrate, kelem, &blklam.ilami[blklam.ielmst[*lambda - 1] - 1]);
|
||||
prate = spdtr_(irate, ilrate, kelem, &ilami[ielmst[*lambda - 1] - 1]);
|
||||
/* TRANS IS THE PRODUCT: */
|
||||
pin[*n] = (1.f - *ptrx) * pelem * prate;
|
||||
L200:
|
||||
|
|
|
@ -24,21 +24,21 @@
|
|||
|
||||
|
||||
|
||||
/* Subroutine */ int savep_(real *p, integer *pathsv, integer *isave, integer
|
||||
int morse::savep_(real *p, integer *pathsv, integer *isave, integer
|
||||
*imax, integer *lamsav, real *dursav, integer *ilrsav, integer *
|
||||
lambda, real *dur, integer *ilrate, integer *sort, real *pmax)
|
||||
{
|
||||
/* Initialized data */
|
||||
|
||||
static real popt = .9f;
|
||||
real popt = .9f;
|
||||
|
||||
/* System generated locals */
|
||||
integer i1, i2;
|
||||
|
||||
/* Local variables */
|
||||
static integer i, j, k, n, ip, jsav, nsav;
|
||||
static real psav[25], psum;
|
||||
static integer iconv[25], ipsav, isavm1, nplus1;
|
||||
integer i, j, k, n, ip, jsav, nsav;
|
||||
real psav[25], psum;
|
||||
integer iconv[25], ipsav, isavm1, nplus1;
|
||||
|
||||
|
||||
/* THIS SUBROUTINE PERFORMS THE ALGORITM TO SAVE */
|
||||
|
@ -152,8 +152,8 @@
|
|||
lambda[i] = lamsav[sort[i]];
|
||||
dur[i] = dursav[sort[i]];
|
||||
ilrate[i] = ilrsav[sort[i]];
|
||||
blksv.ykkip[i - 1] = blksv.ykksv[sort[i] - 1];
|
||||
blksv.pkkip[i - 1] = blksv.pkksv[sort[i] - 1];
|
||||
ykkip[i - 1] = ykksv[sort[i] - 1];
|
||||
pkkip[i - 1] = pkksv[sort[i] - 1];
|
||||
}
|
||||
i1 = *isave;
|
||||
for (i = 1; i <= i1; ++i) {
|
||||
|
@ -193,8 +193,8 @@
|
|||
lambda[n] = lambda[i];
|
||||
dur[n] = dur[i];
|
||||
ilrate[n] = ilrate[i];
|
||||
blksv.ykkip[n - 1] = blksv.ykkip[i - 1];
|
||||
blksv.pkkip[n - 1] = blksv.pkkip[i - 1];
|
||||
ykkip[n - 1] = ykkip[i - 1];
|
||||
pkkip[n - 1] = pkkip[i - 1];
|
||||
pathsv[n] = pathsv[i];
|
||||
sort[n] = sort[i];
|
||||
p[n] = p[i];
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
|
||||
|
||||
doublereal spdtr_(integer *isrt, integer *ilrt, integer *iselm, integer *ilelm)
|
||||
doublereal morse::spdtr_(integer *isrt, integer *ilrt, integer *iselm, integer *ilelm)
|
||||
{
|
||||
/* System generated locals */
|
||||
real ret_val;
|
||||
|
@ -61,8 +61,8 @@ doublereal spdtr_(integer *isrt, integer *ilrt, integer *iselm, integer *ilelm)
|
|||
/* OTHERWISE, OBTAIN SPEED TRANSITION PROB */
|
||||
|
||||
L100:
|
||||
idel = blkrat.memdel[*ilelm + *iselm * 6 - 7];
|
||||
ind1 = blkspd.mempr[*ilelm + *iselm * 6 - 7];
|
||||
idel = memdel[*iselm-1][*ilelm -1];
|
||||
ind1 = mempr[*iselm -1][*ilelm -1];
|
||||
if (ind1 != 0) {
|
||||
goto L200;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ L100:
|
|||
goto L300;
|
||||
L200:
|
||||
idelsp = (*isrt - 3) * idel;
|
||||
ret_val = blkspd.rtrans[*isrt + ind1 * 5 - 6];
|
||||
ret_val = rtrans[ind1-1][*isrt-1];
|
||||
israte = *ilrt + idelsp;
|
||||
if (israte > 60) {
|
||||
ret_val = 0.f;
|
||||
|
|
|
@ -26,15 +26,15 @@
|
|||
extern char debug;
|
||||
extern PARAMS params;
|
||||
|
||||
int sprob_(real *p, integer *isave, integer *ilrsav, real *pelm, integer *khat, real *spdhat, real *px)
|
||||
int morse::sprob_(real *p, integer *isave, integer *ilrsav, real *pelm, integer *khat, real *spdhat, real *px)
|
||||
{
|
||||
/* System generated locals */
|
||||
integer i1;
|
||||
|
||||
/* Local variables */
|
||||
static integer i, j, k, m, n;
|
||||
static real pselem[6];
|
||||
static int initial = 0;
|
||||
integer i, j, k, m, n;
|
||||
real pselem[6];
|
||||
static int initial = 0;
|
||||
|
||||
|
||||
/* SPROB COMPUTES THE POSTERIOR PROBS OF THE ELEMENT */
|
||||
|
|
|
@ -100,7 +100,7 @@ struct TREE {
|
|||
// (c) 2013 AG1LE Mauri Niininen
|
||||
//
|
||||
//
|
||||
int transl_(int *ltr)
|
||||
int morse::transl_(int *ltr)
|
||||
{
|
||||
/* Initialized data */
|
||||
|
||||
|
@ -135,10 +135,10 @@ int transl_(int *ltr)
|
|||
|
||||
/* DETERMINE IF A CSP,WSP, OR PAUSE TO MARK TRASITION */
|
||||
/* HAS OCCURED; IF SO LTR IS READY FOR OUTPUT: */
|
||||
// elmhat = blklam_1.ilami[(1600 + (0 + (blklam_1.ielmst[(0 + (0 + (*ltr - 1 << 2))) / 4] - 1 << 2)) - 1600) / 4];
|
||||
|
||||
|
||||
elmhat = blklam.ilami[*ltr-1];
|
||||
ixl = blklam.ilamx[elmhat - 1];
|
||||
elmhat = ilami[*ltr-1];
|
||||
ixl = ilamx[elmhat - 1];
|
||||
|
||||
/* NO CHANGE FROM LAST - CONTINUE */
|
||||
|
||||
|
|
|
@ -26,27 +26,21 @@
|
|||
//#define DEBUG 1
|
||||
|
||||
|
||||
int trelis_(integer *isave, integer *pathsv, integer *lambda, integer *imax, integer *ipmax)
|
||||
int morse::trelis_(integer *isave, integer *pathsv, integer *lambda, integer *imax, integer *ipmax)
|
||||
{
|
||||
/* Initialized data */
|
||||
|
||||
static integer lmdsav[25*NDELAY]; /* was [200][25] */
|
||||
static integer lmdsav[25][NDELAY]; /* was [200][25] */
|
||||
static integer n = 0;
|
||||
static integer ndelay = NDELAY;
|
||||
static integer ipnod[25] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 };
|
||||
static integer ipnod[25];
|
||||
static integer ncall = 0;
|
||||
static integer nmax = 0;
|
||||
static integer mmax = 0;
|
||||
static integer ltrsv[NDELAY] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0 };
|
||||
static integer ltrsv[NDELAY];
|
||||
static integer kd = 0;
|
||||
static integer ndelst = 0;
|
||||
static integer pthtrl[25*NDELAY]; /* was [200][25] */
|
||||
static integer pthtrl[25][NDELAY]; /* was [200][25] */
|
||||
static integer iend = 0;
|
||||
|
||||
|
||||
|
@ -75,12 +69,17 @@ int trelis_(integer *isave, integer *pathsv, integer *lambda, integer *imax, int
|
|||
--lambda;
|
||||
--pathsv;
|
||||
|
||||
/* Function Body */
|
||||
/* initialize variables*/
|
||||
if (init ==0) {
|
||||
init = 1;
|
||||
for (i=0; i<(25*NDELAY); i++) {
|
||||
pthtrl[i] = 0;
|
||||
lmdsav[i] = 0;
|
||||
for (i=0; i< NDELAY; i++)
|
||||
ltrsv[i] = 0;
|
||||
for (int row =0; row < 25; row++) {
|
||||
ipnod[row] = 1;
|
||||
for (int col =0; col < NDELAY; col++){
|
||||
lmdsav[row][col] = 0;
|
||||
pthtrl[row][col] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -117,8 +116,11 @@ int trelis_(integer *isave, integer *pathsv, integer *lambda, integer *imax, int
|
|||
}
|
||||
i1 = *isave;
|
||||
for (i = 1; i <= i1; ++i) {
|
||||
pthtrl[n + i * NDELAY-NDELAY-1] = pathsv[i];
|
||||
lmdsav[n + i * NDELAY-NDELAY-1] = lambda[i];
|
||||
// pthtrl[n + i * NDELAY-NDELAY-1] = pathsv[i];
|
||||
pthtrl[i-1][n-1] = pathsv[i];
|
||||
|
||||
// lmdsav[n + i * NDELAY-NDELAY-1] = lambda[i];
|
||||
lmdsav[i-1][n-1] = (integer)lambda[i];
|
||||
}
|
||||
|
||||
/* PERFORM DYNAMIC PROGRAM ROUTINE TO FIND CONVERGENT PATH: */
|
||||
|
@ -140,7 +142,8 @@ L190:
|
|||
if (i <= 0) {
|
||||
i = ndelay + i;
|
||||
}
|
||||
ipnod[ip - 1] = pthtrl[i + ipnod[ip - 1] * NDELAY-NDELAY-1];
|
||||
// ipnod[ip - 1] = pthtrl[i + ipnod[ip - 1] * NDELAY-NDELAY-1];
|
||||
ipnod[ip - 1] = pthtrl[ipnod[ip - 1]-1][i-1];
|
||||
if (ip == *imax) {
|
||||
*ipmax = ipnod[ip - 1];
|
||||
}
|
||||
|
@ -170,7 +173,8 @@ L190:
|
|||
if (i <= 0) {
|
||||
i = ndelay + i;
|
||||
}
|
||||
ltr = lmdsav[i + ipnod[0] * NDELAY-NDELAY-1];
|
||||
// ltr = lmdsav[i + ipnod[0] * NDELAY-NDELAY-1];
|
||||
ltr = lmdsav[ipnod[0]-1][i-1];
|
||||
#ifdef DEBUG
|
||||
printf("\nSAME DELAY AS LAST: %d",ltr);
|
||||
#endif
|
||||
|
@ -191,8 +195,14 @@ L350:
|
|||
if (i <= 0) {
|
||||
i = ndelay + i;
|
||||
}
|
||||
ltrsv[kd - 1] = lmdsav[i + ip * NDELAY-NDELAY-1];
|
||||
ip = pthtrl[i + ip * NDELAY-NDELAY-1];
|
||||
// ltrsv[kd - 1] = lmdsav[i + ip * NDELAY-NDELAY-1];
|
||||
if (ip > 26) {
|
||||
printf("\nTRELIS.CXX: Error line 196 ip:%d",ip);
|
||||
return(-1);
|
||||
}
|
||||
ltrsv[kd - 1] = lmdsav[ip-1][i-1];
|
||||
// ip = pthtrl[i + ip * NDELAY-NDELAY-1];
|
||||
ip = pthtrl[ip-1][i-1];
|
||||
}
|
||||
|
||||
/* REVERSE ORDER OF DECODED LETTERS, SINCE THEY */
|
||||
|
@ -217,7 +227,8 @@ L700:
|
|||
if (i <= 0) {
|
||||
i = ndelay + i;
|
||||
}
|
||||
ltr = lmdsav[i + *ipmax * NDELAY-NDELAY-1];
|
||||
// ltr = lmdsav[i + *ipmax * NDELAY-NDELAY-1];
|
||||
ltr = lmdsav[*ipmax-1][i -1];
|
||||
#ifdef DEBUG
|
||||
printf("\nHIGHEST PROB: %d", ltr);
|
||||
#endif
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "bmorse.h"
|
||||
|
||||
int trprob_(integer *ip, integer *lambda, real *dur, integer *ilrate, real *p)
|
||||
int morse::trprob_(integer *ip, integer *lambda, real *dur, integer *ilrate, real *p)
|
||||
{
|
||||
static integer i, k, n;
|
||||
static real pin[30];
|
||||
|
@ -59,7 +59,7 @@ int trprob_(integer *ip, integer *lambda, real *dur, integer *ilrate, real *p)
|
|||
return 0;
|
||||
}
|
||||
|
||||
ielem = blklam.ilami[blklam.ielmst[*lambda - 1] - 1];
|
||||
ielem = ilami[ielmst[*lambda - 1] - 1];
|
||||
/* COMPUTE KEYSTATE TRANSITION PROBABILITY: */
|
||||
ptrx = xtrans_(&ielem, dur, ilrate);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "bmorse.h"
|
||||
#include <math.h>
|
||||
|
||||
doublereal xtrans_(integer *ielem, real *d0, integer *irate)
|
||||
doublereal morse::xtrans_(integer *ielem, real *d0, integer *irate)
|
||||
{
|
||||
/* Initialized data */
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue