# (weighted) pitch analysis

**URL:** <https://discourse.flucoma.org/t/weighted-pitch-analysis/661>\
**Category:** Pre-Release Toolbox2 Usage\
**Created:** [September 26, 2020, 8:16pm UTC](https://discourse.flucoma.org/t/weighted-pitch-analysis/661 "2020-09-26T20:16:03Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![rodrigo.constanzo](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/rodrigo.constanzo/32/12_2.png) [@rodrigo.constanzo](https://discourse.flucoma.org/u/rodrigo.constanzo)\
**Post date:** [October 4, 2020, 11:22am UTC](https://discourse.flucoma.org/t/weighted-pitch-analysis/661/5 "2020-10-04T11:22:58Z")

</div>

> [@weefuzzy](#):
>
> I’m assuming you’re using ‘correct’, ‘wrong’ etc as shorthand for '(not) what Rod hears ’ rather than ‘this algorithm is demonstrably incorrect’?

In general, I meant with “ears”, though in the case of the sine wave example (550Hz), correct=input. It’s obviously more subjective and perceptual with acoustic sounds.

> [@weefuzzy](#):
>
> If I look at the lower end of this file in sonic visualizer, there are plenty of prominent peaks below 125 Hz, incl. a bit ~87Hz. Pitch estimators aren’t ears, by any stretch of the imagination (and how people resolve a sensation of pitch from inharmonic sounds is only sketchily understood in any case), so you might need to give it more to go on (e.g. constrain the pitch detection range)

I guess I meant having some more “vertical awareness” in the matter. For example, if I run that same audio file into `sigmund~`, I obviously get some wiggling around, but it hovers/finds 126Hz to be the fundamental. I don’t know the maths of what’s going on under the hood there, but I imagine it takes harmonics or at least octaves into account when determining what the fundamental is?

At the moment, using confidence weighting, it’s basically saying “I’m certain these pitches happened at some point in this file”, but there’s no way to figure out the relationship between them (harmonics) or make a meaningful(ish) (gu)estimate on what summary statistic would work best (mean/median/min/etc…).

Thanks for the mode thingy!

Testing it out on these sounds is interesting.

For the sine wave, I get 530Hz as the modal bin, which is slightly closer than 523, but not quite 550. That could be a bin width/resolution thing though.

Interestingly I get 390Hz for the metal sample (from my last post), which is a pretty prominent harmonic, so in that sense the mode picked out something more, um, “perceptually accurate” than the vanilla summary stats. This is without confidence weighting either.

> [@weefuzzy](#):
>
> If I look at the lower end of this file in sonic visualizer, there are plenty of prominent peaks below 125 Hz, incl. a bit ~87Hz.

Curious what you used here. I first used `spectrumdraw~` as it was kind of hard to ‘unstick’ my ears from the harmonics, and that got me down to 125Hz. In checking again now in iZotope I can see the lowest harmonic is that 125Hz one:

 ![Screenshot 2020-10-04 at 12.19.16 pm](https://discourse.flucoma.org/uploads/default/original/1X/946147baafd61fe7586fab7fc17b064b6e8476a4.jpeg)

I mean, I see some fuzzy stuff under that, but it doesn’t look like a harmonic of the sound, but rather noise/bin funny business.

---

_[View the full topic](https://discourse.flucoma.org/t/weighted-pitch-analysis/661)._
