# Detecting frequency when frequency is not sufficiently greater than baud rate

I'm writing software this software for decoding audio samples of FSK data back to bits (ASCII, etc). The software is working really well at this point for decoding FSK when the mark and space frequencies are sufficiently greater than the baud rate.

However, I detect a frequency of $$0\textrm{ Hz}$$ when the mark and space frequencies are decreased to values which are not sufficiently greater than the baud rate. I've been using a pretty basic zero crossing algorithm for detecting the frequency present in a given interval. I gather that this is because the frequency is not great enough to have any zero crossings during the interval that I sample.

• What are some other methods for detecting whether the mark or space frequency are present in a given interval when the baud rate is not sufficiently greater than said frequencies?

• And as a follow-on question, is it common for the mark and space frequencies to not be sufficiently greater than the baud rate in real-life FSK implementations?

For example, I read (here and in other places) that the mark and space frequencies for Bell 202 (1,200 baud) are $$1200\textrm{ Hz}$$ and and $$2200\textrm{ Hz}$$, respectively -- the algorithm I'm currently using can detect the $$2200\textrm{ Hz}$$ frequency but not the $$1200\textrm{ Hz}$$ frequency.

• Well this classical FSK isn't used that often anymore; basically because it's not that easy to implement in software, and more importantly, not easier to implement than something spectrally more efficient. So "is this common" is a pretty relative term – but yes, there are quite a few systems that do that. The other day I learned about a class of aircraft transponders, for example. – Marcus Müller Jun 19 '16 at 7:34
• What I can't really read from your question, though: does your system already know what the different subcarriers will be, or is this part of what's to estimate? – Marcus Müller Jun 19 '16 at 7:36
• also, have a look at grinspector.wordpress.com – Marcus Müller Jun 19 '16 at 7:37
• @Dan: if you read this above, the takeaway is the following: you don't actually "gain" any information, but think about what happens if you shift your mark/space frequencies in baseband by multiplying the whole signal with a $e^{j2\pi f_\text{offset}}$ so that they are no longer centered around 0, but have a much higher frequency – that way, you potentially get more than one period of mark/space frequency per symbol duration. – Marcus Müller Jun 19 '16 at 17:17
• simply multiply each complex sample with $e^{j2\pi\frac{f_\text{shift}}{f_\text{sample}}}n$, with $n$ being the sample number. – Marcus Müller Jun 20 '16 at 10:01

You should read https://en.wikipedia.org/wiki/Minimum-shift_keying. The minimum frequency distance between two FSK tones is half the baud rate. But even at 1X the baud rate, the tones look blurred together in the spectrum. Note that, without any pulse shaping, the bandwidth of each tone is effectively the baud rate. This is related to the implicit rectangular window that is applied by the digital modulation. So you have two tones that each have a width of the baud rate. When the separation between them is the baud rate, the left sided half bandwidth of the high tone combines with the right-sided bandwidth of the low tone and you get one big blob. If you were to pulse shape the signal in the phase domain, the single-tone bandwidth would be reduced and you would get more visual separation between the tones.

Demodulation for MSK is usually done in the phase domain, not the frequency domain for this reason. If you plot the unwrapped phase of the signal you would see the phase sloping up for the high tone and sloping down for the low tone (assuming you're using a complex analytical form of the signal). You can demodulate the signal in the phase domain by using a filtered differentiator on the phase of the baseband signal which is basically an FM demod which turns an FSK signal into a BPSK signal. You can also use a Phase locked loop (which is another form of FM demod).