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

Differnt results on Demodulation (ASK, GMSK) #13

Open
Mas313 opened this issue Mar 28, 2024 · 0 comments
Open

Differnt results on Demodulation (ASK, GMSK) #13

Mas313 opened this issue Mar 28, 2024 · 0 comments

Comments

@Mas313
Copy link

Mas313 commented Mar 28, 2024

I have modified this code to print input symbol and output symbol before modulation and after demodulation, in a loop, but demodulator output does not match with the input. Here is the code. Any idea whats going wrong

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

    int n=0;
    while(n<20)

    {
	n++;
        // generate random symbol {0,1}
        sym_in = rand() % 2;
	printf("Input symbol=%d\n",sym_in);
        // modulate
        gmskmod_modulate(mod, sym_in, x);
	//for(int a=0; a<k; a++)	
	//	printf("output_complex real=%f img=%f\n",creal(x[a]),cimag(x[a]));

        // demodulate
        gmskdem_demodulate(demod, x, &sym_out);
	printf("output_decoded=%d\n \n",sym_out);
    }
	

    // destroy modem objects
    gmskmod_destroy(mod);
    gmskdem_destroy(demod);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant