TransWikia.com

How to determine guitar tones played as early as possible?

Computational Science Asked on January 26, 2021

I want to detect chords on a guitar as early as possible, but my approach with a sliding window and a filter bank seems to introduce too much lag.

Would required observation time decrease by using a model where there are only a finite number of tones possible and only a finite number of simultaneous tones? (I.e. the different strings of the guitar).

I would suppose that for the system to not be underdetermined the number of samples would have to be at least as many as the number of guitar strings, and the time window would have to be at least on the same time scale as the tone with the shortest period. Or maybe the number of samples would have to be at least the same as the dimension of the model space (something like ~6 * 20)? And probably the amplitude resolution of the microphone together with the slowest frequency would set a constraint too?

2 Answers

I think that's the way to go. If you do a Fourier transform, you have to do a trade-off that's a variation on the Schroedinger uncertainty principle: The shorter you take your time window if you look at a non-periodic signal, the less well defined your frequency spectrum is.

But you can also think of it the following way: You probably want to know frequencies down to, say, 100 Hz. That means that just one period of that signal is going to take 10 ms, and you probably want to observe several periods to really say for sure that that frequency is there and you're not just moving through a transition in the pressure-as-a-function-of-time period. So you have to expect that if that's where your frequency region of interest starts, you won't be able to go substantially shorter than time windows of around 100 ms. I don't know whether that's a time lag of the kind you're concerned about, but there isn't going to be a way to make a determination on tones and chords much faster than that.

Correct answer by Wolfgang Bangerth on January 26, 2021

I'll add a few other thoughts. First of all, I assume you do not exactly need the fastest way to determine guitar tones ("as early as possible"), but just one that works well with a reasonably short lag.

So what you need is some numerical method that inputs samples of your guitar tone and outputs the dominant frequency (while neglecting other higher harmonics). There are several methods to do so among them the Fourier transform, Wavelet transforms, and harmonic inversion. Of these, the Fourier transform is the basic method with which I'd start to play around.

So you plug your string, record it, and apply a Fourier transformation. First, as mentioned in the answer by @WolfgangBangerth, you need some kind of temporal window (ranging back a fixed duration from "now") for your FT. This is because as you change the tune, you want to get a new result, and not a superposition of the previous tune and the new one. More general, you probably want to apply a specific window function (like "Hamming" and so on) because this makes the signal periodically and thus removes artifacts in the frequency range (at the cost of broadening the peaks).

When you got the results from the FT, you have to spot for the position of the dominant tune, i.e. the largest peak, which must be done automatically. For this, one can possibly apply further methods such as interpolation, averaging over frequencies, etc.

The previous approach cooresponds to a single tone. When you want to determine chords, you can basically do the same process several times. However, I would assume that the problem then becomes quite harder, as you have to separate harmonics from "real" plugged tones and also neglect irrelevant artifacts.

Answered by davidhigh on January 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP