for (i=0; i>15)	* (outhii>>15)	+ (outhiq>>15)	* (outhiq>>15)
	- (outloi>>15)	* (outloi>>15)	- (outloq>>15)	* (outloq>>15);

Listing 2—Every time a sample is received, it’s put into circular buffer rxsamples[]. When the routine is entered, rxptr points to the oldest sample in the buffer. The secret of the FSK demodulator lies in the following few lines of C code.