English 中文(简体)
iPhone microphone high-pass filter
原标题:

In my app, I am using the AVAudioRecorder to detect input from the microphone. However, I need to create a high-pass filter so that I only register higher-pitched sounds. I ve looked into FFT, but I can t figure out how to implement it. So, now I m looking to kind-of fudge an FFT with a high-pass filter.

Any help would be greatly appreciated! Thanks!

最佳回答

Have a look at Wikipedia s article on High-pass filters, especially the section on algorithmic implementation of one.

For the lazy, here s the pseudocode implementation:

// Return RC high-pass filter output samples, given input samples,
// time interval dt, and time constant RC
function highpass(real[0..n] x, real dt, real RC)
    var real[0..n] y
    var real α := RC / (RC + dt)
    y[0] := x[0]
    for i from 1 to n
        y[i] := α * y[i-1] + α * (x[i] - x[i-1])
    return y
问题回答

Using an FFT would be a sledgehammer solution in this case. A simple FIR or IIR filter should suffice, but you need to decide on the design parameters for the filter first, i.e. cut-off frequency (-3 dB point), pass-band ripple, stop-band gain, and whether you care about phase response or not.





相关问题
Playing a Sound With Monotouch

No matter what I try (build -> content, NSUrl, filename) I get a null exception : file not found when I try to play a .caf sound file in monotouch. //var path = NSBundle.MainBundle.PathForResource("...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

Play sound in iPhone web app with Javascript?

I m currently creating an iPhone web application for piano chords, and I wanted to add an option that would let the user press a Play button and play the selected chord. However, I m not sure how to ...

热门标签