just_code_it
just_code_it

Reputation: 41

Extract data from bfsk signal using fft

I have an android app which record an FSK signal.The FSK signal is moduled like this:The sampling rate is 8000, 800Hz for bit '1' and 400Hz for bit '0'. Each bit is represented by 160 samples which means every 0.02 seconds the frequency changes if the data is 101010 for example.

I took the following template to record the audio signal: https://stackoverflow.com/questions/23432398/audio-recorder-in-android-process-the-audio-bytes only I record my data straithgly to a ByteArrayOutputStream. After I finish the recording, I transform the byte array into a normalized double array, I checked this function and it works.

My problem is I got stuck at this point. I want to resolve the data (the binary bits encoded with the different frequencies), I tried sending to the fft chunks of the double array with size 128 every time, I read some stuff about the fft, and I understood that 128 is too small.Only now I don't know how proceed from this point. If I understand correctly, I need to analyze 2 close frequencies and understand which frequencies I captured and resolve the appropriate bits and process analyzing the next 2 close frequencies. I don't have any idea on how to accomplish this. I tried searching for this in google and even here on SO, didn't find what I was looking for.... Any ideas/ suggestions?

Upvotes: 0

Views: 361

Answers (1)

hotpaw2
hotpaw2

Reputation: 70673

An FFT analyzes N/2 frequencies for length N, far more than you need.

A better algorithm might be exactly two Goertzel filters, one for each frequency, of length 160. Slide the filters by 16 samples (there will be 10X overlap), and look for a maximum difference between the two filter outputs for your one or zero detection.

Upvotes: 2

Related Questions