frequency readout

Post any examples or modules that you want to share here
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: frequency readout

Post by Spogg »

MyCo and Martin Hi!

Unfortunately I'm not really able to fully understand your comments; my lack of education and not your fault!
In principle I don't understand how any algorithm could determine what was correct and accurate, other than maybe a neural net based AI perhaps (I do have one in my skull). Then of course there's time-criticallity to worry about in any processor. I imagine than any software would involve recursion and polling but how would it know when it had got the correct answer?
Many years ago (I'm 61) I made a hardware device that you sang or whistled into and it would display the note on a keyboard shaped array of LEDs. The zero-crossings were timed and the result fed into a ROM I programmed to convert the period value into the LED position code. The tricky part was, of course, to get the zero crossings accurate to the fundamental. My solution then was to use a low-pass VCF. It's output amplitude was compared to the incoming raw signal and the result was fed into the VCF's control voltage input. I found that by setting the ratio of about 20:1 I could get the filter to pass just the fundamental, i'e when the VCF's output was about 5% of the audio input amplitude.
I bet some of you uber-clever people could program such a system but I worry about the feedback path that would be involved and,as I found experimentally, the timing and response of the VCF's control signal was all-important and very critical.

Cheers

Spogg
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: frequency readout

Post by martinvicanek »

Spogg, I had this schematic lying around which does pretty much what you describe. It uses a tunable 4th order Butterworth lowpass filter, a dual envelope follower and a comparator in a control loop setup. The lowpass cutoff adapts to the spectral content of the input, such that the amplitude is reduced to 70%. That's a higher value than your 5%, however it provides good results with my (steeper?) filter. There are other adjustable parameters in the loop which one can play with, and as you point out the feedback timing is crucial. The lowpass output is then analysed for zero crossings, using linear interpolation for subsample resolution. All in all it works reasonably well, not great.
ZX_PitchExtractor.png
ZX_PitchExtractor.png (23.66 KiB) Viewed 22239 times
Attachments
AdaptiveLowpassPitchDetection2.fsm
(16.81 KiB) Downloaded 1253 times
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: frequency readout

Post by Spogg »

Wow Martin!
That's a great piece of work and so much more than I'm capable of yet. Worked straight out of the box.
Many thanks for sharing this.
I shall study it and hopefully learn something :D
Cheers
Spogg
BobF
Posts: 598
Joined: Mon Apr 20, 2015 9:54 pm

Re: frequency readout

Post by BobF »

Hi Martin,
YES, and wow, very cool. Keep up the great work! I think we can all learn from Martins great work and of course a few others that have been with Synthmaker and now Flowstone for some time.
Take care, BobF
User avatar
rocknrollkat
Posts: 213
Joined: Mon Jan 04, 2016 7:04 pm
Location: Oakland Gardens, New York City, U.S.A.
Contact:

Re: frequency readout

Post by rocknrollkat »

BobF wrote:Hello all,

Could some kind person show me a simple fsm frequency readout (meter) for reading oscillator and such outputs.

Thank you, BobF.....


Hi Rob,
Here's how I keep track of oscillator outputs.
This is probably not what you're looking for, but if you want to see the readouts in a Flowstone schematic, just break into the oscillator and rig up something like this....

ROXY :D
Attachments
Frequency Readout.fsm
(106.92 KiB) Downloaded 1105 times
BobF
Posts: 598
Joined: Mon Apr 20, 2015 9:54 pm

Re: frequency readout

Post by BobF »

Many thanks rocknrollkat,

for this and all yours others. Keep them comming, some good stuff here. They all go right into my tool box! May not need them now, but when I do they will be very much appreciated

Till next time. BobF.....
User avatar
rocknrollkat
Posts: 213
Joined: Mon Jan 04, 2016 7:04 pm
Location: Oakland Gardens, New York City, U.S.A.
Contact:

Re: frequency readout

Post by rocknrollkat »

Hi Bob,
I'm glad you enjoy my Dead Simple projects !
I find they come in really handy when you have to hold up a project to solve a simple problem.
I'll keep 'em coming as long as you enjoy 'em !

Best Regards,

ROXY :D
Post Reply