just_code_it
just_code_it

Reputation: 41

Audio record in android and FFT

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.

Upvotes: 0

Views: 2765

Answers (1)

code monkey
code monkey

Reputation: 2124

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)

Upvotes: 1

Related Questions