# How to represent ratio between harmonics in audio spectrum

I was provided a report where the amplitudes of spectral harmonics have been extracted from several audio files. The amplitudes have been extracted using Audacity's spectrum visualizer, where the spectrum is provided in dB. I want to compute the ratio between the amplitude of the fundamental and the amplitude of each harmonic. Does it make sense to perform a ratio in dB or should I use the difference between amplitudes? Thank you.

• I would use a difference in log domain and ratio in linear one. – jojek Sep 25 '15 at 10:05
• Recall that a dB is just the logarithm of a ratio, multiplied by 10. We use dBs because they help us compare 2 quantities that may have largely different values. So in your case, if you see that those differences are huge, maybe you would prefer to use dBs. I would. – vaz Sep 25 '15 at 10:34
• @Francesco Did you receive a satisfactory answer to your question? – Richard Lyons Sep 25 '15 at 11:45
• What are you trying to do? What is the goal of this analysis? – endolith Sep 25 '15 at 13:54
• I am analysing several instruments by comparing the relative amplitude of each harmonic (for a specific note), and I want to represent it in the most appropriate way. The available data (harmonics amplitude) are in dB because they have been extracted using Audacity Spectrum analyser – firion Sep 25 '15 at 14:37

## 2 Answers

Based on your most recent comment, it sounds violins' like you're measuring harmonic levels from various violins. And you want to represent your measurements in the most appropriate way. The question is, "What is the most appropriate way?" To answer that question ask yourself, "What information do I want to convey to my audience?" Francesco, does your audience want to look at various violins' spectral plots, or maybe just look at bar charts of various violins' harmonic levels, or what?

If you can tell us exactly how you want to represent your measured harmonic dB results, I'll bet someone here can help you.

Because you're dealing with dB values, forget about any notion of computing ratios. Jaket is correct. If the measured dB value of the fundamental freq is 'x' dB and the measured dB value of the 1st harmonic freq is 'y' dB, then you can say that the 1st harmonic is x-y dB below the fundamental. That subtraction works fine for both positive and negative values of 'x' or 'y'.

I think what you are referring to is called the Total Harmonic Distortion (THD). THD is the level of the fundamental divided by the level of the harmonics. You can express this as either as a ratio (X/Y), a percentage (X/Y * 100) or in dB (20*log10(X/Y)). A percentage is probably what most people are familiar with.

• Actually I am dealing with violin notes (being quasi-periodic they have a spectrum composed by the fundamental and the harmonics), however the issue is the same. So, if I already have the dB of the hamronics, I should perform the difference in order to obtain the ratio in dB right? – firion Sep 25 '15 at 10:58
• How can you have the dB of the harmonics unless that is relative to something else? – jaket Sep 25 '15 at 11:01
• In any case if you have the "dB" of the harmonics and the "dB" of the fundamental - assuming both are on the same scale - then you can compute the distortion in dB as dbFund - dBHarms. – jaket Sep 25 '15 at 11:03