2014-JUN-08 Cleaning up code, removed non-used parameters in function, removed pointer adjustements.

master
AG1LE Mauri 2014-06-08 14:55:45 -04:00
rodzic 8b5424021e
commit a0564dae89
24 zmienionych plików z 328 dodań i 583 usunięć

Wyświetl plik

@ -1 +1 @@
(c) 2013 AG1LE Mauri Niininen
(c) 2013,2014 AG1LE Mauri Niininen

Wyświetl plik

@ -189,15 +189,15 @@ PACKAGE_HOME = https://github.com/ag1le/morse-wip
PACKAGE_NAME = bmorse
PACKAGE_NEWBUG = https://github.com/ag1le/morse-wip/issues
PACKAGE_PROJ = https://github.com/ag1le/morse-wip
PACKAGE_STRING = bmorse 0.1.01
PACKAGE_STRING = bmorse 0.1.02
PACKAGE_TARNAME = bmorse
PACKAGE_URL =
PACKAGE_VERSION = 0.1.01
PACKAGE_VERSION = 0.1.02
PATH_SEPARATOR = :
SET_MAKE =
SHELL = /bin/bash
STRIP =
VERSION = 0.1.01
VERSION = 0.1.02
abs_builddir = /home/mauri/Projects/morse
abs_srcdir = /home/mauri/Projects/morse
abs_top_builddir = /home/mauri/Projects/morse

Wyświetl plik

@ -1,34 +1,15 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* config.h.in. Generated from configure.in by autoheader. */
/* bmorse authors */
#define FLDIGI_AUTHORS "Mauri Niininen"
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `fftw3' library (-lfftw3). */
/* #undef HAVE_LIBFFTW3 */
/* Define to 1 if you have the `m' library (-lm). */
/* #undef HAVE_LIBM */
/* Define to 1 if you have the `sndfile' library (-lsndfile). */
/* #undef HAVE_LIBSNDFILE */
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
/* #undef HAVE_MALLOC */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
/* #undef HAVE_MEMSET */
/* Define to 1 if you have the `pow' function. */
/* #undef HAVE_POW */
/* Define to 1 if you have the `sqrt' function. */
/* #undef HAVE_SQRT */
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
@ -41,9 +22,6 @@
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strrchr' function. */
/* #undef HAVE_STRRCHR */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
@ -53,20 +31,32 @@
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if the system has the type `_Bool'. */
/* #undef HAVE__BOOL */
/* Name of package */
#define PACKAGE "bmorse"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "ag1le@innomore.com"
/* Download page */
#define PACKAGE_DL "https://github.com/ag1le/morse-wip"
/* Docs index */
#define PACKAGE_DOCS "https://github.com/ag1le/morse-wip/wiki"
/* Beginners guide */
#define PACKAGE_GUIDE "https://github.com/ag1le/morse-wip/wiki"
/* Home page */
#define PACKAGE_HOME "https://github.com/ag1le/morse-wip"
/* Define to the full name of this package. */
#define PACKAGE_NAME "bmorse"
/* Trac new ticket page */
#define PACKAGE_NEWBUG "https://github.com/ag1le/morse-wip/issues"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "bmorse 0.1.01"
#define PACKAGE_STRING "bmorse 0.1.02"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "bmorse"
@ -75,19 +65,42 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.1.01"
#define PACKAGE_VERSION "0.1.02"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "0.1.01"
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
/* Define to rpl_malloc if the replacement function should be used. */
/* #undef malloc */
/* Version number of package */
#define VERSION "0.1.02"
/* Define to 1 if on MINIX. */
/* #undef _MINIX */
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
/* #undef _POSIX_1_SOURCE */
/* Define to 1 if you need to in order for `stat' and other things to work. */
/* #undef _POSIX_SOURCE */

Wyświetl plik

