-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Level threshold #26
Level threshold #26
Conversation
Signed-off-by: Guillaume Laurent <[email protected]>
This allows pitch detection to only be started if the input signal is above that threshold. Two limitations : - I don't know how a possible error in InputSignalTracker.setupAudio() should be handled - I don't know how to do the same in OutputSignalTracker. For the moment I've just added the levelThreshold var even if it's a no-op. Signed-off-by: Guillaume Laurent <[email protected]>
Awesome, thanks for your contribution @glaurent! |
you're welcome |
@glaurent can you point me to any resources that explain the level threshold concept and how the values should be interpreted? Thanks, Paul |
@PCrompton it's quite simple : the InputSignalTracker analyses the audio signal received from the device's microphone. This signal has a level. My patch simply lets you set a threshold under which the signal will not be analysed. This is a simple way to filter out low level noise and avoid recognizing "random" notes. |
@glaurent I understood that much, and I noticed that you set the guitar tuner's threshold to -30.0. I played around with different values and found that above -20.0 isn't all that helpful. Does setting the threshold help to filter out harmonics? I'm having trouble below A3 detecting the correct octave. It usually interprets it as the first or second partial. For instance I play G3 and it interprets it as D5, or I play F3 and it returns F4. This is with the |
@PCrompton you'll have to play with the setting, depending on how close the device is to the sound source. |
This branch implements a "signal level threshold" feature which lets the user set a signal level below which no pitch detection is attempted. This avoids the PitchEngineDelegate to be called if there's silence or near silence.
Limitation : this feature is only implemented for the InputSignalTracker, not the OutputSignalTracker. I suppose it's possible, but since I don't know much about AVFoundation I'm not sure how to do it. It's also likely that my implementation in InputSignalTracker could be improved.
Also, there should be a way to get the peak/average levels, so the user can set the threshold without guessing.
This branch also updates the Podfile of the GuitarTuner example.