Convert a character binary bit-stream transmitted at a certain baud-rate into an audio stream using Audio Frequency Shift Key (AFSK) using the Bell 202 standard at a given sample rate.
Frequency of sine audio wave: '1' = 1200 Hz, '0' = 2200 Hz
Duration of each bit: based on baud-rate
Digitized audio stream is produced at the sample rate and is smooth between bits (initially starts at zero phase shift). Normalize final signal to +-1 peak-to-peak.
plot(binaryToBell202('101',1.2e5,600))
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers3
Suggested Problems
More from this Author61
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
For the case in the plot, binaryToBell202('101',1.2e5,600), there are three sine waves for the three bits, each of which is 1/600 seconds long. The first sine wave, at 1200Hz, goes through exactly two periods, so it starts and ends at zero; the second, at 2200Hz, goes through 3+(2/3) periods, so it starts at zero and ends at sin(2*pi*(2/3))=-sqrt(3)/2=-0.866; the third sine wave goes through exactly two periods again, and therefore should end at -0.866 again. This is independent of the sample rate. If you are trying to match the sine waves at the discrete points defined by the sample rate, then it gets more confusing.
I should have prefaced the previous comment with "If I understand what is going on, ".
Sorry, should be fixed now.