Skip to content

Commit

Permalink
Merge branch 'master' into github-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaeddert committed Apr 27, 2024
2 parents 9c63324 + 231df90 commit b431025
Show file tree
Hide file tree
Showing 236 changed files with 7,967 additions and 4,290 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
- name: make
run: make -j 2

- name: make doc-check
run: make doc-check
- name: make check-doc
run: make check-doc

- name: make check
run: make -j 2 check
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ jobs:
- name: make coverage
run: make -j 2 coverage

- name: upload coverage report
- name: upload report to codecov with github action
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
run: bash <(curl -s https://codecov.io/bash)
# prefer codecov action, but produces 'unusable report';
# (suspect path fixing needed: https://docs.codecov.com/docs/fixing-paths)
Expand All @@ -55,4 +60,3 @@ jobs:
# fail_ci_if_error: true
# verbose: true
# files: coverage.out

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ xautotest
autotest.json
autotest/logs/*.bin
autotest/logs/*.gnu
readme.*

# miscellany
octave-core
Expand Down
12 changes: 8 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ compile:
stage: build
script:
- ./bootstrap.sh
- ./configure --enable-strict
- ./configure
- make -j4
artifacts: # save output objects for test stages
paths: [makefile, configure, config.h, config.h.in]
Expand Down Expand Up @@ -53,10 +53,10 @@ bench:
paths: [benchmark.json]

# compile and run documenation checks (e.g. example code in README.md)
doc-check:
check-doc:
stage: test
script:
- make doc-check
- make check-doc

# compile and run all example programs, timing how long each takes to run
examples:
Expand Down Expand Up @@ -90,7 +90,11 @@ coverage:
- ./bootstrap.sh
- ./configure --enable-coverage
- make -j4 coverage
- bash <(curl -s https://codecov.io/bash)
- curl -Os http://cli.codecov.io/latest/linux/codecov
- chmod +x codecov
- ./codecov --version
- ./codecov upload-process -t $CODECOV_TOKEN --git-service gitlab --slug jgaeddert/liquid-dsp

coverage: '/lines: \d+\.\d+%/'
artifacts:
paths: [coverage.out]
Expand Down
41 changes: 41 additions & 0 deletions HISTORY
Original file line number Diff line number Diff line change
@@ -1,8 +1,49 @@

## Latest improvements ##

## Improvements for v1.6.0 ##

Version 1.6.0 includes a new qdsync object to greatly simplify the frame
synchronization process in liquid, allowing for both detection and channel
impairment correction with a simplified interface. Additionally, code
coverage has been increased to 85% across the entire project, with numerous
bug fixes, stability improvements, and massive testing enhancements. From
an "architectural" standpoint, objects have been migrated to use standard
methods for consistency.

* build
- increased code coverage to 85% globally across entire project. This
is the single largest effort included in this version and touches
most modules in some way, most particularly the framing objects
- cleaning build to remove compiler warnings (e.g. unused variables)
- stripped version number off archive
* dotprod
- added support for AVX512-F (thanks, @vankxr!)
* framing
- added numerous tests to increase coverage to 84%
- framesync64: using new qdsync object for simplified operation
- qdsync: new frame detector and synchronizer to much more easily
support frame processing. The object not only detects the frame, but
also provides an initial carrier frequency, phase, and timign offset,
and also corrects for these impairments, passing the results to the
user in a clean callback function.
* modem
- cpfskmod: increasing phase stability for long runs
* multichannel
- added numerous tests to increase coverage to 88%
* optim
- added numerous tests to increase coverage to 92%
* sequence
- msequence: extended support for state variables up to m=31, reversed
order for generator polynomial and internal state definition to be
more consistent with literature and readily-available genpolys

## Improvements for v1.5.0 ##

This release includes substantially improved testing coverage, deep copy()
methods for nearly all objects, improved speed, and resolves a number of
issues and pull requests.

* build
- added support for PlatformIO (https://platformio.org) for embeedded
development (thanks, @jcw!)
Expand Down
33 changes: 29 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,36 @@ buf = interp.execute(1+1j,)
### License ###

liquid projects are released under the X11/MIT license.
By default, this project will try to link to [FFTW](http://www.fftw.org) if it
is available on your build platform.
Because FFTW starting with version 1.3 is
[licensed](http://www.fftw.org/faq/section1.html)
under the [GNU General Public License v2](http://www.fftw.org/doc/License-and-Copyright.html)
this unfortunately means that (and I'm clearly not a lawyer, here)
you cannot distribute `liquid-dsp` without also distributing the source code
if you link to FFTW.
This is a similar situation with the classic
[libfec](https://github.com/quiet/libfec)
which uses the
[GNU Lesser GPL](https://www.gnu.org/licenses/licenses.html#LGPL).
Finally, `liquid-dsp` makes extensive use of GNU
[autoconf](https://www.gnu.org/software/autoconf/),
[automake](https://www.gnu.org/software/automake/),
and related tools.
These are fantastic libraires with amazing functionality and their authors
should be lauded for their efforts.
In a similar vain, much the software I write for a living I give away for
free;
however I believe in more permissive licenses to allow individuals the
flexibility to use software with fewer limitations.
If these restrictions are not acceptible, `liquid-dsp` can be compiled and run
without use of these external libraries, albeit a bit slower and with limited
functionality.

Short version: this code is copyrighted to me (Joseph D. Gaeddert),
I give you full permission to do whatever you want with it except remove my
name from the credits.
Seriously, go nuts.
See the LICENSE file or
[https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT)
for specific terms.
Seriously, go nuts! but take caution when linking to other libraries with
different licenses.
See the [license](https://opensource.org/licenses/MIT) for specific terms.

43 changes: 42 additions & 1 deletion autotest/autotest.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007 - 2022 Joseph Gaeddert
* Copyright (c) 2007 - 2024 Joseph Gaeddert
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -347,3 +347,44 @@ int liquid_autotest_validate_psd_firfilt_cccf(firfilt_cccf _q, unsigned int _nff
return liquid_autotest_validate_spectrum(psd,_nfft,_regions,num_regions,debug_filename);
}

// validate spectral content of an iir filter (real coefficients, input)
int liquid_autotest_validate_psd_iirfilt_rrrf(iirfilt_rrrf _q, unsigned int _nfft,
autotest_psd_s * _regions, unsigned int num_regions, const char * debug_filename)
{
float psd[_nfft];
unsigned int i;
for (i=0; i<_nfft; i++) {
float f = (float)(i)/(float)(_nfft) - 0.5f;
float complex H;
iirfilt_rrrf_freqresponse(_q, f, &H);
psd[i] = 20*log10f(cabsf(H));
}
return liquid_autotest_validate_spectrum(psd,_nfft,_regions,num_regions,debug_filename);
}

// validate spectral content of a spectral periodogram object
int liquid_autotest_validate_psd_spgramcf(spgramcf _q,
autotest_psd_s * _regions, unsigned int num_regions, const char * debug_filename)
{
unsigned int nfft = spgramcf_get_nfft(_q);
float psd[nfft];
spgramcf_get_psd(_q, psd);
return liquid_autotest_validate_spectrum(psd,nfft,_regions,num_regions,debug_filename);
}

// callback function to simplify testing for framing objects
int framing_autotest_callback(
unsigned char * _header,
int _header_valid,
unsigned char * _payload,
unsigned int _payload_len,
int _payload_valid,
framesyncstats_s _stats,
void * _context)
{
printf("*** callback invoked (%s) ***\n", _payload_valid ? "pass" : "FAIL");
unsigned int * secret = (unsigned int*) _context;
*secret = FRAMING_AUTOTEST_SECRET;
return 0;
}

21 changes: 20 additions & 1 deletion autotest/autotest.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007 - 2022 Joseph Gaeddert
* Copyright (c) 2007 - 2024 Joseph Gaeddert
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -312,5 +312,24 @@ int liquid_autotest_validate_psd_firfilt_crcf(firfilt_crcf _q, unsigned int _nff
int liquid_autotest_validate_psd_firfilt_cccf(firfilt_cccf _q, unsigned int _nfft,
autotest_psd_s * _regions, unsigned int num_regions, const char * debug_filename);

// validate spectral content of an iir filter (real coefficients, input)
int liquid_autotest_validate_psd_iirfilt_rrrf(iirfilt_rrrf _q, unsigned int _nfft,
autotest_psd_s * _regions, unsigned int num_regions, const char * debug_filename);

// validate spectral content of a spectral periodogram object
int liquid_autotest_validate_psd_spgramcf(spgramcf _q,
autotest_psd_s * _regions, unsigned int num_regions, const char * debug_filename);

// callback function to simplify testing for framing objects
#define FRAMING_AUTOTEST_SECRET 0x01234567
int framing_autotest_callback(
unsigned char * _header,
int _header_valid,
unsigned char * _payload,
unsigned int _payload_len,
int _payload_valid,
framesyncstats_s _stats,
void * _context);

#endif // __LIQUID_AUTOTEST_H__

25 changes: 14 additions & 11 deletions bench/bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ typedef void(benchmark_function_t) (

// define benchmark_t
typedef struct {
unsigned int id;
benchmark_function_t * api;
const char* name;
unsigned int name_len;
unsigned int num_trials;
float extime;
float rate;
float cycles_per_trial;
unsigned int id; // identification of benchmark
benchmark_function_t * api; // function interface
const char * name; // name of function
unsigned int name_len;
unsigned int num_trials;
float extime;
float rate;
float cycles_per_trial;//
unsigned int num_attempts; // number of attempts to reach target time
} benchmark_t;

// define package_t
Expand Down Expand Up @@ -292,12 +293,13 @@ int main(int argc, char *argv[])
fprintf(fid," \"num_trials\" : %lu,\n", num_base_trials);
fprintf(fid," \"benchmarks\" : [\n");
for (i=0; i<NUM_AUTOSCRIPTS; i++) {
fprintf(fid," {\"id\":%5u, \"trials\":%12u, \"extime\":%12.4e, \"rate\":%12.4e, \"cycles_per_trial\":%12.4e, \"name\":\"%s\"}%s\n",
fprintf(fid," {\"id\":%5u, \"trials\":%12u, \"extime\":%12.4e, \"rate\":%12.4e, \"cycles_per_trial\":%12.4e, \"attempts\":%2u, \"name\":\"%s\"}%s\n",
scripts[i].id,
scripts[i].num_trials,
scripts[i].extime,
scripts[i].rate,
scripts[i].cycles_per_trial,
scripts[i].num_attempts,
scripts[i].name,
i==NUM_AUTOSCRIPTS-1 ? "" : ",");
}
Expand Down Expand Up @@ -394,6 +396,7 @@ void execute_benchmark(benchmark_t* _benchmark, int _verbose)
} while (1);

_benchmark->num_trials = num_trials;
_benchmark->num_attempts = num_attempts;
_benchmark->rate = _benchmark->extime==0 ? 0 : (float)(_benchmark->num_trials) / _benchmark->extime;
_benchmark->cycles_per_trial = _benchmark->extime==0 ? 0 : cpu_clock / (_benchmark->rate);

Expand Down Expand Up @@ -448,8 +451,8 @@ void print_benchmark_results(benchmark_t* _b)
float cycles_format = _b->cycles_per_trial;
char cycles_units = convert_units(&cycles_format);

printf(" %-3u: %-30s: %6.2f %c trials / %6.2f %cs (%6.2f %c t/s, %6.2f %c c/t)\n",
_b->id, _b->name,
printf(" %-3u: [%2u] %-30s: %6.2f %c trials / %6.2f %cs (%6.2f %c t/s, %6.2f %c c/t)\n",
_b->id, _b->num_attempts, _b->name,
trials_format, trials_units,
extime_format, extime_units,
rate_format, rate_units,
Expand Down
37 changes: 23 additions & 14 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Process with autoconf to generate configure script
#

AC_INIT([liquid-dsp],[1.5],[[email protected]])
AC_INIT([liquid-dsp],[1.6],[[email protected]])
AC_CONFIG_SRCDIR([src/libliquid.c])
AC_CONFIG_MACRO_DIR([scripts])

Expand Down Expand Up @@ -170,9 +170,18 @@ else
# SSSE3 : tmmintrin.h
# SSE4.1/2: smmintrin.h
# AVX : immintrin.h
# AVX2 : immintrin.h
# AVX512 : immintrin.h
AX_EXT

if [ test "$ax_cv_have_avx2_ext" = yes ]; then
if [ test "$ax_cv_have_avx512f_ext" = yes ]; then
# AVX512 extensions
MLIBS_DOTPROD="src/dotprod/src/dotprod_cccf.avx512f.o \
src/dotprod/src/dotprod_crcf.avx512f.o \
src/dotprod/src/dotprod_rrrf.avx512f.o \
src/dotprod/src/sumsq.avx512f.o"
ARCH_OPTION='-mavx512f'
elif [ test "$ax_cv_have_avx2_ext" = yes ]; then
# AVX2 extensions
MLIBS_DOTPROD="src/dotprod/src/dotprod_cccf.avx.o \
src/dotprod/src/dotprod_crcf.avx.o \
Expand All @@ -188,24 +197,24 @@ else
ARCH_OPTION='-mavx'
elif [ test "$ax_cv_have_sse41_ext" = yes ]; then
# SSE4.1/2 extensions
MLIBS_DOTPROD="src/dotprod/src/dotprod_cccf.mmx.o \
src/dotprod/src/dotprod_crcf.mmx.o \
src/dotprod/src/dotprod_rrrf.sse4.o \
src/dotprod/src/sumsq.mmx.o"
MLIBS_DOTPROD="src/dotprod/src/dotprod_cccf.sse.o \
src/dotprod/src/dotprod_crcf.sse.o \
src/dotprod/src/dotprod_rrrf.sse.o \
src/dotprod/src/sumsq.sse.o"
ARCH_OPTION='-msse4.1'
elif [ test "$ax_cv_have_sse3_ext" = yes ]; then
# SSE3 extensions
MLIBS_DOTPROD="src/dotprod/src/dotprod_cccf.mmx.o \
src/dotprod/src/dotprod_crcf.mmx.o \
src/dotprod/src/dotprod_rrrf.mmx.o \
src/dotprod/src/sumsq.mmx.o"
MLIBS_DOTPROD="src/dotprod/src/dotprod_cccf.sse.o \
src/dotprod/src/dotprod_crcf.sse.o \
src/dotprod/src/dotprod_rrrf.sse.o \
src/dotprod/src/sumsq.sse.o"
ARCH_OPTION='-msse3'
elif [ test "$ax_cv_have_sse2_ext" = yes ]; then
# SSE2 extensions
MLIBS_DOTPROD="src/dotprod/src/dotprod_cccf.mmx.o \
src/dotprod/src/dotprod_crcf.mmx.o \
src/dotprod/src/dotprod_rrrf.mmx.o \
src/dotprod/src/sumsq.mmx.o"
MLIBS_DOTPROD="src/dotprod/src/dotprod_cccf.sse.o \
src/dotprod/src/dotprod_crcf.sse.o \
src/dotprod/src/dotprod_rrrf.sse.o \
src/dotprod/src/sumsq.sse.o"
ARCH_OPTION='-msse2'
else
# portable C version
Expand Down
1 change: 1 addition & 0 deletions examples/bpacketsync_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ int main(int argc, char*argv[]) {

// create packet synchronizer
bpacketsync ps = bpacketsync_create(0, callback, (void*)msg_dec);
bpacketsync_print(ps);

// initialize original data message
for (i=0; i<n; i++)
Expand Down
4 changes: 0 additions & 4 deletions examples/cbufferf_example.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//
// cbufferf_example.c
//
// This example demonstrates the circular buffer object on
// floating-point data.
//
Expand Down Expand Up @@ -35,7 +32,6 @@ int main() {
cbufferf_write(cb, v, 8);

// print
cbufferf_debug_print(cb);
cbufferf_print(cb);

// destroy object
Expand Down
Loading

0 comments on commit b431025

Please sign in to comment.