Here I'm talking about the less-than-ideal situations, in other words, the audio sample data may have burrs or error bits in it.
Encode and decode theory:
I am using FSK to encode my original binary data (
lead-byte), and transform the square wave it generated to sine wave. Then I generate a stream of audio samples through mic (for example, a stream of 44100 16-bit integers for every second etc.).
When I decode (
c language), the key factor is,
0:1:lead-byte = 1:2:4(or other ratio).
original binary data:
encoded wave data:
lead-byte...lead-byte 0|1...0|1 lead-byte.
bad wave 1
Now my decode method is simple (just count the samples up and below zero, and get stable lead-byte width first, then use
1:2:4 to calculate 0 and 1's width). Should I use more complex mathematical analysis in decoding? If so, what theory can I use, Fourier? Gaussian Noise? Rayleigh Fading? Goertzel algorithm?
I have to point out that I am totally new in audio stuff. Any help would be much appreciated!