1
$\begingroup$

I would like to compare between two signals (original signal and its encoded version) and plot the scores) as we do with STOI and PESQ. should we calculate the THD for each single signal separately then subtract the scores?

$\endgroup$
3
  • 1
    $\begingroup$ We need more info about this: what type of signals are comparing and what is the nature of the encoding and decoding process. For perceptual encoders, THD is generally not a good quality metric. $\endgroup$
    – Hilmar
    Dec 30, 2021 at 12:37
  • $\begingroup$ Thank you @Hilmar for your answer. Here is my explanation: I created a series of harmonics with different frequencies, then I saved it in a file (I'll call it signal_X). Afterward, I've encoded the previously created harmonics with LC3 codec (signal_X_hat). And I would like to compare between : signal_X and signal_X_hat. $\endgroup$
    – user60790
    Dec 30, 2021 at 15:03
  • 1
    $\begingroup$ Any mathematical definition of THD between two signal? $\endgroup$
    – ZR Han
    Dec 31, 2021 at 4:51

1 Answer 1

1
$\begingroup$

Assuming that you know the set of fundamental frequencies, you should be able to calculate the THD for either signal (original or encoded) as $$\frac{\sqrt{v_2^2 + v_3^2 + \ldots + v_n^2}}{v_1}$$ where $v_1$ is the signal amplitude at the fundamental frequency and $v_2, \ldots, v_n$ are the signal amplitudes at the harmonics of interest for that fundamental frequency.

If there are more than one fundamental frequency, you would include all of them in the denominator and all of the harmonics of interest in the numerator. Since this is a normalized quantity, you can take the difference between the original and encoded signal to get a measure of introduced distortion.

See the Wikipedia link for details.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.