Audio frequency measuring

craigyb

Active member
Recently I started adding autotune to a polyphonic midi to CV. I was looking at what libraries are available and there seems to be several. First I tried Freqmeasure and it didn't work, took a short while to realize it's not been developed past Teensy 3.2 and I'm using a T4.1.

I think the same is true of FreqCount as that gave me similar issues.

I tried using interrupts but there was no accuracy to two decimal places, so I persevered with Freqmeasuremulti.h. After struggling for several days with incorrect reads I started looking at my hardware and I was feeding a perfect squarewave into the Teensy at 3.3v it was still not giving me good readings. So I found that a narrow pulse was required and I fed that through a Schmidt trigger to get a nice pulse and I started getting reasonable accuracy.

So now I'm at the stage where I can read accurately the VCOs from around 4Hz to 1.5kHz, but after that the readings are very unstable and I'm not able to average the readings, making the pulse slightly wider helps, but I still cannot measure it properly.

Does freqcountmany actually work, it seems to have very little support but is recommended above 1kHz.

I'm quite happily reading and adjusting control voltages to make the autotune work, but I'd like to finish off this final part to around 6kHz.
 
What exactly are you trying to measure? An AC signal that is centered around zero or a digital input? Freqcount will definitely only work with the latter (it counts transitions from low to high) and I suspect FreqMeasure is the same except it counts the length of the pulses.
 
It's a squarewave output of a vco, I have PWM control of it so I can vary the width. The voltage is 0-10v but I fed it through a voltage divider and Schmitt trigger to get a 3.3v pulse.
 
In that case FreqCount on the Teensy4 should work fine, it runs off a 150MHz clock so can handle frequencies up to 75MHz.
 
But frequency count does not work on a T4.1, it's not supported, although according to the blurb it is and countmany is just a .ino file according to the GitHub
 
Back
Top