Improving Pitch Detection

247 views
Skip to first unread message

Herr der Töne

unread,
Nov 16, 2015, 3:31:37 PM11/16/15
to AudioKit Users Group
I'm working on an App that needs a good pitch detection. Sadly, I have problems with low notes for example of guitars.

What I tried:
I got the detection going with help of the Audio Kit Demo (AKAudioAnalyzer). To improve the detection I maxed hopSize and tried different peaks parameters for AKTrackedFrequency. I also added a LowPass (750 Hz) to isolate the signal and experimented with different EQ settings I determined by analyzing the signal externally. I recognized that all my Apple devices (iPhone 5s, iPad 4th Gen, MacBook Pro Retina 13") lose signal below 120 Hz and push around 200 Hz. So the recognition of notes with a fundamental of around 100 Hz very often get's tracked one octave to high. Differences between the fundamental and first overtone are about 20-30 dB. I tried to inverse this with corresponding EQ settings but couldn't get much better results.

What I wanted to try but wasn't yet able to:
AKTrackedFrequency uses multiple peaks to determine the fundamental frequency. I suppose the algorithm for that has something like a range between the first two partial frequencies and "thinks" 20-30 db are to high to make sense for a relation between these two peaks. I'd love to look into that algorithm and probably improve it for lower frequencies but cannot find out where to look since AKTrackedFrequency has like no functions at all and the documentation doesn't tell how it does what it does. 

Call for Help:
Can someone help me find the place where the peaks of AKTrackedFrequency are determined?

Thanks a lot!

Aurelius Prochazka Ph.D.

unread,
Nov 18, 2015, 2:38:31 AM11/18/15
to AudioKit Users Group
Hi,

Sounds like you did all that you can do without diving the deep dive.  AKTrackedFrequency is a wrapper for Csound's ptrack opcode.  This is defined in pitchtrack.c, which you could edit and recompile Csound for AudioKit.  It's a very deep dive, but you sound like you know what you're doing.

Aure

Herr der Töne

unread,
Nov 19, 2015, 4:40:43 AM11/19/15
to AudioKit Users Group
Hi,

well that's indeed a very deep dive. It's more like I know what I wanna do, but don't know how to :) Thanks anyway, I'll see how far I can take it.

hdt

Stephane Peter

unread,
Nov 19, 2015, 5:32:35 AM11/19/15
to AudioKit Users Group
Please let us know if you manage to improve on this, I could actually use a solution for this. I encountered much of the same problems when trying to do a simple tuner.

As Aure said, this is mostly all done in Csound itself, we do have our own fork of it that we build for AudioKit though, so you may want to check it out:


It has a few patches from the mainstream csound, and also includes special scripts to build binaries for iOS / OS X / tvOS.
Reply all
Reply to author
Forward
0 new messages