0

I am using this code I found to record mic audio, I am not writing the data into the PCM file, I simply write the data to a ByteArrayOutputStream variable: Android AudioRecord example

When I finish the record, I have a byte array. How should I analyze the byte array using FFT? Simply speaking, I am trying to analyze a FSK sound wave.

Community
  • 1
  • 1
just_code_it
  • 41
  • 1
  • 5
  • 1
    What's your problem? There are many fast FFT implementations for android. Just use a library. – code monkey Mar 08 '15 at 16:14
  • @codemonkey I'll clarify the question,I found this implementation: http://www.ee.columbia.edu/~ronw/code/MEAPsoft/doc/html/FFT_8java-source.html I dont really know how to use it, and there are 2 more implementations I found, but lets stay on this one, how do I need to use it? – just_code_it Mar 08 '15 at 17:53
  • The Java class that you have posted has a main method. The main method shows you how to use it. – code monkey Mar 08 '15 at 20:08
  • 1
    And keep in mind: To decode a FSK Signal you don't need FFT. – code monkey Mar 08 '15 at 20:16
  • I tried to explain it in an answer. – code monkey Mar 09 '15 at 09:26

1 Answers1

1

I think that I understood your question now. You want to know how to decode a FSK Signal with android? And to do this you want to use the FFT? You can achieve this without the FFT.

Android Demo App

There is the source code of an Android App that implements FSK Modulation/Demodulation.

The FSKModule.java implements a decoder that uses 3150Hz/1575Hz as mark/space. The important methods are findStartBit, parseBits, processSound and countPeaks. The implementation simply counts the number of peaks within a time slice. With the number of peaks you can infer to the corresponding frequency and decode the signal. This is easier and faster than using FFT.

Why not using FFT?

There is a nice blog that describes when to (not) use the FFT. (e.g. Why EQ Is Done In the Time Domain and other interesting things)

code monkey
  • 2,094
  • 3
  • 23
  • 26