Arduino RTTY decoder

Istevene:
I've calculate the values in an empiric way.
Later I'll do some tests.. but I don't understand how to find the FFT bit number for the CHK() function

This calculation could be wrong.
FFT bin width = ((Samplerate / 2) / (NumberOfSamples / 2)) * 2
CHK value = (SpaceFrequency / FFT bin width)
Then round CHK to the nearest integer.