This script simulates the Binary Phase Shift keying. Since BPSK is a digital modulation scheme, you can modulate as many bits as you want. however, I have only simulated it for few bits, so that the results are visible.
This is code for BPSK only, means it can only modulated two digital states on two different phases.
I hope this will help out students and instructors alike.