12

I am working on an app that analyzes incoming audio from the built in microphone on iPhone/iPad using the iOS 6.0 SDK.

I have been struggling some time with very low levels of the lower frequencies (i.e. below 200 Hz) and I have (on the web) found others having the same problems without any answers to the problem.

Various companies working with audio tools for iOS states that there was (previous to iOS 6.0) a built in low-frequency rolloff filter that was causing these low signals on the lower frequencies BUT those sources also states that starting with iOS 6.0, it should be possible to turn off this automatic low-frequency filtering of the input audio signals.

I have gone through the audio unit header files, the audio documentation in Xcode as well as audio-related sample code without success. I have played with the different parameters and properties of the AudioUnit (which mentions low-pass filters and such) without solving the problem.

Does anybody know how to turn off the automatic low-frequency rolloff filter for RemoteIO input in iOS 6.0?

Leif
  • 121
  • 1
  • 5

2 Answers2

15

Under iOS 6.0 there is the possibility to set the current AVAudioSession to AVAudioSessionModeMeasurement like this:

[[AVAudioSession sharedInstance] setMode: AVAudioSessionModeMeasurement error:NULL];

This removes the low frequency filtering.

Link:

http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAudioSession_ClassReference/Reference/Reference.html

I hope this helps.

Martin Jun
  • 219
  • 3
  • 6
  • The documentation states "When this mode is in use, the device does not perform automatic gain adjustment". There's nothing that says that the low pass filtering is disabled. – Nikolai Ruhe Mar 20 '13 at 14:19
  • 2
    The automatic gain adjustment includes the low-frequency filtering. You'll see the difference, if you process the microphone data via fft. – Martin Jun Jul 25 '13 at 13:31
-1

I'm not sure if there is any way to ever accomplish this on these devices. Most microphones have difficulty with frequencies below 200 HZ (and above the 20 kHZ range as well). In fact, a lot of speakers can barely play audio at that range either. In order to get a clean signal at the <200 HZ range, you would require good enough hardware, which I think is a bit beyond the capabilities of the built in microphones of the iPhone/iPad. That's probably why Apple has filtered out these low frequency sounds, as they cannot guarantee a good enough recording, OR a good enough playback. Here's a link describing the situation better for the older devices (iPhone 4, iPhone 3GS, and iPad 1).

Apple is also very picky about what they will and won't let you play with. Even if you do find out where this filtering is taking place, interrupting that code will most likely result in your app being rejected by the app store. And due to hardware limitations, you probably wouldn't be able to achieve what you want to anyways.

Hope that Helps!

msgambel
  • 7,320
  • 4
  • 46
  • 62
  • downvoted: while it was once reasonable (but incorrect) speculation, the later answer by @martin-jun makes it obsolete. – Spike0xff Jun 01 '16 at 13:52