I am new to this field and yesterday I began a project for BPSK modulation. So this is what i did:
$\ x(t) = 0 $ or$\ 1 $ binary data
$\ Fs = 15 $ sampling frequency kHz
$\ Fc = 10 $ carrier frequency kHz
BPSK modulation
$\ BPSK(t) = A.sin(2.\pi.Fc.t + \pi.x(t) ) $
BPSK demodulation
$\ S(t) = BPSK(t) . (Ac.sin(2.\pi.Fc.t))$
low pass filter
void lowPassFrequency(float input[], float fs, float output[], int points)
{
float CUTOFF = 2 * Fc;
float RC = 1.0/(CUTOFF*2*M_PI);
float dt = 1.0/fs;
float alpha = dt/(RC+dt);
output[0] = input[0];
for(int i = 1; i < points; ++i)
{
output[i] = output[i-1] + (alpha*(input[i] - output[i-1]));
}
}
it seems to me that the filtering part is not as it should be ... it supposed to be smoothed so i can get values like -1 and 1 ... Any ideas please?