diff --git a/ChangeLog b/ChangeLog index 4815748..c0d4a7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1 +1,74 @@ -2013--9-07 initial version +(C) 2013,2014 AG1LE Mauri Niininen + + +2014-JAN-02 + New release bmorse-0.1.01 + Added FFT filtering code from FLDIGI cw.cxx and fftflt.cxx + Converted all files from C to C++. + Found a workaround for P(max) bug - see Sept 26. Adjusting dur[] initialization value from 1000.0 to 9000.0 in proces.cxx worked in most test files so far. + + +2013-DEC-29 + Added more options to enable debugging and testing bmorse decoder while using WAV audio files as source. + Bit filter (-bfv) option does envelope smoothing - 10 msec rise time assumption based on experiences with FLDIGI. + Plot option (-plt) enables piping such as "bmorse -plt | xplot" to visualize the CW envelope. + AGC option (-agc) has fast rise and slow decay in case original signal has very large dynamic range. + AMP option (-amp) allows to multiply envelope signal with a constant. + DUR option (-dur) allows manually to set Bayesian decoder sample duration (used in path.c). + FFT option (-fft) enables either FFT based signal recovery or just low pass filtering. + - FFT has also peak_detection() to find if there are multiple signals in the audio frequency range. + - Parameter "delta" sets peak detection threshold + - Width (-wid) and length (-len) parameters can be used to set FFT size and chunking + + +2013-DEC-28 + Renamed this program as "bmorse" - it stands for Bayesian Morse code decoder. + Built new functionality and options for testing both sound files and text files. + + + +2013-SEP-26 + enabled decoding from FLDIGI data feed. clamping x value to 1.0 max as FLDIGI sends values over 20.0 during startup before AGC kicks in. + BUG: P(dah) abruptly goes from near 1.0 down and the bounces back => P(max) jumps to huge values + too long dahs? + +2013-SEP-25 + BUG: missing word space /pause between words QUICK BROWN when < 30 db SNR ? + FOUND: enabled noise.c processing in morse.c + changed to: + noise_(&x, &rn, &zout); + retstat = proces_(&zout, &rn, &xhat, &px, &elmhat, &spdhat, &imax, &pmax); + much better decoding with low SNR test signals. + +2013-SEP-25 + run "./morse t test/test20db.in | less" + BUG: QUICD and FOB when high 20 dB SNR? + D should be K and B should be X + for some reason last 'dah' following word space gets decoded as 'dit'. + FOUND: Initl.c - line 123 1, 1, 0, 0, 0, 0, // mauri 2013-09-25 bugfix + had 0 instead of 1 in state k=4 + + +2013-SEP-02 Morse decoding works on C++ version. Added decoding struct TREE in transl.c + and logic to translate incoming morse symbols. This is marked as version v01. + + +2013-SEP-01 Initial version. Original Fortran sources compiled with + gfortran -g *.f + produces a.out executable program. + + Based on initial testing the element state estimation works, but translating letters + has still problems. Produces a sequence of letter states but translation to actual + characters produces incorrect letters. + + Compilation of C-sources produced by f2c is done with following commands: + + gcc -c *.c + gcc *.o -lf2c -lm + + produces a.out executable program. The output of both versions of a.out is in + output_c.txt + output_f.txt + + These have minor differences - source still unknown. + diff --git a/Makefile b/Makefile index 5fad6c1..0256f3e 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,6 @@ - am__make_dryrun = \ { \ am__dry=no; \ @@ -49,14 +48,13 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -bin_PROGRAMS = bmorse$(EXEEXT) subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ compile depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -65,36 +63,34 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) -am__dirstamp = $(am__leading_dot)dirstamp -am_bmorse_OBJECTS = src/initl.$(OBJEXT) src/likhd.$(OBJEXT) \ - src/path.$(OBJEXT) src/spdtr.$(OBJEXT) src/trelis.$(OBJEXT) \ - src/bpfdet.$(OBJEXT) src/inputl.$(OBJEXT) src/model.$(OBJEXT) \ - src/probp.$(OBJEXT) src/sprob.$(OBJEXT) src/trprob.$(OBJEXT) \ - src/kalfil.$(OBJEXT) src/bmorse.$(OBJEXT) src/proces.$(OBJEXT) \ - src/savep.$(OBJEXT) src/stats.$(OBJEXT) src/xtrans.$(OBJEXT) \ - src/noise.$(OBJEXT) src/ptrans.$(OBJEXT) src/transl.$(OBJEXT) \ - src/window.$(OBJEXT) -bmorse_OBJECTS = $(am_bmorse_OBJECTS) -bmorse_LDADD = $(LDADD) -DEFAULT_INCLUDES = -I. -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(bmorse_SOURCES) -DIST_SOURCES = $(bmorse_SOURCES) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -104,6 +100,31 @@ am__remove_distdir = \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print @@ -112,16 +133,18 @@ am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ distcleancheck_listfiles = find . -type f -print ACLOCAL = ${SHELL} /home/mauri/Projects/morse/missing --run aclocal-1.11 AMTAR = $${TAR-tar} +AM_DEFAULT_VERBOSITY = 0 AUTOCONF = ${SHELL} /home/mauri/Projects/morse/missing --run autoconf AUTOHEADER = ${SHELL} /home/mauri/Projects/morse/missing --run autoheader AUTOMAKE = ${SHELL} /home/mauri/Projects/morse/missing --run automake-1.11 AWK = gawk -CC = clang +BMORSE_AUTHORS = +CC = gcc CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CPP = clang -E +CFLAGS = -Wall -pedantic +CPP = gcc -E CPPFLAGS = -CXX = clang++ +CXX = g++ CXXDEPMODE = depmode=gcc3 CXXFLAGS = -g -O2 CYGPATH_W = echo @@ -140,29 +163,47 @@ INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s LDFLAGS = LIBOBJS = + +#bin_PROGRAMS = bmorse + +#AM_CXXFLAGS = $(INTI_CFLAGS) + +#bmorse_SOURCES = src/fftfilt.cxx src/kalfil.cxx src/model.cxx src/probp.cxx\ +# src/savep.cxx src/sprob.cxx src/trelis.cxx src/xtrans.cxx \ +# src/bmorse.cxx src/fft.cxx src src/misc.cxx src/initl.cxx src/noise.cxx\ +# src/proces.cxx src/trprob.cxx\ +# src/likhd.cxx src/path.cxx\ +# src/ptrans.cxx src/spdtr.cxx src/transl.cxx src/window.cxx LIBS = -lm -lsndfile -lfftw3 LTLIBOBJS = +MAINT = # MAKEINFO = ${SHELL} /home/mauri/Projects/morse/missing --run makeinfo MKDIR_P = /bin/mkdir -p OBJEXT = o PACKAGE = bmorse PACKAGE_BUGREPORT = ag1le@innomore.com +PACKAGE_DL = https://github.com/ag1le/morse-wip +PACKAGE_DOCS = https://github.com/ag1le/morse-wip/wiki +PACKAGE_GUIDE = https://github.com/ag1le/morse-wip/wiki +PACKAGE_HOME = https://github.com/ag1le/morse-wip PACKAGE_NAME = bmorse -PACKAGE_STRING = bmorse 0.1 +PACKAGE_NEWBUG = https://github.com/ag1le/morse-wip/issues +PACKAGE_PROJ = https://github.com/ag1le/morse-wip +PACKAGE_STRING = bmorse 0.1.01 PACKAGE_TARNAME = bmorse PACKAGE_URL = -PACKAGE_VERSION = 0.1 +PACKAGE_VERSION = 0.1.01 PATH_SEPARATOR = : SET_MAKE = SHELL = /bin/bash STRIP = -VERSION = 0.1 +VERSION = 0.1.01 abs_builddir = /home/mauri/Projects/morse abs_srcdir = /home/mauri/Projects/morse abs_top_builddir = /home/mauri/Projects/morse abs_top_srcdir = /home/mauri/Projects/morse -ac_ct_CC = clang -ac_ct_CXX = +ac_ct_CC = gcc +ac_ct_CXX = g++ am__include = include am__leading_dot = . am__quote = @@ -200,38 +241,26 @@ target_alias = top_build_prefix = top_builddir = . top_srcdir = . -AUTOMAKE_OPTIONS = subdir-objects -ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -AM_CFLAGS = -ggdb -bmorse_SOURCES = src/initl.c src/likhd.c src/path.c\ - src/spdtr.c src/trelis.c\ - src/bpfdet.c src/inputl.c src/model.c \ - src/probp.c src/sprob.c src/trprob.c\ - src/kalfil.c src/bmorse.c src/proces.c src/savep.c \ - src/stats.c src/xtrans.c\ - src/noise.c src/ptrans.c src/transl.c \ - src/window.c - +SUBDIRS = src all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-am + $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: -.SUFFIXES: .c .o .obj am--refresh: Makefile @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -246,9 +275,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: # $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): # $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): @@ -259,159 +288,83 @@ config.h: stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) +$(srcdir)/config.h.in: # $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -src/$(am__dirstamp): - @$(MKDIR_P) src - @: > src/$(am__dirstamp) -src/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) src/$(DEPDIR) - @: > src/$(DEPDIR)/$(am__dirstamp) -src/initl.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/likhd.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/path.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/spdtr.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/trelis.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/bpfdet.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/inputl.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/model.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/probp.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/sprob.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/trprob.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/kalfil.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/bmorse.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/proces.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/savep.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/stats.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/xtrans.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/noise.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/ptrans.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/transl.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/window.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -bmorse$(EXEEXT): $(bmorse_OBJECTS) $(bmorse_DEPENDENCIES) $(EXTRA_bmorse_DEPENDENCIES) - @rm -f bmorse$(EXEEXT) - $(LINK) $(bmorse_OBJECTS) $(bmorse_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -rm -f src/bmorse.$(OBJEXT) - -rm -f src/bpfdet.$(OBJEXT) - -rm -f src/initl.$(OBJEXT) - -rm -f src/inputl.$(OBJEXT) - -rm -f src/kalfil.$(OBJEXT) - -rm -f src/likhd.$(OBJEXT) - -rm -f src/model.$(OBJEXT) - -rm -f src/noise.$(OBJEXT) - -rm -f src/path.$(OBJEXT) - -rm -f src/probp.$(OBJEXT) - -rm -f src/proces.$(OBJEXT) - -rm -f src/ptrans.$(OBJEXT) - -rm -f src/savep.$(OBJEXT) - -rm -f src/spdtr.$(OBJEXT) - -rm -f src/sprob.$(OBJEXT) - -rm -f src/stats.$(OBJEXT) - -rm -f src/transl.$(OBJEXT) - -rm -f src/trelis.$(OBJEXT) - -rm -f src/trprob.$(OBJEXT) - -rm -f src/window.$(OBJEXT) - -rm -f src/xtrans.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -include src/$(DEPDIR)/bmorse.Po -include src/$(DEPDIR)/bpfdet.Po -include src/$(DEPDIR)/initl.Po -include src/$(DEPDIR)/inputl.Po -include src/$(DEPDIR)/kalfil.Po -include src/$(DEPDIR)/likhd.Po -include src/$(DEPDIR)/model.Po -include src/$(DEPDIR)/noise.Po -include src/$(DEPDIR)/path.Po -include src/$(DEPDIR)/probp.Po -include src/$(DEPDIR)/proces.Po -include src/$(DEPDIR)/ptrans.Po -include src/$(DEPDIR)/savep.Po -include src/$(DEPDIR)/spdtr.Po -include src/$(DEPDIR)/sprob.Po -include src/$(DEPDIR)/stats.Po -include src/$(DEPDIR)/transl.Po -include src/$(DEPDIR)/trelis.Po -include src/$(DEPDIR)/trprob.Po -include src/$(DEPDIR)/window.Po -include src/$(DEPDIR)/xtrans.Po - -.c.o: - depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ - $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ - $(am__mv) $$depbase.Tpo $$depbase.Po -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(COMPILE) -c -o $@ $< - -.c.obj: - depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ - $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ - $(am__mv) $$depbase.Tpo $$depbase.Po -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -423,10 +376,23 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) mkid -fID $$unique tags: TAGS -TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ @@ -445,7 +411,7 @@ TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ fi; \ fi ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -497,6 +463,31 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ @@ -628,21 +619,19 @@ distcleancheck: distclean $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) config.h -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-am +installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ @@ -660,107 +649,99 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -rm -f src/$(DEPDIR)/$(am__dirstamp) - -rm -f src/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -clean: clean-am +clean: clean-recursive -clean-am: clean-binPROGRAMS clean-generic mostlyclean-am +clean-am: clean-generic mostlyclean-am -distclean: distclean-am +distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf src/$(DEPDIR) -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-hdr distclean-tags +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags -dvi: dvi-am +dvi: dvi-recursive dvi-am: -html: html-am +html: html-recursive html-am: -info: info-am +info: info-recursive info-am: install-data-am: -install-dvi: install-dvi-am +install-dvi: install-dvi-recursive install-dvi-am: -install-exec-am: install-binPROGRAMS +install-exec-am: -install-html: install-html-am +install-html: install-html-recursive install-html-am: -install-info: install-info-am +install-info: install-info-recursive install-info-am: install-man: -install-pdf: install-pdf-am +install-pdf: install-pdf-recursive install-pdf-am: -install-ps: install-ps-am +install-ps: install-ps-recursive install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-am +maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf src/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-am +mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-compile mostlyclean-generic +mostlyclean-am: mostlyclean-generic -pdf: pdf-am +pdf: pdf-recursive pdf-am: -ps: ps-am +ps: ps-recursive ps-am: -uninstall-am: uninstall-binPROGRAMS +uninstall-am: -.MAKE: all install-am install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ + ctags-recursive install-am install-strip tags-recursive -.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ - clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ - dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ - dist-zip distcheck distclean distclean-compile \ - distclean-generic distclean-hdr distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-binPROGRAMS +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am -# src/simsgi.c src/key.c src/rcvr.c - -#dist_noinst_SCRIPTS = autogen.sh - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/Makefile.am b/Makefile.am index a0555c7..2642c2e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,18 +1,16 @@ -AUTOMAKE_OPTIONS = subdir-objects -ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} +SUBDIRS = src +CFLAGS= -Wall -pedantic + +#bin_PROGRAMS = bmorse + +#AM_CXXFLAGS = $(INTI_CFLAGS) + +#bmorse_SOURCES = src/fftfilt.cxx src/kalfil.cxx src/model.cxx src/probp.cxx\ +# src/savep.cxx src/sprob.cxx src/trelis.cxx src/xtrans.cxx \ +# src/bmorse.cxx src/fft.cxx src src/misc.cxx src/initl.cxx src/noise.cxx\ +# src/proces.cxx src/trprob.cxx\ +# src/likhd.cxx src/path.cxx\ +# src/ptrans.cxx src/spdtr.cxx src/transl.cxx src/window.cxx + LIBS = -lm -lsndfile -lfftw3 -AM_CFLAGS = -ggdb -bin_PROGRAMS = bmorse -bmorse_SOURCES = src/initl.c src/likhd.c src/path.c\ - src/spdtr.c src/trelis.c\ - src/bpfdet.c src/inputl.c src/model.c \ - src/probp.c src/sprob.c src/trprob.c\ - src/kalfil.c src/bmorse.c src/proces.c src/savep.c \ - src/stats.c src/xtrans.c\ - src/noise.c src/ptrans.c src/transl.c \ - src/window.c - -# src/simsgi.c src/key.c src/rcvr.c - -#dist_noinst_SCRIPTS = autogen.sh diff --git a/Makefile.in b/Makefile.in index 185dd8e..dbe42c9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -14,7 +14,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - VPATH = @srcdir@ am__make_dryrun = \ { \ @@ -49,14 +48,13 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -bin_PROGRAMS = bmorse$(EXEEXT) subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ compile depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -65,36 +63,34 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) -am__dirstamp = $(am__leading_dot)dirstamp -am_bmorse_OBJECTS = src/initl.$(OBJEXT) src/likhd.$(OBJEXT) \ - src/path.$(OBJEXT) src/spdtr.$(OBJEXT) src/trelis.$(OBJEXT) \ - src/bpfdet.$(OBJEXT) src/inputl.$(OBJEXT) src/model.$(OBJEXT) \ - src/probp.$(OBJEXT) src/sprob.$(OBJEXT) src/trprob.$(OBJEXT) \ - src/kalfil.$(OBJEXT) src/bmorse.$(OBJEXT) src/proces.$(OBJEXT) \ - src/savep.$(OBJEXT) src/stats.$(OBJEXT) src/xtrans.$(OBJEXT) \ - src/noise.$(OBJEXT) src/ptrans.$(OBJEXT) src/transl.$(OBJEXT) \ - src/window.$(OBJEXT) -bmorse_OBJECTS = $(am_bmorse_OBJECTS) -bmorse_LDADD = $(LDADD) -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(bmorse_SOURCES) -DIST_SOURCES = $(bmorse_SOURCES) +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -104,6 +100,31 @@ am__remove_distdir = \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print @@ -112,13 +133,15 @@ am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BMORSE_AUTHORS = @BMORSE_AUTHORS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ +CFLAGS = -Wall -pedantic CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ @@ -140,14 +163,32 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ + +#bin_PROGRAMS = bmorse + +#AM_CXXFLAGS = $(INTI_CFLAGS) + +#bmorse_SOURCES = src/fftfilt.cxx src/kalfil.cxx src/model.cxx src/probp.cxx\ +# src/savep.cxx src/sprob.cxx src/trelis.cxx src/xtrans.cxx \ +# src/bmorse.cxx src/fft.cxx src src/misc.cxx src/initl.cxx src/noise.cxx\ +# src/proces.cxx src/trprob.cxx\ +# src/likhd.cxx src/path.cxx\ +# src/ptrans.cxx src/spdtr.cxx src/transl.cxx src/window.cxx LIBS = -lm -lsndfile -lfftw3 LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_DL = @PACKAGE_DL@ +PACKAGE_DOCS = @PACKAGE_DOCS@ +PACKAGE_GUIDE = @PACKAGE_GUIDE@ +PACKAGE_HOME = @PACKAGE_HOME@ PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_NEWBUG = @PACKAGE_NEWBUG@ +PACKAGE_PROJ = @PACKAGE_PROJ@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ @@ -200,38 +241,26 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AUTOMAKE_OPTIONS = subdir-objects -ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -AM_CFLAGS = -ggdb -bmorse_SOURCES = src/initl.c src/likhd.c src/path.c\ - src/spdtr.c src/trelis.c\ - src/bpfdet.c src/inputl.c src/model.c \ - src/probp.c src/sprob.c src/trprob.c\ - src/kalfil.c src/bmorse.c src/proces.c src/savep.c \ - src/stats.c src/xtrans.c\ - src/noise.c src/ptrans.c src/transl.c \ - src/window.c - +SUBDIRS = src all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-am + $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: -.SUFFIXES: .c .o .obj am--refresh: Makefile @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -246,9 +275,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): @@ -259,159 +288,83 @@ config.h: stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -src/$(am__dirstamp): - @$(MKDIR_P) src - @: > src/$(am__dirstamp) -src/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) src/$(DEPDIR) - @: > src/$(DEPDIR)/$(am__dirstamp) -src/initl.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/likhd.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/path.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/spdtr.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/trelis.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/bpfdet.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/inputl.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/model.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/probp.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/sprob.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/trprob.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/kalfil.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/bmorse.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/proces.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/savep.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/stats.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/xtrans.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/noise.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) -src/ptrans.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/transl.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -src/window.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) -bmorse$(EXEEXT): $(bmorse_OBJECTS) $(bmorse_DEPENDENCIES) $(EXTRA_bmorse_DEPENDENCIES) - @rm -f bmorse$(EXEEXT) - $(LINK) $(bmorse_OBJECTS) $(bmorse_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -rm -f src/bmorse.$(OBJEXT) - -rm -f src/bpfdet.$(OBJEXT) - -rm -f src/initl.$(OBJEXT) - -rm -f src/inputl.$(OBJEXT) - -rm -f src/kalfil.$(OBJEXT) - -rm -f src/likhd.$(OBJEXT) - -rm -f src/model.$(OBJEXT) - -rm -f src/noise.$(OBJEXT) - -rm -f src/path.$(OBJEXT) - -rm -f src/probp.$(OBJEXT) - -rm -f src/proces.$(OBJEXT) - -rm -f src/ptrans.$(OBJEXT) - -rm -f src/savep.$(OBJEXT) - -rm -f src/spdtr.$(OBJEXT) - -rm -f src/sprob.$(OBJEXT) - -rm -f src/stats.$(OBJEXT) - -rm -f src/transl.$(OBJEXT) - -rm -f src/trelis.$(OBJEXT) - -rm -f src/trprob.$(OBJEXT) - -rm -f src/window.$(OBJEXT) - -rm -f src/xtrans.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bmorse.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bpfdet.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/initl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/inputl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/kalfil.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/likhd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/model.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/noise.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/path.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/probp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/proces.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/ptrans.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/savep.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/spdtr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sprob.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/stats.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/transl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/trelis.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/trprob.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/window.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/xtrans.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -423,10 +376,23 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) mkid -fID $$unique tags: TAGS -TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ @@ -445,7 +411,7 @@ TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ fi; \ fi ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -497,6 +463,31 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ @@ -628,21 +619,19 @@ distcleancheck: distclean $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) config.h -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-am +installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ @@ -660,107 +649,99 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -rm -f src/$(DEPDIR)/$(am__dirstamp) - -rm -f src/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -clean: clean-am +clean: clean-recursive -clean-am: clean-binPROGRAMS clean-generic mostlyclean-am +clean-am: clean-generic mostlyclean-am -distclean: distclean-am +distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf src/$(DEPDIR) -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-hdr distclean-tags +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags -dvi: dvi-am +dvi: dvi-recursive dvi-am: -html: html-am +html: html-recursive html-am: -info: info-am +info: info-recursive info-am: install-data-am: -install-dvi: install-dvi-am +install-dvi: install-dvi-recursive install-dvi-am: -install-exec-am: install-binPROGRAMS +install-exec-am: -install-html: install-html-am +install-html: install-html-recursive install-html-am: -install-info: install-info-am +install-info: install-info-recursive install-info-am: install-man: -install-pdf: install-pdf-am +install-pdf: install-pdf-recursive install-pdf-am: -install-ps: install-ps-am +install-ps: install-ps-recursive install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-am +maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf src/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-am +mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-compile mostlyclean-generic +mostlyclean-am: mostlyclean-generic -pdf: pdf-am +pdf: pdf-recursive pdf-am: -ps: ps-am +ps: ps-recursive ps-am: -uninstall-am: uninstall-binPROGRAMS +uninstall-am: -.MAKE: all install-am install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ + ctags-recursive install-am install-strip tags-recursive -.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ - clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ - dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ - dist-zip distcheck distclean distclean-compile \ - distclean-generic distclean-hdr distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-binPROGRAMS +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am -# src/simsgi.c src/key.c src/rcvr.c - -#dist_noinst_SCRIPTS = autogen.sh - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/README b/README index 5cca8fc..7b7a98a 100644 --- a/README +++ b/README @@ -8,6 +8,10 @@ MORSE - PROJECT IDEAS automake --add-missing ./configure make + + + http://inti.sourceforge.net/tutorial/libinti/autotoolsproject.html + 1. Build a simple to use C/C++ advanced Bayesian Morse decoder library diff --git a/README.md b/README.md index 3b9add6..75a749f 100644 --- a/README.md +++ b/README.md @@ -4,66 +4,5 @@ This software is a Morse decoder orinally created by Dr. E. L. Bell in 1977. The software was manually entered from Fortran program listings and later converted to C++ by AG1LE Mauri Niininen. -2013-DEC-29 - Added more options to enable debugging and testing bmorse decoder while using WAV audio files as source. - Bit filter (-bfv) option does envelope smoothing - 10 msec rise time assumption based on experiences with FLDIGI. - Plot option (-plt) enables piping such as "bmorse -plt | xplot" to visualize the CW envelope. - AGC option (-agc) has fast rise and slow decay in case original signal has very large dynamic range. - AMP option (-amp) allows to multiply envelope signal with a constant. - DUR option (-dur) allows manually to set Bayesian decoder sample duration (used in path.c). - FFT option (-fft) enables either FFT based signal recovery or just low pass filtering. - - FFT has also peak_detection() to find if there are multiple signals in the audio frequency range. - - Parameter "delta" sets peak detection threshold - - Width (-wid) and length (-len) parameters can be used to set FFT size and chunking - - -2013-DEC-28 - Renamed this program as "bmorse" - it stands for Bayesian Morse code decoder. - Built new functionality and options for testing both sound files and text files. - - - -2013-SEP-26 - enabled decoding from FLDIGI data feed. clamping x value to 1.0 max as FLDIGI sends values over 20.0 during startup before AGC kicks in. - BUG: P(dah) abruptly goes from near 1.0 down and the bounces back => P(max) jumps to huge values - too long dahs? - -2013-SEP-25 - BUG: missing word space /pause between words QUICK BROWN when < 30 db SNR ? - FOUND: enabled noise.c processing in morse.c - changed to: - noise_(&x, &rn, &zout); - retstat = proces_(&zout, &rn, &xhat, &px, &elmhat, &spdhat, &imax, &pmax); - much better decoding with low SNR test signals. - -2013-SEP-25 - run "./morse t test/test20db.in | less" - BUG: QUICD and FOB when high 20 dB SNR? - D should be K and B should be X - for some reason last 'dah' following word space gets decoded as 'dit'. - FOUND: Initl.c - line 123 1, 1, 0, 0, 0, 0, // mauri 2013-09-25 bugfix - had 0 instead of 1 in state k=4 - - -2013-SEP-02 Morse decoding works on C++ version. Added decoding struct TREE in transl.c - and logic to translate incoming morse symbols. This is marked as version v01. -2013-SEP-01 Initial version. Original Fortran sources compiled with - gfortran -g *.f - produces a.out executable program. - - Based on initial testing the element state estimation works, but translating letters - has still problems. Produces a sequence of letter states but translation to actual - characters produces incorrect letters. - - Compilation of C-sources produced by f2c is done with following commands: - - gcc -c *.c - gcc *.o -lf2c -lm - - produces a.out executable program. The output of both versions of a.out is in - output_c.txt - output_f.txt - - These have minor differences - source still unknown. diff --git a/aclocal.m4 b/aclocal.m4 index d3dedb4..c31879a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -600,6 +600,46 @@ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, +# 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless `enable' is passed literally. +# For symmetry, `disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], +[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. @@ -652,41 +692,6 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 6 - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) - # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 @@ -858,6 +863,63 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) +# Copyright (C) 2009, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# (`yes' being less verbose, `no' or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few `make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using `$V' instead of `$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation diff --git a/config.h b/config.h index 38d184e..0142dcd 100644 --- a/config.h +++ b/config.h @@ -4,20 +4,30 @@ /* Define to 1 if you have the 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). */ -#define HAVE_LIBM 1 +/* #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 header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `memset' function. */ -#define HAVE_MEMSET 1 +/* #undef HAVE_MEMSET */ /* Define to 1 if you have the `pow' function. */ -#define HAVE_POW 1 +/* #undef HAVE_POW */ /* Define to 1 if you have the `sqrt' function. */ -#define HAVE_SQRT 1 +/* #undef HAVE_SQRT */ /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -32,7 +42,7 @@ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strrchr' function. */ -#define HAVE_STRRCHR 1 +/* #undef HAVE_STRRCHR */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -43,8 +53,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -/* #undef NO_MINUS_C_MINUS_O */ +/* Define to 1 if the system has the type `_Bool'. */ +/* #undef HAVE__BOOL */ /* Name of package */ #define PACKAGE "bmorse" @@ -56,7 +66,7 @@ #define PACKAGE_NAME "bmorse" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "bmorse 0.1" +#define PACKAGE_STRING "bmorse 0.1.01" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "bmorse" @@ -65,10 +75,19 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.1" +#define PACKAGE_VERSION "0.1.01" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "0.1" +#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 */ +#endif + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ diff --git a/config.log b/config.log index 2b3222d..3c3cf27 100644 --- a/config.log +++ b/config.log @@ -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, which was +It was created by bmorse configure 0.1.01, which was generated by GNU Autoconf 2.69. Invocation command line was $ ./configure @@ -42,256 +42,533 @@ PATH: /usr/local/games ## Core tests. ## ## ----------- ## -configure:2232: checking for a BSD-compatible install -configure:2300: result: /usr/bin/install -c -configure:2311: checking whether build environment is sane -configure:2361: result: yes -configure:2502: checking for a thread-safe mkdir -p -configure:2541: result: /bin/mkdir -p -configure:2554: checking for gawk -configure:2570: found /usr/bin/gawk -configure:2581: result: gawk -configure:2592: checking whether make sets $(MAKE) -configure:2614: result: yes -configure:2807: checking for C++ compiler version -configure:2816: clang++ --version >&5 -Ubuntu clang version 3.2-1~exp9ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) -Target: i386-pc-linux-gnu +configure:2143: checking for a BSD-compatible install +configure:2211: result: /usr/bin/install -c +configure:2222: checking whether build environment is sane +configure:2272: result: yes +configure:2413: checking for a thread-safe mkdir -p +configure:2452: result: /bin/mkdir -p +configure:2465: checking for gawk +configure:2481: found /usr/bin/gawk +configure:2492: result: gawk +configure:2503: checking whether make sets $(MAKE) +configure:2525: result: yes +configure:2680: checking whether make supports nested variables +configure:2697: result: yes +configure:2709: checking whether to enable maintainer-specific portions of Makefiles +configure:2718: result: no +configure:2848: checking for g++ +configure:2864: found /usr/bin/g++ +configure:2875: result: g++ +configure:2902: checking for C++ compiler version +configure:2911: g++ --version >&5 +g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 +Copyright (C) 2012 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +configure:2922: $? = 0 +configure:2911: g++ -v >&5 +Using built-in specs. +COLLECT_GCC=g++ +COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.7/lto-wrapper +Target: i686-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.3-1ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --enable-objc-gc --enable-targets=all --with-cloog --enable-cloog-backend=ppl --disable-cloog-version-check --disable-ppl-version-check --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu Thread model: posix -configure:2827: $? = 0 -configure:2816: clang++ -v >&5 -Ubuntu clang version 3.2-1~exp9ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) -Target: i386-pc-linux-gnu -Thread model: posix -configure:2827: $? = 0 -configure:2816: clang++ -V >&5 -clang: error: argument to '-V' is missing (expected 1 value) -clang: error: no input files -configure:2827: $? = 1 -configure:2816: clang++ -qversion >&5 -clang: error: no input files -configure:2827: $? = 1 -configure:2847: checking whether the C++ compiler works -configure:2869: clang++ conftest.cpp >&5 -configure:2873: $? = 0 -configure:2921: result: yes -configure:2924: checking for C++ compiler default output file name -configure:2926: result: a.out -configure:2932: checking for suffix of executables -configure:2939: clang++ -o conftest conftest.cpp >&5 -configure:2943: $? = 0 -configure:2965: result: -configure:2987: checking whether we are cross compiling -configure:2995: clang++ -o conftest conftest.cpp >&5 -configure:2999: $? = 0 -configure:3006: ./conftest -configure:3010: $? = 0 -configure:3025: result: no -configure:3030: checking for suffix of object files -configure:3052: clang++ -c conftest.cpp >&5 -configure:3056: $? = 0 -configure:3077: result: o -configure:3081: checking whether we are using the GNU C++ compiler -configure:3100: clang++ -c conftest.cpp >&5 -configure:3100: $? = 0 -configure:3109: result: yes -configure:3118: checking whether clang++ accepts -g -configure:3138: clang++ -c -g conftest.cpp >&5 -configure:3138: $? = 0 -configure:3179: result: yes -configure:3213: checking for style of include used by make -configure:3241: result: GNU -configure:3267: checking dependency style of clang++ -configure:3378: result: gcc3 -configure:3441: checking for gcc -configure:3468: result: clang -configure:3697: checking for C compiler version -configure:3706: clang --version >&5 -Ubuntu clang version 3.2-1~exp9ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) -Target: i386-pc-linux-gnu -Thread model: posix -configure:3717: $? = 0 -configure:3706: clang -v >&5 -Ubuntu clang version 3.2-1~exp9ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) -Target: i386-pc-linux-gnu -Thread model: posix -configure:3717: $? = 0 -configure:3706: clang -V >&5 -clang: error: argument to '-V' is missing (expected 1 value) -clang: error: no input files -configure:3717: $? = 1 -configure:3706: clang -qversion >&5 -clang: error: no input files -configure:3717: $? = 1 -configure:3721: checking whether we are using the GNU C compiler -configure:3740: clang -c conftest.c >&5 -configure:3740: $? = 0 -configure:3749: result: yes -configure:3758: checking whether clang accepts -g -configure:3778: clang -c -g conftest.c >&5 -configure:3778: $? = 0 -configure:3819: result: yes -configure:3836: checking for clang option to accept ISO C89 -configure:3899: clang -c -g -O2 conftest.c >&5 -configure:3899: $? = 0 -configure:3912: result: none needed -configure:3934: checking dependency style of clang -configure:4045: result: gcc3 -configure:4061: checking whether clang and cc understand -c and -o together -configure:4092: clang -c conftest.c -o conftest2.o >&5 -configure:4096: $? = 0 -configure:4102: clang -c conftest.c -o conftest2.o >&5 -configure:4106: $? = 0 -configure:4117: cc -c conftest.c >&5 -configure:4121: $? = 0 -configure:4129: cc -c conftest.c -o conftest2.o >&5 -configure:4133: $? = 0 -configure:4139: cc -c conftest.c -o conftest2.o >&5 -configure:4143: $? = 0 -configure:4161: result: yes -configure:4190: checking for main in -lm -configure:4209: clang -o conftest -g -O2 conftest.c -lm >&5 -configure:4209: $? = 0 -configure:4218: result: yes -configure:4236: checking how to run the C preprocessor -configure:4267: clang -E conftest.c -configure:4267: $? = 0 -configure:4281: clang -E conftest.c -conftest.c:12:10: fatal error: 'ac_nonexistent.h' file not found -#include - ^ -1 error generated. -configure:4281: $? = 1 +gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) +configure:2922: $? = 0 +configure:2911: g++ -V >&5 +g++: error: unrecognized command line option '-V' +g++: fatal error: no input files +compilation terminated. +configure:2922: $? = 4 +configure:2911: g++ -qversion >&5 +g++: error: unrecognized command line option '-qversion' +g++: fatal error: no input files +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" -| #define PACKAGE_STRING "bmorse 0.1" +| #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" -| #define HAVE_LIBM 1 +| #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. */ -| #include -configure:4306: result: clang -E -configure:4326: clang -E conftest.c -configure:4326: $? = 0 -configure:4340: clang -E conftest.c -conftest.c:12:10: fatal error: 'ac_nonexistent.h' file not found -#include - ^ -1 error generated. -configure:4340: $? = 1 +| +| 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" -| #define PACKAGE_STRING "bmorse 0.1" +| #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" -| #define HAVE_LIBM 1 +| #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 +configure:3362: checking dependency style of g++ +configure:3473: result: gcc3 +configure:3490: checking dependency style of g++ +configure:3601: result: gcc3 +configure:3664: checking for gcc +configure:3680: found /usr/bin/gcc +configure:3691: result: gcc +configure:3920: checking for C compiler version +configure:3929: gcc --version >&5 +gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 +Copyright (C) 2012 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +configure:3940: $? = 0 +configure:3929: gcc -v >&5 +Using built-in specs. +COLLECT_GCC=gcc +COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.7/lto-wrapper +Target: i686-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.3-1ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --enable-objc-gc --enable-targets=all --with-cloog --enable-cloog-backend=ppl --disable-cloog-version-check --disable-ppl-version-check --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu +Thread model: posix +gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) +configure:3940: $? = 0 +configure:3929: gcc -V >&5 +gcc: error: unrecognized command line option '-V' +gcc: fatal error: no input files +compilation terminated. +configure:3940: $? = 4 +configure:3929: gcc -qversion >&5 +gcc: error: unrecognized command line option '-qversion' +gcc: fatal error: no input files +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 +configure:4268: result: gcc3 +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 +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. */ | #include -configure:4369: checking for grep that handles long lines and -e -configure:4427: result: /bin/grep -configure:4432: checking for egrep -configure:4494: result: /bin/grep -E -configure:4499: checking for ANSI C header files -configure:4519: clang -c -g -O2 conftest.c >&5 -configure:4519: $? = 0 -configure:4592: clang -o conftest -g -O2 conftest.c -lm >&5 -configure:4592: $? = 0 -configure:4592: ./conftest -configure:4592: $? = 0 -configure:4603: result: yes -configure:4616: checking for sys/types.h -configure:4616: clang -c -g -O2 conftest.c >&5 -configure:4616: $? = 0 -configure:4616: result: yes -configure:4616: checking for sys/stat.h -configure:4616: clang -c -g -O2 conftest.c >&5 -configure:4616: $? = 0 -configure:4616: result: yes -configure:4616: checking for stdlib.h -configure:4616: clang -c -g -O2 conftest.c >&5 -configure:4616: $? = 0 -configure:4616: result: yes -configure:4616: checking for string.h -configure:4616: clang -c -g -O2 conftest.c >&5 -configure:4616: $? = 0 -configure:4616: result: yes -configure:4616: checking for memory.h -configure:4616: clang -c -g -O2 conftest.c >&5 -configure:4616: $? = 0 -configure:4616: result: yes -configure:4616: checking for strings.h -configure:4616: clang -c -g -O2 conftest.c >&5 -configure:4616: $? = 0 -configure:4616: result: yes -configure:4616: checking for inttypes.h -configure:4616: clang -c -g -O2 conftest.c >&5 -configure:4616: $? = 0 -configure:4616: result: yes -configure:4616: checking for stdint.h -configure:4616: clang -c -g -O2 conftest.c >&5 -configure:4616: $? = 0 -configure:4616: result: yes -configure:4616: checking for unistd.h -configure:4616: clang -c -g -O2 conftest.c >&5 -configure:4616: $? = 0 -configure:4616: result: yes -configure:4631: checking for stdlib.h -configure:4631: result: yes -configure:4631: checking for string.h -configure:4631: result: yes -configure:4648: checking for memset -configure:4648: clang -o conftest -g -O2 conftest.c -lm >&5 -conftest.c:47:6: warning: incompatible redeclaration of library function 'memset' -char memset (); - ^ -conftest.c:47:6: note: 'memset' is a builtin with type 'void *(void *, int, unsigned int)' -1 warning generated. -configure:4648: $? = 0 -configure:4648: result: yes -configure:4648: checking for pow -configure:4648: clang -o conftest -g -O2 conftest.c -lm >&5 -conftest.c:48:6: warning: incompatible redeclaration of library function 'pow' -char pow (); - ^ -conftest.c:48:6: note: 'pow' is a builtin with type 'double (double, double)' -1 warning generated. -configure:4648: $? = 0 -configure:4648: result: yes -configure:4648: checking for sqrt -configure:4648: clang -o conftest -g -O2 conftest.c -lm >&5 -conftest.c:49:6: warning: incompatible redeclaration of library function 'sqrt' -char sqrt (); - ^ -conftest.c:49:6: note: 'sqrt' is a builtin with type 'double (double)' -1 warning generated. -configure:4648: $? = 0 -configure:4648: result: yes -configure:4648: checking for strrchr -configure:4648: clang -o conftest -g -O2 conftest.c -lm >&5 -conftest.c:50:6: warning: incompatible redeclaration of library function 'strrchr' -char strrchr (); - ^ -conftest.c:50:6: note: 'strrchr' is a builtin with type 'char *(const char *, int)' -1 warning generated. -configure:4648: $? = 0 -configure:4648: result: yes -configure:4794: creating ./config.status +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 +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. */ +| #include +configure:4550: checking for grep that handles long lines and -e +configure:4608: result: /bin/grep +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 +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" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| #include +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 +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" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| /* end confdefs.h. */ +| #include +configure:4810: result: no +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 ## ---------------------- ## ## Running config.status. ## ## ---------------------- ## -This file was extended by bmorse config.status 0.1, which was +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 = @@ -302,10 +579,11 @@ generated by GNU Autoconf 2.69. Invocation command line was on X301 -config.status:861: creating Makefile -config.status:861: creating config.h -config.status:1042: config.h is unchanged -config.status:1090: executing depfiles commands +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 ## ---------------- ## ## Cache variables. ## @@ -315,8 +593,8 @@ ac_cv_c_compiler_gnu=yes ac_cv_cxx_compiler_gnu=yes ac_cv_env_CCC_set= ac_cv_env_CCC_value= -ac_cv_env_CC_set=set -ac_cv_env_CC_value=clang +ac_cv_env_CC_set= +ac_cv_env_CC_value= ac_cv_env_CFLAGS_set= ac_cv_env_CFLAGS_value= ac_cv_env_CPPFLAGS_set= @@ -325,8 +603,8 @@ ac_cv_env_CPP_set= ac_cv_env_CPP_value= ac_cv_env_CXXFLAGS_set= ac_cv_env_CXXFLAGS_value= -ac_cv_env_CXX_set=set -ac_cv_env_CXX_value=clang++ +ac_cv_env_CXX_set= +ac_cv_env_CXX_value= ac_cv_env_LDFLAGS_set= ac_cv_env_LDFLAGS_value= ac_cv_env_LIBS_set= @@ -337,12 +615,9 @@ ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= -ac_cv_func_memset=yes -ac_cv_func_pow=yes -ac_cv_func_sqrt=yes -ac_cv_func_strrchr=yes ac_cv_header_inttypes_h=yes ac_cv_header_memory_h=yes +ac_cv_header_minix_config_h=no ac_cv_header_stdc=yes ac_cv_header_stdint_h=yes ac_cv_header_stdlib_h=yes @@ -351,22 +626,23 @@ ac_cv_header_strings_h=yes ac_cv_header_sys_stat_h=yes ac_cv_header_sys_types_h=yes ac_cv_header_unistd_h=yes -ac_cv_lib_m_main=yes ac_cv_objext=o ac_cv_path_EGREP='/bin/grep -E' ac_cv_path_GREP=/bin/grep ac_cv_path_install='/usr/bin/install -c' ac_cv_path_mkdir=/bin/mkdir ac_cv_prog_AWK=gawk -ac_cv_prog_CPP='clang -E' -ac_cv_prog_ac_ct_CC=clang +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_ac_ct_CXX=g++ ac_cv_prog_cc_c89= -ac_cv_prog_cc_clang_c_o=yes ac_cv_prog_cc_g=yes ac_cv_prog_cxx_g=yes ac_cv_prog_make_make_set=yes +ac_cv_safe_to_define___extensions__=yes am_cv_CC_dependencies_compiler_type=gcc3 am_cv_CXX_dependencies_compiler_type=gcc3 +am_cv_make_support_nested_variables=yes ## ----------------- ## ## Output variables. ## @@ -377,16 +653,21 @@ AMDEPBACKSLASH='\' AMDEP_FALSE='#' AMDEP_TRUE='' AMTAR='$${TAR-tar}' +AM_BACKSLASH='\' +AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +AM_DEFAULT_VERBOSITY='0' +AM_V='$(V)' AUTOCONF='${SHELL} /home/mauri/Projects/morse/missing --run autoconf' AUTOHEADER='${SHELL} /home/mauri/Projects/morse/missing --run autoheader' AUTOMAKE='${SHELL} /home/mauri/Projects/morse/missing --run automake-1.11' AWK='gawk' -CC='clang' +BMORSE_AUTHORS='' +CC='gcc' CCDEPMODE='depmode=gcc3' CFLAGS='-g -O2' -CPP='clang -E' +CPP='gcc -E' CPPFLAGS='' -CXX='clang++' +CXX='g++' CXXDEPMODE='depmode=gcc3' CXXFLAGS='-g -O2' CYGPATH_W='echo' @@ -404,25 +685,34 @@ INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' LDFLAGS='' LIBOBJS='' -LIBS='-lm ' +LIBS='' LTLIBOBJS='' +MAINT='#' +MAINTAINER_MODE_FALSE='' +MAINTAINER_MODE_TRUE='#' MAKEINFO='${SHELL} /home/mauri/Projects/morse/missing --run makeinfo' MKDIR_P='/bin/mkdir -p' OBJEXT='o' PACKAGE='bmorse' PACKAGE_BUGREPORT='ag1le@innomore.com' +PACKAGE_DL='https://github.com/ag1le/morse-wip' +PACKAGE_DOCS='https://github.com/ag1le/morse-wip/wiki' +PACKAGE_GUIDE='https://github.com/ag1le/morse-wip/wiki' +PACKAGE_HOME='https://github.com/ag1le/morse-wip' PACKAGE_NAME='bmorse' -PACKAGE_STRING='bmorse 0.1' +PACKAGE_NEWBUG='https://github.com/ag1le/morse-wip/issues' +PACKAGE_PROJ='https://github.com/ag1le/morse-wip' +PACKAGE_STRING='bmorse 0.1.01' PACKAGE_TARNAME='bmorse' PACKAGE_URL='' -PACKAGE_VERSION='0.1' +PACKAGE_VERSION='0.1.01' PATH_SEPARATOR=':' SET_MAKE='' SHELL='/bin/bash' STRIP='' -VERSION='0.1' -ac_ct_CC='clang' -ac_ct_CXX='' +VERSION='0.1.01' +ac_ct_CC='gcc' +ac_ct_CXX='g++' am__EXEEXT_FALSE='' am__EXEEXT_TRUE='#' am__fastdepCC_FALSE='#' @@ -471,13 +761,20 @@ target_alias='' /* confdefs.h */ #define PACKAGE_NAME "bmorse" #define PACKAGE_TARNAME "bmorse" -#define PACKAGE_VERSION "0.1" -#define PACKAGE_STRING "bmorse 0.1" +#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" -#define HAVE_LIBM 1 +#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" #define STDC_HEADERS 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_STAT_H 1 @@ -488,11 +785,10 @@ target_alias='' #define HAVE_INTTYPES_H 1 #define HAVE_STDINT_H 1 #define HAVE_UNISTD_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRING_H 1 -#define HAVE_MEMSET 1 -#define HAVE_POW 1 -#define HAVE_SQRT 1 -#define HAVE_STRRCHR 1 +#define __EXTENSIONS__ 1 +#define _ALL_SOURCE 1 +#define _GNU_SOURCE 1 +#define _POSIX_PTHREAD_SEMANTICS 1 +#define _TANDEM_SOURCE 1 configure: exit 0 diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 693897c..0000000 --- a/configure.ac +++ /dev/null @@ -1,28 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.69]) -AC_INIT([bmorse], [0.1], [ag1le@innomore.com]) -AC_CONFIG_SRCDIR([config.h.in]) -AC_CONFIG_HEADERS([config.h]) - -AM_INIT_AUTOMAKE -# Checks for programs. -AC_PROG_CXX -AC_PROG_CC -AM_PROG_CC_C_O - -# Checks for libraries. -# FIXME: Replace `main' with a function in `-lm': -AC_CHECK_LIB([m], [main]) - -# Checks for header files. -AC_CHECK_HEADERS([stdlib.h string.h]) - -# Checks for typedefs, structures, and compiler characteristics. - -# Checks for library functions. -AC_CHECK_FUNCS([memset pow sqrt strrchr]) - -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..adff822 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,18 @@ + +bin_PROGRAMS = bmorse +FLAGS= -Wall -pedantic + +#AM_CXXFLAGS = -I$(src) + +bmorse_SOURCES = fftfilt.cxx kalfil.cxx model.cxx probp.cxx\ + savep.cxx sprob.cxx trelis.cxx xtrans.cxx \ + bmorse.cxx fft.cxx misc.cxx initl.cxx noise.cxx\ + proces.cxx trprob.cxx\ + likhd.cxx path.cxx\ + ptrans.cxx spdtr.cxx transl.cxx window.cxx\ + bmorse.h complex.h config.h fftfilt.h fft.h misc.h window.h + + + +LIBS = -lm -lsndfile -lfftw3 + diff --git a/src/autocr.c b/src/autocr.c deleted file mode 100644 index 46b69fc..0000000 --- a/src/autocr.c +++ /dev/null @@ -1,121 +0,0 @@ -// ---------------------------------------------------------------------------- -// autocr.c -- bayesian morse code decoder -// -// Copyright (C) 2012-2014 -// (C) Mauri Niininen, AG1LE -// -// This file is part of Bayesian Morse code decoder - -// bmorse is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// bmorse is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with bmorse. If not, see . -// ---------------------------------------------------------------------------- - -#include "f2c.h" - -/* Subroutine */ int autocr_(real *s5, real *rs) -{ - /* Initialized data */ - - static real s[1000] = { 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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f }; - static real xn = 0.f; - - static integer i__, k; - static real rs1[500]; - - /* Parameter adjustments */ - --rs; - --s5; - - /* Function Body */ - xn += 1; - for (i__ = 1; i__ <= 500; ++i__) { - s[i__ - 1] = s5[i__]; - rs1[i__ - 1] = 0.f; -/* L100: */ - } - for (i__ = 1; i__ <= 500; ++i__) { - for (k = 1; k <= 500; ++k) { - rs1[i__ - 1] += s[k + i__ - 2] * s[k - 1]; -/* L300: */ - } -/* L200: */ - } - for (i__ = 1; i__ <= 500; ++i__) { - rs[i__] = (rs[i__] * (xn - 1.f) + rs1[i__ - 1]) / xn; -/* L400: */ - } - return 0; -} /* autocr_ */ - diff --git a/src/bmorse.c b/src/bmorse.cxx similarity index 84% rename from src/bmorse.c rename to src/bmorse.cxx index 6625740..f4a131d 100644 --- a/src/bmorse.c +++ b/src/bmorse.cxx @@ -1,10 +1,11 @@ // ---------------------------------------------------------------------------- // bmorse.c -- bayesian morse code decoder // -// Copyright (C) 2012-2014 -// (C) Mauri Niininen, AG1LE +// Copyright (C) 2012-2014 Mauri Niininen, AG1LE // // This file is part of Bayesian Morse code decoder +// Parts of this is adapted from FLDIGI cw.cxx +// Copyright (C) 2006-2010 Dave Freese, W1HKJ // Parts of this is adapted from sndfile-spectrogram // Copyright (C) 2007-2009 Erik de Castro Lopo // @@ -27,10 +28,12 @@ #include #include #include -#include "bmorse.h" #include #include +#include "complex.h" #include "window.h" +#include "bmorse.h" +#include "fftfilt.h" #define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof (x [0]))) #define MAX(x,y) ((x) > (y) ? (x) : (y)) @@ -39,6 +42,8 @@ #define MIN_HEIGHT 480 #define MAX_WIDTH 65536 #define MAX_HEIGHT 4096 +#define TWOPI 2.0*M_PI +#define DEC_RATIO 20 /* { int print_variables ; // FALSE @@ -49,6 +54,7 @@ int width; // 8192 int speclen ; // 32 int bfv; // 0 + double frequency; // 600 double sample_duration; // 5 double sample_rate; // 0 double delta; // 10.0 @@ -56,10 +62,12 @@ int fft; // 0 int agc; // 0 int speed; // 20 + 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, 5, 0, 10.0, 0.0, 0, 0,20}; +FALSE, FALSE, FALSE, FALSE, FALSE, 8192, 32, 0, 600, 5, 4000, 10.0, 0.0, 0, 0,20,20}; +fftfilt *FFT_filter; double filter(double a, int len) @@ -198,7 +206,7 @@ void peak_detect(double *v, int length, struct PEAKS *p) { int i, lookformax; - double this, mn,mx; + double value, mn,mx; int mnpos,mxpos; p->mxcount = 0; @@ -216,24 +224,24 @@ void peak_detect(double *v, int length, struct PEAKS *p) lookformax = 1; for (i=0; i< length; i++) { - this = v[i]; - if (this > mx) {mx = this; mxpos = i;} - if (this < mn) {mn = this; mnpos = i;} + value = v[i]; + if (value > mx) {mx = value; mxpos = i;} + if (value < mn) {mn = value; mnpos = i;} if (lookformax){ - if (this < mx-p->delta) { + if (value < mx-p->delta) { p->mx[p->mxcount] = mx; p->mxpos[p->mxcount] = mxpos; p->mxcount += 1; - mn = this; mnpos = i; + mn = value; mnpos = i; lookformax = 0; }; } else { - if (this > mn+p->delta) { + if (value > mn+p->delta) { p->mn[p->mncount] = mn; p->mnpos[p->mncount] = mnpos; p->mncount += 1; - mx = this; mxpos = i; + mx = value; mxpos = i; lookformax = 1; }; } @@ -325,8 +333,8 @@ void process_data(double x) noise_(x, &rn, &zout); - if (zout > 1.0) zout = 1.0; - if (zout < 0.0) zout = 0.0; +// 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); if (params.print_variables) @@ -335,6 +343,51 @@ void process_data(double x) } +int rx_FFTprocess(const double *buf, int len) +{ + complex z, *zp; + int n,i; + static int smpl_ctr = 0; + static double FFTvalue,FFTphase =0.0; + + while (len-- > 0) { + // convert CW signal to baseband + z = complex ( *buf * cos(FFTphase), *buf * sin(FFTphase) ); + FFTphase += TWOPI * params.frequency / params.sample_rate; + if (FFTphase > M_PI) + FFTphase -= TWOPI; + else if (FFTphase < M_PI) + FFTphase += TWOPI; + + buf++; + + // run low pass filter + n = FFT_filter->run(z, &zp); // n = 0 or filterlen/2 + + if (!n) continue; + + for (int i = 0; i < n; i++) { + + + + // update the basic sample counter used for morse timing + ++smpl_ctr; + if (smpl_ctr % params.dec_ratio) continue; // decimate by DEC_RATIO + + // demodulate + FFTvalue = zp[i].mag(); + // run envelope filter + FFTvalue = filter(FFTvalue,params.bfv); + + process_data(FFTvalue); + + } // for (i =0; i < n ... + + } //while (len-- > 0) + +} + + static void decode_sndfile (SNDFILE *infile, SF_INFO info) @@ -356,7 +409,6 @@ decode_sndfile (SNDFILE *infile, SF_INFO info) int f,sr,sc =0,c,num_items,num,i,j; double *buf; int bfv; // bit filter value - int dec_ratio; // decimation ratio samplerate / bayes decoder rate // speclen should be multiple of 2^n but also keep time resolution < 5 ms // for 48Khz sampling rate speclen 64 represents 2.6667 ms sample time?? @@ -366,9 +418,11 @@ decode_sndfile (SNDFILE *infile, SF_INFO info) /* Print some of the info, and figure out how much data to read. */ f = info.frames; sr = info.samplerate; + params.sample_rate = info.samplerate; + params.dec_ratio = info.samplerate / BAYES_RATE; c = info.channels; num_items = f*c; - dec_ratio = info.samplerate / BAYES_RATE; + // bit filter based on 10 msec rise time of CW waveform or manually set @@ -382,13 +436,17 @@ decode_sndfile (SNDFILE *infile, SF_INFO info) //params.sample_duration= (2.0*speclen*1000.0)/((double)16*sr); printf("frames=%d\n",f); - printf("samplerate=%d\n",sr); 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("dec_ratio=%d\n",dec_ratio); 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.fft) { // speclen = 16; // 16 ok for 4000 Hz test60db.wav @16384 width @@ -450,16 +508,29 @@ decode_sndfile (SNDFILE *infile, SF_INFO info) fftw_destroy_plan (plan) ; - } else { // don't use FFT - just basic filtering - see http://octave.sourceforge.net/communications/function/filter.html + } else { // use FLDIGI CW.CXX FFT filtering + + //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); /* Allocate space for the data to be read, then read it. */ buf = (double *) malloc(num_items*sizeof(double)); + if (buf == 0) { + printf ("%s : line %d :out of memory.\n", __FILE__, __LINE__) ; + exit (1) ; + } + num = sf_read_double(infile,buf,num_items); printf("Read %d items\n",num); - for (i = 0; i < num; i += c){ - for (j = 0; j < c; ++j) { - x = (buf[i+j]); + for (i = 0; i < num; i += 512){ + + rx_FFTprocess(buf, 512); + buf += 512; + +/* if (x < 0) x = -x; x = filter(x,bfv); sc++; @@ -468,10 +539,10 @@ decode_sndfile (SNDFILE *infile, SF_INFO info) process_data(x); - } - } - +*/ + } + //free(buf); } @@ -550,6 +621,7 @@ static void usage_exit (const char * argv0) " -txf Process text file instead of soundfile.\n" " -agc Use Automatic Gain Control (default off).\n" " -bfv Bit filter value (default 10 msec).\n" + " -frq CW signal frequency (default 600 Hz).\n" " -fft Enable FFT filtering (default 0 - off) \n" " -plt Plot envelope using xplot: ./morse -plt | xplot \n" " -spd Set default speed in WPM for decoder (default 20 ) \n" @@ -577,7 +649,7 @@ static void usage_exit (const char * argv0) // (c) Mauri Niininen AG1LE // -int main(int argc, char**argv) +int main(int argc, const char* argv[]) { /* Initialized data */ @@ -632,6 +704,11 @@ int main(int argc, char**argv) params.speed = atoi (argv [k]) ; continue ; } + if (strcmp (argv [k], "-frq") == 0){ + k++ ; + params.frequency = atof (argv [k]) ; + continue ; + } if (strcmp (argv [k], "-amp") == 0){ k++ ; params.amplify = atof (argv [k]) ; @@ -665,12 +742,11 @@ int main(int argc, char**argv) /* INITIALIZE DATA STRUCTURES */ initl_(); - inputl_(); if(params.process_textfile) - process_textfile(argv[k-1]); + process_textfile((char *)argv[k-1]); else - process_sndfile(argv[k-1]); + process_sndfile((char *)argv[k-1]); } /* MAIN__ */ diff --git a/src/bmorse.h b/src/bmorse.h index a840e0a..f98c7dc 100644 --- a/src/bmorse.h +++ b/src/bmorse.h @@ -43,8 +43,12 @@ 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 @@ -62,6 +66,7 @@ typedef struct int print_xplot; int width, speclen ; int bfv; + double frequency; double sample_duration; double sample_rate; double delta; @@ -69,43 +74,45 @@ typedef struct int fft; int agc; int speed; + int dec_ratio; } PARAMS ; extern PARAMS params; /* Common Block Declarations */ -struct BLKSPD { +extern struct BLKSPD { real rtrans[10] /* was [5][2] */; integer mempr[36] /* was [6][6] */; } blkspd; -struct BLKRAT { +extern struct BLKRAT { integer memdel[36] /* was [6][6] */; } blkrat; -struct BLKLAM { +extern struct BLKLAM { integer ielmst[400], ilami[16], ilamx[6]; } blklam; -struct BLKS { +extern struct BLKS { integer isx[6]; } blks; -struct BLKELM { +extern struct BLKELM { real elemtr[96] /* was [16][6] */; } blkelm; -struct BLKMEM { +extern struct BLKMEM { integer memfcn[2400] /* was [400][6] */; } blkmem; -struct BLKSV { +extern struct BLKSV { real ykkip[25], pkkip[25], ykksv[750], pkksv[750]; } blksv; + diff --git a/src/bpfdet.c b/src/bpfdet.c deleted file mode 100644 index 7572b6e..0000000 --- a/src/bpfdet.c +++ /dev/null @@ -1,82 +0,0 @@ -// ---------------------------------------------------------------------------- -// bpfdet.c -- bayesian morse code decoder -// -// Copyright (C) 2012-2014 -// (C) Mauri Niininen, AG1LE -// -// This file is part of Bayesian Morse code decoder - -// bmorse is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// bmorse is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with bmorse. If not, see . -// --------------------------------------------------------------------------- - -#include "bmorse.h" -#include - -/* Subroutine */ int bpfdet_(real *zin, real *z__) -{ - /* Initialized data */ - - static real a[4] = { 3.0051e-5f,2.9507982f,2.90396345f,-.953135172f }; - static real ck1 = 1.37158f; - static real ck2 = .9409f; - static real cg = .015f; - static real c1 = 1.2726f; - static real c2 = .81f; - static real c__ = .19f; - - /* System generated locals */ - real r__1; - - /* Builtin functions */ -// double sqrt(doublereal); - - /* Local variables */ - static real w1, w2, w3, x3, x2, x1, y3, y2, y1, y0, z3, z2, z1, zbpf, - xdet; - - -/* THIS SUBROUTINE IMPLEMENTS THE BANDPASS FILTER AND */ -/* ENVELOPE DETECTOR FUNCTIONS. THE BPF IS A SIMPLE CASCADE */ -/* OF TWO 2-POLE DIGITAL RESONATORS AT A CENTER FREQ OF */ -/* 1000 HZ. THE LPF OF THE ENVELOPE DETECTOR IS A */ -/* THREE - POLE CHEBYSCHEV 100 HZ LPF. */ - - -/* OFF IS TWO 2 - POLE RESONATORS : */ - w3 = w2; - w2 = w1; - w1 = c1 * w2 - c2 * w3 + c__ * *zin; - x3 = x2; - x2 = x1; - x1 = ck1 * x2 - ck2 * x3 + cg * w1; - zbpf = x1; -/* ENVELOPE DETECTOR (SQUARE-LAW): */ -/* sQUARE- */ -/* Computing 2nd power */ - r__1 = zbpf; - xdet = sqrt(r__1 * r__1); -/* LOW-PASS FILTER- */ - y3 = y2; - y2 = y1; - y1 = y0; - y0 = xdet * a[0]; - z3 = z2; - z2 = z1; - z1 = *z__; - *z__ = y0 + (y1 + y2) * 3.f + y3; - *z__ = *z__ + a[1] * z1 - a[2] * z2 - a[3] * 23; -/* L200: */ - return 0; -} /* bpfdet_ */ - diff --git a/src/complex.h b/src/complex.h new file mode 100644 index 0000000..c6800e1 --- /dev/null +++ b/src/complex.h @@ -0,0 +1,146 @@ +// ---------------------------------------------------------------------------- +// complex.h -- Complex arithmetic +// +// Copyright (C) 2006-2008 +// Dave Freese, W1HKJ +// Copyright (C) 2008 +// Stelios Bounanos, M0GLD +// +// This file is part of fldigi. +// +// Fldigi is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Fldigi is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with fldigi. If not, see . +// ---------------------------------------------------------------------------- + +#ifndef _COMPLEX_H +#define _COMPLEX_H + +#include + +class complex { +public: + double re; + double im; + complex(double r = 0.0, double i = 0.0) + : re(r), im(i) { } + + double real() { return re; }; + void real(double R) {re = R;}; + double imag() { return im; }; + void imag(double I) {im = I;}; + +// Z = X * Y + complex& operator*=(const complex& y) { + double temp = re * y.re - im * y.im; + im = re * y.im + im * y.re; + re = temp; + return *this; + } + complex operator*(const complex& y) const { + return complex(re * y.re - im * y.im, re * y.im + im * y.re); + } + +// Z = X * y + complex& operator*=(double y) { + re *= y; + im *= y; + return *this; + } + complex operator*(double y) const { + return complex(re * y, im * y); + } + +// Z = X + Y + complex& operator+=(const complex& y) { + re += y.re; + im += y.im; + return *this; + } + complex operator+(const complex& y) const { + return complex(re + y.re, im + y.im); + } + +// Z = X - Y + complex& operator-=(const complex& y) { + re -= y.re; + im -= y.im; + return *this; + } + complex operator-(const complex& y) const { + return complex(re - y.re, im - y.im); + } + +// Z = X / Y + complex& operator/=(const complex& y) { + double temp, denom = y.re*y.re + y.im*y.im; + if (denom == 0.0) denom = 1e-10; + temp = (re * y.re + im * y.im) / denom; + im = (im * y.re - re * y.im) / denom; + re = temp; + return *this; + } + complex operator/(const complex& y) const { + double denom = y.re*y.re + y.im*y.im; + if (denom == 0.0) denom = 1e-10; + return complex((re * y.re + im * y.im) / denom, (im * y.re - re * y.im) / denom); + } + +// Z = (complex conjugate of X) * Y +// Z1 = x1 + jy1, or Z1 = |Z1|exp(jP1) +// Z2 = x2 + jy2, or Z2 = |Z2|exp(jP2) +// Z = (x1 - jy1) * (x2 + jy2) +// or Z = |Z1|*|Z2| exp (j (P2 - P1)) + complex& operator%=(const complex& y) { + double temp = re * y.re + im * y.im; + im = re * y.im - im * y.re; + re = temp; + return *this; + } + complex operator%(const complex& y) const { + complex z; + z.re = re * y.re + im * y.im; + z.im = re * y.im - im * y.re; + return z; + } + +// n = |Z| * |Z| + double norm() const { + return (re * re + im * im); + } + +// n = |Z| + double mag() const { + return sqrt(norm()); + } + +// Z = x + jy +// Z = |Z|exp(jP) +// arg returns P + double arg() const { + return atan2(im, re); + } + +}; + +inline complex cmac (const complex *a, const complex *b, int ptr, int len) { + complex z; + ptr %= len; + for (int i = 0; i < len; i++) { + z += a[i] * b[ptr]; + ptr = (ptr + 1) % len; + } + return z; + } + + +#endif diff --git a/src/config.h b/src/config.h new file mode 100644 index 0000000..7453391 --- /dev/null +++ b/src/config.h @@ -0,0 +1,93 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `fftw3' library (-lfftw3). */ +#define HAVE_LIBFFTW3 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `sndfile' library (-lsndfile). */ +#define HAVE_LIBSNDFILE 1 + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#define HAVE_MALLOC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the `pow' function. */ +#define HAVE_POW 1 + +/* Define to 1 if you have the `sqrt' function. */ +#define HAVE_SQRT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if the system has the type `_Bool'. */ +#define HAVE__BOOL 1 + +/* Name of package */ +#define PACKAGE "full-package-name" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "BUG-REPORT-ADDRESS" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "FULL-PACKAGE-NAME" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "FULL-PACKAGE-NAME VERSION" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "full-package-name" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "VERSION" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "VERSION" + +/* 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 */ +#endif + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ diff --git a/src/fft.cxx b/src/fft.cxx new file mode 100644 index 0000000..7753fd6 --- /dev/null +++ b/src/fft.cxx @@ -0,0 +1,804 @@ +//=========================================================================== +// Real Discrete Fourier Transform +// dimension :one +// data length :power of 2, must be larger than 4 +// decimation :frequency +// radix :4, 2 +// data :inplace +// classes: +// Cfft: real discrete fourier transform class +// functions: +// Cfft::rdft : compute the forward real discrete fourier transform +// Cfft::cdft : compute the forward double discrete fourier transform +// Cfft::icdft : compute the reverse double discrete fourier transform +// Cfft::fft : compute the forward real dft on a set of integer values +// +// This class is derived from the work of Takuya Ooura, who has kindly put his +// fft algorithims in the public domain. Thank you Takuya Ooura! +//=========================================================================== + +#include + +#include "misc.h" +#include "fft.h" + +// n = size of fourier transform in complex pairs +// fftsiz = size of fourier transform in real (double) values + +Cfft::Cfft(int n) +{ + int tablesize = (int)(sqrt(n*1.0)+0.5) + 2; + fftlen = n; + fftsiz = 2 * n; + ip = new int[tablesize]; + w = new double[fftlen]; + fftwin = new double[fftlen*2]; + makewt(); + makect(); + wintype = FFT_NONE; + RectWindow(fftwin, fftlen*2); +} + +Cfft::~Cfft() +{ + if (ip) delete [] ip; + if (w) delete [] w; + if (fftwin) delete [] fftwin; +} + +void Cfft::resize(int n) +{ + int tablesize = (int)(sqrt(n*1.0)+0.5) + 2; + fftlen = n; + fftsiz = 2 * n; + if (ip) delete [] ip; + ip = new int[tablesize]; + if (w) delete [] w; + w = new double[fftlen]; + if (fftwin) delete [] fftwin; + fftwin = new double[fftlen*2]; + makewt(); + makect(); + wintype = FFT_NONE; + RectWindow(fftwin, fftlen*2); +} + +void Cfft::cdft(double *aCmpx) +{ + if (wintype != FFT_NONE) + for (int i = 0; i < fftlen; i++) { + aCmpx[2*i] *= fftwin[2*i]; + aCmpx[2*i+1] *= fftwin[2*i]; + } + bitrv2(fftsiz, ip + 2, aCmpx); + cftfsub(fftsiz, aCmpx); + double scale = 1.0 / fftlen; + for (int i = 0; i < fftsiz; i++) aCmpx[i] = aCmpx[i] * scale; +} + +void Cfft::icdft(double *aCmpx) +{ + bitrv2conj(fftsiz, ip + 2, aCmpx); + cftbsub(fftsiz, aCmpx); +} + +// FFT of an array of short integers +// siData = array (size n) of unsigned integers such as the output of a soundcard +// operating in 16 bit mode +// out = array (size n) of double pairs + +void Cfft::sifft(short int *siData, double *out) +{ + for (int i = 0; i < fftlen; i++) { + out[2*i] = siData[i]; + out[2*i+1] = 0.0; + } + cdft(out); + return; +} + + +void Cfft::rdft(double *RealData) // RealData is 2N long +{ + if (wintype != FFT_NONE) + for (int i = 0; i < fftlen*2; i++) { + RealData[i] *= fftwin[i]; + } + + if (fftsiz > 4) { + bitrv2(fftsiz, ip + 2, RealData); + cftfsub(fftsiz, RealData); + rftfsub(fftsiz, RealData); + } else if (fftsiz == 4) { + cftfsub(fftsiz, RealData); + } + double xi = RealData[0] - RealData[1]; + RealData[0] += RealData[1]; + RealData[1] = xi; + double scale = 1.0 / fftlen; + for (int i = 0; i < fftsiz; i++) RealData[i] *= scale; + +} + +void Cfft::irdft(double *RealData) +{ +/* + int nw, nc; + double xi; + + nw = ip[0]; + if (n > (nw << 2)) { + nw = n >> 2; + makewt(nw, ip, w); + } + nc = ip[1]; + if (n > (nc << 2)) { + nc = n >> 2; + makect(nc, ip, w + nw); + } + if (isgn >= 0) { + if (n > 4) { + bitrv2(n, ip + 2, a); + cftfsub(n, a, w); + rftfsub(n, a, nc, w + nw); + } else if (n == 4) { + cftfsub(n, a, w); + } + xi = a[0] - a[1]; + a[0] += a[1]; + a[1] = xi; + } else { + a[1] = 0.5 * (a[0] - a[1]); + a[0] -= a[1]; + if (n > 4) { + rftbsub(n, a, nc, w + nw); + bitrv2(n, ip + 2, a); + cftbsub(n, a, w); + } else if (n == 4) { + cftfsub(n, a, w); + } + } +*/ +} + +void Cfft::setWindow(fftPrefilter pf) +{ + wintype = pf; + if (wintype == FFT_TRIANGULAR) + TriangularWindow(fftwin, fftlen*2); + else if (wintype == FFT_HAMMING) + HammingWindow(fftwin, fftlen*2); + else if (wintype == FFT_HANNING) + HanningWindow(fftwin, fftlen*2); + else if (wintype == FFT_BLACKMAN) + BlackmanWindow(fftwin, fftlen*2); + else + RectWindow(fftwin, fftlen*2); +} + +/* -------- initializing routines -------- */ + + +void Cfft::makewt() +{ + int j, + nwh, nw = fftsiz / 4; + double delta, x, y; + + ip[0] = nw; + ip[1] = 1; + if (nw > 2) { + nwh = nw >> 1; + delta = atan(1.0) / nwh; + w[0] = 1; + w[1] = 0; + w[nwh] = cos(delta * nwh); + w[nwh + 1] = w[nwh]; + if (nwh > 2) { + for (j = 2; j < nwh; j += 2) { + x = cos(delta * j); + y = sin(delta * j); + w[j] = x; + w[j + 1] = y; + w[nw - j] = y; + w[nw - j + 1] = x; + } + bitrv2(nw, ip + 2, w); + } + } +} + +void Cfft::makect() +{ + int j, nch, nc = fftsiz / 4; + double delta; + double *c = w + fftsiz / 4; + c = w + fftsiz / 4; + ip[1] = nc; + if (nc > 1) { + nch = nc >> 1; + delta = atan(1.0) / nch; + c[0] = cos(delta * nch); + c[nch] = 0.5 * c[0]; + for (j = 1; j < nch; j++) { + c[j] = 0.5 * cos(delta * j); + c[nc - j] = 0.5 * sin(delta * j); + } + } +} + + +/* -------- child routines -------- */ + + +void Cfft::bitrv2(int n, int *ip, double *a) +{ + int j, j1, k, k1, l, m, m2; + double xr, xi, yr, yi; + + ip[0] = 0; + l = n; + m = 1; + while ((m << 3) < l) { + l >>= 1; + for (j = 0; j < m; j++) { + ip[m + j] = ip[j] + l; + } + m <<= 1; + } + m2 = 2 * m; + if ((m << 3) == l) { + for (k = 0; k < m; k++) { + for (j = 0; j < k; j++) { + j1 = 2 * j + ip[k]; + k1 = 2 * k + ip[j]; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += m2; + k1 += 2 * m2; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += m2; + k1 -= m2; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += m2; + k1 += 2 * m2; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + } + j1 = 2 * k + m2 + ip[k]; + k1 = j1 + m2; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + } + } else { + for (k = 1; k < m; k++) { + for (j = 0; j < k; j++) { + j1 = 2 * j + ip[k]; + k1 = 2 * k + ip[j]; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += m2; + k1 += m2; + xr = a[j1]; + xi = a[j1 + 1]; + yr = a[k1]; + yi = a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + } + } + } +} + + +void Cfft::cftfsub(int n, double *a) +{ + int j, j1, j2, j3, l; + double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i; + + l = 2; + if (n > 8) { + cft1st(n, a); + l = 8; + while ((l << 2) < n) { + cftmdl(n, l, a); + l <<= 2; + } + } + if ((l << 2) == n) { + for (j = 0; j < l; j += 2) { + j1 = j + l; + j2 = j1 + l; + j3 = j2 + l; + x0r = a[j] + a[j1]; + x0i = a[j + 1] + a[j1 + 1]; + x1r = a[j] - a[j1]; + x1i = a[j + 1] - a[j1 + 1]; + x2r = a[j2] + a[j3]; + x2i = a[j2 + 1] + a[j3 + 1]; + x3r = a[j2] - a[j3]; + x3i = a[j2 + 1] - a[j3 + 1]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + a[j2] = x0r - x2r; + a[j2 + 1] = x0i - x2i; + a[j1] = x1r - x3i; + a[j1 + 1] = x1i + x3r; + a[j3] = x1r + x3i; + a[j3 + 1] = x1i - x3r; + } + } else { + for (j = 0; j < l; j += 2) { + j1 = j + l; + x0r = a[j] - a[j1]; + x0i = a[j + 1] - a[j1 + 1]; + a[j] += a[j1]; + a[j + 1] += a[j1 + 1]; + a[j1] = x0r; + a[j1 + 1] = x0i; + } + } +} + + +void Cfft::cft1st(int n, double *a) +{ + int j, k1, k2; + double wk1r, wk1i, wk2r, wk2i, wk3r, wk3i; + double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i; + + x0r = a[0] + a[2]; + x0i = a[1] + a[3]; + x1r = a[0] - a[2]; + x1i = a[1] - a[3]; + x2r = a[4] + a[6]; + x2i = a[5] + a[7]; + x3r = a[4] - a[6]; + x3i = a[5] - a[7]; + a[0] = x0r + x2r; + a[1] = x0i + x2i; + a[4] = x0r - x2r; + a[5] = x0i - x2i; + a[2] = x1r - x3i; + a[3] = x1i + x3r; + a[6] = x1r + x3i; + a[7] = x1i - x3r; + wk1r = w[2]; + x0r = a[8] + a[10]; + x0i = a[9] + a[11]; + x1r = a[8] - a[10]; + x1i = a[9] - a[11]; + x2r = a[12] + a[14]; + x2i = a[13] + a[15]; + x3r = a[12] - a[14]; + x3i = a[13] - a[15]; + a[8] = x0r + x2r; + a[9] = x0i + x2i; + a[12] = x2i - x0i; + a[13] = x0r - x2r; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[10] = wk1r * (x0r - x0i); + a[11] = wk1r * (x0r + x0i); + x0r = x3i + x1r; + x0i = x3r - x1i; + a[14] = wk1r * (x0i - x0r); + a[15] = wk1r * (x0i + x0r); + k1 = 0; + for (j = 16; j < n; j += 16) { + k1 += 2; + k2 = 2 * k1; + wk2r = w[k1]; + wk2i = w[k1 + 1]; + wk1r = w[k2]; + wk1i = w[k2 + 1]; + wk3r = wk1r - 2 * wk2i * wk1i; + wk3i = 2 * wk2i * wk1r - wk1i; + x0r = a[j] + a[j + 2]; + x0i = a[j + 1] + a[j + 3]; + x1r = a[j] - a[j + 2]; + x1i = a[j + 1] - a[j + 3]; + x2r = a[j + 4] + a[j + 6]; + x2i = a[j + 5] + a[j + 7]; + x3r = a[j + 4] - a[j + 6]; + x3i = a[j + 5] - a[j + 7]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + x0r -= x2r; + x0i -= x2i; + a[j + 4] = wk2r * x0r - wk2i * x0i; + a[j + 5] = wk2r * x0i + wk2i * x0r; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j + 2] = wk1r * x0r - wk1i * x0i; + a[j + 3] = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j + 6] = wk3r * x0r - wk3i * x0i; + a[j + 7] = wk3r * x0i + wk3i * x0r; + wk1r = w[k2 + 2]; + wk1i = w[k2 + 3]; + wk3r = wk1r - 2 * wk2r * wk1i; + wk3i = 2 * wk2r * wk1r - wk1i; + x0r = a[j + 8] + a[j + 10]; + x0i = a[j + 9] + a[j + 11]; + x1r = a[j + 8] - a[j + 10]; + x1i = a[j + 9] - a[j + 11]; + x2r = a[j + 12] + a[j + 14]; + x2i = a[j + 13] + a[j + 15]; + x3r = a[j + 12] - a[j + 14]; + x3i = a[j + 13] - a[j + 15]; + a[j + 8] = x0r + x2r; + a[j + 9] = x0i + x2i; + x0r -= x2r; + x0i -= x2i; + a[j + 12] = -wk2i * x0r - wk2r * x0i; + a[j + 13] = -wk2i * x0i + wk2r * x0r; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j + 10] = wk1r * x0r - wk1i * x0i; + a[j + 11] = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j + 14] = wk3r * x0r - wk3i * x0i; + a[j + 15] = wk3r * x0i + wk3i * x0r; + } +} + + +void Cfft::cftmdl(int n, int l, double *a) +{ + int j, j1, j2, j3, k, k1, k2, m, m2; + double wk1r, wk1i, wk2r, wk2i, wk3r, wk3i; + double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i; + + m = l << 2; + for (j = 0; j < l; j += 2) { + j1 = j + l; + j2 = j1 + l; + j3 = j2 + l; + x0r = a[j] + a[j1]; + x0i = a[j + 1] + a[j1 + 1]; + x1r = a[j] - a[j1]; + x1i = a[j + 1] - a[j1 + 1]; + x2r = a[j2] + a[j3]; + x2i = a[j2 + 1] + a[j3 + 1]; + x3r = a[j2] - a[j3]; + x3i = a[j2 + 1] - a[j3 + 1]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + a[j2] = x0r - x2r; + a[j2 + 1] = x0i - x2i; + a[j1] = x1r - x3i; + a[j1 + 1] = x1i + x3r; + a[j3] = x1r + x3i; + a[j3 + 1] = x1i - x3r; + } + wk1r = w[2]; + for (j = m; j < l + m; j += 2) { + j1 = j + l; + j2 = j1 + l; + j3 = j2 + l; + x0r = a[j] + a[j1]; + x0i = a[j + 1] + a[j1 + 1]; + x1r = a[j] - a[j1]; + x1i = a[j + 1] - a[j1 + 1]; + x2r = a[j2] + a[j3]; + x2i = a[j2 + 1] + a[j3 + 1]; + x3r = a[j2] - a[j3]; + x3i = a[j2 + 1] - a[j3 + 1]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + a[j2] = x2i - x0i; + a[j2 + 1] = x0r - x2r; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j1] = wk1r * (x0r - x0i); + a[j1 + 1] = wk1r * (x0r + x0i); + x0r = x3i + x1r; + x0i = x3r - x1i; + a[j3] = wk1r * (x0i - x0r); + a[j3 + 1] = wk1r * (x0i + x0r); + } + k1 = 0; + m2 = 2 * m; + for (k = m2; k < n; k += m2) { + k1 += 2; + k2 = 2 * k1; + wk2r = w[k1]; + wk2i = w[k1 + 1]; + wk1r = w[k2]; + wk1i = w[k2 + 1]; + wk3r = wk1r - 2 * wk2i * wk1i; + wk3i = 2 * wk2i * wk1r - wk1i; + for (j = k; j < l + k; j += 2) { + j1 = j + l; + j2 = j1 + l; + j3 = j2 + l; + x0r = a[j] + a[j1]; + x0i = a[j + 1] + a[j1 + 1]; + x1r = a[j] - a[j1]; + x1i = a[j + 1] - a[j1 + 1]; + x2r = a[j2] + a[j3]; + x2i = a[j2 + 1] + a[j3 + 1]; + x3r = a[j2] - a[j3]; + x3i = a[j2 + 1] - a[j3 + 1]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + x0r -= x2r; + x0i -= x2i; + a[j2] = wk2r * x0r - wk2i * x0i; + a[j2 + 1] = wk2r * x0i + wk2i * x0r; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j1] = wk1r * x0r - wk1i * x0i; + a[j1 + 1] = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j3] = wk3r * x0r - wk3i * x0i; + a[j3 + 1] = wk3r * x0i + wk3i * x0r; + } + wk1r = w[k2 + 2]; + wk1i = w[k2 + 3]; + wk3r = wk1r - 2 * wk2r * wk1i; + wk3i = 2 * wk2r * wk1r - wk1i; + for (j = k + m; j < l + (k + m); j += 2) { + j1 = j + l; + j2 = j1 + l; + j3 = j2 + l; + x0r = a[j] + a[j1]; + x0i = a[j + 1] + a[j1 + 1]; + x1r = a[j] - a[j1]; + x1i = a[j + 1] - a[j1 + 1]; + x2r = a[j2] + a[j3]; + x2i = a[j2 + 1] + a[j3 + 1]; + x3r = a[j2] - a[j3]; + x3i = a[j2 + 1] - a[j3 + 1]; + a[j] = x0r + x2r; + a[j + 1] = x0i + x2i; + x0r -= x2r; + x0i -= x2i; + a[j2] = -wk2i * x0r - wk2r * x0i; + a[j2 + 1] = -wk2i * x0i + wk2r * x0r; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[j1] = wk1r * x0r - wk1i * x0i; + a[j1 + 1] = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[j3] = wk3r * x0r - wk3i * x0i; + a[j3 + 1] = wk3r * x0i + wk3i * x0r; + } + } +} + + +void Cfft::cftbsub(int n, double *a) +{ + int j, j1, j2, j3, l; + double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i; + + l = 2; + if (n > 8) { + cft1st(n, a); + l = 8; + while ((l << 2) < n) { + cftmdl(n, l, a); + l <<= 2; + } + } + if ((l << 2) == n) { + for (j = 0; j < l; j += 2) { + j1 = j + l; + j2 = j1 + l; + j3 = j2 + l; + x0r = a[j] + a[j1]; + x0i = -a[j + 1] - a[j1 + 1]; + x1r = a[j] - a[j1]; + x1i = -a[j + 1] + a[j1 + 1]; + x2r = a[j2] + a[j3]; + x2i = a[j2 + 1] + a[j3 + 1]; + x3r = a[j2] - a[j3]; + x3i = a[j2 + 1] - a[j3 + 1]; + a[j] = x0r + x2r; + a[j + 1] = x0i - x2i; + a[j2] = x0r - x2r; + a[j2 + 1] = x0i + x2i; + a[j1] = x1r - x3i; + a[j1 + 1] = x1i - x3r; + a[j3] = x1r + x3i; + a[j3 + 1] = x1i + x3r; + } + } else { + for (j = 0; j < l; j += 2) { + j1 = j + l; + x0r = a[j] - a[j1]; + x0i = -a[j + 1] + a[j1 + 1]; + a[j] += a[j1]; + a[j + 1] = -a[j + 1] - a[j1 + 1]; + a[j1] = x0r; + a[j1 + 1] = x0i; + } + } +} + +void Cfft::bitrv2conj(int n, int *ip, double *a) +{ + int j, j1, k, k1, l, m, m2; + double xr, xi, yr, yi; + + ip[0] = 0; + l = n; + m = 1; + while ((m << 3) < l) { + l >>= 1; + for (j = 0; j < m; j++) { + ip[m + j] = ip[j] + l; + } + m <<= 1; + } + m2 = 2 * m; + if ((m << 3) == l) { + for (k = 0; k < m; k++) { + for (j = 0; j < k; j++) { + j1 = 2 * j + ip[k]; + k1 = 2 * k + ip[j]; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += m2; + k1 += 2 * m2; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += m2; + k1 -= m2; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += m2; + k1 += 2 * m2; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + } + k1 = 2 * k + ip[k]; + a[k1 + 1] = -a[k1 + 1]; + j1 = k1 + m2; + k1 = j1 + m2; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + k1 += m2; + a[k1 + 1] = -a[k1 + 1]; + } + } else { + a[1] = -a[1]; + a[m2 + 1] = -a[m2 + 1]; + for (k = 1; k < m; k++) { + for (j = 0; j < k; j++) { + j1 = 2 * j + ip[k]; + k1 = 2 * k + ip[j]; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + j1 += m2; + k1 += m2; + xr = a[j1]; + xi = -a[j1 + 1]; + yr = a[k1]; + yi = -a[k1 + 1]; + a[j1] = yr; + a[j1 + 1] = yi; + a[k1] = xr; + a[k1 + 1] = xi; + } + k1 = 2 * k + ip[k]; + a[k1 + 1] = -a[k1 + 1]; + a[k1 + m2 + 1] = -a[k1 + m2 + 1]; + } + } +} + +void Cfft::rftfsub(int n, double *a) +{ + int j, k, kk, ks, m; + double wkr, wki, xr, xi, yr, yi; + double *c = w + fftsiz / 4; + int nc = n >> 2; + + m = n >> 1; + ks = 2 * nc / m; + kk = 0; + for (j = 2; j < m; j += 2) { + k = n - j; + kk += ks; + wkr = 0.5 - c[nc - kk]; + wki = c[kk]; + xr = a[j] - a[k]; + xi = a[j + 1] + a[k + 1]; + yr = wkr * xr - wki * xi; + yi = wkr * xi + wki * xr; + a[j] -= yr; + a[j + 1] -= yi; + a[k] += yr; + a[k + 1] -= yi; + } +} + +void Cfft::rftbsub(int n, double *a) +{ +} + + + diff --git a/src/fft.h b/src/fft.h new file mode 100644 index 0000000..99f8a25 --- /dev/null +++ b/src/fft.h @@ -0,0 +1,64 @@ +//=========================================================================== +// Real Discrete Fourier Transform +// dimension :one +// data length :power of 2, must be larger than 4 +// decimation :frequency +// radix :4, 2 +// data :inplace +// classes: +// Cfft: real discrete fourier transform class +// functions: +// Cfft::rdft : compute the forward real discrete fourier transform +// Cfft::cdft : compute the forward complex discrete fourier transform +// Cfft::fft : compute the forward real dft on a set of integer values +// +// This class is derived from the work of Takuya Ooura, who has kindly put his +// fft algorithims in the public domain. Thank you Takuya Ooura! +//=========================================================================== + +#ifndef FFT_H +#define FFT_H + +#include "complex.h" + +enum fftPrefilter {FFT_NONE, FFT_HAMMING, FFT_HANNING, FFT_BLACKMAN, FFT_TRIANGULAR}; + +class Cfft { +private: + double xi; + double *w; + int *ip; + double *fftwin; + fftPrefilter wintype; + int fftlen; + int fftsiz; + void makewt(); + void makect(); + void bitrv2(int n, int *ip, double *a); + void bitrv2conj(int n, int *ip, double *a); + void cftfsub(int n, double *a); + void cftbsub(int n, double *a); + void cftmdl(int n, int l, double *a); + void cft1st(int n, double *a); + void rftfsub(int n, double *a); + void rftbsub(int n, double *a); + +public: + Cfft(int n); + ~Cfft(); + void resize(int n); + void cdft(double *a); + void cdft(complex *a) { cdft( (double *) a); } + void icdft(double *a); + void icdft(complex *a) { icdft( (double *) a); } + void sifft(short int *siData, double *out); + void sifft(short int *siData, complex *a) { sifft(siData, (double *) a); } + void rdft(double *a); + void rdft(complex *a) { rdft( (double *) a); } + void irdft(double *a); + void irdft(complex *a) { irdft( (double *) a); } + + void setWindow(fftPrefilter pf); +}; + +#endif diff --git a/src/fftfilt.cxx b/src/fftfilt.cxx new file mode 100644 index 0000000..fced250 --- /dev/null +++ b/src/fftfilt.cxx @@ -0,0 +1,491 @@ +// ---------------------------------------------------------------------------- +// fftfilt.cxx -- Fast convolution Overlap-Add filter +// +// Filter implemented using overlap-add FFT convolution method +// h(t) characterized by Windowed-Sinc impulse response +// +// Reference: +// "The Scientist and Engineer's Guide to Digital Signal Processing" +// by Dr. Steven W. Smith, http://www.dspguide.com +// Chapters 16, 18 and 21 +// +// Copyright (C) 2006-2008 Dave Freese, W1HKJ +// +// This file is part of fldigi. +// +// Fldigi is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Fldigi is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with fldigi. If not, see . +// ---------------------------------------------------------------------------- + +#include + +#include +#include + +#include + +#include +#include "misc.h" + +#include "fftfilt.h" + + +fftfilt::fftfilt(double f1, double f2, int len) +{ + filterlen = len; + fft = new Cfft(filterlen); + ift = new Cfft(filterlen); + + ovlbuf = new complex[filterlen/2]; + filter = new complex[filterlen]; + filtdata = new complex[filterlen]; + ht = new complex[filterlen]; + + for (int i = 0; i < filterlen; i++) + filter[i].re = filter[i].im = + filtdata[i].re = filtdata[i].im = 0.0; + for (int i = 0; i < filterlen/2; i++) + ovlbuf[i].re = ovlbuf[i].im = 0.0; + + inptr = 0; + + create_filter(f1, f2); +} + +fftfilt::fftfilt(double f, int len) +{ + filterlen = len; + fft = new Cfft(filterlen); + ift = new Cfft(filterlen); + + ovlbuf = new complex[filterlen/2]; + filter = new complex[filterlen]; + filtdata = new complex[filterlen]; + ht = new complex[filterlen]; + + for (int i = 0; i < filterlen; i++) + filter[i].re = filter[i].im = + filtdata[i].re = filtdata[i].im = 0.0; + for (int i = 0; i < filterlen/2; i++) + ovlbuf[i].re = ovlbuf[i].im = 0.0; + + inptr = 0; + + create_lpf(f); +} + +fftfilt::~fftfilt() +{ + if (fft) delete fft; + if (ift) delete ift; + if (ovlbuf) delete [] ovlbuf; + if (filter) delete [] filter; + if (filtdata) delete [] filtdata; + if (ht) delete [] ht; +} + +/* + * Filter with fast convolution (overlap-add algorithm). + */ +int fftfilt::run(const complex& in, complex **out) +{ +// collect filterlen/2 input samples + const int filterlen_div2 = filterlen / 2 ; + filtdata[inptr++] = in; + + if (inptr < filterlen_div2) + return 0; + if (pass) --pass; // filter output is not stable until 2 passes + +// zero the rest of the input data + for (int i = filterlen_div2 ; i < filterlen; i++) + filtdata[i].re = filtdata[i].im = 0.0; + +// FFT transpose to the frequency domain + fft->cdft(filtdata); + +// multiply with the filter shape + for (int i = 0; i < filterlen; i++) + filtdata[i] *= filter[i]; + +// IFFT transpose back to the time domain + ift->icdft(filtdata); + +// overlap and add + for (int i = 0; i < filterlen_div2; i++) { + filtdata[i] += ovlbuf[i]; + } + *out = filtdata; + +// save the second half for overlapping + // Memcpy is allowed because complex are POD objects. + memcpy( ovlbuf, filtdata + filterlen_div2, sizeof( ovlbuf[0] ) * filterlen_div2 ); + +// clear inbuf pointer + inptr = 0; + +// signal the caller there is filterlen/2 samples ready + if (pass) return 0; + + return filterlen_div2; +} + +void fftfilt::create_filter(double f1, double f2) +{ + int len = filterlen / 2 + 1; + double t, h, x, it; + Cfft *tmpfft; + tmpfft = new Cfft(filterlen); + +// initialize the filter to zero + for (int i = 0; i < filterlen; i++) + filter[i].re = filter[i].im = 0.0; + +// create the filter shape coefficients by fft +// filter values initialized to the impulse response h(t) + for (int i = 0; i < len; i++) { + it = (double) i; + t = it - (len - 1) / 2.0; + h = it / (len - 1); + + x = f2 * sinc(2 * f2 * t) - f1 * sinc(2 * f1 * t); // sinc(x) +// x *= hamming(t); +// x *= hanning(h); + x *= blackman(h); // windowed by Blackman function + x *= filterlen; // scaled for unity in passband + filter[i].re = x; + } +// perform the complex forward fft to obtain H(w) + tmpfft->cdft(filter); +// start outputs after 2 full passes are complete + pass = 2; + delete tmpfft; +} + +void fftfilt::create_lpf(double f) +{ + int len = filterlen / 2 + 1; + double t, h, x, it; + Cfft *tmpfft; + tmpfft = new Cfft(filterlen); + +// initialize the filter to zero + for (int i = 0; i < filterlen; i++) + filter[i].re = filter[i].im = 0.0; + +// create the filter shape coefficients by fft +// filter values initialized to the impulse response h(t) + for (int i = 0; i < len; i++) { + it = (double) i; + t = it - (len - 1) / 2.0; + h = it / (len - 1); + + x = f * sinc(2 * f * t); + x *= blackman(h); // windowed by Blackman function + x *= filterlen; // scaled for unity in passband + filter[i].re = x; + } +// perform the complex forward fft to obtain H(w) + tmpfft->cdft(filter); +// start outputs after 2 full passes are complete + pass = 2; + delete tmpfft; +} + +//bool print_filter = true; // flag to inhibit printing multiple copies + +void fftfilt::create_rttyfilt(double f) +{ + int len = filterlen / 2 + 1; + double t, h, it; + Cfft *tmpfft; + tmpfft = new Cfft(filterlen); + + // initialize the filter to zero + for (int i = 0; i < filterlen; i++) + filter[i].re = filter[i].im = 0.0; + + // get an array to hold the sinc-respose + double* sinc_array = new double[ len ]; + + // create the impulse-response in it + for (int i = 0; i < len; ++i) { + it = (double)i; + t = it - ( (double)len - 1.0) / 2.0; + h = it / ( (double)len - 1.0); + + // create the filter impulses with an additional zero at 1.5f + // remark: sinc(..) is scaled by 2, see misc.h + +// Modified Lanzcos filter see http://en.wikipedia.org/wiki/Lanczos_resampling + sinc_array[i] = + ( sinc( 3.0 * f * t ) + + sinc( 3.0 * f * t - 1.0 ) * 0.8 + + sinc( 3.0 * f * t + 1.0 ) * 0.8 ) * + ( sinc( 4.0 * f * t / 3.0 ) + + sinc( 4.0 * f * t / 3.0 - 1.0 ) * 0.8 + + sinc( 4.0 * f * t / 3.0 + 1.0 ) * 0.8 ); + } + + // normalize the impulse-responses + double sum = 0.0; + for (int i = 0; i < len; ++i) { + sum += sinc_array[i]; + } + for (int i = 0; i < len; ++i) { + sinc_array[i] /= 8*sum; + } + + // setup windowed-filter + for (int i = 0; i < len; ++i) { + it = (double)i; + t = it - ( (double)len - 1.0) / 2.0; + h = it / ( (double)len - 1.0); + + filter[i].re = ( sinc_array[i] ) * (double)filterlen * blackman(h); + sinc_array[i] = filter[i].re; + } + +/* +// create an identical filter impulse response for testing +// ht_B should be identical to ht_A within limits of math processing +// Hw is the frequency response of filter created using ht_A impulse +// response + Cfft test_fft(filterlen); + complex ht_A[filterlen]; // original impulse response + complex ht_B[filterlen]; // computed impulse response + complex Hw[filterlen]; // computed H(w) + +// ht_A retains the original normalized impulse response +// ht_B used for forward / reverse FFT + for (int i = 0; i < len; ++i) + ht_B[i] = ht_A[i] = filter[i]; + +// perform the complex forward fft to obtain H(w) + test_fft.cdft(ht_B); + for (int i = 0; i < len; ++i) + Hw[i] = ht_B[i]; + +// perform the complex reverse fft to obtain h(t) again + test_fft.icdft(ht_B); + +// ht_B should be equal to ht_A + std::fstream file1("filter_debug.csv", std::ios::out ); + for (int i = 0; i < len; ++i) + file1 << ht_A[i].re << "," << ht_A[i].im << "," << + ht_B[i].re << "," << ht_B[i].im << "," << + Hw[i].re << "," << Hw[i].im << "," << Hw[i].mag() << "\n"; + file1.close(); +*/ + +// perform the complex forward fft to obtain H(w) + tmpfft->cdft(filter); +/* + if (print_filter) { + std::fstream file2("filter_response.csv", std::ios::out ); + file2 << "Modified Lanzcos 1.5 stop bit filter\n\n"; + file2 << "h(t), |H(w)|, dB\n\n"; + double dc = 20*log10(filter[0].mag()); + for (int i = 0; i < len; i++) + file2 << sinc_array[i] << "," << filter[i].mag() << "," + 20*log10(filter[i].mag()) - dc << "\n"; + file2.close(); + print_filter = false; + } +*/ + +// start outputs after 2 full passes are complete + pass = 2; + delete tmpfft; + delete [] sinc_array; + +} + +double xrcos(double t, double T, int order, double alpha = 1) +{ + if (order == 1) return rcos(t, T, alpha); + order--; + return xrcos(2*t - T/2, T, order, alpha) + xrcos(2*t + T/2, T, order, alpha); +} + +double stefan(double t, double T) +{ +// Stefan implementation + double a=.7; + double h = rcos( t , T/4.0, a ); + h += rcos( t - T/4.0, T/4.0, a ); + h += rcos( t + T/4.0, T/4.0, a ); + return h; +} + +double matched(double t, double T) +{ + if (t > -T/2 && t < T/2) return 1; + return 0; +} + +double sinc_filter(double t, double T) +{ + return sinc(t / T); +} + +void fftfilt::rtty_order(double f, int N, double twarp, double alpha) +{ + int len = filterlen / 2 + 1; + double ft; + Cfft tmpfft(filterlen); + + // create the impulse-response + for (int i = 0; i < filterlen; ++i) { + if (i > len) { + ht[i].re = ht[i].im = 0.0; + continue; + } + ft = f * (1.0* i - len / 2.0); + switch(N) { + default: + case 0: + ft *= twarp; // compromise filter CPFSK vs SHAPED_AFSK + ht[i] = xrcos( ft, 1.0, 1, alpha); + break; + case 1: + ft *= 1.1; + ht[i] = xrcos( ft, 1.0, 2, alpha ); + break; + case 2: +// ft *= 1.0; + ht[i] = xrcos( ft, 1.0, 3, alpha ); + break; + case 3: + ft *= 1.5; + ht[i] = rcos( ft, 1.0 ); + break; + case 4: + ft *= (1.0 + M_PI/2.0); + ht[i] = rcos( ft - 0.5, 1.0 ); + ht[i] += rcos( ft + 0.5, 1.0 ); + break; + case 5: + ft *= (3.0 + M_PI/2.0); + ht[i] = rcos( ft - 1.5, 1.0 ); + ht[i] += rcos( ft - 0.5, 1.0 ); + ht[i] += rcos( ft + 0.5, 1.0 ); + ht[i] += rcos( ft + 1.5, 1.0 ); + break; + case 6: + ft *= M_PI / 2.0; + ht[i] = sinc_filter(ft, 1.0 ); + break; + case 7: + ft *= (2.0 + M_PI/2.0); + ht[i] = rcos( ft - 1.0, 1.0 ); + ht[i] += rcos( ft, 1.0 ); + ht[i] += rcos( ft + 1.0, 1.0 ); + break; + case 8: +// ft *= 1.0+0.57079/10.0E10; // simulating inf + ht[i] = matched(ft, 1.0); + break; + } + } + +// normalize the impulse-response + double sum = 0.0; + for (int i = 0; i <= len; ++i) { + sum += ht[i].re; + } + for (int i = 0; i < filterlen; ++i) { + ht[i].re *= filterlen/sum; + filter[i] = ht[i]; + } + +/* +// create an identical filter impulse response for testing +// ht_B should be identical to ht_A within limits of math processing +// Hw is the frequency response of filter created using ht_A impulse +// response + Cfft test_fft(filterlen); + complex ht_A[filterlen]; // original impulse response + complex ht_B[filterlen]; // computed impulse response + complex Hw[filterlen]; // computed H(w) + +// ht_A retains the original normalized impulse response +// ht_B used for forward / reverse FFT + for (int i = 0; i < filterlen; i++) + ht_B[i] = ht_A[i] = filter[i]; + +// perform the complex forward fft to obtain H(w) + test_fft.cdft(ht_B); + for (int i = 0; i < filterlen; i++) + Hw[i] = ht_B[i]; + +// perform the complex reverse fft to obtain h(t) again + test_fft.icdft(ht_B); + +// ht_B should be equal to ht_A + std::fstream file1("filter_debug.csv", std::ios::out ); + for (int i = 0; i < filterlen; i++)//len; ++i) + file1 << ht_A[i].re << "," << ht_B[i].re << "," + << ht_A[i].re - ht_B[i].re << "," + << Hw[i].mag() << "\n"; + file1.close(); +*/ + +// perform the complex forward fft to obtain H(w) +// tmpfft->cdft(filter); + tmpfft.cdft(filter); + +// start outputs after 2 full passes are complete + pass = 2; +// delete tmpfft; + +// Stefan's latest + + f*=1.275; // This factor is ominous to me. I can't explain it. It shouldn't + // be there. But if I leave it out ht(f) differs inbetween the + // raised cosine from above and this one. And if left out the error + // rate increases... So, this is an unsolved mystery for now. + + for( int i = 0; i < filterlen/2; ++i ) { + double a = 1.0; + double x = (double)i/(double)(filterlen/2); + + // raised cosine response (changed for -1.0...+1.0 times Nyquist-f + // instead of books versions ranging from -1..+1 times samplerate) + + double ht = + fabs(x) <= (1.0 - a)/(1.0/f) ? 1.0: + fabs(x) > (1.0 + a)/(1.0/f) ? 0.0: + cos(M_PI/(f*4.0*a)*(fabs(x)-(1.0-a)/(1.0/f))); + ht *= ht; // cos^2 + + // equalized nyquist-channel response + double eq = 1.0/sinc((double)i*f*2); + + // compensate for "awkward" FFT-implementation. For every other imple- + // mentation of a FFT this would have been just... + + filter[i].re = eq*ht*sin((double)i* - 0.5*M_PI); + filter[i].im = eq*ht*cos((double)i* - 0.5*M_PI); + + filter[(filterlen-i)%filterlen].re = eq*ht*sin((double)i*+0.5*M_PI); + filter[(filterlen-i)%filterlen].im = eq*ht*cos((double)i*+0.5*M_PI); + + // ... this (caused most headache): + //filter[i].re = eq*ht*0.7071; + //filter[i].im = eq*ht*0.7071; + //filter[(filterlen-i)%filterlen].re = eq*ht*0.7071; + //filter[(filterlen-i)%filterlen].im = eq*ht*0.7071; + + } +} diff --git a/src/fftfilt.h b/src/fftfilt.h new file mode 100644 index 0000000..83f2e7f --- /dev/null +++ b/src/fftfilt.h @@ -0,0 +1,39 @@ +/* + * fftfilt.h -- Fast convolution FIR filter +*/ + +#ifndef _FFTFILT_H +#define _FFTFILT_H + +#include "complex.h" +#include "fft.h" + +//---------------------------------------------------------------------- + +class fftfilt { +enum {NONE, BLACKMAN, HAMMING, HANNING}; + +protected: + int filterlen; + Cfft *fft; + Cfft *ift; + complex *filter; + complex *filtdata; + complex *ovlbuf; + complex *ht; + int inptr; + int pass; + int window; +public: + fftfilt(double f1, double f2, int len); + fftfilt(double f, int len); + ~fftfilt(); + void create_filter(double f1, double f2); + void create_lpf(double f); + void create_rttyfilt(double f); + void rtty_order(double, int, double twarp = 1.275, double alpha = 1.0); + + int run(const complex& in, complex **out); +}; + +#endif diff --git a/src/initl.c b/src/initl.cxx similarity index 97% rename from src/initl.c rename to src/initl.cxx index a5c4143..48a0b04 100644 --- a/src/initl.c +++ b/src/initl.cxx @@ -22,17 +22,6 @@ #include "bmorse.h" -/* Common Block Declarations */ - - - - - -struct { - integer itext[200]; -} blktxt_; - -#define blktxt_1 blktxt_ /* Initialized data */ @@ -74,6 +63,7 @@ struct BLKELM blkelm = { 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, @@ -205,7 +195,13 @@ struct BLKMEM blkmem = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; struct BLKS blks = { 1, 1, 0, 0, 0, 0 }; +/* Initialized data */ +struct BLKSV blksv = { .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, + .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 */ diff --git a/src/inputl.c b/src/inputl.c deleted file mode 100644 index 5ae8840..0000000 --- a/src/inputl.c +++ /dev/null @@ -1,127 +0,0 @@ -// ---------------------------------------------------------------------------- -// inputl.c -- bayesian morse code decoder -// -// Copyright (C) 2012-2014 -// (C) Mauri Niininen, AG1LE -// -// This file is part of Bayesian Morse code decoder - -// bmorse is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// bmorse is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with bmorse. If not, see . -// --------------------------------------------------------------------------- - -#include "bmorse.h" -#include - -/* Common Block Declarations */ - -struct blk1_1_ { - real tau; -}; - -#define blk1_1 (*(struct blk1_1_ *) &blk1_) - -struct blk6_1_ { - real dmean, xdur, esep[6], edev[6]; -}; - -#define blk6_1 (*(struct blk6_1_ *) &blk6_) - -struct { - real wc, wchirp, asigma, bsigma, phisgm, rsigm, tchirp, gamm; -} blk2_; - -#define blk2_1 blk2_ - -/* Initialized data */ - -struct { - real e_1; - } blk1_ = { 1.25e-4f }; - -struct { - integer fill_1[1]; - real e_2[13]; - } blk6_ = { {0}, 0.f, 1.f, 3.f, 1.f, 3.f, 7.f, 14.f, 0.f, 0.f, 0.f, 0.f, - 0.f, 0.f }; - - -/* Subroutine */ int inputl_(void) -{ - /* Format strings */ -/* static char fmt_100[] = "(1x,\002INPUT KEYING PARMS: RATE,MEAN ELEM DURA" - "TIONS\002)"; - static char fmt_150[] = "(1x,\002INPUT ELEM DURATION STD OEVIATIONS\002)"; - static char fmt_300[] = "(1x,\002INPUT SIG PARMS- AVAR,BVAR,FCHIRP,TCHIR" - "P,PHIVAR\002)"; - static char fmt_400[] = "(1x,\002INPUT SIG PARMS: GAMMA,FREQ,NOISE\002)"; -*/ - /* Builtin functions */ -// integer s_wsfe(cilist *), e_wsfe(void); -// double sqrt(doublereal); - - /* Local variables */ - static real fc, rc, avar, bvar, rate, fchirp, phivar, rnoise; - - /* Fortran I/O blocks */ - /* static cilist io___1 = { 0, 6, 0, fmt_100, 0 }; - static cilist io___2 = { 0, 6, 0, fmt_150, 0 }; - static cilist io___3 = { 0, 6, 0, fmt_300, 0 }; - static cilist io___4 = { 0, 6, 0, fmt_400, 0 }; -*/ - - goto L600; -// s_wsfe(&io___1); -// e_wsfe(); -/* READ 200,RATE,(ESEP(K), K=1,6) */ -// s_wsfe(&io___2); -// e_wsfe(); -/* READ 200,(EDEV(K),K=1,6) */ -/* L200: */ -// s_wsfe(&io___3); -// e_wsfe(); -/* READ 210,AVAR,BVAR,FCHIRP,TCHIRP,PHIVAR */ -/* L210: */ -// s_wsfe(&io___4); -// e_wsfe(); -/* READ 220, GAMM,FC,RNOISE */ -/* L220: */ -L600: -/* ADDED BY MAURI */ - avar = 4.f; - bvar = 4.f; - rate = 25.f; - fc = 4e3f; - fchirp = 20.f; - rnoise = 4.f; - phivar = 4.f; - blk2_1.tchirp = 2.f; - blk2_1.gamm = 1.f; - blk2_1.asigma = sqrt(avar); - blk2_1.bsigma = sqrt(bvar); - blk2_1.phisgm = sqrt(phivar); - blk2_1.rsigm = sqrt(rnoise); - blk6_1.dmean = 1200.f / rate; - rc = fc * 6.28319f; - blk2_1.wchirp = fchirp * 6.2831f; -/* IF (ESEP(1).NE.0.) GO TO 500 */ - blk6_1.esep[0] = 1.f; - blk6_1.esep[1] = 3.f; - blk6_1.esep[2] = 1.f; - blk6_1.esep[3] = 3.f; - blk6_1.esep[4] = 7.f; - blk6_1.esep[5] = 14.f; -/* L500: */ - return 0; -} /* inputl_ */ - diff --git a/src/kalfil.c b/src/kalfil.cxx similarity index 79% rename from src/kalfil.c rename to src/kalfil.cxx index 6559a2e..881dae2 100644 --- a/src/kalfil.c +++ b/src/kalfil.cxx @@ -22,14 +22,7 @@ #include "bmorse.h" #include - - -/* Initialized data */ - -struct BLKSV blksv = { .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, - .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 }; +#include int kalfil_(real *z, integer *ip, real *rn, integer *ilx, @@ -46,8 +39,7 @@ int kalfil_(real *z, integer *ip, real *rn, integer *ilx, /* Local variables */ - static real a, g, qa, hz, pz, zr, phi, pkk, ykk, expa, pest; - extern /* Subroutine */ int model_(real *, integer *, integer *, integer *, integer *, real *, real *, real *); + static real a, g, qa, hz, pz, zr, phi, pkk, ykk, pest; static real ppred, ypred, pzinv; @@ -69,20 +61,17 @@ int kalfil_(real *z, integer *ip, real *rn, integer *ilx, /* SUBROUTINES USED */ /* MODEL - OBTAINS THE SIGNAL-STATE-DEPENDENT LINEAR */ -/* MODEL FOR THE KALMAN FILTER RECURSIONS */ +/* MODEL FOR THE KALMAN FILTER RECURSIONS */ /* IF TRANSITION PROBABILITY IS VERY SMALL, DON'T */ /* BOTHER WITH LIKELIHOOD CALCULATION: */ - if (*pin > pinmin) { - goto L100; + if (*pin <= pinmin) { + *lkhdj = 0.f; + return 0; } - *lkhdj = 0.f; - goto L400; /* OBTAIN STATE-DEPENDENT MODEL PARAMETERS: */ - -L100: model_(dur, kelem, ilrate, israte, ixs, &phi, &qa, &hz); /* GET PREVIOUS ESTIMATES FOR PATH IP */ @@ -102,21 +91,17 @@ L100: blksv.ykksv[*jnode - 1] = ypred + g * zr; blksv.pkksv[*jnode - 1] = pest; if (blksv.ykksv[*jnode - 1] <= .01f) { - blksv.ykksv[*jnode - 1] = .01f; + blksv.ykksv[*jnode - 1] = .01f; } /* Computing 2nd power */ r1 = zr; a = pzinv * .5f * (r1 * r1); - if (a <= 1e3f) { - goto L200; + if (a > 1e3f) { + *lkhdj = 0.; + return 0; } - *lkhdj = 0.f; - goto L400; -L200: - expa = exp(-a); *lkhdj = 1.f / sqrt(pz) * exp(-a); - goto L400; -L400: + // printf("\nz:%f a:%f lkhdj:%f israte:%d ilrate:%d dur:%f",*z,a,*lkhdj,*israte,*ilrate,*dur); return 0; } /* kalfil_ */ diff --git a/src/key.c b/src/key.cxx similarity index 100% rename from src/key.c rename to src/key.cxx diff --git a/src/likhd.c b/src/likhd.cxx similarity index 94% rename from src/likhd.c rename to src/likhd.cxx index a7957d0..5f2323c 100644 --- a/src/likhd.c +++ b/src/likhd.cxx @@ -33,9 +33,7 @@ int likhd_(real *z, real *rn, integer *ip, integer *lambda, static integer ilx, ixs; static real lkhdj; static integer kelem; - extern /* Subroutine */ int kalfil_(real *, integer *, real *, integer *, - integer *, integer *, integer *, integer *, real *, integer *, - real *, real *); + static integer israte; diff --git a/src/misc.cxx b/src/misc.cxx new file mode 100644 index 0000000..c86541e --- /dev/null +++ b/src/misc.cxx @@ -0,0 +1,202 @@ +// ---------------------------------------------------------------------------- +// misc.cxx -- Miscellaneous helper functions +// +// Copyright (C) 2006-2007 +// Dave Freese, W1HKJ +// +// This file is part of fldigi. These filters were adapted from code contained +// in the gmfsk source code distribution. +// +// Fldigi is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Fldigi is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with fldigi. If not, see . +// ---------------------------------------------------------------------------- + +#include + +#include "misc.h" +#include + +// ---------------------------------------------------------------------------- + +/* + * Hamming weight (number of bits that are ones). + */ +unsigned long hweight32(unsigned long w) +{ + w = (w & 0x55555555) + ((w >> 1) & 0x55555555); + w = (w & 0x33333333) + ((w >> 2) & 0x33333333); + w = (w & 0x0F0F0F0F) + ((w >> 4) & 0x0F0F0F0F); + w = (w & 0x00FF00FF) + ((w >> 8) & 0x00FF00FF); + w = (w & 0x0000FFFF) + ((w >> 16) & 0x0000FFFF); + return w; +} + +unsigned short int hweight16(unsigned short int w) +{ + w = (w & 0x5555) + ((w >> 1) & 0x5555); + w = (w & 0x3333) + ((w >> 2) & 0x3333); + w = (w & 0x0F0F) + ((w >> 4) & 0x0F0F); + w = (w & 0x00FF) + ((w >> 8) & 0x00FF); + return w; +} + +unsigned char hweight8(unsigned char w) +{ + w = (w & 0x55) + ((w >> 1) & 0x55); + w = (w & 0x33) + ((w >> 2) & 0x33); + w = (w & 0x0F) + ((w >> 4) & 0x0F); + return w; +} + +// ---------------------------------------------------------------------------- + +/* + * Parity function. Return one if `w' has odd number of ones, zero otherwise. + */ + +int parity(unsigned long w) +{ + return hweight32(w) & 1; +} + +// ---------------------------------------------------------------------------- + +/* + * Reverse order of bits. + */ +unsigned long rbits32(unsigned long w) +{ + w = ((w >> 1) & 0x55555555) | ((w << 1) & 0xAAAAAAAA); + w = ((w >> 2) & 0x33333333) | ((w << 2) & 0xCCCCCCCC); + w = ((w >> 4) & 0x0F0F0F0F) | ((w << 4) & 0xF0F0F0F0); + w = ((w >> 8) & 0x00FF00FF) | ((w << 8) & 0xFF00FF00); + w = ((w >> 16) & 0x0000FFFF) | ((w << 16) & 0xFFFF0000); + return w; +} + +unsigned short int rbits16(unsigned short int w) +{ + w = ((w >> 1) & 0x5555) | ((w << 1) & 0xAAAA); + w = ((w >> 2) & 0x3333) | ((w << 2) & 0xCCCC); + w = ((w >> 4) & 0x0F0F) | ((w << 4) & 0xF0F0); + w = ((w >> 8) & 0x00FF) | ((w << 8) & 0xFF00); + return w; +} + +unsigned char rbits8(unsigned char w) +{ + w = ((w >> 1) & 0x55) | ((w << 1) & 0xFF); + w = ((w >> 2) & 0x33) | ((w << 2) & 0xCC); + w = ((w >> 4) & 0x0F) | ((w << 4) & 0xF0); + return w; +} + +// ---------------------------------------------------------------------------- + +// Integer base-2 logarithm + +unsigned int log2u(unsigned int x) +{ + int y = 0; + x >>= 1; + while (x) { + x >>= 1; + y++; + } + return y; +} + +// ---------------------------------------------------------------------------- + +// Gray encoding and decoding (8 bit) + +unsigned char grayencode(unsigned char data) +//unsigned char graydecode(unsigned char data) +{ + unsigned char bits = data; + + bits ^= data >> 1; + bits ^= data >> 2; + bits ^= data >> 3; + bits ^= data >> 4; + bits ^= data >> 5; + bits ^= data >> 6; + bits ^= data >> 7; + + return bits; +} + +unsigned char graydecode(unsigned char data) +//unsigned char grayencode(unsigned char data) +{ + return data ^ (data >> 1); +} + +// ---------------------------------------------------------------------------- + +// Rectangular - no pre filtering of data array +void RectWindow(double *array, int n) { + for (int i = 0; i < n; i++) + array[i] = 1.0; +} + +// Hamming - used by gmfsk +void HammingWindow(double *array, int n) { + double pwr = 0.0; + for (int i = 0; i < n; i++) { + array[i] = hamming((double)i/(double)n); + pwr += array[i] * array[i]; + } + pwr = sqrt((double)n/pwr); + for (int i = 0; i < n; i++) + array[i] *= pwr; +} + +// Hanning - used by winpsk +void HanningWindow(double *array, int n) { + double pwr = 0.0; + for (int i = 0; i < n; i++) { + array[i] = hanning((double)i/(double)n); + pwr += array[i] * array[i]; + } + pwr = sqrt((double)n/pwr); + for (int i = 0; i < n; i++) + array[i] *= pwr; +} + +// Best lob suppression - least in band ripple +void BlackmanWindow(double *array, int n) { + double pwr = 0.0; + for (int i = 0; i < n; i++) { + array[i] = blackman((double)i/(double)n); + pwr += array[i] * array[i]; + } + pwr = sqrt((double)n/pwr); + for (int i = 0; i < n; i++) + array[i] *= pwr; +} + +// Simple about effective as Hamming or Hanning +void TriangularWindow(double *array, int n) { + double pwr = 0.0; + for (int i = 0; i < n; i++) array[i] = 1.0; + for (int i = 0; i < n / 4; i++) { + array[i] = 4.0 * (double)i / (double)n; + array[n-i] = array[i]; + } + for (int i = 0; i < n; i++) pwr += array[i] * array[i]; + pwr = sqrt((double)n/pwr); + for (int i = 0; i < n; i++) + array[i] *= pwr; +} + diff --git a/src/misc.h b/src/misc.h new file mode 100644 index 0000000..f9da93a --- /dev/null +++ b/src/misc.h @@ -0,0 +1,106 @@ +// ---------------------------------------------------------------------------- +// misc.h -- Miscellaneous helper functions +// +// Copyright (C) 2006-2008 +// Dave Freese, W1HKJ +// +// This file is part of fldigi. These filters were adapted from code contained +// in the gmfsk source code distribution. +// +// Fldigi is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Fldigi is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with fldigi. If not, see . +// ---------------------------------------------------------------------------- + +#ifndef _MISC_H +#define _MISC_H + +#include + +extern unsigned long hweight32(unsigned long w); +extern unsigned short int hweight16(unsigned short int w); +extern unsigned char hweight8(unsigned char w); +extern int parity(unsigned long w); +extern unsigned long rbits32(unsigned long w); +extern unsigned short int rbits16(unsigned short int w); +extern unsigned char rbits8(unsigned char w); + +extern unsigned int log2u(unsigned int x); + +extern unsigned char graydecode(unsigned char data); +extern unsigned char grayencode(unsigned char data); +extern void MilliSleep(long msecs); + +inline double sinc(double x) +{ + return (fabs(x) < 1e-10) ? 1.0 : (sin(M_PI * x) / (M_PI * x)); +} + +inline double cosc(double x) +{ + return (fabs(x) < 1e-10) ? 0.0 : ((1.0 - cos(M_PI * x)) / (M_PI * x)); +} + +inline double clamp(double x, double min, double max) +{ + return (x < min) ? min : ((x > max) ? max : x); +} + +inline double decayavg(double average, double input, double weight) +{ + if (weight <= 1.0) return input; + return input * (1.0 / weight) + average * (1.0 - (1.0 / weight)); +} + +// following are defined inline to provide best performance + +inline double rect(double x) +{ + return 1.0; +} + +inline double blackman(double x) +{ + return (0.42 - 0.50 * cos(2 * M_PI * x) + 0.08 * cos(4 * M_PI * x)); +} + +inline double hamming(double x) +{ + return 0.54 - 0.46 * cos(2 * M_PI * x); +} + +inline double hanning(double x) +{ + return 0.5 - 0.5 * cos(2 * M_PI * x); +} + +inline double rcos( double t, double T, double alpha=1.0 ) +{ + if( t == 0 ) return 1.0; + if( fabs(t) == ( T/(2.0*alpha) ) ) return ((alpha/2.0) * sin(M_PI/(2.0*alpha))); + return sin(M_PI*t/T)/(M_PI*t/T)*cos(alpha*M_PI*t/T)/(1.0-(2.0*alpha*t/T)*(2.0*alpha*t/T)); +} + +// Rectangular - no pre filtering of data array +void RectWindow(double *array, int n); +// Hamming - used by gmfsk +void HammingWindow(double *array, int n); +// Hanning - used by winpsk +void HanningWindow(double *array, int n); +// Best lob suppression - least in band ripple +void BlackmanWindow(double *array, int n); +// Simple about effective as Hamming or Hanning +void TriangularWindow(double *array, int n); + +#define fftabs(a,b) sqrt((a)*(a) + (b)*(b)) + +#endif diff --git a/src/model.c b/src/model.cxx similarity index 84% rename from src/model.c rename to src/model.cxx index 47289f7..d9207d1 100644 --- a/src/model.c +++ b/src/model.cxx @@ -30,7 +30,7 @@ static doublereal c_b5 = 10.; -/* Subroutine */ int model_(real *dur, integer *ielm, integer *ilr, integer * +int model_(real *dur, integer *ielm, integer *ilr, integer * isr, integer *ixs, real *phi, real *qa, real *hz) { /* System generated locals */ @@ -65,32 +65,29 @@ static doublereal c_b5 = 10.; r1 = 1200.f / *ilr; bauds = *dur / r1; if (bauds >= 14.f) { - bauds = 14.f; + bauds = 14.f; } - if (*ielm >= 3) { - goto L100; + if (*ielm < 3) { + *qa = 1e-4f; + *phi = 1.f; + return 0; } - *qa = 1e-4f; - *phi = 1.f; - goto L300; -L100: - if (*ixs == 0) { - goto L200; + + if (*ixs != 0) { + *phi = 1.f; + *qa = exp((bauds - 14.f) * .6f) * .15f; + *qa += bauds * .01f * exp((1.f - bauds) * .2f); + return 0; } - *phi = 1.f; - *qa = exp((bauds - 14.f) * .6f) * .15f; - *qa += bauds * .01f * exp((1.f - bauds) * .2f); - goto L300; -L200: + xsamp = r1 * 22.4f; d1 = (doublereal) (-2 / xsamp); -// *phi = pow_dd(&c_b5, &d1); *phi = pow(10.0, d1); + if (bauds >= 14.f) { - *phi = 1.f; + *phi = 1.f; } *qa = 0.f; -L300: return 0; } /* model_ */ diff --git a/src/noise.c b/src/noise.cxx similarity index 98% rename from src/noise.c rename to src/noise.cxx index 260fa5e..d07b7c1 100644 --- a/src/noise.c +++ b/src/noise.cxx @@ -56,7 +56,7 @@ int noise_(double zin, real *rn, real *z) /* Local variables */ static integer i; - static real fs, ymin; + static real ymin; /* THIS SUBROUTINE ESTIMATES THE NOISE POWER IN THE */ @@ -70,7 +70,7 @@ int noise_(double zin, real *rn, real *z) if (kl == 201) { kl = 1; } - fs = (real) (ks + 1); + ++ks; if (ks == 51) { ks = 1; } diff --git a/src/path.c b/src/path.cxx similarity index 100% rename from src/path.c rename to src/path.cxx diff --git a/src/probp.c b/src/probp.cxx similarity index 100% rename from src/probp.c rename to src/probp.cxx diff --git a/src/proces.c b/src/proces.cxx similarity index 98% rename from src/proces.c rename to src/proces.cxx index 33f2d7b..8a3c452 100644 --- a/src/proces.c +++ b/src/proces.cxx @@ -22,8 +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 proces_(real *z, real *rn, integer *xhat, real *px, integer *elmhat, real *spdhat, integer *imax, real * pmax, int spd) { /* Initialized data */ @@ -101,7 +100,7 @@ int proces_(real *z, real *rn, integer *xhat, real *px, integer *elmhat, real * for(i=0;i<25;i++) { lambda[i] = 5; ilrate[i]= ((i/5+1)*10); - dur[i]=1e3f; + dur[i]=9e3f; pathsv[i]=5; } for(i=0;i<750;i++) { diff --git a/src/ptrans.c b/src/ptrans.cxx similarity index 100% rename from src/ptrans.c rename to src/ptrans.cxx diff --git a/src/savep.c b/src/savep.cxx similarity index 100% rename from src/savep.c rename to src/savep.cxx diff --git a/src/simsgi.c b/src/simsgi.c deleted file mode 100644 index 23b137e..0000000 --- a/src/simsgi.c +++ /dev/null @@ -1,95 +0,0 @@ -// ---------------------------------------------------------------------------- -// simsgi.c -- bayesian morse code decoder -// -// Copyright (C) 2012-2014 -// (C) Mauri Niininen, AG1LE -// -// This file is part of Bayesian Morse code decoder - -// bmorse is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// bmorse is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with bmorse. If not, see . -// ---------------------------------------------------------------------------- - - -#include "f2c.h" - -/* Common Block Declarations */ - -struct { - real tau; -} blk1_; - -#define blk1_1 blk1_ - -struct { - real wc, wchirp, asigma, bsigma, phismg, rsigm, tchirp, gamm; -} blk2_; - -#define blk2_1 blk2_ - -/* Table of constant values */ - -static real c_b2 = 6.28319f; - -/* Subroutine */ int simsgi_(real *x, real *sig) -{ - /* Initialized data */ - - static real xlast = 1.f; - static real beta = 1.f; - static real amp = 1.f; - static real bfade = 0.f; - static real theta = 1.f; - static real phi = 1.f; - - /* Builtin functions */ - double exp(doublereal), r_mod(real *, real *), sin(doublereal); - - /* Local variables */ - static real w; - static integer nc; - static real tk; - extern /* Subroutine */ int key_(real *, real *); - static real dur, ampb, tdur, wchrp; - - dur = beta; - key_(&dur, x); - beta = beta * (1.f - *x - xlast + *x * 2.f * xlast) + 1.f; - tk = *x * (1.f - xlast); - xlast = *x; -/* CALL RANDN(W,1,0.,ASIGMA) */ - amp += tk * w; - if (amp < .01f) { - amp = .01f; - } -/* CALL RANDN(W,1,0.,BSIGMA) */ - bfade = blk2_1.gamm * bfade + w; - ampb = amp + bfade; - if (ampb < .001f) { - bfade = .001f - amp; - } - ampb = amp + bfade; - tdur = blk1_1.tau * 1e3f * beta; - wchrp = *x * blk2_1.wchirp * exp(-tdur / blk2_1.tchirp); - theta += (nc + wchrp) * blk1_1.tau; - theta = r_mod(&theta, &c_b2); -/* CALL RANDN(W,1,0.,PHISGM) */ - phi += tk * w; - phi = r_mod(&phi, &c_b2); - *sig = *x * ampb * sin(theta + phi); -/* CALL RANDN(ZN,1,0.,RSIGM) */ -/* PRINT 100,DUR, X */ -/* 100 FORMAT('SIMSG:', 2(2X,F10.3)) */ - return 0; -} /* simsgi_ */ - diff --git a/src/spdtr.c b/src/spdtr.cxx similarity index 100% rename from src/spdtr.c rename to src/spdtr.cxx diff --git a/src/sprob.c b/src/sprob.cxx similarity index 99% rename from src/sprob.c rename to src/sprob.cxx index 1128983..af1ac3a 100644 --- a/src/sprob.c +++ b/src/sprob.cxx @@ -24,6 +24,7 @@ #include extern char debug; +extern PARAMS params; int sprob_(real *p, integer *isave, integer *ilrsav, real *pelm, integer *khat, real *spdhat, real *px) { diff --git a/src/stats.c b/src/stats.c deleted file mode 100644 index f43e13e..0000000 --- a/src/stats.c +++ /dev/null @@ -1,41 +0,0 @@ -// ---------------------------------------------------------------------------- -// stats.c -- bayesian morse code decoder -// -// Copyright (C) 2012-2014 -// (C) Mauri Niininen, AG1LE -// -// This file is part of Bayesian Morse code decoder - -// bmorse is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// bmorse is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with bmorse. If not, see . -// ---------------------------------------------------------------------------- - -#include "f2c.h" - -int stats_(real *xin1, real *xin2, real *xin3, real *xin4, - real *s1, real *s2, real *s3, real *s4, integer *n) -{ - /* Parameter adjustments */ - --s4; - --s3; - --s2; - --s1; - - /* Function Body */ - s1[*n] = *xin1; - s2[*n] = *xin2; - s3[*n] = *xin3; - s4[*n] = *xin4; - return 0; -} /* stats_ */ - diff --git a/src/transl.c b/src/transl.cxx similarity index 100% rename from src/transl.c rename to src/transl.cxx diff --git a/src/trelis.c b/src/trelis.cxx similarity index 95% rename from src/trelis.c rename to src/trelis.cxx index 2d5d099..f092b28 100644 --- a/src/trelis.c +++ b/src/trelis.cxx @@ -25,18 +25,6 @@ //#define DEBUG 1 -/* Common Block Declarations */ - -struct { - integer iend; -} blkend_; - -#define blkend_1 blkend_ - -/* Table of constant values */ - -static integer c__1 = 1; - int trelis_(integer *isave, integer *pathsv, integer *lambda, integer *imax, integer *ipmax) { @@ -59,6 +47,7 @@ int trelis_(integer *isave, integer *pathsv, integer *lambda, integer *imax, int static integer kd = 0; static integer ndelst = 0; static integer pthtrl[25*NDELAY]; /* was [200][25] */ + static integer iend = 0; /* System generated locals */ @@ -97,14 +86,13 @@ int trelis_(integer *isave, integer *pathsv, integer *lambda, integer *imax, int /* KEEP AVERAGE OF ISAVE, NDEL FOR DATA ANALYSIS: */ -/* CALL VISBUI('PSV', PATHSV) */ -/* CALL VISBUI('LBD', LAMBDA) */ + retstat = 1; ++ncall; - if (blkend_1.iend == 1) { + if (iend == 1) { isavg = xsavg; ndlavg = xdlavg; - blkend_1.iend = 0; + iend = 0; printf("\nAVG # OF PATHS SAVED:%4.2f,AVG DECODE DELAY:%4.2f)", xsavg, xdlavg); printf("\nPERCENT OF TIME PATHS = 25: %3.2f, PERCENT OF TIME DELAY = 200: %3.2f", xmmax, xnmax); } diff --git a/src/trprob.c b/src/trprob.cxx similarity index 93% rename from src/trprob.c rename to src/trprob.cxx index 3632bbe..4fa0c73 100644 --- a/src/trprob.c +++ b/src/trprob.cxx @@ -29,9 +29,7 @@ int trprob_(integer *ip, integer *lambda, real *dur, integer *ilrate, real *p) static integer kelm; static real psum, ptrx; static integer ielem, irate; - extern /* Subroutine */ int ptrans_(integer *, integer *, integer *, - integer *, real *, real *, real *, integer *); - extern doublereal xtrans_(integer *, real *, integer *); + /* THIS SUBROUTINE COMPUTES THE TRANSITION PROBABILITY */ diff --git a/src/window.c b/src/window.cxx similarity index 100% rename from src/window.c rename to src/window.cxx diff --git a/src/xtrans.c b/src/xtrans.cxx similarity index 97% rename from src/xtrans.c rename to src/xtrans.cxx index fcfffba..661a7cb 100644 --- a/src/xtrans.c +++ b/src/xtrans.cxx @@ -33,8 +33,6 @@ doublereal xtrans_(integer *ielem, real *d0, integer *irate) /* System generated locals */ real ret_val; - /* Builtin functions */ - double exp(doublereal); /* Local variables */ static real b0, b1, p0, p1, alpha;