Feedback Effect (Freqout, AcouFiend, etc)

This. I’ve also been down in this rabbit hole for the better part of a year now. Time domain pitch detection is a hard problem, and often ideas that work really well on synthesized waveforms fall flat on real world audio.

Joel’s BACF implementation from the Q library is by far the most robust I’ve found, and it is efficient enough for a the 50 to 500Hz I’m looking to cover with the Daisy Seed. But the implementation is complicated because it contains solutions to the problems real world signals present - hysteresis for noise, bias for stability, etc.

I agree, the most relevant part of this system, in terms of achieving this effect, is the relationship between the vibration caused by the speaker, and the high Q filter that is an electric guitar string. While this system can probably be whittled down to a feedback loop and a few filters, the “finger position on fret board” parameter is tricky part.

What you can’t do as well with a Cortex M7 yet. Your constraint here is knowledge. The engineers at Boss in 1985 had an entirely different set of constraints (and resources!).

1 Like

Frequency Detection

I’m coming at this from a position of great ignorance. But sometimes that’s where fresh insight can arise. I have an application where I really need to know the fundamental frequency but I haven’t done c++ in like 20 years. So, here’s my idea:

Monitor for zero crossings.
Keep a moving average of the time/samples between crossings.
Ignore crossings that are too far from the average (too soon), but if they don’t immediately re-cross then keep them. Crossings that are later than expected are assumed correct.
The duration of the moving average needs to be adjusted based on its value, so at a higher frequency it can respond more quickly.
The moving average is 1/2 the period of the frequency.
The moving average alone might not be enough to kick out harmonics and noise. Maybe also store the most recent high value (long time between crossings) as a sanity check.

Thoughts?

After doing more research I can see I’m way behind the power curve on this topic. But maybe I can be a fast learner? I’m considering a slimmed down budget correlation method and will report back if I make any headway. Something like:
Iterate a number of samples equal to the lowest frequency you need to detect and fill an array with the zero crossings. Scan the array to find the biggest gaps between crossings. The distance between the centers of those gaps is 1/2 the period.

On a side topic, I’m pretty sure guitar feedback isn’t speaker air movement to string as much as it is magnetic radiation from the voice coil directly to the pickups. I may be wrong but that’s how it seems to me having played in bands for decades.

  • Karl

I think low to moderate guitar feedback is mostly an air-string movement. You can tune the feedback by pressing the strings against the frets (like a silent chord) and tame it or stop it by muting them. And air-string feedback behaves differently whether you’re in a small room or open-air. Coil-pickup feedback sounds much more unusual to me, you have to stay close from the cabinet, the effect is high-pitched, much harder to control and cannot be stopped by muting the strings.

You might be right Fire, of course depends a lot on your rig as well.

So here’s what I’m going to try to do for frequency detection:
analyzeFreq:
scan x samples and locate first and second biggest zones with no zero crossings
x samples determined by lowest frequency you might be interested in
distance between the centers of these zones is trialHalfPeriod

add up the sample values (maybe skip every other to same time) in that area (center to center of no cross zones)
while nearing the end of that area monitor whether we’re at a sum of zero
when the sum is zero, that is the half period
calculate the frequency from the half period

Probably just processing a half period won’t be very accurate. So expand to 4 or 8 zero crossing zones if needed.

I don’t even know how to read the input into a buffer yet. So it will be a couple days probably, but I’d appreciate any input on my ideas.

After a few iterations I have a pretty solid frequency detection algorithm in case anyone is still interested. I’m running it with an electric bass and it’s not good enough to make a tuner, but can differentiate between notes.

But I don’t see how to upload a cpp file… :frowning:

1 Like