Detecting blowing on the iPhone microphone? -
I am trying to figure out that when the user is flying in an IIC mai. Right now I am using the SCListener class to call
if ([[SCListener sharedListener] peakPower]> 0.99) Although in an NSTimer It sometimes gives returns when I'm not flying, is there a sample code to check if the user is flying in the mic or not?
I would recommend power. The first signal always seems to be some transient noise which would be confused with the instant readings is; Low-low filtering helps in reducing it A good and easy low-pass filter will be something like this:
// Make it a global variable or a member of your class: Double Micropower = 0.0; // This value should be according to your liking (between 0 and 1); Conf double alpha = 0.05; // Make this every 'tick' of your application (like every 1/30 of one second) double instantaneous power = [[SCLister shared listener] Peeppauge]; // This low-pass filtered value is the main line in computing micropower = ALPHA * instantaneous power + (1.0 - alpha) * MikePower; If you have an example blowing on your microphone
Comments
Post a Comment