Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquid dsp ampmodem update #724

Merged
merged 4 commits into from
Apr 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified external/liquid-dsp/gcc/32/libliquid.a
Binary file not shown.
Binary file modified external/liquid-dsp/gcc/32/libliquid.dll
Binary file not shown.
Binary file modified external/liquid-dsp/gcc/64/libliquid.a
Binary file not shown.
Binary file modified external/liquid-dsp/gcc/64/libliquid.dll
Binary file not shown.
104 changes: 78 additions & 26 deletions external/liquid-dsp/include/liquid/liquid.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@ float AGC(_get_gain)(AGC() _q); \
void AGC(_set_gain)(AGC() _q, \
float _gain); \
\
/* Get the ouput scaling applied to each sample (linear). */ \
float AGC(_get_scale)(AGC() _q); \
\
/* Set the agc object's output scaling (linear). Note that this does */ \
/* affect the response of the AGC. */ \
/* _q : automatic gain control object */ \
/* _gain : gain to apply to input signal, _gain > 0 */ \
void AGC(_set_scale)(AGC() _q, \
float _scale); \
\
/* Estimate signal level and initialize internal gain on an input */ \
/* array. */ \
/* _q : automatic gain control object */ \
Expand Down Expand Up @@ -1996,6 +2006,14 @@ void liquid_firdes_kaiser(unsigned int _n,
float _mu,
float *_h);

// Design finite impulse response DC-blocking filter
// _m : filter semi-length, m in [1,1000]
// _As : stop-band attenuation [dB], _As > 0
// _h : output coefficient buffer, [size: 2*_m+1 x 1]
void liquid_firdes_dcblocker(unsigned int _m,
float _As,
float * _h);

// Design FIR doppler filter
// _n : filter length
// _fd : normalized doppler frequency (0 < _fd < 0.5)
Expand Down Expand Up @@ -2482,6 +2500,12 @@ FIRFILT() FIRFILT(_create_rnyquist)(int _type, \
/* _n : length of filter [samples], 0 < _n <= 1024 */ \
FIRFILT() FIRFILT(_create_rect)(unsigned int _n); \
\
/* Create DC blocking filter from prototype */ \
/* _m : prototype filter semi-length such that filter length is 2*m+1 */ \
/* _As : prototype filter stop-band attenuation [dB], _As > 0 */ \
FIRFILT() FIRFILT(_create_dc_blocker)(unsigned int _m, \
float _As); \
\
/* Re-create filter object of potentially a different length with */ \
/* different coefficients. If the length of the filter does not change, */ \
/* not memory reallocation is invoked. */ \
Expand Down Expand Up @@ -2625,10 +2649,12 @@ void FIRHILB(_r2c_execute)(FIRHILB() _q, \
/* Execute Hilbert transform (complex to real) */ \
/* _q : Hilbert transform object */ \
/* _x : complex-valued input sample */ \
/* _y : real-valued output sample */ \
/* _y0 : real-valued output sample, lower side-band retained */ \
/* _y1 : real-valued output sample, upper side-band retained */ \
void FIRHILB(_c2r_execute)(FIRHILB() _q, \
TC _x, \
T * _y); \
T * _y0, \
T * _y1); \
\
/* Execute Hilbert transform decimator (real to complex) */ \
/* _q : Hilbert transform object */ \
Expand Down Expand Up @@ -3671,18 +3697,36 @@ LIQUID_RESAMP2_DEFINE_API(LIQUID_RESAMP2_MANGLE_CCCF,
/* Rational rate resampler, implemented as a polyphase filterbank */ \
typedef struct RRESAMP(_s) * RRESAMP(); \
\
/* Create rational-rate resampler object from filter prototype to */ \
/* Create rational-rate resampler object from external coeffcients to */ \
/* resample at an exact rate P/Q */ \
/* _P : interpolation factor, P > 0 */ \
/* _Q : decimation factor, Q > 0 */ \
/* _m : filter semi-length (delay), 0 < _m */ \
/* _bw : filter bandwidth relative to sample rate, 0 < _bw <= 0.5 */ \
/* _As : filter stop-band attenuation [dB], 0 < _As */ \
/* _h : filter coefficients, [size: 2*_P*_m x 1] */ \
RRESAMP() RRESAMP(_create)(unsigned int _P, \
unsigned int _Q, \
unsigned int _m, \
float _bw, \
float _As); \
TC * _h); \
\
/* Create rational-rate resampler object from filter prototype to */ \
/* resample at an exact rate P/Q */ \
/* _P : interpolation factor, P > 0 */ \
/* _Q : decimation factor, Q > 0 */ \
/* _m : filter semi-length (delay), 0 < _m */ \
/* _bw : filter bandwidth relative to sample rate, 0 < _bw <= 0.5 */ \
/* _As : filter stop-band attenuation [dB], 0 < _As */ \
RRESAMP() RRESAMP(_create_kaiser)(unsigned int _P, \
unsigned int _Q, \
unsigned int _m, \
float _bw, \
float _As); \
\
/* Create rational-rate resampler object from filter prototype to... */ \
RRESAMP() RRESAMP(_create_prototype)(int _type, \
unsigned int _P, \
unsigned int _Q, \
unsigned int _m, \
float _beta); \
\
/* Create rational resampler object with a specified resampling rate of */ \
/* exactly P/Q with default parameters. This is a simplified method to */ \
Expand Down Expand Up @@ -5117,6 +5161,9 @@ float ofdmflexframesync_get_rssi(ofdmflexframesync _q);
// query the received carrier offset estimate
float ofdmflexframesync_get_cfo(ofdmflexframesync _q);

// set the received carrier offset estimate
void ofdmflexframesync_set_cfo(ofdmflexframesync _q, float _cfo);

// enable/disable debugging
void ofdmflexframesync_debug_enable(ofdmflexframesync _q);
void ofdmflexframesync_debug_disable(ofdmflexframesync _q);
Expand Down Expand Up @@ -7089,42 +7136,44 @@ typedef struct ampmodem_s * ampmodem;

// create ampmodem object
// _m : modulation index
// _fc : carrier frequency, range: [-0.5,0.5]
// _type : AM type (e.g. LIQUID_AMPMODEM_DSB)
// _suppressed_carrier : carrier suppression flag
ampmodem ampmodem_create(float _m,
float _fc,
ampmodem ampmodem_create(float _mod_index,
liquid_ampmodem_type _type,
int _suppressed_carrier);
int _suppressed_carrier);

// destroy ampmodem object
void ampmodem_destroy(ampmodem _fm);
void ampmodem_destroy(ampmodem _q);

// print ampmodem object internals
void ampmodem_print(ampmodem _fm);
void ampmodem_print(ampmodem _q);

// reset ampmodem object state
void ampmodem_reset(ampmodem _fm);
void ampmodem_reset(ampmodem _q);

// accessor methods
unsigned int ampmodem_get_delay_mod (ampmodem _q);
unsigned int ampmodem_get_delay_demod(ampmodem _q);

// modulate sample
void ampmodem_modulate(ampmodem _fm,
float _x,
liquid_float_complex *_y);
void ampmodem_modulate(ampmodem _q,
float _x,
liquid_float_complex * _y);

void ampmodem_modulate_block(ampmodem _q,
float * _m,
unsigned int _n,
liquid_float_complex *_s);
void ampmodem_modulate_block(ampmodem _q,
float * _m,
unsigned int _n,
liquid_float_complex * _s);

// demodulate sample
void ampmodem_demodulate(ampmodem _fm,
void ampmodem_demodulate(ampmodem _q,
liquid_float_complex _y,
float *_x);
float * _x);

void ampmodem_demodulate_block(ampmodem _q,
void ampmodem_demodulate_block(ampmodem _q,
liquid_float_complex * _r,
unsigned int _n,
float * _m);
unsigned int _n,
float * _m);

//
// MODULE : multichannel
Expand Down Expand Up @@ -7471,6 +7520,9 @@ void ofdmframesync_execute(ofdmframesync _q,
float ofdmframesync_get_rssi(ofdmframesync _q); // received signal strength indication
float ofdmframesync_get_cfo(ofdmframesync _q); // carrier offset estimate

// set methods
void ofdmframesync_set_cfo(ofdmframesync _q, float _cfo); // set carrier offset estimate

// debugging
void ofdmframesync_debug_enable(ofdmframesync _q);
void ofdmframesync_debug_disable(ofdmframesync _q);
Expand Down
7 changes: 7 additions & 0 deletions external/liquid-dsp/makefile.mingw32
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ src/modem/src/modem_arb_const.o : %.o : %.c $(include_headers)


modem_autotests := \
src/modem/tests/ampmodem_autotest.c \
src/modem/tests/cpfskmodem_autotest.c \
src/modem/tests/freqmodem_autotest.c \
src/modem/tests/fskmodem_autotest.c \
Expand Down Expand Up @@ -1426,6 +1427,7 @@ example_programs := \
examples/firfarrow_rrrf_example \
examples/firfilt_cccf_example \
examples/firfilt_crcf_example \
examples/firfilt_crcf_dcblocker_example \
examples/firfilt_rrrf_example \
examples/firdes_kaiser_example \
examples/firdespm_callback_example \
Expand Down Expand Up @@ -1555,6 +1557,10 @@ clean-examples:
# NOTE: sandbox _requires_ fftw3 to build
.PHONY: sandbox
sandbox_programs = \
sandbox/am_demod_dsb_peak_detect_test \
sandbox/am_demod_dsb_pll_carrier_test \
sandbox/am_demod_dsb_pll_costas_test \
sandbox/am_demod_ssb_pll_carrier_test \
sandbox/bpresync_test \
sandbox/cpmodem_test \
sandbox/count_ones_gentab \
Expand Down Expand Up @@ -1599,6 +1605,7 @@ sandbox_programs = \
sandbox/firdes_gmskrx_test \
sandbox/firdes_length_test \
sandbox/firfarrow_rrrf_test \
sandbox/firfilt_dcblocker_test \
sandbox/firpfbch_analysis_alignment_test \
sandbox/firpfbch2_analysis_equivalence_test \
sandbox/firpfbch2_test \
Expand Down
7 changes: 7 additions & 0 deletions external/liquid-dsp/makefile.mingw64
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ src/modem/src/modem_arb_const.o : %.o : %.c $(include_headers)


modem_autotests := \
src/modem/tests/ampmodem_autotest.c \
src/modem/tests/cpfskmodem_autotest.c \
src/modem/tests/freqmodem_autotest.c \
src/modem/tests/fskmodem_autotest.c \
Expand Down Expand Up @@ -1426,6 +1427,7 @@ example_programs := \
examples/firfarrow_rrrf_example \
examples/firfilt_cccf_example \
examples/firfilt_crcf_example \
examples/firfilt_crcf_dcblocker_example \
examples/firfilt_rrrf_example \
examples/firdes_kaiser_example \
examples/firdespm_callback_example \
Expand Down Expand Up @@ -1555,6 +1557,10 @@ clean-examples:
# NOTE: sandbox _requires_ fftw3 to build
.PHONY: sandbox
sandbox_programs = \
sandbox/am_demod_dsb_peak_detect_test \
sandbox/am_demod_dsb_pll_carrier_test \
sandbox/am_demod_dsb_pll_costas_test \
sandbox/am_demod_ssb_pll_carrier_test \
sandbox/bpresync_test \
sandbox/cpmodem_test \
sandbox/count_ones_gentab \
Expand Down Expand Up @@ -1599,6 +1605,7 @@ sandbox_programs = \
sandbox/firdes_gmskrx_test \
sandbox/firdes_length_test \
sandbox/firfarrow_rrrf_test \
sandbox/firfilt_dcblocker_test \
sandbox/firpfbch_analysis_alignment_test \
sandbox/firpfbch2_analysis_equivalence_test \
sandbox/firpfbch2_test \
Expand Down
Loading