BPSK SYSTEM SIMULATION We simulate the generation of random variables r0 and r1, which constitutes the input to detector.The detector output is compared with the binary transmitted sequence and an error counter is used to count the number of bit errors.