GestureSynth.me

Music calculator

Audio THD Calculator

Calculate audio THD from fundamental and harmonic RMS amplitudes. Report percent and dB with explicit harmonic selection and noise limits.

audio thd calculator

Audio THD Calculator guide

Combine measured harmonic amplitudes into total harmonic distortion relative to a known fundamental. Enter RMS magnitudes in one consistent linear unit, such as volts, millivolts or calibrated FFT amplitude.

Play the instrument ↑
Input reference
THD ratio = √(H₂² + H₃² + … + Hₙ²) / F₁.

Formula and input units

THD ratio = √(H₂² + H₃² + … + Hₙ²) / F₁. Multiply by 100 for percent, or use 20 × log10(ratio) for dB. The fundamental must be positive. The comma- or space-separated harmonic list accepts up to 20 nonnegative values.

Worked examples

With a fundamental of 1 and harmonics of 0.01 and 0.005, combined harmonic RMS is approximately 0.01118034. THD is 1.118034 percent, approximately −39.0309 dB relative to the fundamental.

A fundamental of 2 with one harmonic of 0.02 gives 1 percent THD, or −40 dB. Multiplying all amplitudes by the same factor leaves the ratio unchanged. A list containing only zero gives zero percent and negative-infinite dB.

Using the result

Measure amplitudes on a consistent RMS basis and identify the harmonic orders included. Keep the fundamental outside the harmonic list. If an analyzer reports peak amplitudes for all sine components, convert consistently or confirm that the common scale factor cancels in your ratio.

Record the bandwidth, measurement frequency and analyzer settings with the result. Leakage from a poorly chosen FFT record can contaminate nearby bins. Calibrated harmonic magnitudes are a prerequisite to interpreting the arithmetic as a meaningful distortion measurement.

Build a reproducible harmonic measurement record

Keep a table with each included harmonic order and its measured RMS magnitude. For a 1 kHz fundamental, the second and third harmonics lie at 2 kHz and 3 kHz. A measurement bandwidth ending below 3 kHz would omit the third harmonic, so two THD results with different bandwidths may differ even when the device and fundamental are unchanged.

If harmonic amplitudes are given as dBc relative to the fundamental, convert each one to a linear amplitude ratio using 10^(dBc/20). A harmonic at −40 dBc has ratio 0.01. Two harmonics each at −40 dBc combine to √(0.01² + 0.01²), about 0.014142, yielding 1.414214 percent THD. Adding the dB values directly would not represent the harmonic energy sum.

The fundamental normalization used here can be compared with total-signal normalization in a deliberately large example. If the fundamental is 1 and the combined harmonic RMS is 0.5, this calculator gives 50 percent THD. Normalizing instead to total RMS √(1² + 0.5²) gives about 44.721 percent. State the chosen definition when comparing a result with a specification.

When harmonics approach an instrument noise floor, uncertainty in the measured amplitudes can dominate a finely rounded calculation. Repeat the measurement with a suitable range and known bandwidth, and retain analyzer settings. A displayed zero may mean a component was below detection rather than exactly absent. Entering zero here represents a mathematical zero for that chosen component and does not establish the measurement system detection limit.

For a calibration check, scale the fundamental and every harmonic by ten and confirm that THD stays unchanged. Then retain the fundamental and double only one harmonic. The new total depends on the sum of squares, so it need not double unless that harmonic is the only contributor. This pair of checks distinguishes harmonic aggregation from a simple arithmetic average of amplitudes or percentages.

Assumptions and limits

The result includes only the harmonics you supply. It excludes broadband noise, DC, unrelated tones and any omitted higher harmonics. THD+N uses a residual containing noise as well as distortion and therefore needs a different input and measurement procedure.

Some specifications normalize distortion to total signal RMS instead of the fundamental. This page explicitly uses fundamental normalization. At high distortion those conventions differ. Values expressed in dB must be converted to linear amplitudes before entering this form.

Answers before you play

Common questions

Do I enter dB values in the harmonic list?

Enter nonnegative linear RMS amplitudes. Convert amplitude dB values to linear ratios or matching physical units first.

Does the tool analyze a WAV file?

It calculates from measured amplitudes supplied in the fields. It does not extract an FFT from a file.

Why can omitted harmonics matter?

Every included squared harmonic increases the sum. Leaving out significant harmonics understates the chosen total.

How do I use harmonic levels reported in dBc?

Convert each harmonic with 10^(dBc/20), enter those linear ratios in the harmonic field, and use a fundamental of 1. Keep the reported harmonic orders, bandwidth and amplitude conventions with the result so the calculation can be reproduced.