Merge remote-tracking branch 'origin/master' into code_quality

This commit is contained in:
Charles J. Cliffe
2019-04-10 22:24:11 -04:00
13 changed files with 3341 additions and 3107 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+187 -59
View File
@@ -4825,6 +4825,56 @@ void bpacketsync_execute_sym(bpacketsync _q,
void bpacketsync_execute_bit(bpacketsync _q,
unsigned char _bit);
//
// M-FSK frame generator
//
typedef struct fskframegen_s * fskframegen;
// create M-FSK frame generator
fskframegen fskframegen_create();
void fskframegen_destroy (fskframegen _fg);
void fskframegen_print (fskframegen _fg);
void fskframegen_reset (fskframegen _fg);
void fskframegen_assemble(fskframegen _fg,
unsigned char * _header,
unsigned char * _payload,
unsigned int _payload_len,
crc_scheme _check,
fec_scheme _fec0,
fec_scheme _fec1);
unsigned int fskframegen_getframelen(fskframegen _q);
int fskframegen_write_samples(fskframegen _fg,
liquid_float_complex * _buf,
unsigned int _buf_len);
//
// M-FSK frame synchronizer
//
typedef struct fskframesync_s * fskframesync;
// create M-FSK frame synchronizer
// _callback : callback function
// _userdata : user data pointer passed to callback function
fskframesync fskframesync_create(framesync_callback _callback,
void * _userdata);
void fskframesync_destroy(fskframesync _q);
void fskframesync_print (fskframesync _q);
void fskframesync_reset (fskframesync _q);
void fskframesync_execute(fskframesync _q,
liquid_float_complex _x);
void fskframesync_execute_block(fskframesync _q,
liquid_float_complex * _x,
unsigned int _n);
// debugging
void fskframesync_debug_enable (fskframesync _q);
void fskframesync_debug_disable(fskframesync _q);
void fskframesync_debug_export (fskframesync _q, const char * _filename);
//
// GMSK frame generator
//
@@ -6924,6 +6974,11 @@ unsigned int fskdem_demodulate(fskdem _q,
// get demodulator frequency error
float fskdem_get_frequency_error(fskdem _q);
// get energy for a particular symbol within a certain range
float fskdem_get_symbol_energy(fskdem _q,
unsigned int _s,
unsigned int _range);
//
// Analog frequency modulator
@@ -7229,6 +7284,75 @@ LIQUID_FIRPFBCH2_DEFINE_API(LIQUID_FIRPFBCH2_MANGLE_CRCF,
float,
liquid_float_complex)
//
// Finite impulse response polyphase filterbank channelizer
// with output rate Fs * P / M
//
#define LIQUID_FIRPFBCHR_MANGLE_CRCF(name) LIQUID_CONCAT(firpfbchr_crcf,name)
#define LIQUID_FIRPFBCHR_DEFINE_API(FIRPFBCHR,TO,TC,TI) \
typedef struct FIRPFBCHR(_s) * FIRPFBCHR(); \
\
/* create rational rate resampling channelizer (firpfbchr) object by */ \
/* specifying filter coefficients directly */ \
/* _M : number of output channels in chanelizer */ \
/* _P : output decimation factor (output rate is 1/P the input) */ \
/* _m : prototype filter semi-length, length=2*M*m */ \
/* _h : prototype filter coefficient array, [size: 2*M*m x 1] */ \
FIRPFBCHR() FIRPFBCHR(_create)(unsigned int _M, \
unsigned int _P, \
unsigned int _m, \
TC * _h); \
\
/* create rational rate resampling channelizer (firpfbchr) object by */ \
/* specifying filter design parameters for Kaiser prototype */ \
/* _M : number of output channels in chanelizer */ \
/* _P : output decimation factor (output rate is 1/P the input) */ \
/* _m : prototype filter semi-length, length=2*M*m */ \
/* _As : filter stop-band attenuation [dB] */ \
FIRPFBCHR() FIRPFBCHR(_create_kaiser)(unsigned int _M, \
unsigned int _P, \
unsigned int _m, \
float _As); \
\
/* destroy firpfbchr object, freeing internal memory */ \
void FIRPFBCHR(_destroy)(FIRPFBCHR() _q); \
\
/* reset firpfbchr object internal state and buffers */ \
void FIRPFBCHR(_reset)(FIRPFBCHR() _q); \
\
/* print firpfbchr object internals to stdout */ \
void FIRPFBCHR(_print)(FIRPFBCHR() _q); \
\
/* get number of output channels to channelizer */ \
unsigned int FIRPFBCHR(_get_M)(FIRPFBCHR() _q); \
\
/* get decimation factor for channelizer */ \
unsigned int FIRPFBCHR(_get_P)(FIRPFBCHR() _q); \
\
/* get semi-length to channelizer filter prototype */ \
unsigned int FIRPFBCHR(_get_m)(FIRPFBCHR() _q); \
\
/* push buffer of samples into filter bank */ \
/* _q : channelizer object */ \
/* _x : channelizer input [size: P x 1] */ \
void FIRPFBCHR(_push)(FIRPFBCHR() _q, \
TI * _x); \
\
/* execute filterbank channelizer, writing complex baseband samples for */ \
/* each channel into output array */ \
/* _q : channelizer object */ \
/* _y : channelizer output [size: _M x 1] */ \
void FIRPFBCHR(_execute)(FIRPFBCHR() _q, \
TO * _y); \
LIQUID_FIRPFBCHR_DEFINE_API(LIQUID_FIRPFBCHR_MANGLE_CRCF,
liquid_float_complex,
float,
liquid_float_complex)
#define OFDMFRAME_SCTYPE_NULL 0
@@ -8301,65 +8425,69 @@ void liquid_get_scale(float _val,
// VECTOR : name-mangling macro
// T : data type
// TP : data type (primitive)
#define LIQUID_VECTOR_DEFINE_API(VECTOR,T,TP) \
\
/* initialize vector with scalar: x[i] = c (scalar) */ \
void VECTOR(_init)(T _c, \
T * _x, \
unsigned int _n); \
\
/* add each element: z[i] = x[i] + y[i] */ \
void VECTOR(_add)(T * _x, \
T * _y, \
unsigned int _n, \
T * _z); \
/* add scalar to each element: y[i] = x[i] + c */ \
void VECTOR(_addscalar)(T * _x, \
unsigned int _n, \
T _c, \
T * _y); \
\
/* multiply each element: z[i] = x[i] * y[i] */ \
void VECTOR(_mul)(T * _x, \
T * _y, \
unsigned int _n, \
T * _z); \
/* multiply each element with scalar: y[i] = x[i] * c */ \
void VECTOR(_mulscalar)(T * _x, \
unsigned int _n, \
T _c, \
T * _y); \
\
/* compute complex phase rotation: x[i] = exp{j theta[i]} */ \
void VECTOR(_cexpj)(TP * _theta, \
unsigned int _n, \
T * _x); \
/* compute angle of each element: theta[i] = arg{ x[i] } */ \
void VECTOR(_carg)(T * _x, \
unsigned int _n, \
TP * _theta); \
/* compute absolute value of each element: y[i] = |x[i]| */ \
void VECTOR(_abs)(T * _x, \
unsigned int _n, \
TP * _y); \
\
/* compute sum of squares: sum{ |x|^2 } */ \
TP VECTOR(_sumsq)(T * _x, \
unsigned int _n); \
\
/* compute l-2 norm: sqrt{ sum{ |x|^2 } } */ \
TP VECTOR(_norm)(T * _x, \
unsigned int _n); \
\
/* compute l-p norm: { sum{ |x|^p } }^(1/p) */ \
TP VECTOR(_pnorm)(T * _x, \
unsigned int _n, \
TP _p); \
\
/* scale vector elements by l-2 norm: y[i] = x[i]/norm(x) */ \
void VECTOR(_normalize)(T * _x, \
unsigned int _n, \
T * _y); \
#define LIQUID_VECTOR_DEFINE_API(VECTOR,T,TP) \
\
/* Initialize vector with scalar: x[i] = c (scalar) */ \
void VECTOR(_init)(T _c, \
T * _x, \
unsigned int _n); \
\
/* Add each element pointwise: z[i] = x[i] + y[i] */ \
void VECTOR(_add)(T * _x, \
T * _y, \
unsigned int _n, \
T * _z); \
\
/* Add scalar to each element: y[i] = x[i] + c */ \
void VECTOR(_addscalar)(T * _x, \
unsigned int _n, \
T _c, \
T * _y); \
\
/* Multiply each element pointwise: z[i] = x[i] * y[i] */ \
void VECTOR(_mul)(T * _x, \
T * _y, \
unsigned int _n, \
T * _z); \
\
/* Multiply each element with scalar: y[i] = x[i] * c */ \
void VECTOR(_mulscalar)(T * _x, \
unsigned int _n, \
T _c, \
T * _y); \
\
/* Compute complex phase rotation: x[i] = exp{j theta[i]} */ \
void VECTOR(_cexpj)(TP * _theta, \
unsigned int _n, \
T * _x); \
\
/* Compute angle of each element: theta[i] = arg{ x[i] } */ \
void VECTOR(_carg)(T * _x, \
unsigned int _n, \
TP * _theta); \
\
/* Compute absolute value of each element: y[i] = |x[i]| */ \
void VECTOR(_abs)(T * _x, \
unsigned int _n, \
TP * _y); \
\
/* Compute sum of squares: sum{ |x|^2 } */ \
TP VECTOR(_sumsq)(T * _x, \
unsigned int _n); \
\
/* Compute l-2 norm: sqrt{ sum{ |x|^2 } } */ \
TP VECTOR(_norm)(T * _x, \
unsigned int _n); \
\
/* Compute l-p norm: { sum{ |x|^p } }^(1/p) */ \
TP VECTOR(_pnorm)(T * _x, \
unsigned int _n, \
TP _p); \
\
/* Scale vector elements by l-2 norm: y[i] = x[i]/norm(x) */ \
void VECTOR(_normalize)(T * _x, \
unsigned int _n, \
T * _y); \
LIQUID_VECTOR_DEFINE_API(LIQUID_VECTOR_MANGLE_RF, float, float)
LIQUID_VECTOR_DEFINE_API(LIQUID_VECTOR_MANGLE_CF, liquid_float_complex, float)
+28 -18
View File
@@ -22,22 +22,22 @@
# Makefile for liquid-dsp libraries
#
# Targets:
# all : dynamic shared-library object (e.g. libliquid.so)
# install : install the dynamic shared library object and headers
# uninstall : uninstall the library and header file(s)
# clean : clean all targets (bench, check, examples, etc)
# distclean : removes everything except the originally distributed files
# check : build and run autotest program
# bench : build and run benchmarking program
# examples : build all examples
# sandbox : build all sandbox examples
# world : build absolutely everything (but don't install)
# all : dynamic shared-library object (e.g. libliquid.so)
# install : install the dynamic shared library object and headers
# uninstall : uninstall the library and header file(s)
# clean : clean all targets (bench, check, examples, etc)
# distclean : removes everything except the originally distributed files
# check : build and run autotest program
# bench : build and run benchmarking program
# examples : build all examples
# sandbox : build all sandbox examples
# world : build absolutely everything (but don't install)
#
# clean-modules : clean all modules
# clean-examples : clean examples programs
# clean-sandbox : clean sandbox programs
# clean-check : clean autotest program
# clean-bench : clean benchmark program
# clean-modules : clean all modules
# clean-examples : clean examples programs
# clean-sandbox : clean sandbox programs
# clean-check : clean autotest program
# clean-bench : clean benchmark program
#
# autoconf initialization macros
@@ -63,14 +63,14 @@ LIBTOOL :=
RANLIB := ranlib
# flags
INCLUDE_CFLAGS = $(addprefix -I ,$(include_dirs))
INCLUDE_CFLAGS = $(addprefix -I,$(include_dirs))
#MINGW: optimizations goes here
CONFIG_CFLAGS = -m32 -O3 -msse3 -ffast-math
CPPFLAGS = $(INCLUDE_CFLAGS)
CFLAGS = $(CONFIG_CFLAGS) -Wall -fPIC
LDFLAGS =
#MINGW:
LIBS += -lmsvcrt
LIBS = -lmsvcrt
PATHSEP = /
#
@@ -601,6 +601,8 @@ framing_objects := \
src/framing/src/framesync64.o \
src/framing/src/flexframegen.o \
src/framing/src/flexframesync.o \
src/framing/src/fskframegen.o \
src/framing/src/fskframesync.o \
src/framing/src/gmskframegen.o \
src/framing/src/gmskframesync.o \
src/framing/src/msourcecf.o \
@@ -709,6 +711,7 @@ math_autotests := \
src/math/tests/math_gamma_autotest.c \
src/math/tests/math_complex_autotest.c \
src/math/tests/polynomial_autotest.c \
src/math/tests/polynomial_findroots_autotest.c \
src/math/tests/prime_autotest.c \
@@ -872,6 +875,7 @@ $(multichannel_objects) : %.o : %.c $(include_headers)
multichannel_includes := \
src/multichannel/src/firpfbch.c \
src/multichannel/src/firpfbch2.c \
src/multichannel/src/firpfbchr.c \
src/multichannel/src/firpfbch_crcf.o : %.o : %.c $(include_headers) $(multichannel_includes)
src/multichannel/src/firpfbch_cccf.o : %.o : %.c $(include_headers) $(multichannel_includes)
@@ -887,6 +891,7 @@ multichannel_autotests := \
multichannel_benchmarks := \
src/multichannel/bench/firpfbch_crcf_benchmark.c \
src/multichannel/bench/firpfbch2_crcf_benchmark.c \
src/multichannel/bench/firpfbchr_crcf_benchmark.c \
src/multichannel/bench/ofdmframesync_acquire_benchmark.c \
src/multichannel/bench/ofdmframesync_rxsymbol_benchmark.c \
@@ -1194,7 +1199,7 @@ libliquid.so: libliquid.a
$(CC) $(CFLAGS) $(LDFLAGS) -shared -Xlinker -soname=$@ -o $@ -Wl,-whole-archive $^ -Wl,-no-whole-archive $(LIBS)
#MINGW:
libliquid.dll: libliquid.a
$(CC) -shared -Xlinker -soname=$@ -o $@ -Wl,-whole-archive $^ -Wl,-no-whole-archive -Wl,--output-def,libliquid.def -Wl,--out-implib,libliquid.lib $(LIBS)
$(CC) $(CFLAGS) $(LDFLAGS) -shared -Xlinker -soname=$@ -o $@ -Wl,-whole-archive $^ -Wl,-no-whole-archive -Wl,--output-def,libliquid.def -Wl,--out-implib,libliquid.lib $(LIBS)
# static archive and library objects
all: ${ARCHIVE_LIB} ${SHARED_LIB}
@@ -1431,6 +1436,7 @@ example_programs := \
examples/firhilb_filter_example \
examples/firhilb_interp_example \
examples/firpfbch2_crcf_example \
examples/firpfbchr_crcf_example \
examples/firinterp_crcf_example \
examples/firinterp_firdecim_crcf_example \
examples/firpfbch_crcf_example \
@@ -1440,6 +1446,7 @@ example_programs := \
examples/flexframesync_reconfig_example \
examples/framesync64_example \
examples/freqmodem_example \
examples/fskframesync_example \
examples/fskmodem_example \
examples/fskmodem_waterfall_example \
examples/gasearch_example \
@@ -1499,6 +1506,8 @@ example_programs := \
examples/random_histogram_example \
examples/repack_bytes_example \
examples/rresamp_crcf_example \
examples/rresamp_crcf_rnyquist_example \
examples/rresamp_rrrf_example \
examples/resamp_crcf_example \
examples/resamp_crcf_noise_example \
examples/resamp2_cccf_example \
@@ -1576,6 +1585,7 @@ sandbox_programs = \
sandbox/fecsoft_hamming128_gentab \
sandbox/fecsoft_ldpc_test \
sandbox/fec_sumproduct_test \
sandbox/fskcorr_test \
sandbox/fskmodem_test \
sandbox/fft_dual_radix_test \
sandbox/fft_mixed_radix_test \
+28 -18
View File
@@ -22,22 +22,22 @@
# Makefile for liquid-dsp libraries
#
# Targets:
# all : dynamic shared-library object (e.g. libliquid.so)
# install : install the dynamic shared library object and headers
# uninstall : uninstall the library and header file(s)
# clean : clean all targets (bench, check, examples, etc)
# distclean : removes everything except the originally distributed files
# check : build and run autotest program
# bench : build and run benchmarking program
# examples : build all examples
# sandbox : build all sandbox examples
# world : build absolutely everything (but don't install)
# all : dynamic shared-library object (e.g. libliquid.so)
# install : install the dynamic shared library object and headers
# uninstall : uninstall the library and header file(s)
# clean : clean all targets (bench, check, examples, etc)
# distclean : removes everything except the originally distributed files
# check : build and run autotest program
# bench : build and run benchmarking program
# examples : build all examples
# sandbox : build all sandbox examples
# world : build absolutely everything (but don't install)
#
# clean-modules : clean all modules
# clean-examples : clean examples programs
# clean-sandbox : clean sandbox programs
# clean-check : clean autotest program
# clean-bench : clean benchmark program
# clean-modules : clean all modules
# clean-examples : clean examples programs
# clean-sandbox : clean sandbox programs
# clean-check : clean autotest program
# clean-bench : clean benchmark program
#
# autoconf initialization macros
@@ -63,14 +63,14 @@ LIBTOOL :=
RANLIB := ranlib
# flags
INCLUDE_CFLAGS = $(addprefix -I ,$(include_dirs))
INCLUDE_CFLAGS = $(addprefix -I,$(include_dirs))
#MINGW: optimizations goes here, use SSSE42 for 64bit
CONFIG_CFLAGS = -O3 -msse4.2 -ffast-math
CPPFLAGS = $(INCLUDE_CFLAGS)
CFLAGS = $(CONFIG_CFLAGS) -Wall -fPIC
LDFLAGS =
#MINGW:
LIBS += -static-libgcc
LIBS = -static-libgcc
PATHSEP = /
#
@@ -601,6 +601,8 @@ framing_objects := \
src/framing/src/framesync64.o \
src/framing/src/flexframegen.o \
src/framing/src/flexframesync.o \
src/framing/src/fskframegen.o \
src/framing/src/fskframesync.o \
src/framing/src/gmskframegen.o \
src/framing/src/gmskframesync.o \
src/framing/src/msourcecf.o \
@@ -709,6 +711,7 @@ math_autotests := \
src/math/tests/math_gamma_autotest.c \
src/math/tests/math_complex_autotest.c \
src/math/tests/polynomial_autotest.c \
src/math/tests/polynomial_findroots_autotest.c \
src/math/tests/prime_autotest.c \
@@ -872,6 +875,7 @@ $(multichannel_objects) : %.o : %.c $(include_headers)
multichannel_includes := \
src/multichannel/src/firpfbch.c \
src/multichannel/src/firpfbch2.c \
src/multichannel/src/firpfbchr.c \
src/multichannel/src/firpfbch_crcf.o : %.o : %.c $(include_headers) $(multichannel_includes)
src/multichannel/src/firpfbch_cccf.o : %.o : %.c $(include_headers) $(multichannel_includes)
@@ -887,6 +891,7 @@ multichannel_autotests := \
multichannel_benchmarks := \
src/multichannel/bench/firpfbch_crcf_benchmark.c \
src/multichannel/bench/firpfbch2_crcf_benchmark.c \
src/multichannel/bench/firpfbchr_crcf_benchmark.c \
src/multichannel/bench/ofdmframesync_acquire_benchmark.c \
src/multichannel/bench/ofdmframesync_rxsymbol_benchmark.c \
@@ -1194,7 +1199,7 @@ libliquid.so: libliquid.a
$(CC) $(CFLAGS) $(LDFLAGS) -shared -Xlinker -soname=$@ -o $@ -Wl,-whole-archive $^ -Wl,-no-whole-archive $(LIBS)
#MINGW:
libliquid.dll: libliquid.a
$(CC) -shared -Xlinker -soname=$@ -o $@ -Wl,-whole-archive $^ -Wl,-no-whole-archive -Wl,--output-def,libliquid.def -Wl,--out-implib,libliquid.lib $(LIBS)
$(CC) $(CFLAGS) $(LDFLAGS) -shared -Xlinker -soname=$@ -o $@ -Wl,-whole-archive $^ -Wl,-no-whole-archive -Wl,--output-def,libliquid.def -Wl,--out-implib,libliquid.lib $(LIBS)
# static archive and library objects
all: ${ARCHIVE_LIB} ${SHARED_LIB}
@@ -1431,6 +1436,7 @@ example_programs := \
examples/firhilb_filter_example \
examples/firhilb_interp_example \
examples/firpfbch2_crcf_example \
examples/firpfbchr_crcf_example \
examples/firinterp_crcf_example \
examples/firinterp_firdecim_crcf_example \
examples/firpfbch_crcf_example \
@@ -1440,6 +1446,7 @@ example_programs := \
examples/flexframesync_reconfig_example \
examples/framesync64_example \
examples/freqmodem_example \
examples/fskframesync_example \
examples/fskmodem_example \
examples/fskmodem_waterfall_example \
examples/gasearch_example \
@@ -1499,6 +1506,8 @@ example_programs := \
examples/random_histogram_example \
examples/repack_bytes_example \
examples/rresamp_crcf_example \
examples/rresamp_crcf_rnyquist_example \
examples/rresamp_rrrf_example \
examples/resamp_crcf_example \
examples/resamp_crcf_noise_example \
examples/resamp2_cccf_example \
@@ -1576,6 +1585,7 @@ sandbox_programs = \
sandbox/fecsoft_hamming128_gentab \
sandbox/fecsoft_ldpc_test \
sandbox/fec_sumproduct_test \
sandbox/fskcorr_test \
sandbox/fskmodem_test \
sandbox/fft_dual_radix_test \
sandbox/fft_mixed_radix_test \
+1549 -1506
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
+1549 -1506
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.