@ -1,7 +1,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bmorse configure 0.1.01, which was
It was created by bmorse configure 0.1.02, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure
@ -89,105 +89,31 @@ compilation terminated.
configure:2922: $? = 4
configure:2942: checking whether the C++ compiler works
configure:2964: g++ conftest.cpp >&5
conftest.cpp:11:0: warning: "VERSION" redefined [enabled by default]
conftest.cpp:9:0: note: this is the location of the previous definition
configure:2968: $? = 0
configure:3016: result: yes
configure:3019: checking for C++ compiler default output file name
configure:3021: result: a.out
configure:3027: checking for suffix of executables
configure:3034: g++ -o conftest conftest.cpp >&5
conftest.cpp:11:0: warning: "VERSION" redefined [enabled by default]
conftest.cpp:9:0: note: this is the location of the previous definition
configure:3038: $? = 0
configure:3060: result:
configure:3082: checking whether we are cross compiling
configure:3090: g++ -o conftest conftest.cpp >&5
conftest.cpp:11:0: warning: "VERSION" redefined [enabled by default]
conftest.cpp:9:0: note: this is the location of the previous definition
configure:3094: $? = 0
configure:3101: ./conftest
configure:3105: $? = 0
configure:3120: result: no
configure:3125: checking for suffix of object files
configure:3147: g++ -c conftest.cpp >&5
conftest.cpp:11:0: warning: "VERSION" redefined [enabled by default]
conftest.cpp:9:0: note: this is the location of the previous definition
configure:3151: $? = 0
configure:3172: result: o
configure:3176: checking whether we are using the GNU C++ compiler
configure:3195: g++ -c conftest.cpp >&5
conftest.cpp:11:0: warning: "VERSION" redefined [enabled by default]
conftest.cpp:9:0: note: this is the location of the previous definition
configure:3195: $? = 0
configure:3204: result: yes
configure:3213: checking whether g++ accepts -g
configure:3233: g++ -c -g conftest.cpp >&5
conftest.cpp:11:0: warning: "VERSION" redefined [enabled by default]
conftest.cpp:9:0: note: this is the location of the previous definition
configure:3233: $? = 0
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "bmorse"
| #define PACKAGE_TARNAME "bmorse"
| #define PACKAGE_VERSION "0.1.01"
| #define PACKAGE_STRING "bmorse 0.1.01"
| #define PACKAGE_BUGREPORT "ag1le@innomore.com"
| #define PACKAGE_URL ""
| #define PACKAGE "bmorse"
| #define VERSION "0.1.0"
| #define PACKAGE "bmorse"
| #define VERSION "0.1.01"
| #define FLDIGI_AUTHORS "Mauri Niininen"
| #define PACKAGE_HOME "https://github.com/ag1le/morse-wip"
| #define PACKAGE_DL "https://github.com/ag1le/morse-wip"
| #define PACKAGE_NEWBUG "https://github.com/ag1le/morse-wip/issues"
| #define PACKAGE_DOCS "https://github.com/ag1le/morse-wip/wiki"
| #define PACKAGE_GUIDE "https://github.com/ag1le/morse-wip/wiki"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3248: g++ -c conftest.cpp >&5
conftest.cpp:11:0: warning: "VERSION" redefined [enabled by default]
conftest.cpp:9:0: note: this is the location of the previous definition
configure:3248: $? = 0
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "bmorse"
| #define PACKAGE_TARNAME "bmorse"
| #define PACKAGE_VERSION "0.1.01"
| #define PACKAGE_STRING "bmorse 0.1.01"
| #define PACKAGE_BUGREPORT "ag1le@innomore.com"
| #define PACKAGE_URL ""
| #define PACKAGE "bmorse"
| #define VERSION "0.1.0"
| #define PACKAGE "bmorse"
| #define VERSION "0.1.01"
| #define FLDIGI_AUTHORS "Mauri Niininen"
| #define PACKAGE_HOME "https://github.com/ag1le/morse-wip"
| #define PACKAGE_DL "https://github.com/ag1le/morse-wip"
| #define PACKAGE_NEWBUG "https://github.com/ag1le/morse-wip/issues"
| #define PACKAGE_DOCS "https://github.com/ag1le/morse-wip/wiki"
| #define PACKAGE_GUIDE "https://github.com/ag1le/morse-wip/wiki"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3264: g++ -c -g conftest.cpp >&5
conftest.cpp:11:0: warning: "VERSION" redefined [enabled by default]
conftest.cpp:9:0: note: this is the location of the previous definition
configure:3264: $? = 0
configure:3274: result: yes
configure:3308: checking for style of include used by make
configure:3336: result: GNU
@ -227,82 +153,14 @@ compilation terminated.
configure:3940: $? = 4
configure:3944: checking whether we are using the GNU C compiler
configure:3963: gcc -c conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:3963: $? = 0
configure:3972: result: yes
configure:3981: checking whether gcc accepts -g
configure:4001: gcc -c -g conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4001: $? = 0
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "bmorse"
| #define PACKAGE_TARNAME "bmorse"
| #define PACKAGE_VERSION "0.1.01"
| #define PACKAGE_STRING "bmorse 0.1.01"
| #define PACKAGE_BUGREPORT "ag1le@innomore.com"
| #define PACKAGE_URL ""
| #define PACKAGE "bmorse"
| #define VERSION "0.1.0"
| #define PACKAGE "bmorse"
| #define VERSION "0.1.01"
| #define FLDIGI_AUTHORS "Mauri Niininen"
| #define PACKAGE_HOME "https://github.com/ag1le/morse-wip"
| #define PACKAGE_DL "https://github.com/ag1le/morse-wip"
| #define PACKAGE_NEWBUG "https://github.com/ag1le/morse-wip/issues"
| #define PACKAGE_DOCS "https://github.com/ag1le/morse-wip/wiki"
| #define PACKAGE_GUIDE "https://github.com/ag1le/morse-wip/wiki"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:4016: gcc -c conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4016: $? = 0
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "bmorse"
| #define PACKAGE_TARNAME "bmorse"
| #define PACKAGE_VERSION "0.1.01"
| #define PACKAGE_STRING "bmorse 0.1.01"
| #define PACKAGE_BUGREPORT "ag1le@innomore.com"
| #define PACKAGE_URL ""
| #define PACKAGE "bmorse"
| #define VERSION "0.1.0"
| #define PACKAGE "bmorse"
| #define VERSION "0.1.01"
| #define FLDIGI_AUTHORS "Mauri Niininen"
| #define PACKAGE_HOME "https://github.com/ag1le/morse-wip"
| #define PACKAGE_DL "https://github.com/ag1le/morse-wip"
| #define PACKAGE_NEWBUG "https://github.com/ag1le/morse-wip/issues"
| #define PACKAGE_DOCS "https://github.com/ag1le/morse-wip/wiki"
| #define PACKAGE_GUIDE "https://github.com/ag1le/morse-wip/wiki"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:4032: gcc -c -g conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4032: $? = 0
configure:4042: result: yes
configure:4059: checking for gcc option to accept ISO C89
configure:4122: gcc -c -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4122: $? = 0
configure:4135: result: none needed
configure:4157: checking dependency style of gcc
@ -311,12 +169,8 @@ configure:4285: checking dependency style of gcc
configure:4396: result: gcc3
configure:4417: checking how to run the C preprocessor
configure:4448: gcc -E conftest.c
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4448: $? = 0
configure:4462: gcc -E conftest.c
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
conftest.c:19:28: fatal error: ac_nonexistent.h: No such file or directory
compilation terminated.
configure:4462: $? = 1
@ -324,14 +178,14 @@ configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "bmorse"
| #define PACKAGE_TARNAME "bmorse"
| #define PACKAGE_VERSION "0.1.01"
| #define PACKAGE_STRING "bmorse 0.1.01"
| #define PACKAGE_VERSION "0.1.02"
| #define PACKAGE_STRING "bmorse 0.1.02"
| #define PACKAGE_BUGREPORT "ag1le@innomore.com"
| #define PACKAGE_URL ""
| #define PACKAGE "bmorse"
| #define VERSION "0.1.0"
| #define VERSION "0.1.02"
| #define PACKAGE "bmorse"
| #define VERSION "0.1.01"
| #define VERSION "0.1.02"
| #define FLDIGI_AUTHORS "Mauri Niininen"
| #define PACKAGE_HOME "https://github.com/ag1le/morse-wip"
| #define PACKAGE_DL "https://github.com/ag1le/morse-wip"
@ -342,12 +196,8 @@ configure: failed program was:
| #include <ac_nonexistent.h>
configure:4487: result: gcc -E
configure:4507: gcc -E conftest.c
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4507: $? = 0
configure:4521: gcc -E conftest.c
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
conftest.c:19:28: fatal error: ac_nonexistent.h: No such file or directory
compilation terminated.
configure:4521: $? = 1
@ -355,14 +205,14 @@ configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "bmorse"
| #define PACKAGE_TARNAME "bmorse"
| #define PACKAGE_VERSION "0.1.01"
| #define PACKAGE_STRING "bmorse 0.1.01"
| #define PACKAGE_VERSION "0.1.02"
| #define PACKAGE_STRING "bmorse 0.1.02"
| #define PACKAGE_BUGREPORT "ag1le@innomore.com"
| #define PACKAGE_URL ""
| #define PACKAGE "bmorse"
| #define VERSION "0.1.0"
| #define VERSION "0.1.02"
| #define PACKAGE "bmorse"
| #define VERSION "0.1.01"
| #define VERSION "0.1.02"
| #define FLDIGI_AUTHORS "Mauri Niininen"
| #define PACKAGE_HOME "https://github.com/ag1le/morse-wip"
| #define PACKAGE_DL "https://github.com/ag1le/morse-wip"
@ -377,78 +227,50 @@ configure:4613: checking for egrep
configure:4675: result: /bin/grep -E
configure:4680: checking for ANSI C header files
configure:4700: gcc -c -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4700: $? = 0
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4773: gcc -o conftest -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4773: $? = 0
configure:4773: ./conftest
configure:4773: $? = 0
configure:4784: result: yes
configure:4797: checking for sys/types.h
configure:4797: gcc -c -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4797: $? = 0
configure:4797: result: yes
configure:4797: checking for sys/stat.h
configure:4797: gcc -c -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4797: $? = 0
configure:4797: result: yes
configure:4797: checking for stdlib.h
configure:4797: gcc -c -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4797: $? = 0
configure:4797: result: yes
configure:4797: checking for string.h
configure:4797: gcc -c -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4797: $? = 0
configure:4797: result: yes
configure:4797: checking for memory.h
configure:4797: gcc -c -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4797: $? = 0
configure:4797: result: yes
configure:4797: checking for strings.h
configure:4797: gcc -c -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4797: $? = 0
configure:4797: result: yes
configure:4797: checking for inttypes.h
configure:4797: gcc -c -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4797: $? = 0
configure:4797: result: yes
configure:4797: checking for stdint.h
configure:4797: gcc -c -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4797: $? = 0
configure:4797: result: yes
configure:4797: checking for unistd.h
configure:4797: gcc -c -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4797: $? = 0
configure:4797: result: yes
configure:4810: checking minix/config.h usability
configure:4810: gcc -c -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
conftest.c:62:26: fatal error: minix/config.h: No such file or directory
compilation terminated.
configure:4810: $? = 1
@ -456,14 +278,14 @@ configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "bmorse"
| #define PACKAGE_TARNAME "bmorse"
| #define PACKAGE_VERSION "0.1.01"
| #define PACKAGE_STRING "bmorse 0.1.01"
| #define PACKAGE_VERSION "0.1.02"
| #define PACKAGE_STRING "bmorse 0.1.02"
| #define PACKAGE_BUGREPORT "ag1le@innomore.com"
| #define PACKAGE_URL ""
| #define PACKAGE "bmorse"
| #define VERSION "0.1.0"
| #define VERSION "0.1.02"
| #define PACKAGE "bmorse"
| #define VERSION "0.1.01"
| #define VERSION "0.1.02"
| #define FLDIGI_AUTHORS "Mauri Niininen"
| #define PACKAGE_HOME "https://github.com/ag1le/morse-wip"
| #define PACKAGE_DL "https://github.com/ag1le/morse-wip"
@ -518,8 +340,6 @@ configure: failed program was:
configure:4810: result: no
configure:4810: checking minix/config.h presence
configure:4810: gcc -E conftest.c
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
conftest.c:29:26: fatal error: minix/config.h: No such file or directory
compilation terminated.
configure:4810: $? = 1
@ -527,14 +347,14 @@ configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "bmorse"
| #define PACKAGE_TARNAME "bmorse"
| #define PACKAGE_VERSION "0.1.01"
| #define PACKAGE_STRING "bmorse 0.1.01"
| #define PACKAGE_VERSION "0.1.02"
| #define PACKAGE_STRING "bmorse 0.1.02"
| #define PACKAGE_BUGREPORT "ag1le@innomore.com"
| #define PACKAGE_URL ""
| #define PACKAGE "bmorse"
| #define VERSION "0.1.0"
| #define VERSION "0.1.02"
| #define PACKAGE "bmorse"
| #define VERSION "0.1.01"
| #define VERSION "0.1.02"
| #define FLDIGI_AUTHORS "Mauri Niininen"
| #define PACKAGE_HOME "https://github.com/ag1le/morse-wip"
| #define PACKAGE_DL "https://github.com/ag1le/morse-wip"
@ -558,8 +378,6 @@ configure:4810: checking for minix/config.h
configure:4810: result: no
configure:4831: checking whether it is safe to define __EXTENSIONS__
configure:4849: gcc -c -g -O2 conftest.c >&5
conftest.c:11:0: warning: "VERSION" redefined [enabled by default]
conftest.c:9:0: note: this is the location of the previous definition
configure:4849: $? = 0
configure:4856: result: yes
configure:5029: creating ./config.status
@ -568,7 +386,7 @@ configure:5029: creating ./config.status
## Running config.status. ##
## ---------------------- ##
This file was extended by bmorse config.status 0.1.01, which was
This file was extended by bmorse config.status 0.1.02, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES =
@ -582,7 +400,6 @@ on X301
config.status:882: creating Makefile
config.status:882: creating src/Makefile
config.status:882: creating config.h
config.status:1063: config.h is unchanged
config.status:1111: executing depfiles commands
## ---------------- ##
@ -702,15 +519,15 @@ PACKAGE_HOME='https://github.com/ag1le/morse-wip'
PACKAGE_NAME='bmorse'
PACKAGE_NEWBUG='https://github.com/ag1le/morse-wip/issues'
PACKAGE_PROJ='https://github.com/ag1le/morse-wip'
PACKAGE_STRING='bmorse 0.1.01'
PACKAGE_STRING='bmorse 0.1.02'
PACKAGE_TARNAME='bmorse'
PACKAGE_URL=''
PACKAGE_VERSION='0.1.01'
PACKAGE_VERSION='0.1.02'
PATH_SEPARATOR=':'
SET_MAKE=''
SHELL='/bin/bash'
STRIP=''
VERSION='0.1.01'
VERSION='0.1.02'
ac_ct_CC='gcc'
ac_ct_CXX='g++'
am__EXEEXT_FALSE=''
@ -761,14 +578,14 @@ target_alias=''
/* confdefs.h */
#define PACKAGE_NAME "bmorse"
#define PACKAGE_TARNAME "bmorse"
#define PACKAGE_VERSION "0.1.01"
#define PACKAGE_STRING "bmorse 0.1.01"
#define PACKAGE_VERSION "0.1.02"
#define PACKAGE_STRING "bmorse 0.1.02"
#define PACKAGE_BUGREPORT "ag1le@innomore.com"
#define PACKAGE_URL ""
#define PACKAGE "bmorse"
#define VERSION "0.1.0"
#define VERSION "0.1.02"
#define PACKAGE "bmorse"
#define VERSION "0.1.01"
#define VERSION "0.1.02"
#define FLDIGI_AUTHORS "Mauri Niininen"
#define PACKAGE_HOME "https://github.com/ag1le/morse-wip"
#define PACKAGE_DL "https://github.com/ag1le/morse-wip"
@ -792,20 +609,3 @@ 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

