For example here is a simple message in binary that I want to send via ultrasound:
Bit Stuffing
12 Byte Message (3 Time Stamps)
Bit Stuffing
01010101
10100001 00101110 01011001 00101110
10100001 00101110 01011001 00101110
10100001 00101110 01011001 00101110
01010101
Lets say we use 30kHz ultrasound at a sampling rate of 120kHz. Idealized the sound would look like this right ?
To realize this what one can do is just set a GPIO on the Pi to HIGH when sending a 1 and to LOW when sending a 0. But how do you do this at a constant specific frequency, so that you can just split the measured values into 33,3us windows where you just check if it was a 1 or a 0 ?