Measuring Input Frequency

New user, maybe this is simple and obvious but I’ve searched around for a while and I’m not seeing anything. My application needs to determine and monitor the fundamental frequency of the input in real time. Is there anything in the library designed to do this, or any examples I could look at?
TIA, Karl

There was some discussion about this here: Feedback Effect (Freqout, AcouFiend, etc)

Wow, that’s quite a thread. I was really hoping there was some hardware support for this. Before I dive into doing this purely in software I want to dig into the Cortex DSP to see whether it can be utilized.

The only “DSP” instructions that are present are related to running low precision integer operations and are rarely useful for audio that typically utilizes FPU. Pretty much everything you’ll see running on this MCU is done in software.

Thanks antisvin, yeah I looked into it and there’s just a few math functions.

I have a pretty good solution for this working now. I don’t see how to upload a cpp file but at some point I will put it up on github and link to it from here. In the meantime if anyone wants a frequency detector let me know and I’ll get you the cpp file.

  • Karl

I’d be interested to see the code! Still very early days but I am thinking about filterbanks and would be interested in monitoring the frequency of the input!

There is a decent, monophonic, time-domain pitch detection implementation in the Cycfi Q library. It works well, but you need to define your frequency range of interest as narrow as possible, and condition the signal (Clip, BP filter, gate, and compress) to get the most out of it.

I created a template project for working with this library on the Daisy.

1 Like

I thought I had put this up but maybe I forgot. Here’s the code on github. This is for seed with petal, so if you’re running seed alone of course you’ll need to make some adjustments. It’s very accurate and pretty fast. I was using a Fender P bass for testing.