22
configure vendored
Wyświetl plik

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for bmorse 0.1.01.
# Generated by GNU Autoconf 2.69 for bmorse 0.1.02.
#
# Report bugs to <ag1le@innomore.com>.
#
@ -582,8 +582,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='bmorse'
PACKAGE_TARNAME='bmorse'
PACKAGE_VERSION='0.1.01'
PACKAGE_STRING='bmorse 0.1.01'
PACKAGE_VERSION='0.1.02'
PACKAGE_STRING='bmorse 0.1.02'
PACKAGE_BUGREPORT='ag1le@innomore.com'
PACKAGE_URL=''
@ -1288,7 +1288,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures bmorse 0.1.01 to adapt to many kinds of systems.
\`configure' configures bmorse 0.1.02 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1354,7 +1354,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of bmorse 0.1.01:";;
short | recursive ) echo "Configuration of bmorse 0.1.02:";;
esac
cat <<\_ACEOF
@ -1447,7 +1447,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bmorse configure 0.1.01
bmorse configure 0.1.02
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1743,7 +1743,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bmorse $as_me 0.1.01, which was
It was created by bmorse $as_me 0.1.02, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2093,7 +2093,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
PACKAGE=bmorse
VERSION=0.1.0
VERSION=0.1.02
am__api_version='1.11'
@ -2626,7 +2626,7 @@ fi
# Define the identity of the package.
PACKAGE='bmorse'
VERSION='0.1.01'
VERSION='0.1.02'
cat >>confdefs.h <<_ACEOF
@ -5418,7 +5418,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by bmorse $as_me 0.1.01, which was
This file was extended by bmorse $as_me 0.1.02, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -5484,7 +5484,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
bmorse config.status 0.1.01
bmorse config.status 0.1.02
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Wyświetl plik

@ -6,12 +6,12 @@ AC_COPYRIGHT([Copyright (C) 2013,2014 Mauri Niininen, AG1LE])
AC_PREREQ(2.61)
m4_define(BMORSE_MAJOR, [0])
m4_define(BMORSE_MINOR, [1])
m4_define(BMORSE_PATCH, [.01])
m4_define(BMORSE_PATCH, [.02])
AC_INIT([bmorse], BMORSE_MAJOR.BMORSE_MINOR[]BMORSE_PATCH, [ag1le@innomore.com])
PACKAGE=bmorse
VERSION=0.1.0
VERSION=0.1.02
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)

Wyświetl plik

@ -48,6 +48,7 @@
/*
{ int print_variables ; // FALSE
int print_symbols; // FALSE
int print_speed; // FALSE
int process_textfile; // FALSE
int print_text; // FALSE
int print_xplot; // FALSE
@ -65,7 +66,7 @@
int dec_ratio; // 20 (4000 Hz/ 20 => 200 Hz ) decimation ratio samplerate / bayes decoder rate
*/
PARAMS params = {
FALSE, FALSE, FALSE, FALSE, FALSE, 8192, 32, 0, 600, 5, 4000, 10.0, 0.0, 0, 0,20,20};
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, 8192, 32, 0, 600, 5, 4000, 10.0, 0.0, 0, 0,20,20};
fftfilt *FFT_filter;
@ -303,8 +304,8 @@ void process_data(double x)
static real rn = .1f;
static integer retstat, n1, n2, imax, xhat, elmhat;
static real pmax, zout, spdhat, px;
static int init = 1;
static double agc_peak = 0.1;
static int init = 1,pinit = 1;
static double agc_peak = 0.0;
static morse* mp;
if (init) {
@ -318,12 +319,14 @@ void process_data(double x)
if (params.agc) {
if (x > agc_peak)
agc_peak = decayavg(agc_peak, x, 20);
agc_peak = decayavg(agc_peak, x, 10);
else
agc_peak = decayavg(agc_peak, x, 800);
agc_peak = decayavg(agc_peak, x, 900);
if (agc_peak != 0.0)
if (agc_peak != 0.0){
x /= agc_peak;
x = clamp(x, 0.0, 1.0);
}
else
x = 0.0;
}
@ -332,19 +335,23 @@ void process_data(double x)
if (params.print_xplot)
printf("\n%f",x);
if (params.print_variables && init) { //print variable labels first (only once) iu
if (params.print_variables && pinit) { //print variable labels first (only once) iu
printf("\nretstat\timax\telmhat\txhat\tx\tpx\tpmax\tspdhat\trn\tzout\tp1\tp2\tp3\tp4\tp5\tp6\n");
init = 0;
pinit = 0;
}
mp->noise_(x, &rn, &zout);
zout = clamp(zout, 0.0, 1.0);
// if (zout > 1.0) zout = 1.0;
// if (zout < 0.0) zout = 0.0;
retstat = mp->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);
if (params.print_speed)
printf("\n%f", spdhat);
}
@ -435,23 +442,26 @@ decode_sndfile (SNDFILE *infile, SF_INFO info)
if (params.bfv !=0)
bfv = params.bfv;
else
bfv = sr/100; // Samplerate / 100 => bfv value required for 10 msec rise time
// bit filter based on 10 msec rise time of CW waveform
bfv = (int)(sr * .010 / params.dec_ratio);
// bfv = sr/100; // Samplerate / 100 => bfv value required for 10 msec rise time
speclen = params.speclen;
p.delta = params.delta;
//params.sample_duration= (2.0*speclen*1000.0)/((double)16*sr);
printf("frames=%d\n",f);
printf("channels=%d\n",c);
printf("samplerate=%d\n",sr);
printf("dec_ratio=%d\n",params.dec_ratio);
printf("bit filter=%d\n",bfv);
printf("num_items=%d\n",num_items);
printf("sample_duration=%f\n",params.sample_duration);
printf("bitfilter=%d\n",params.bfv);
printf("speed(WPM):%d\n",params.speed);
printf("FFT filter %f\n",(params.speed/(1.2 * params.sample_rate)));
if (!params.print_text) {
printf("# frames=%d\n",f);
printf("# channels=%d\n",c);
printf("# samplerate=%d\n",sr);
printf("# dec_ratio=%d\n",params.dec_ratio);
printf("# bit filter=%d\n",bfv);
printf("# num_items=%d\n",num_items);
printf("# sample_duration=%f\n",params.sample_duration);
printf("# bitfilter=%d\n",params.bfv);
printf("# speed(WPM):%d\n",params.speed);
printf("# FFT filter bandwidth %f\n",2.0* params.speed/1.2);
}
if (params.fft) {
@ -520,7 +530,7 @@ decode_sndfile (SNDFILE *infile, SF_INFO info)
//overlap and add filter length should be a factor of 2
// low pass implementation
int FilterFFTLen = 4096;
FFT_filter = new fftfilt((params.speed*20)/(1.2 * params.sample_rate), FilterFFTLen);
FFT_filter = new fftfilt((params.speed)/(1.2 * params.sample_rate), FilterFFTLen);
/* Allocate space for the data to be read, then read it. */
buf = (double *) malloc(num_items*sizeof(double));
@ -530,24 +540,14 @@ decode_sndfile (SNDFILE *infile, SF_INFO info)
}
num = sf_read_double(infile,buf,num_items);
printf("Read %d items\n",num);
// printf("Read %d items\n",num);
for (i = 0; i < num; i += 512){
rx_FFTprocess(buf, 512);
buf += 512;
/*
if (x < 0) x = -x;
x = filter(x,bfv);
sc++;
if ((sc % dec_ratio)==0) { // 48 kHz to 200 Hz - decimate samples by 240
process_data(x);
*/
}
//free(buf);
}
@ -631,6 +631,7 @@ static void usage_exit (const char * argv0)
" -frq <value> CW signal frequency (default 600 Hz).\n"
" -fft <value> Enable FFT filtering (default 0 - off) \n"
" -plt Plot envelope using xplot: ./morse -plt <sndfile> | xplot \n"
" -prs Plot speed (WPM)using xplot: ./morse -plt <sndfile> | xplot \n"
" -spd <value> Set default speed in WPM for decoder (default 20 ) \n"
" -len <length> Window length for FFT [8,16,32,64,128...].\n"
" -wid <width> Width of buffer to read & process [8192, 16384].\n"
@ -745,6 +746,10 @@ int main(int argc, const char* argv[])
params.print_xplot = TRUE;
continue ;
}
if (strcmp (argv [k], "-prs") == 0){
params.print_speed = TRUE;
continue ;
}
} ;
/* INITIALIZE DATA STRUCTURES */

Wyświetl plik

@ -31,13 +31,14 @@ typedef int ftnlen;
#define SAMPLEDURATION (1000. * DECIMATE) / FSAMPLE // 1000*DECIMATE / FSAMPLE SHOULD BE 5 msec
#define NDELAY 200 // 200 SAMPLES * 5 msec = 1000 msec decoding delay
#define BAYES_RATE 200 // Bayes decoder expects to get signal envelope at 200 Hz
#define PATHS 30
#define PATHS 40 // 25-30 paths normal
#define TRUE 1
#define FALSE 0
typedef struct
{ int print_variables ;
int print_symbols;
int print_speed;
int process_textfile;
int print_text;
int print_xplot;
@ -56,35 +57,37 @@ typedef struct
extern PARAMS params;
inline double clamp(double x, double min, double max)
{
return (x < min) ? min : ((x > max) ? max : x);
}
class morse {
protected:
int initl_(void);
int likhd_(real *z, real *rn, integer *ip, integer *lambda, real *dur, integer *ilrate);
int likhd_(real z, real rn, integer ip, integer lambda, real dur, integer ilrate);
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);
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);
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);
real kalfil_(real z, integer ip, real rn, integer ixs, integer kelem, integer jnode, integer israte, real dur, integer ilrate, real pin);
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 model_(real , integer , integer , integer , real *, real *);
int probp_(real *, integer *);
int sprob_(real *, integer *, integer *, real *, integer *, real *, real *);
doublereal xtrans_(integer *, real *, integer *);
doublereal xtrans_(integer *, real , integer );
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];
integer memfcn[6][400];
real elemtr[6][16] /* was [16][6] */;
@ -106,10 +109,11 @@ public:
:
isx { 1, 1, 0, 0, 0, 0 },
// rtrans[2][5] - symbol conditional speed transition probabilities - Page 104 - Table X
// used in spdtr.c
// used in spdtr.cxx
rtrans {
{ .1f, .2f, .4f, .2f, .1f}, // dot, dash, e-sp, w-s
{ .15f, .2f, .3f, .2f, .15f}}, // c-sp, pause
// mempr and memdel used in spdtr.cxx - see Page 103
mempr {
{0, 0, 1, 2, 1, 2},
{0, 0, 1, 2, 1, 2},
@ -136,9 +140,9 @@ public:
/* w */ {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, .069f, .069f, .012f, .012f, .012f, .012f, .009f,.009f},
/* p */ {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[6][400]
//memfcn[400][6]
memfcn {
/*k=0*/ 9, 11, 13, 15, 9, 11, 13, 15, 9, 0, 11, 0, 13, 0, 15, 0, 0,
/*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,
@ -156,9 +160,9 @@ public:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0},
/*k=1*/ 10, 12, 14, 16, 10, 12, 14, 16, 0, 10, 0, 12, 0, 14, 0, 16, 0, 0,
/*k=1*/ {10, 12, 14, 16, 10, 12, 14, 16, 0, 10, 0, 12, 0, 14, 0, 16, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -176,9 +180,9 @@ public:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/*k=2*/ 1, 0, 0, 0, 5, 0, 0, 0, 1, 5, 1, 5, 1, 5, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*k=2*/ {1, 0, 0, 0, 5, 0, 0, 0, 1, 5, 1, 5, 1, 5, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -195,9 +199,9 @@ public:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/*k=3*/ 0, 2, 0, 0, 0, 6, 0, 0, 2, 6, 2, 6, 2, 6, 2, 6, 0, 0, 0, 0, 0, 0, 0,
/*k=3*/ {0, 2, 0, 0, 0, 6, 0, 0, 2, 6, 2, 6, 2, 6, 2, 6, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -215,9 +219,9 @@ public:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,
0, 0, 0},
/*k=4*/ 0, 0, 3, 0, 0, 0, 7, 0, 3, 7, 3, 7, 3, 7, 3, 7, 0, 0, 0,
/*k=4*/ {0, 0, 3, 0, 0, 0, 7, 0, 3, 7, 3, 7, 3, 7, 3, 7, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -235,9 +239,9 @@ public:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0},
/*k=5*/ 0, 0, 0, 4, 0, 0, 0, 8, 4, 8, 4, 8, 4, 8, 4,
/*k=5*/ {0, 0, 0, 4, 0, 0, 0, 8, 4, 8, 4, 8, 4, 8, 4,
8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -255,7 +259,8 @@ public:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
ielmst { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -283,5 +288,5 @@ public:
~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);
int proces_(real z, real rn, integer *xhat, real *px, integer *elmhat, real *spdhat, integer *imax, real *pmax, int spd);
};

Wyświetl plik

@ -25,9 +25,7 @@
#include <stdio.h>
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)
real morse::kalfil_(real z, integer ip, real rn, integer ixs, integer kelem, integer jnode, integer israte, real dur, integer ilrate, real pin)
{
/* Initialized data */
@ -66,42 +64,41 @@ int morse::kalfil_(real *z, integer *ip, real *rn, integer *ilx,
/* IF TRANSITION PROBABILITY IS VERY SMALL, DON'T */
/* BOTHER WITH LIKELIHOOD CALCULATION: */
if (*pin <= 1e-4f) {
*lkhdj = 0.f;
return 0;
if (pin <= 1e-4f) { // was 1e-4f
return 0.f;
}
/* OBTAIN STATE-DEPENDENT MODEL PARAMETERS: */
model_(dur, kelem, ilrate, israte, ixs, &phi, &qa, &hz);
model_(dur, kelem, ilrate, ixs, &phi, &qa);
/* COMPUTE MEASUREMENT COEFFICIENT: */
hz = (real)ixs;
/* GET PREVIOUS ESTIMATES FOR PATH IP */
ykk = ykkip[*ip - 1];
pkk = pkkip[*ip - 1];
ykk = ykkip[ip];
pkk = pkkip[ip];
/* IMPLEMENT KALMAN FILTER FOR THIS TRANSITION */
ypred = phi * ykk;
ppred = phi * pkk * phi + qa;
pz = hz * ppred + *rn;
pz = hz * ppred + rn;
pzinv = 1.f / pz;
g = ppred * hz * pzinv;
pest = (1.f - g * hz) * ppred;
zr = *z - hz * ypred;
zr = z - hz * ypred;
ykksv[*jnode - 1] = ypred + g * zr;
pkksv[*jnode - 1] = pest;
if (ykksv[*jnode - 1] <= .01f) {
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 */
a = .5f*pzinv*(zr * zr);
if (a > 1e3f) {
*lkhdj = 0.;
return 0;
return 0.f;
}
*lkhdj = (1.f / sqrt(pz)) * exp(-a);
// printf("\nz:%f a:%f lkhdj:%f israte:%d ilrate:%d dur:%f",*z,a,*lkhdj,*israte,*ilrate,*dur);
return 0;
return (1.f / sqrt(pz)) * exp(-a);
} /* kalfil_ */

Wyświetl plik

@ -23,8 +23,7 @@
#include "bmorse.h"
#include <stdio.h>
int morse::likhd_(real *z, real *rn, integer *ip, integer *lambda,
real *dur, integer *ilrate)
int morse::likhd_(real z, real rn, integer ip, integer lambda, real dur, integer ilrate)
{
/* Local variables */
@ -57,16 +56,14 @@ int morse::likhd_(real *z, real *rn, integer *ip, integer *lambda,
/* KALFIL-KALMAN FILTER FOR EACH NEW PATH */
/* OBTAIN SAVED KEYSTATE: */
/* Parameter adjustments */
// --lkhd;
// p -= 26; //pin
/* Function Body */
if (*lambda == 0) {
goto L200;
}
kelem = ilami[ielmst[*lambda - 1] - 1];
ilx = ilamx[kelem - 1];
if (lambda == 0)
return 0;
kelem = ilami[ielmst[lambda - 1] - 1];
/* FOR EACH STATE: */
for (k = 1; k <= 6; ++k) {
for (i = 1; i <= 5; ++i) {
@ -74,22 +71,13 @@ int morse::likhd_(real *z, real *rn, integer *ip, integer *lambda,
ixs = isx[k - 1];
israte = i;
n = (i - 1) * 6 + k;
j = (*ip - 1) * 30 + n;
// pinr = p[*ip + n * PATHS];
pinr = pin[n-1][*ip -1];
j = (ip ) * 30 + n;
pinr = pin[n-1][ip];
/* COMPUTE AND STORE LIKELIHOOD: */
kalfil_(z, ip, rn, &ilx, &ixs, &kelem, &j, &israte, dur, ilrate,&pinr, &lkhdj);
lkhd[n-1][*ip-1] = lkhdj;
// goto L100;
if (pinr > 1e-6f) {
//printf("\nz:%f ip:%3d rn:%f ilx:%d ixs:%d kelem:%d j:%4d israte:%d dur:%4.1f ilrate:%d pin:%f lkhd:%f",(double)*z,(int)*ip,(double)*rn,(int)ilx,(int)ixs,(int)kelem,(int)j,(int)israte,(double)*dur,(int)*ilrate,(double)pin,(double)lkhdj);
}
L100:
;
lkhd[n-1][ip] = kalfil_(z, ip, rn, ixs, kelem, j, israte, dur, ilrate, pinr);
}
}
L200:
return 0;
} /* likhd_ */

Wyświetl plik

@ -24,13 +24,7 @@
#include "bmorse.h"
/* Table of constant values */
static doublereal c_b5 = 10.;
int morse::model_(real *dur, integer *ielm, integer *ilr, integer *isr, integer *ixs, real *phi, real *qa, real *hz)
int morse::model_(real dur, integer ielm, integer ilr, integer ixs, real *phi, real *qa)
{
/* System generated locals */
doublereal d1;
@ -40,8 +34,8 @@ int morse::model_(real *dur, integer *ielm, integer *ilr, integer *isr, integer
/* THIS SUBROUTINE COMPUTES THE PARAMETERS OF THE */
/* OBSERVATION STATE TRANSITION MATRIX PHI, THE */
/* MEASUREMENT MATRIX, AND THE COVARIANCES. */
/* OBSERVATION STATE TRANSITION MATRIX PHI AND THE */
/* MEASUREMENT MATRIX*/
/* VARIABLES: */
/* DUR- INPUT ELEMENT DURATION */
@ -51,25 +45,24 @@ int morse::model_(real *dur, integer *ielm, integer *ilr, integer *isr, integer
/* IXS- INPUT KEYSTATE OF NEW STATE */
/* PHI- OUTPUT STATE TRANSITION MATRIX ENTRY FOR SIGNAL AMPLITUDE STATE */
/* QA- OUTPUT COVARIANCE FOR AMPLITUDE STATE */
/* HZ- OUTPUT MEASUREMENT MATRIX VALUE */
/* COMPUTE MEASUREMENT COEFFICIENT: */
*hz = (real) (*ixs);
/* COMPUTE PHI AND AMPLITUDE STATE VARIANCE (Q): */
r1 = 1200.f / *ilr;
bauds = *dur / r1;
r1 = 1200.f / ilr;
bauds = dur / r1;
if (bauds >= 14.f) {
bauds = 14.f;
}
if (*ielm < 3) {
if (ielm < 3) {
*qa = 1e-4f;
*phi = 1.f;
return 0;
}
if (*ixs != 0) {
if (ixs != 0) {
*phi = 1.f;
*qa = exp((bauds - 14.f) * .6f) * .15f;
*qa += bauds * .01f * exp((1.f - bauds) * .2f);

Wyświetl plik

@ -23,7 +23,7 @@
#include "bmorse.h"
int morse::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;
@ -47,9 +47,9 @@ int morse::path_(integer *ip, integer *lambda, real *dur, integer *ilrate, integ
/* FOR EACH ELEM STATE K, AND EACH SPEED I, COMPUTE: */
/* Parameter adjustments */
--ilrsav;
--dursav;
--lamsav;
// --ilrsav;
// --dursav;
// --lamsav;
/* Function Body */
for (k = 1; k <= 6; ++k) {
@ -59,33 +59,31 @@ int morse::path_(integer *ip, integer *lambda, real *dur, integer *ilrate, integ
n = (i - 1) * 6 + k;
/* NEW PATH IDENTITY: */
j = (*ip - 1) * 30 + n;
j = (ip) * 30 + n;
/* NEW LTR STATE: */
if (*lambda != 0) {
goto L50;
if (lambda == 0) {
lamsav[j-1] = 0;
break;
}
lamsav[j] = 0;
goto L100;
L50:
lamsav[j] = memfcn[*lambda + k * 400 - 401];
if (lamsav[j] == 0) {
goto L100;
lamsav[j-1] = memfcn[k-1][lambda-1];
if (lamsav[j-1] == 0) {
break;
}
/* NEW DURATION: */
/* OBTAIN KEYSTATE OF SAVED PATH AND NEW STATE: */
ilelm = ilami[ielmst[*lambda - 1] - 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;
dursav[j-1] = dur * (1 - ixs - ixl + (ixs << 1) * ixl) + params.sample_duration;
/* NEW DATA RATE: */
ilrsav[j] = *ilrate + (i - 3) * memdel[k-1][ilelm -1];
L100:
ilrsav[j-1] = ilrate + (i - 3) * memdel[k-1][ilelm -1];
;
}
}

Wyświetl plik

@ -25,11 +25,9 @@
int morse::probp_(real *p, integer *isave)
{
/* System generated locals */
integer i1;
/* Local variables */
integer i, j, n, ni;
integer i, j, n;
real pmax, psav[30*PATHS], psum;
@ -42,41 +40,31 @@ int morse::probp_(real *p, integer *isave)
/* LKHD- INPUT LIKELIHOODS OF EACH TRANSTION */
/* PSUM- NORMALIZING CONSTANT (SUM OF P(J)) */
/* Parameter adjustments */
// --lkhd;
// pin -= 26;
--p;
/* Function Body */
pmax = 0.f;
psum = 0.f;
/* FOR EACH SAVED PATH, EACH TRANSITION: */
i1 = *isave;
for (i = 1; i <= i1; ++i) {
for (i = 1; i <= *isave; ++i) {
for (n = 1; n <= 30; ++n) {
/* COMPUTE IDENTITY OF NEW PATH: */
j = (i - 1) * 30 + n;
/* PRODUCT OF PROBS, ADD TO PSUM */
// psav[j - 1] = p[i] * pin[i + n * PATHS] * lkhd[j];
psav[j - 1] = p[i] * pin[n-1][i-1] * lkhd[n-1][i-1];
psum += psav[j - 1];
if (psav[j - 1] <= pmax) {
goto L100;
psav[j-1] = p[i-1] * pin[n-1][i-1] * lkhd[n-1][i-1];
psum += psav[j-1];
if (psav[j - 1] > pmax) {
pmax = psav[j - 1];
}
pmax = psav[j - 1];
L100:
;
}
}
/* NORMALIZE TO GET PROBABILITIES; SAVE: */
ni = *isave * 30;
i1 = ni;
if (psum ==0.0) {
printf("\nprobp: psum = 0");
return 0;
}
for (j = 1; j <= i1; ++j) {
p[j] = psav[j - 1] / psum;
for (j = 1; j <= *isave * 30; ++j) {
p[j-1] = psav[j - 1] / psum;
}
return 0;
} /* probp_ */

Wyświetl plik

@ -23,7 +23,7 @@
#include "bmorse.h"
#include <stdio.h>
int morse::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 */
@ -40,8 +40,6 @@ int morse::proces_(real *z, real *rn, integer *xhat, real *px, integer *elmhat,
static integer ilrsav[30*PATHS];
/* System generated locals */
integer i1;
static integer i, retstat;
static real pelm;
@ -100,8 +98,8 @@ int morse::proces_(real *z, real *rn, integer *xhat, real *px, integer *elmhat,
if (init) {
for(i=0;i<PATHS;i++) {
lambda[i] = 5;
ilrate[i]= ((i/5+1)*10);
dur[i]=9e3f;
ilrate[i]= 30;//((i/5+1)*10); // Initial speed WPM
dur[i]=1000.f;
pathsv[i]=5;
ykkip[i] = .5f;
pkkip[i] = .1f;
@ -115,12 +113,10 @@ int morse::proces_(real *z, real *rn, integer *xhat, real *px, integer *elmhat,
init = 0;
}
i1 = isave;
for (i = 1; i <= i1; ++i) {
ipath = i;
trprob_(&ipath, &lambda[i - 1], &dur[i - 1], &ilrate[i - 1]);
path_(&ipath, &lambda[i - 1], &dur[i - 1], &ilrate[i - 1],lamsav, dursav, ilrsav);
likhd_(z, rn, &ipath, &lambda[i - 1], &dur[i - 1], &ilrate[i- 1]);
for (i = 0; i < isave; i++) { // i == ipath
trprob_(i, lambda[i], dur[i], ilrate[i]);
path_(i, lambda[i], dur[i], ilrate[i],lamsav, dursav, ilrsav);
likhd_(z, rn, i, lambda[i], dur[i], ilrate[i]);
}
/* HAVING OBTAINED ALL NEW PATHS, COMPUTE: */
/* POSTERIOR PROBABILITY OF EACH NEW PATH(PROBP); */
@ -142,10 +138,6 @@ int morse::proces_(real *z, real *rn, integer *xhat, real *px, integer *elmhat,
/* OBTAIN LETTER STATE ESTIMATE: */
retstat=trelis_(&isave, pathsv, lambda, imax, &ipmax);
if (pathsv[0] > 1358 ) {
printf("\n pathsv[0]:%d", pathsv[0]);
return -1;
}
return retstat;
} /* proces_ */

Wyświetl plik

@ -24,7 +24,7 @@
int morse::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)
{
real pelem, prate;
@ -38,26 +38,24 @@ int morse::ptrans_(integer *kelem, integer *irate, integer *lambda, integer *ilr
/* PTRX- INPUT KEYSTATE TRANSITION PROBABILITY */
/* ELEMTR- ELEMENT TRANSITION PROBABILITY MATRIX */
/* FUNCTION SUBROTINE USED: */
/* FUNCTION SUBROUTINE USED: */
/* SPDTR- RETURNS DATA RATE TRANSITION PROBS,CONDITIONED ON CURRENT SPACE TYPE. */
/* IF THE SAVED ELEMENT AND THE ELEMENT OF THE STATE */
/* N TO WHICH THE PATH IS BEING EXTENDED ARE THE */
/* SAME, THEN THE STATE TRANS PROB IS SIMPLY */
/* KEYSTATE TRANS PROB: */
/* SAME, THEN THE STATE TRANS PROB IS SIMPLY KEYSTATE TRANS PROB: */
/* Parameter adjustments */
--pin;
/* Function Body */
if (*kelem != ilami[ielmst[*lambda - 1] - 1]) {
if (kelem != ilami[ielmst[lambda - 1] - 1]) {
goto L100;
}
pin[*n] = *ptrx;
pin[n-1] = ptrx;
/* HOWEVER, IF CURRENT DATA RATE STATE = 3, THEN TRANS PROB = 0 ... WHY ? */
if (*irate != 3) {
pin[*n] = 0.f;
/* HOWEVER, IF CURRENT DATA RATE STATE != 3, THEN STATE TRANS PROB = 0 ... WHY ? */
/* See page 104 in thesis */
if (irate != 3) {
pin[n-1] = 0.f;
}
goto L200;
@ -65,13 +63,15 @@ int morse::ptrans_(integer *kelem, integer *irate, integer *lambda, integer *ilr
/* OBTAIN ELEM TRANS PROBS TABLE: */
L100:
pelem = elemtr[*kelem-1][ielmst[*lambda - 1]-1];
pelem = elemtr[kelem-1][ielmst[lambda - 1]-1];
/* NEXT COMPUTE ELEM-CONDITIONAL SPEED TRANS PROB: */
prate = spdtr_(irate, ilrate, kelem, &ilami[ielmst[*lambda - 1] - 1]);
/* TRANS IS THE PRODUCT: */
pin[*n] = (1.f - *ptrx) * pelem * prate;
prate = spdtr_(irate, ilrate, kelem, ilami[ielmst[lambda - 1] - 1]);
/* TRANS PROBABILITY IS THE PRODUCT: */
pin[n-1] = (1.f - ptrx) * pelem * prate;
L200:
*psum += pin[*n];
*psum += pin[n-1];
return 0;
} /* ptrans_ */

Wyświetl plik

@ -116,7 +116,7 @@ int morse::savep_(real *p, integer *pathsv, integer *isave, integer
j = (ip - 1) * 30 + n;
for (i = 1; i <= nsav; ++i) {
if (j == sort[i]) {
goto L500;
break; //goto L500;
}
}
if (p[j] > *pmax) {
@ -124,8 +124,6 @@ int morse::savep_(real *p, integer *pathsv, integer *isave, integer
jsav = j;
ipsav = ip;
}
L500:
;
}
}
psum += *pmax;
@ -133,10 +131,10 @@ int morse::savep_(real *p, integer *pathsv, integer *isave, integer
psav[nsav - 1] = *pmax;
pathsv[nsav] = ipsav;
sort[nsav] = jsav;
if (psum >= popt) {
if (psum >= popt)
break;
}
} while (nsav < PATHS);
/* NEW ISAVE EQUALS NO. OF NODES SAVED: */
*isave = nsav;
@ -186,7 +184,6 @@ int morse::savep_(real *p, integer *pathsv, integer *isave, integer
}
}
// psum = p[0];
psum = p[1];
n = 1;
for (i = 2; i <= *isave; ++i) {

Wyświetl plik

@ -25,7 +25,7 @@
doublereal morse::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;
@ -46,39 +46,36 @@ doublereal morse::spdtr_(integer *isrt, integer *ilrt, integer *iselm, integer *
/* ILELM - ELEM TYPE ON CURRENT PATH */
/* PAGES 103-104 IN THESIS - SYMBOL CONDITIONAL TRANSITION PROBABILITIES */
/* IF SAVED ELEMENT AND NEW ELEMENT ARE THE SAME */
/* THEN THERE CAN BE NO SPEED CHANGE: */
if (*ilelm != *iselm) {
if (ilelm != iselm) {
goto L100;
}
ret_val = 1.f;
if (*isrt != 3) {
ret_val = 0.f;
}
goto L300;
ret_val = 1.f; // TRANSITION PROBABILITY = 1.0
/* SAVED ELEMENT AND NEW ELEMENT ARE THE SAME */
/* IF DATA RATE STATE IS NOT 3 THEN SPEED TRANSITION PROBABILITY = 0.0 */
if (isrt != 3)
return 0.f;
/* OTHERWISE, OBTAIN SPEED TRANSITION PROB */
L100:
idel = memdel[*iselm-1][*ilelm -1];
ind1 = mempr[*iselm -1][*ilelm -1];
if (ind1 != 0) {
goto L200;
}
ret_val = 0.f;
goto L300;
L200:
idelsp = (*isrt - 3) * idel;
ret_val = rtrans[ind1-1][*isrt-1];
israte = *ilrt + idelsp;
if (israte > 60) {
ret_val = 0.f;
}
if (israte < 10) {
ret_val = 0.f;
}
L300:
idel = memdel[iselm-1][ilelm-1];
ind1 = mempr[iselm-1][ilelm-1];
if (ind1 == 0)
return 0.f;
/* */
idelsp = (isrt - 3) * idel;
ret_val = rtrans[ind1-1][isrt-1];
israte = ilrt + idelsp;
if (israte > 60) ret_val = 0.f; // if speed rate is > 60 WPM TRANSITION PROBABILITY = 0
if (israte < 10) ret_val = 0.f; // if speed rate is < 10 WPM TRANSITION PROBABILITY = 0
return ret_val;
} /* spdtr_ */

Wyświetl plik

@ -28,8 +28,6 @@ extern PARAMS params;
int morse::sprob_(real *p, integer *isave, integer *ilrsav, real *pelm, integer *khat, real *spdhat, real *px)
{
/* System generated locals */
integer i1;
/* Local variables */
integer i, j, k, m, n;
@ -39,7 +37,7 @@ int morse::sprob_(real *p, integer *isave, integer *ilrsav, real *pelm, integer
/* SPROB COMPUTES THE POSTERIOR PROBS OF THE ELEMENT */
/* STATES, DATA RATE STATES, AND KEYSTATES BY SUMMING */
/* OVER THE APPROPRIETE PATHS. */
/* OVER THE APPROPRIATE PATHS. */
/* VARIABLE: */
/* P- INPUT PATH PROBABILITIES */
@ -49,9 +47,6 @@ int morse::sprob_(real *p, integer *isave, integer *ilrsav, real *pelm, integer
/* PX- OUTPUT KEYSTATE PROBABILITY */
/* INITIALIZE: */
/* Parameter adjustments */
--ilrsav;
--p;
/* Function Body */
*spdhat = 0.f;
@ -62,13 +57,12 @@ int morse::sprob_(real *p, integer *isave, integer *ilrsav, real *pelm, integer
pselem[k - 1] = 0.f;
for (i = 1; i <= 5; ++i) {
n = (i - 1) * 6 + k;
i1 = *isave;
for (m = 1; m <= i1; ++m) {
for (m = 1; m <= *isave; ++m) {
j = (m - 1) * 30 + n;
pselem[k - 1] += p[j];
*spdhat += ilrsav[j] * p[j];
pselem[k - 1] += p[j-1];
*spdhat += ilrsav[j-1] * p[j-1];
if (k <= 2) {
*px += p[j];
*px += p[j-1];
}
}
}

Wyświetl plik

@ -22,9 +22,9 @@
#include <stdio.h>
#include "bmorse.h"
struct TREE {
int dit,dah;
char chr[12];
struct TREE { // Tree structure to decode dit/dah sequence to corresponding character
int dit,dah; //
char chr[12]; // max string 11 chars +null for prosigns and error cases
} tree[] = { // check http://en.wikipedia.org/wiki/Morse_code
//dit,dah, chr
{1,2, "#"}, // null state
@ -45,7 +45,7 @@ struct TREE {
{31,32,"H"}, // ....
{33,34,"V"}, // ...-
{35,36,"F"}, // ..-.
{37,38,"*"},// ..--
{37,38,"*..--*"},// ..--
{39,40,"L"}, // .-..
{41,42,"Ä"}, // .-.- Ä
{43,44,"P"}, // .--.
@ -66,14 +66,14 @@ struct TREE {
{00,00,"*..-.-*"}, // ..-.-
{58,00,"*..--.*"}, // ..--. D?
{00,00,"2"}, // ..---
{00,00,"*"}, // .-...
{00,00,"*.-...*"}, // .-...
{00,00,"e"}, // .-..-
{00,63,"+"}, // .-.-.
{00,00,"*"}, // .-.--
{00,00,"*.-.--*"}, // .-.--
{00,00,"*.--..*"}, // .--..
{59,00,"a"}, // .--.-
{00,00,"*"}, // .----
{00,00,"1"}, // .---.
{00,00,"*.---.*"}, // .---.
{00,00,"1"}, // .----
{00,00,"6"}, // -....
{61,00,"="}, // -...-
{00,00,"/"}, // -..-.
@ -103,25 +103,13 @@ struct TREE {
int morse::transl_(int *ltr)
{
/* Initialized data */
static char ispace[2] = " ";
static integer spflag = 0;
static integer nchar = 0;
static integer lstltr = 0;
static integer ixlast = 0;
static integer lstelm = 6;
/* System generated locals */
integer i1;
/* Local variables */
static integer i, ixl, nblank, elmhat;
static char ltrout[1];
static integer ixlast = 0;
static int curstate = 0;
static int newstate = 0;
/* Local variables */
static integer ixl, elmhat;
/* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
/* .^ .~ .w .p -^ -~ -w -p ^. ^- ~. ~- w. w- p. p- */
@ -129,11 +117,8 @@ int morse::transl_(int *ltr)
/* THIS SUBROUTINE PRODUCES THE OUTPUT TEXT ON A CRT. */
/* IT USES THE SIMPLE FORMATTING RULES DESCRIBED IN THE */
/* TEXT. */
/* DETERMINE IF A CSP,WSP, OR PAUSE TO MARK TRASITION */
/* DETERMINE IF A CSP,WSP, OR PAUSE TO MARK TRANSITION */
/* HAS OCCURED; IF SO LTR IS READY FOR OUTPUT: */
@ -260,8 +245,8 @@ L700:
fflush(stdout);
curstate = newstate;
ixlast = ixl;
lstelm = elmhat;
lstltr = *ltr;
// lstelm = elmhat;
// lstltr = *ltr;
return newstate;
} /* transl_ */

Wyświetl plik

@ -44,17 +44,13 @@ int morse::trelis_(integer *isave, integer *pathsv, integer *lambda, integer *im
static integer iend = 0;
/* System generated locals */
integer i1;
/* Local variables */
static int i, k, ip, ieq, ltr, ndel, retstat;
static char wait[1];
static int isavg, init=0;
static real xsavg, xmmax, xnmax;
static int ndlavg;
static real xdlavg;
static char *chrp;
/* THIS SUBROUTINE STORES THE SAVED NODES AT EACH */
/* STAGE AND FORMS THE TREE OF SAVED PATHS LINKING */
@ -114,8 +110,8 @@ int morse::trelis_(integer *isave, integer *pathsv, integer *lambda, integer *im
if (n == ndelay + 1) {
n = 1;
}
i1 = *isave;
for (i = 1; i <= i1; ++i) {
for (i = 1; i <= *isave; ++i) {
// pthtrl[n + i * NDELAY-NDELAY-1] = pathsv[i];
pthtrl[i-1][n-1] = pathsv[i];
@ -125,8 +121,7 @@ int morse::trelis_(integer *isave, integer *pathsv, integer *lambda, integer *im
/* PERFORM DYNAMIC PROGRAM ROUTINE TO FIND CONVERGENT PATH: */
k = 0;
i1 = *isave;
for (i = 1; i <= i1; ++i) {
for (i = 1; i <= *isave; ++i) {
ipnod[i - 1] = i;
}
L190:
@ -136,8 +131,7 @@ L190:
}
/* IF IP EQUALS INDEX OF HIGHEST PROBABILITY NODE, STORE NODE TO IPMAX */
i1 = *isave;
for (ip = 1; ip <= i1; ++ip) {
for (ip = 1; ip <= *isave; ++ip) {
i = n - k + 1;
if (i <= 0) {
i = ndelay + i;
@ -150,8 +144,8 @@ L190:
}
/* IF ALL NODES ARE EQUAL,THEN PATHS CONVERGE: */
i1 = *isave;
for (ieq = 2; ieq <= i1; ++ieq) {
for (ieq = 2; ieq <= *isave; ++ieq) {
if (ipnod[0] != ipnod[ieq - 1]) {
goto L190;
}
@ -188,8 +182,7 @@ printf("\nSAME DELAY AS LAST: %d",ltr);
L350:
kd = 0;
ip = ipnod[0];
i1 = ndelst;
for (k = ndel; k <= i1; ++k) {
for (k = ndel; k <= ndelst; ++k) {
++kd;
i = n - k + 1;
if (i <= 0) {
@ -208,8 +201,8 @@ L350:
/* REVERSE ORDER OF DECODED LETTERS, SINCE THEY */
/* WERE OBTAINED FROM THE TRELLIS IN REVERSE; */
/* TRANSLATE EACH: */
i1 = kd;
for (i = 1; i <= i1; ++i) {
for (i = 1; i <= kd; ++i) {
ltr = ltrsv[kd - i];
#ifdef DEBUG
printf("\nIN REVERSE ORDER: %d",ltr);
@ -234,8 +227,7 @@ printf("\nHIGHEST PROB: %d", ltr);
#endif
retstat = transl_(&ltr);
/* PRUNE AWAY NODES WHICH ARE NOT ON THIS PATH: */
i1 = *isave;
for (k = 1; k <= i1; ++k) {
for (k = 1; k <= *isave; ++k) {
if (ipnod[k - 1] != *ipmax) {
lambda[k] = 0;
}

Wyświetl plik

@ -23,7 +23,7 @@
#include "bmorse.h"
#include <stdio.h>
int morse::trprob_(integer *ip, integer *lambda, real *dur, integer *ilrate)
int morse::trprob_(integer ip, integer lambda, real dur, integer ilrate)
{
static integer i, k, n;
static real pint[30];
@ -41,7 +41,7 @@ int morse::trprob_(integer *ip, integer *lambda, real *dur, integer *ilrate)
/* IP - INPUT SAVED PATH IDENTITY */
/* LAMBDA INPUT SAVED LTR STATE IDENTITY */
/* DUR - INPUT SAVED ELEMENT DURATION */
/* ILPATE INPUT SAVED DATA RATE IDENTITY */
/* ILRATE INPUT SAVED DATA RATE IDENTITY */
/* P - OUTPUT TRANSITION PROBABILITY MATRIX */
/* THE FOLLOWING FUNCTION SUBROUTINES ARE USED: */
@ -53,26 +53,26 @@ int morse::trprob_(integer *ip, integer *lambda, real *dur, integer *ilrate)
// p -= 26;
/* Function Body */
if (*lambda == 0) {
if (lambda == 0) {
for (n = 1; n <= 30; ++n) {
// p[*ip + n * PATHS] = 0.f;
pin[n-1][*ip-1] = 0.f;
// p[ip + n * PATHS] = 0.f;
pin[n-1][ip] = 0.f;
}
return 0;
}
ielem = ilami[ielmst[*lambda - 1] - 1];
ielem = ilami[ielmst[lambda - 1] - 1];
/* COMPUTE KEYSTATE TRANSITION PROBABILITY: */
ptrx = xtrans_(&ielem, dur, ilrate);
/* FOR EACH STATE, COMPUTE STATE TRANSITION PROBABILITY: */
psum = 0.f;
for (k = 1; k <= 6; ++k) {
for (i = 1; i <= 5; ++i) {
for (k = 1; k <= 6; ++k) { // 6 element states 1=dit,2=dah, 3=e-spc, 4=chr-s, 5=wrd-s, 6=pause
for (i = 1; i <= 5; ++i) { // 5 speed states -2 -1 0 1 2
n = (i - 1) * 6 + k;
kelm = k;
irate = i;
ptrans_(&kelm, &irate, lambda, ilrate, &ptrx, &psum, pint, &n);
ptrans_(kelm, irate, lambda, ilrate, ptrx, &psum, pint, n);
}
}
if (psum ==0.0) {
@ -81,8 +81,8 @@ int morse::trprob_(integer *ip, integer *lambda, real *dur, integer *ilrate)
}
for (n = 1; n <= 30; ++n) {
// p[*ip + n * PATHS] = pint[n - 1] / psum;
pin[n-1][*ip-1] = pint[n - 1] / psum;
// p[ip + n * PATHS] = pint[n - 1] / psum;
pin[n-1][ip] = pint[n - 1] / psum;
}
return 0;

Wyświetl plik

@ -23,12 +23,13 @@
#include "bmorse.h"
#include <math.h>
doublereal morse::xtrans_(integer *ielem, real *d0, integer *irate)
doublereal morse::xtrans_(integer *ielem, real dur, integer irate)
{
/* Initialized data */
static integer kimap[6] = { 1,3,1,3,7,14 };
static real aparm[3] = { 3.f,1.5f,1.f };
static integer kimap[6] = { 1, 3, 1, 3, 7, 14 };
static real aparm[3] = { 3.f, 1.5f, 1.f };
/* System generated locals */
real ret_val;
@ -44,7 +45,7 @@ doublereal morse::xtrans_(integer *ielem, real *d0, integer *irate)
/* CURRENT DURATION, AND DATA RATE. */
/* VARIABLES: */
/* IELEM- INPUT CURRENT ELEMENT TYPE */
/* D0- INPUT CURRENT ELEMENT DURATION */
/* DUR- INPUT CURRENT ELEMENT DURATION */
/* IRATE - INPUT CURRENT DATA RATE */
/* TABLES IN COMMON CONTAIN DENSITY PARMS FOR EACH ELEMENT TYPE, DATA RATE. */
@ -52,18 +53,18 @@ doublereal morse::xtrans_(integer *ielem, real *d0, integer *irate)
/* SCALE DURATION AND OBTAIN DENSITY PARAMETER: */
mscale = kimap[*ielem - 1];
rscale = 1200.f / *irate;
b0 = *d0 / (mscale * rscale);
b1 = (*d0 + 5.f) / (mscale * rscale);
rscale = 1200.f / irate;
b0 = dur / (mscale * rscale);
b1 = (dur + 5.f) / (mscale * rscale);
switch (*ielem) {
case 6:
case 6: // element is Pause
alpha = aparm[2] * 14.f;
break;
case 5:
case 5: // element is word space
alpha = aparm[1] * 7.f;
break;
default:
default: // element is dit, dah, e-space or chr-space
alpha = mscale * aparm[0];
}

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.