0
$\begingroup$

I am trying to encode a bitstream as offset in a complex exponential, but when I do, the sinusoids get chopped off. Do I need to apply a lowpass to the bitstream or is there a more elegant way?

bits_t bit;
double t, cycle;
double pi = 4 * atan(1.0);
doubl x, y;
double complex z;
short ch[2];
int f = CARRIERFREQ;
int fs = SAMPLERATE;

z = cexp(-I * 2 * pi * f * n/fs);
z = (z + (bit+I*bit))/2;                                                                                                            
x = creal(z);                                                                                                                               
y = cimag(z);    

The generation of the bistream is not included in the code. Just take the variable bit given as the current bit.

enter image description here

I basically want them to look like this

enter image description here

$\endgroup$
5
  • $\begingroup$ Could you please detail how you obtain this? $\endgroup$ Commented Nov 15, 2020 at 18:29
  • $\begingroup$ yeah, this is not just a complex exponential; you either are describing what you're doing incorrectly, or your system has a bug! Either way, we can't help with what we don't see :) $\endgroup$ Commented Nov 15, 2020 at 18:41
  • $\begingroup$ I have a long bitstream and I am applying an offset of one for a HIGH and not offset for a LOW. I want this to happen smoothly, so the sinusoid doesn't get distorted. $\endgroup$
    – neolith
    Commented Nov 15, 2020 at 18:53
  • $\begingroup$ The answer is "pulse shaping". $\endgroup$
    – MBaz
    Commented Nov 15, 2020 at 19:04
  • $\begingroup$ @MBaz This seems to be what I am looking for. I want to get rid of the intersymbol interference. Thank you :) $\endgroup$
    – neolith
    Commented Nov 15, 2020 at 19:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.