# How to properly filter a BPSK demodulated signal?

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?

• I'd say your filter doesn't have enough out-of-band rejection.
– MBaz
Apr 25, 2018 at 14:03

## 1 Answer

You must use a sampling frequency of at least the Nyquist rate, which is greater than 15 kHz in this case. It should be greater than $2(f_c + W/2) = 2 (10~\text{kHz} + W/2)$, being $W$ the signal's bandwidth.

You did not specify the bit rate, which also must be considered to determine the signal's bandwidth, and thus the Nyquist rate.

You signal is probably having time-aliasing. More details in the answers to the following question: A voice signal is band-limited to 3.3 kHz. What is the Nyquist frequency?