# modulation – BPSK demodulation on scilab

I have a csv file which contains the time and magnitude of the BPSK modulated waveform.
I now want to demodulate this. Its bitrate is fc/128 (~106 kbit/s) and the carrier frequency is fc/16 (~847 kHz). I tried demodulating it using the below code:

Array=csvRead('modulated_wfm.csv');
col1 = Array(:, 1);
col2 = Array(:, 2);
t1 = linspace(0,0.00165,20635);
subplot(3,1,1);

plot(t1,col2);'

T = 106000;
f = 847000;
t = 0:0.00000008:0.00165;
cosine_func = cos(2*3.14*f*t);
demodulated=col2.*(sqrt(2/T)*cosine_func);


I don’t know what to do next. I am stuck. Can someone please help me with this?