<commit_before>//
// ofdmoqamframe64sync_example.c
//
// This example demonstrates the ofdmoqamframe64 synchronizer with
// arbitrary linear data modulation under a multi-path fading
// channel exhibiting additive white Gauss noise and carrier
// frequency offset.
//

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <assert.h>

#include "liquid.h"

#define OUTPUT_FILENAME "ofdmoqamframe64sync_example.m"

// static data sequence
static unsigned int data_tx[48];

// static callback function invoked when each symbol received
static int callback(float complex * _y, void * _userdata)
{
    unsigned int data_rx[48];
    modem demod = (modem)_userdata;
    unsigned int i, num_sym_errors=0;
    for (i=0; i<48; i++) {
        modem_demodulate(demod,_y[i],&data_rx[i]);
        num_sym_errors += (data_rx[i]==data_tx[i]) ? 0 : 1;
    }
    printf("callback invoked :: num symbol errors : %u / 48\n", num_sym_errors);
    return 0;
}

int main() {
    srand(time(NULL));

    // options
    unsigned int num_symbols_S0=3;  // num short sequence symbols
    unsigned int num_symbols_S1=8;  // num long sequence symbols
    unsigned int num_symbols_data=1;// num data symbols
    unsigned int m=2;
    float beta = 0.9f;
    modulation_scheme ms = MOD_QPSK;
    unsigned int bps = 2;
    float cfo=0.0f;         // carrier frequency offset (max: pi/(2*64) ~ 0.024544)
    float cpo=0.0f;         // carrier phase offset
    float SNRdB=30.0f;      // signal-to-noise ratio (dB)
    unsigned int p=0;       // number of multi-path channel taps
    float fstd=0.2f;        // multi-path channel taps standard deviation<commit_msg>ofdm/oqam|sync: reverting signal level correction; need to figure this out<commit_after>//
// ofdmoqamframe64sync_example.c
//
// This example demonstrates the ofdmoqamframe64 synchronizer with
// arbitrary linear data modulation under a multi-path fading
// channel exhibiting additive white Gauss noise and carrier
// frequency offset.
//

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <assert.h>

#include "liquid.h"

#define OUTPUT_FILENAME "ofdmoqamframe64sync_example.m"

// static data sequence
static unsigned int data_tx[48];

// static callback function invoked when each symbol received
static int callback(float complex * _y, void * _userdata)
{
    unsigned int data_rx[48];
    modem demod = (modem)_userdata;
    unsigned int i, num_sym_errors=0;
    for (i=0; i<48; i++) {
        modem_demodulate(demod,_y[i],&data_rx[i]);
        num_sym_errors += (data_rx[i]==data_tx[i]) ? 0 : 1;
    }
    printf("callback invoked :: num symbol errors : %u / 48\n", num_sym_errors);
    return 0;
}

int main() {
    srand(time(NULL));

    // options
    unsigned int num_symbols_S0=3;  // num short sequence symbols
    unsigned int num_symbols_S1=2;  // num long sequence symbols
    unsigned int num_symbols_data=6;// num data symbols
    unsigned int m=2;
    float beta = 0.9f;
    modulation_scheme ms = MOD_QPSK;
    unsigned int bps = 2;
    float cfo=0.0f;         // carrier frequency offset (max: pi/(2*64) ~ 0.024544)
    float cpo=0.0f;         // carrier phase offset
    float SNRdB=30.0f;      // signal-to-noise ratio (dB)
    unsigned int p=0;       // number of multi-path channel taps
    float fstd=0.2f;        // multi-path channel taps standard deviation
{'fraction_non_alphanumeric': 0.11458637825197311, 'fraction_numerical': 0.028061970184156678, 'mean_word_length': 3.178266178266178, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2873552', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1133, 'n_words': 338}