.. _cpfskmodem: Continuous-Phase Frequency-Shift Keying (CPFSK) Modem ===================================================== .. author jgaeddert Joseph D. Gaeddert .. date January 1, 1975 .. location Boston, MA .. header /doc/cpfskmodem/banner.png .. keywords continuous phase, frequency shift keying, FSK, modem, Gauss, minimum shift keying, CPFSK, FSK, GMSK, MSK Shown in :numref:`fig-cpfsk-psd` below is a compaarison of the transmitted spectrum for various combinations of parameters. .. qplot:: series modem/cpfskmodem_psd.c :kwargs: {"series" : [["f","square", {}], ["f","full", {}], ["f","partial",{}], ["f","gmsk", {}] ], "xlabel" : "Normalized Frequency [f/Fs]", "ylabel" : "Power Spectral Density [dB]", "xrange" : [-0.5, 0.5], "yrange" : [-70, 10], "legend" : ["square", "rcos (full)", "rcos (partial)", "GMSK, BT=0.35"] } :width: 75% :name: fig-cpfsk-psd :caption: Power spectral density of different CPFSK modem types with :math:`k=8` samples per symbol Interface --------- Here is a basic example of the `cpfksmod` and `cpfskdem` objects. .. code-block:: c // demonstrate interface to cpfskmod and cpfskdem objects #include #include #include #include int main(int argc, char*argv[]) { // options unsigned int bps = 1; // number of bits/symbol float h = 0.5f; // modulation index (h=1/2 for MSK) unsigned int k = 4; // filter samples/symbol unsigned int m = 3; // filter delay (symbols) float beta = 0.35f; // filter bandwidth-time product int filter_type = LIQUID_CPFSK_SQUARE; // filter type // create modem objects cpfskmod mod = cpfskmod_create(bps, h, k, m, beta, filter_type); cpfskdem dem = cpfskdem_create(bps, h, k, m, beta, filter_type); // arrays unsigned int i; unsigned int M = 1 << bps; // constellation size float complex buf[k]; // sample buffer for (i=0; i<20; i++) { // generate random message signal unsigned int sym_in = rand() % M; // modulate signal cpfskmod_modulate(mod, sym_in, buf); // demodulate signal unsigned int sym_out = cpfskdem_demodulate(dem, buf); } // destroy modem objects cpfskmod_destroy(mod); cpfskdem_destroy(dem); return 0; }