smalandr
Newbie level 4
Hi all,
in order to test various signals from different sound softwares, I am measuring parameters such as THD + N for the rendered files.
However I have come to a critical point of evaluating the results, and those are a bit confusing.
After applying the fft transformation, in linear scale (no dB) I have the spectrum of the signal I need to measure.
I then take half of the samples (symmetric) and square them ^2 .. in order to get the Power of the all harmonics. I am identifying where the fundamental is - actually I let the code do that, and I include some samples before and some after, depending on how many samples are not around zero close to the fundamental - the "bell" around the fundamental. Then it should be the sum of all Power of the signal points apart from the fundamental points - divided by the Power of the points around the fundamental.
Does this sound correct? I am pasting the code, which I hope makes some sense:
[a,b]=max(Sig24);
spectP=(Sig24_nodB(1:2048));
spectP=spectP.^2;
spectP_peak=sum(spectP(b-2:b+2));
allpowers = sum(spectP) ;
num= allpowers - spectP_peak;
den=spectP_peak;
THD_N=(num/den) * 100
Many thanks,
Stef
in order to test various signals from different sound softwares, I am measuring parameters such as THD + N for the rendered files.
However I have come to a critical point of evaluating the results, and those are a bit confusing.
After applying the fft transformation, in linear scale (no dB) I have the spectrum of the signal I need to measure.
I then take half of the samples (symmetric) and square them ^2 .. in order to get the Power of the all harmonics. I am identifying where the fundamental is - actually I let the code do that, and I include some samples before and some after, depending on how many samples are not around zero close to the fundamental - the "bell" around the fundamental. Then it should be the sum of all Power of the signal points apart from the fundamental points - divided by the Power of the points around the fundamental.
Does this sound correct? I am pasting the code, which I hope makes some sense:
[a,b]=max(Sig24);
spectP=(Sig24_nodB(1:2048));
spectP=spectP.^2;
spectP_peak=sum(spectP(b-2:b+2));
allpowers = sum(spectP) ;
num= allpowers - spectP_peak;
den=spectP_peak;
THD_N=(num/den) * 100
Many thanks,
Stef