0

I'm using python 2.7 to compare tonal differences in guitar stings. I asked this same question in dsp.stackexchange.com but didn't have much luck so I figured I'd ask here, too.

I've found that in matplotlib, there are some great built-in features such as matplotlib.mlab.magnitude_spectrum and matplotlib.mlab.psd

The magnitude_spectrum function seems to be the no brainer, as it is the FFT of the signal, showing each specific harmonic. However, when comparing various guitar strings, it's tricky to pinpoint each peak to compare. The PSD function gives very nice smooth graphs, which is perfect for obvious visual comparisons.

My understanding is that PSD's are useful for random signals but not necessarily known signals. Is this true? And is there any reason I shouldn't be using the PSD for guitar string comparisons?

Here's what 1 second of a guitar pluck looks like using PSD and magnitude_spectrum:

Note that these are plucks of the same string and not different strings. I'm trying to make sure that my plucks are consistent prior to comparing various strings.

PSD Magnitude Spectrum

Community
  • 1
  • 1

1 Answers1

1

They are providing you similar information. PSD is a measure of energy per frequency where as magnitude spectrum is just the frequencies present. Ultimately either should work.

The best way (IMHO), to determine if a specific guitar string is being plucked is to first create a filter to filter out noise you don't care about, and then to compare that against the power level of your un-filtered signal. Some general information on this are:

http://www.ee.columbia.edu/~ronw/dsp/

http://www.bsharp.org/physics/guitar

Clarus
  • 2,259
  • 16
  • 27