# Gauss Minimum-Shift Keying Modulator/Demodulator (gmskmodem)

The two objects gmksmod and gmskdem implement the Gauss minimum-shift keying (GMSK) modem in liquid . Notice that unlike the linear modem objects, the GMSK modulator and demodulator are split into separate objects.

• gmskmod_create(k,m,BT) creates and returns an gmskmod object with $$k$$ samples/symbol, a delay of $$m$$ symbols, and a bandwidth-time product (excess bandwidth factor) $$BT$$ .
• gmskmod_destroy(q) destroys an gmskmod object, freeing all internally-allocated memory.
• gmskmod_reset(q) clears the internal state of the gmskmod object.
• gmskmod_print(q) prints the internal state of the gmskmod object.
• gmskmod_modulate(q,s,*y) modulates a symbol $$s \in \{0,1\}$$ , storing the output in $$k$$ -element array $$\vec{y}$$ .

Demodulation is performed by differentiating the instantaneous received frequency and running the resulting time-varying phase through a matched filter. By design, the GMSK transmit filter imparts inter-symbol interference (by nature of the pulse shape). To mitigate symbol errors, the receive filter is initially designed to remove as much ISI as possible (see [section-filter-firdes_gmsk] for a discussion on GMSK transmit and receive filter designs in liquid ). Internally, the GMSK demodulator takes care of timing recovery using an LMS equalizer (see [section-equalization-eqlms] ). The GMSK demodulator has a similar interface to the modulator:

• gmskdem_create(k,m,BT) creates and returns an gmskdem object with $$k$$ samples/symbol, a delay of $$m$$ symbols, and a bandwidth-time product (excess bandwidth factor) $$BT$$ .
• gmskdem_destroy(q) destroys an gmskdem object, freeing all internally-allocated memory.
• gmskdem_reset(q) clears the internal state of the gmskdem object.
• gmskdem_print(q) prints the internal state of the gmskdem object.
• gmskdem_demodulate(q,*y,*s) demodulates the $$k$$ -element array $$\vec{y}$$ , storing the output symbol ( 0 or 1 ) in the de-referenced pointer $$s$$ .
• gmskdem_set_eq_bw(q,w) sets the bandwidth (learning rate) of the internal LMS equalizer to $$w$$ where $$w \in [0,0.5]$$ .

Listed below is an example to interfacing with the gmskmod and gmskdem modulator/demodulator objects.


#include <liquid/liquid.h>

int main() {
// options
unsigned int k  =    10;    // filter samples/symbol
unsigned int m  =     7;    // filter delay (symbols)
float        BT = 0.25f;    // bandwidth-time product

// create modulator/demodulator objects
gmskmod mod   = gmskmod_create(k, m, BT);
gmskdem demod = gmskdem_create(k, m, BT);

unsigned int  i;
unsigned int  sym_in;       // input data symbol
float complex x[k];         // modulated samples
unsigned int  sym_out;      // demodulated data symbol

{
// generate random symbol {0,1}
sym_in = rand() % 2;

// modulate
gmskmod_modulate(mod, sym_in, x);

// demodulate
gmskdem_demodulate(demod, x, &sym_out);
}

// destroy modem objects
gmskmod_destroy(mod);
gmskdem_destroy(demod);
}


Here is a time series and spectral estimate of the resulting signal:

Figure [fig-gmskmodem-psd]. GMSK modem time series for first 50 symbols and power spectral density with an excess bandwidth factor BT=0.25
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4962621331214905, "perplexity": 14931.931615673097}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-47/segments/1542039742338.13/warc/CC-MAIN-20181115013218-20181115035218-00399.warc.gz"}