Incremental frequency keying (IFK) is a modulation scheme where the transmitted bits are represented by an increase or decrease in the frequency of the signal.
For example, a bitstring 1010011 can be transmitted with IFK with a base frequency of 500 Hz and a shift of 50 Hz can be sent as follows.
IFK is useful because it is a self-clocking signal. Each transmitted bit causes a shift in the frequency, and can be detected easily.
If there are long runs of 0’s or 1’s, the tone will deviate too much from the base frequency.
const auto DATA = "0101010111001101010100010101010100010111101000";
// Incremental frequency keying
auto freq = 900;
for (size_t i = 0; i < strlen(DATA); i++) {
auto c = DATA[i];
auto shift = 200;
if (c == '0')
shift = -shift;
freq += shift;
play_tone(freq);
}