This function demodulates BPSK modulated signals. It takes in a signal, samples it based on the bit rate to extract individual bits. It uses the sampled signals and reference sine and cosine waves to calculate inphase and quadrature values to determine if each bit is a 1 or 0. It then plots the original signal, demodulated binary data and received binary values.