• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

The Signal Chain: How do noise and distortion propagate through my system?

Active speakers, anyone?
 
Active speakers, anyone?
Speakers are not included in this analysis, active or otherwise. You could apply it to the amplifier(s) inside the speakers, if you know their specifications.
 
Speakers are not included in this analysis, active or otherwise. You could apply it to the amplifier(s) inside the speakers, if you know their specifications.
Morning Don. Thanks for all you've done for us. My comment was inspired by the complexity of putting together a well designed system from individual components, as you've so eloquently described. From a Sonos Five to a Focus 50 the convenience and quality of systems designed and implemented by audio engineers has gotten very appealing.
 
[...]
Distortion is correlated to the signal, but since each stage in the chain is independent, the distortion does not simply add linearly. Each stage will add a little delay and phase shift so that the distortion is not exactly in phase with the input signal. To calculate the output distortion Dout we again RSS the distortion from each stage (XXd):
  • Dout = sqrt[(DACd*G1*G2*G3*G4*G5)^2 + (G1d*G2*G3*G4*G5)^2 + (G3d*G4*G4)^2 + G5d^2]; [...]

RSS implies the signals are uncorrelated. The RMS level of the sum of correlated signals includes cross-products.

At any instant, the total distortion Dout is
Dout = DACd*G1*G2*G3*G4*G5 + G1d*G2*G3*G4*G5 + G3d*G4*G5 + G5d = ((DACd*G1 + G1d)*G2*G3 + G3d)*G4*G5 + G5d

The sum of squares is
sum(Dout^2) = sum((((DACd*G1 + G1d)*G2*G3 + G3d)*G4*G5 + G5d)^2)
= sum((((DACd*G1 + G1d)*G2*G3 + G3d)*G4*G5)^2 + G5d^2 + 2*(((DACd*G1 + G1d)*G2*G3 + G3d)*G4*G5)*G5d)
= sum((((DACd*G1 + G1d)*G2*G3 + G3d)*G4*G5)^2) + sum(G5d^2) + 2*sum((((DACd*G1 + G1d)*G2*G3 + G3d)*G4*G5)*G5d)
= (G4*G5)^2*sum(((DACd*G1 + G1d)*G2*G3 + G3d)^2) + sum(G5d^2) + 2*sum((((DACd*G1 + G1d)*G2*G3 + G3d)*G4*G5)*G5d)
= (G4*G5)^2*sum(((DACd*G1 + G1d)*G2*G3)^2 + G3d^2 + 2*(DACd*G1 + G1d)*G2*G3*G3d) + sum(G5d^2) + 2*sum((((DACd*G1 + G1d)*G2*G3 + G3d)*G4*G5)*G5d)
= (G4*G5)^2*(sum(((DACd*G1 + G1d)*G2*G3)^2) + sum(G3d^2) + 2*G2*G3*sum((DACd*G1 + G1d)*G3d)) + sum(G5d^2)
+ 2*G4*G5*sum(((DACd*G1 + G1d)*G2*G3 + G3d)*G5d)
= (G4*G5)^2*((G2*G3)^2*sum(DACd^2*G1^2 + G1d^2 + 2*DACd*G1*G1d) + sum(G3d^2) + 2*G2*G3*sum((DACd*G1 + G1d)*G3d)) + sum(G5d^2)
+ 2*G4*G5*sum(((DACd*G1 + G1d)*G2*G3 + G3d)*G5d)
= (G4*G5)^2*((G2*G3)^2*(G1^2*sum(DACd^2) + sum(G1d^2) + 2*G1*sum(DACd*G1d)) + sum(G3d^2) + 2*G2*G3*sum((DACd*G1 + G1d)*G3d)) + sum(G5d^2)
+ 2*G4*G5*sum(((DACd*G1 + G1d)*G2*G3 + G3d)*G5d)
= (G1*G2*G3*G4*G5)^2*sum(DACd^2) + (G2*G3*G4*G5)^2*sum(G1d^2) + (G4*G5)^2*sum(G3d^2) + sum(G5d^2)
+ 2*G1*(G2*G3*G4*G5)^2*sum(DACd*G1d) + 2*G2*G3*(G4*G5)^2*(G1*sum(DACd*G3d) + sum(G1d*G3d))
+ 2*G1*G2*G3*G4*G5*sum(DACd*G5d) + 2*G2*G3*G4*G5*sum(G1d*G5d) + 2*G4*G5*sum(G3d*G5d)
= (G1*G2*G3*G4*G5)^2*sum(DACd^2) + (G2*G3*G4*G5)^2*sum(G1d^2) + (G4*G5)^2*sum(G3d^2) + sum(G5d^2)
+ 2*G1*(G2*G3*G4*G5)^2*sum(DACd*G1d) + 2*G1*G2*G3*(G4*G5)^2*sum(DACd*G3d) + 2*G2*G3*(G4*G5)^2*sum(G1d*G3d)
+ 2*G1*G2*G3*G4*G5*sum(DACd*G5d) + 2*G2*G3*G4*G5*sum(G1d*G5d) + 2*G4*G5*sum(G3d*G5d)

For N observations, the mean of squares (MS) is
MS(Dout) = sum(Dout^2)/N
= (G1*G2*G3*G4*G5)^2*sum(DACd^2)/N + (G2*G3*G4*G5)^2*sum(G1d^2)/N + (G4*G5)^2*sum(G3d^2)/N + sum(G5d^2)/N
+ 2*G1*(G2*G3*G4*G5)^2*sum(DACd*G1d)/N + 2*G1*G2*G3*(G4*G5)^2*sum(DACd*G3d)/N + 2*G2*G3*(G4*G5)^2*sum(G1d*G3d)/N
+ 2*G1*G2*G3*G4*G5*sum(DACd*G5d)/N + 2*G2*G3*G4*G5*sum(G1d*G5d)/N + 2*G4*G5*sum(G3d*G5d)/N
= (G1*G2*G3*G4*G5)^2*MS(DACd) + (G2*G3*G4*G5)^2*MS(G1d) + (G4*G5)^2*MS(G3d) + MS(G5d)
+ 2*G1*(G2*G3*G4*G5)^2*sum(DACd*G1d)/N + 2*G1*G2*G3*(G4*G5)^2*sum(DACd*G3d)/N + 2*G2*G3*(G4*G5)^2*sum(G1d*G3d)/N
+ 2*G1*G2*G3*G4*G5*sum(DACd*G5d)/N + 2*G2*G3*G4*G5*sum(G1d*G5d)/N + 2*G4*G5*sum(G3d*G5d)/N

Since the covariance is definced as sum((x-m(x))*(y - m(y)))/N, where m(x) is the mean of x, i.e. sum(x)/N,
cov(x,y) = sum((x-m(x))*(y - m(y)))/N = sum(x*y - x*m(y) - m(x)*y + m(x)*m(y))/N = sum(x*y)/N - sum(x)/N*m(y) - m(x)*sum(y)/N + m(x)*m(y)*sum(1)/N
= sum(x*y)/N - m(x)*m(y) - m(x)*m(y) + m(x)*m(y)*N/N = sum(x*y)/N - m(x)*m(y)

Thus, sum(x*y)/N = cov(x,y) + m(x)*m(y). If the mean of all signals is zero, m(x) = 0 for all signals, thus,
MS(Dout) = (G1*G2*G3*G4*G5)^2*MS(DACd) + (G2*G3*G4*G5)^2*MS(G1d) + (G4*G5)^2*MS(G3d) + MS(G5d)
+ 2*G1*(G2*G3*G4*G5)^2*cov(DACd*G1d) + 2*G1*G2*G3*(G4*G5)^2*cov(DACd*G3d) + 2*G2*G3*(G4*G5)^2*cov(G1d*G3d)
+ 2*G1*G2*G3*G4*G5*cov(DACd*G5d) + 2*G2*G3*G4*G5*cov(G1d*G5d) + 2*G4*G5*cov(G3d*G5d)

The standard deviation is
std(x) = sqrt(sum((x - m(x))^2)/N) = sqrt(sum(x^2 + m(x)^2 - 2*m(x)*x)/N) = sqrt(sum(x^2)/N + m(x)^2/N*sum(1) - 2*m(x)*sum(x)/N) = sqrt(MS(x) - m(x)^2)

Since the coefficient of correlation is defined as corr(x, y) = cov(x, y)/(std(x)*std(y)) and std(x) = RMS(x) since m(x) = 0 for all signals, cov(x, y) = corr(x, y)*RMS(x)*RMS(y). Thus,
MS(Dout) = (G1*G2*G3*G4*G5)^2*MS(DACd) + (G2*G3*G4*G5)^2*MS(G1d) + (G4*G5)^2*MS(G3d) + MS(G5d)
+ 2*G1*(G2*G3*G4*G5)^2*corr(DACd, G1d)*RMS(DACd)*RMS(G1d) + 2*G1*G2*G3*(G4*G5)^2*corr(DACd, G3d)*RMS(DACd)*RMS(G3d)
+ 2*G2*G3*(G4*G5)^2*corr(G1d, G3d)*RMS(G1d)*RMS(G3d) + 2*G1*G2*G3*G4*G5*corr(DACd, G5d)*RMS(DACd)*RMS(G5d)
+ 2*G2*G3*G4*G5*corr(G1d, G5d)*RMS(G1d)*RMS(G5d) + 2*G4*G5*corr(G3d, G5d)*RMS(G3d)*RMS(G5d)

Since MS = RMS^2, the RMS of total distortion is given by
RMS(Dout) = sqrt((G1*G2*G3*G4*G5)^2*RMS(DACd)^2 + (G2*G3*G4*G5)^2*RMS(G1d)^2 + (G4*G5)^2*RMS(G3d)^2 + RMS(G5d)^2
+ 2*G1*(G2*G3*G4*G5)^2*corr(DACd, G1d)*RMS(DACd)*RMS(G1d) + 2*G1*G2*G3*(G4*G5)^2*corr(DACd, G3d)*RMS(DACd)*RMS(G3d)
+ 2*G2*G3*(G4*G5)^2*corr(G1d, G3d)*RMS(G1d)*RMS(G3d) + 2*G1*G2*G3*G4*G5*corr(DACd, G5d)*RMS(DACd)*RMS(G5d)
+ 2*G2*G3*G4*G5*corr(G1d, G5d)*RMS(G1d)*RMS(G5d) + 2*G4*G5*corr(G3d, G5d)*RMS(G3d)*RMS(G5d))

The integral of squares is entirely analog and obtained by replacing the sum operator by the integral operator. The MS is then calculated by dividing by the measuring time T instead of N and all following steps are the same.

If the means of some signals are non-zero, the calculations are straightforward but tedious and add nothing to the point. I have omitted them for that reason.
 
Based on my above post, I derived the general RMS formula for a sum of correlated signals in terms of RMS, means and correlation coefficients.

Let the signal S be the sum of signals S_i where i goes from 1 to N, i.e. S = sum(S_i, i = 1, N). Thus,
MS(S) = sum(MS(S_i), i = 1, N) + 2*sum(sum(corr(S_i, S_j)*sqrt((MS(S_i) - m(S_i)^2)*(MS(S_j) - m(S_j)^2)) + m(S_i)*m(S_j), j = 1, N), i = j + 1, N)
and thus
RMS(S) = sqrt(sum(RMS(S_i)^2, i= 1, N) + 2*sum(sum(corr(S_i, S_j)*sqrt((RMS(S_i)^2 - m(S_i)^2)*(RMS(S_j)^2 - m(S_j)^2)) + m(S_i)*m(S_j), j = 1, N), i = j + 1, N))
 
Based on my above post, I derived the general RMS formula for a sum of correlated signals in terms of RMS, means and correlation coefficients.

Let the signal S be the sum of signals S_i where i goes from 1 to N, i.e. S = sum(S_i, i = 1, N). Thus,
MS(S) = sum(MS(S_i), i = 1, N) + 2*sum(sum(corr(S_i, S_j)*sqrt((MS(S_i) - m(S_i)^2)*(MS(S_j) - m(S_j)^2)) + m(S_i)*m(S_j), j = 1, N), i = j + 1, N)
and thus
RMS(S) = sqrt(sum(RMS(S_i)^2, i= 1, N) + 2*sum(sum(corr(S_i, S_j)*sqrt((RMS(S_i)^2 - m(S_i)^2)*(RMS(S_j)^2 - m(S_j)^2)) + m(S_i)*m(S_j), j = 1, N), i = j + 1, N))
I am not sure why you are bringing all this up now, two-plus years later? I haven't time to redo everything so it would be good if you could simply implement your methodology and start a thread to explain and show the differences. I suspect few ASR members will wade through your equations, and those that will are already aware of the drawbacks of my approach. It would be great if you could move your work to a new thread and go through similar examples to show the differences, and explain why they occur.

In practice, we (my design team and I) found simple RSS'ing to work well in RF systems (my day job for many years) and was good enough for this introductory thread. Since this was just theoretical I decided that, without knowing the correlation of real device distortion products, going through correlation was not worth the effort without applying more detailed modeling through the chain. Similarly, I did not model the frequency response with amplitude and phase variation of harmonic content based upon open- and closed-loop bandwidth and such, which in turn determines all the various correlation coefficients needed for a more complete analysis. The intent was to provide an overview for people to see roughly how noise and distortion can work through the chain, not provide a complete model guide for design. As I have said before, my articles are well below the level of a practicing engineer working in the field, and intended to target an audience of educated lay people with sufficient background to follow along. I am not going to try to post decades of experience here; too much work for me, too in-depth for more casual readers, and not useful for readers such as you who already know it all.
 
I just discovered it today. That is why. I don't expect you to rework it.
OK, no worries. Apologies for a terse reply, long day, and I get tired of people bringing up old (sometimes 10+ year old) posts without the context of the original thread. I meant what I said (wrote); your more detailed analysis would be useful for some more advanced readers, but is more than I want to take on. I do plan to get back to going through your equations for my own satisfaction, and perhaps inclusion in a future project.

If RSS works well for distortion as well, adding that to justify using it might have been enough for me.
"Well" is relative... Since distortion peaks are determined by signal peaks, assuming random phase/delay and through the chain, then RSS provides answers reasonably close to RMS using (much!) more information. My experience FWIW is they are usually very close, with 3 dB or so, but it all depends upon the characteristics of the blocks in the chain. Worst case they will all add linearly, but that is pretty rare in the real world, so some sort of correlation, product square or RMS summing, or weighting (or a combination) is used in my experience. Since phase varies through the chain, usually nonlinearly due to bandwidth and filter effects of the blocks, the distortion tends to look sort-of quasi-random in the words of the senior scientist who introduced me to this concept many years ago (ca. late 1970's). My practical experience is mainly RF/mW, not audio, in case that matters.

You write that each stage is independent and the distortion does not add linearly. To me this does not read as the distortion signals being uncorrelated only that they are not perfectly correlated. Particularly since you pointed out that the noises of the devices are uncorrelated.
That is true, at least to a point. The actual transfer functions tend to be complex in amplitude and phase so neither is perfectly correlated, but you are correct that the result is not completely uncorrelated rather than random for distortion. But, in practice using RSS simplifies things for quick (often hand) calculations, and more detailed models are constructed when I do the circuit design (using SPICE, ADS, or similar tools), then measured to verify (we hope!) the results.

Noise is normally treated as uncorrelated (and I did) but even that is not always true. Again, I took the basic theoretical approach, without considering any correlated noise sources passing through the chain. Baby steps... My last position required me to analysis something like 27 components of jitter, correlated and uncorrelated, and I honestly do not miss dealing with that sort of math.

I have no model for the interaction of distortions between devices so nowhere to go with it at the moment.
I could have done a bit with them, but did not want to do so for this introductory presentation. Real circuits quickly get very complicated and I usually just went straight to a circuit simulator, though complex mixed-signal systems sometimes required detailed behavioral models (that were painful to create). What I considered, but rejected, was adding some delay and frequency response terms to better model the filter response of the blocks, but even that was more than I wished to do at the time and was not really needed for the target audience. This was mainly to answer the questions of "Why does the SINAD curve rise at low levels?" and "How do distortion and noise change going through the chain?" I admit I took some shortcuts to simplify the amount of effort but, again in my experience, it is pretty close to what I expect in the real world, at least at a fairly gross level.

I also might have done more if I was using Matlab since I am (was) more familiar with it; I was learning Python and some of its signal-processing features so limited the scope of my efforts. At this point I am retired and not doing much with either, though I need to prepare a couple of talks for the local college at some point.

Again, it would be great to extend the knowledge base as you propose as the next step in this presentation, something like a level 102 thread versus my level 101 start.
 
OK, no worries. Apologies for a terse reply, long day, and I get tired of people bringing up old (sometimes 10+ year old) posts without the context of the original thread. I meant what I said (wrote); your more detailed analysis would be useful for some more advanced readers, but is more than I want to take on. I do plan to get back to going through your equations for my own satisfaction, and perhaps inclusion in a future project.


"Well" is relative... Since distortion peaks are determined by signal peaks, assuming random phase/delay and through the chain, then RSS provides answers reasonably close to RMS using (much!) more information. My experience FWIW is they are usually very close, with 3 dB or so, but it all depends upon the characteristics of the blocks in the chain. Worst case they will all add linearly, but that is pretty rare in the real world, so some sort of correlation, product square or RMS summing, or weighting (or a combination) is used in my experience. Since phase varies through the chain, usually nonlinearly due to bandwidth and filter effects of the blocks, the distortion tends to look sort-of quasi-random in the words of the senior scientist who introduced me to this concept many years ago (ca. late 1970's). My practical experience is mainly RF/mW, not audio, in case that matters.


That is true, at least to a point. The actual transfer functions tend to be complex in amplitude and phase so neither is perfectly correlated, but you are correct that the result is not completely uncorrelated rather than random for distortion. But, in practice using RSS simplifies things for quick (often hand) calculations, and more detailed models are constructed when I do the circuit design (using SPICE, ADS, or similar tools), then measured to verify (we hope!) the results.

Noise is normally treated as uncorrelated (and I did) but even that is not always true. Again, I took the basic theoretical approach, without considering any correlated noise sources passing through the chain. Baby steps... My last position required me to analysis something like 27 components of jitter, correlated and uncorrelated, and I honestly do not miss dealing with that sort of math.


I could have done a bit with them, but did not want to do so for this introductory presentation. Real circuits quickly get very complicated and I usually just went straight to a circuit simulator, though complex mixed-signal systems sometimes required detailed behavioral models (that were painful to create). What I considered, but rejected, was adding some delay and frequency response terms to better model the filter response of the blocks, but even that was more than I wished to do at the time and was not really needed for the target audience. This was mainly to answer the questions of "Why does the SINAD curve rise at low levels?" and "How do distortion and noise change going through the chain?" I admit I took some shortcuts to simplify the amount of effort but, again in my experience, it is pretty close to what I expect in the real world, at least at a fairly gross level.

I also might have done more if I was using Matlab since I am (was) more familiar with it; I was learning Python and some of its signal-processing features so limited the scope of my efforts. At this point I am retired and not doing much with either, though I need to prepare a couple of talks for the local college at some point.

Again, it would be great to extend the knowledge base as you propose as the next step in this presentation, something like a level 102 thread versus my level 101 start.

After the moderator deleted my last post, I did not expect to hear anymore from you here. Alas you replied here. I think the general if simplified point was made well. The correlation of distortion is certainly no easy expansion of the model. If you have not gone through my equations, I recommend you wait a bit since I have done a more formal derivation of the RMS for sums of signals which also determines the conditions for RSS, linear addition for perfectly positively correlated signals and cancellation of perfectly negatively correlated signals. The general formula I posted in #45 holds up. I will post it soon in a thread I will make for it. Also, I did not check everything in #44. The parentheses have equal left and right but I am not sure about the terms inside. However, the result I am quite sure is correct.
 
After the moderator deleted my last post, I did not expect to hear anymore from you here. Alas you replied here. I think the general if simplified point was made well. The correlation of distortion is certainly no easy expansion of the model. If you have not gone through my equations, I recommend you wait a bit since I have done a more formal derivation of the RMS for sums of signals which also determines the conditions for RSS, linear addition for perfectly positively correlated signals and cancellation of perfectly negatively correlated signals. The general formula I posted in #45 holds up. I will post it soon in a thread I will make for it. Also, I did not check everything in #44. The parentheses have equal left and right but I am not sure about the terms inside. However, the result I am quite sure is correct.
I didn't know it was deleted; I responded directly to the email I received (from watching the thread).

I have been through a number of distortion analyses and derivations over the years and am sure I have similar work from decades ago, just too lazy to dig up my notes (if I could find them, or even still have them after all these years). One thing to note that I'm sure you already know is that non-zero mean values (e.g. from DC offsets) can affect RMS (etc.) values so some methodologies calculate the mean of the signal and subtract it before generating distortion ratios. IIRC some of the IEEE Standards discuss that. At this point in life (retired a coupe of years ago) I am spending less time on such things and more time just trying to have fun.

I was not arguing the result was not correct, just that it was not needful for the purpose of this thread, and I have been doing simple RSS for so many years I just naturally did it without thinking. It may be less accurate for audio with such low bandwidths and general lack of nonlinear operations like mixing compared to the RF/mW systems I worked with back then.

If you look at any of my other "teaching" threads you will find that I use simplified models and gloss over many details that I consider beyond the scope of the article and the typical audiophile readers. They are not intended to be rigorous design aides and do not target engineers and scientists who will find them well beneath their level of knowledge. Nor do they convey the extent of my knowledge on the subjects -- or the extent of my ignorance, for that matter.
 
  • Like
Reactions: MAB
I didn't know it was deleted; I responded directly to the email I received (from watching the thread).

I have been through a number of distortion analyses and derivations over the years and am sure I have similar work from decades ago, just too lazy to dig up my notes (if I could find them, or even still have them after all these years). One thing to note that I'm sure you already know is that non-zero mean values (e.g. from DC offsets) can affect RMS (etc.) values so some methodologies calculate the mean of the signal and subtract it before generating distortion ratios. IIRC some of the IEEE Standards discuss that. At this point in life (retired a coupe of years ago) I am spending less time on such things and more time just trying to have fun.

I was not arguing the result was not correct, just that it was not needful for the purpose of this thread, and I have been doing simple RSS for so many years I just naturally did it without thinking. It may be less accurate for audio with such low bandwidths and general lack of nonlinear operations like mixing compared to the RF/mW systems I worked with back then.

If you look at any of my other "teaching" threads you will find that I use simplified models and gloss over many details that I consider beyond the scope of the article and the typical audiophile readers. They are not intended to be rigorous design aides and do not target engineers and scientists who will find them well beneath their level of knowledge. Nor do they convey the extent of my knowledge on the subjects -- or the extent of my ignorance, for that matter.
I was surprised and did not find the reason given - diluting the thread further - adequate so given the tone of your first reply and your standing in the forum, I considered the possibility of something foul but alas it seems the moderator acted of his own accord.

Yes, means affect RMS but the case of DC offset is also the simplest since it is simply a constant and hence orthogonal to a AC signals due to them having mean zero over a full cycle by definition. Harmonics are orthogonal so RSS is valid for them as well. In my analysis, I am considering combining several signals each possibly having their own DC and AC components if electrical.

I have not found much material about the mathematical derivations. Also, I have no training as an engineer so have no easy access to standards. The Wikipedia page for RMS has a section and a reference but nothing general (and also what seems like a false statement). I have also found two forum discussions today but again not as general as I want to go. Anyways, I did not look for much when I started because it is fairly easy for me to do the derivations. Explaining them to people with a less mathematical background is more challenging.

The question of it being correct was about you going through the equations. I don't have much of an issue with the simplification leading to statements that are strictly false but illustrate a true point. What motivated my original response was that the simplification you chose was not clear to me as such and I corrected what I considered was deliberately part of your model.
 
I was surprised and did not find the reason given - diluting the thread further - adequate so given the tone of your first reply and your standing in the forum, I considered the possibility of something foul but alas it seems the moderator acted of his own accord.
Probably protecting me; I've been swamped and sudden "attacks" (too strong but you get the idea) on old posts can be vexing. At times (not now) it turns into a long-winded pissing contest for which I have no interest. My standing in the forum does not mean I am always right; I have my wife and kids to remind me of that.

My simplifications have come up before and the engineers and scientists here understand why I do what I do even if they do not always agree. It takes some effort to present things at a practical level for lay readers without overwhelming them with things not in their background, and whilst I avoid falsehoods AFAIK, things may be (are) simplified more than an engineer or scientist would want to see. I generally assume a junior high or high school level of math, so at least one course in algebra and trigonometry, and try to include lots of pictures.

Yes, means affect RMS but the case of DC offset is also the simplest since it is simply a constant and hence orthogonal to a AC signals due to them having mean zero over a full cycle by definition. Harmonics are orthogonal so RSS is valid for them as well. In my analysis, I am considering combining several signals each possibly having their own DC and AC components if electrical.
Mean can get complicated; some signals have non-zero mean and yet the mean is not completely orthogonal. My career started dealing with radar signals and then spread-spectrum communications where things get nasty. I was (am) a hairy-knuckled analog IC designer, not a theoretical scientist, so usually dove in just deep enough to understand the problem (and hopefully solution).

Note that, while I used RSS for simplicity, that often provides worse numbers that RMS in the real world. Also, IIRC most standards do use RMS and not RSS when calculating THD. As I said, I do not disagree with you, just did not feel it worthwhile for this thread.

I have not found much material about the mathematical derivations. Also, I have no training as an engineer so have no easy access to standards. The Wikipedia page for RMS has a section and a reference but nothing general (and also what seems like a false statement). I have also found two forum discussions today but again not as general as I want to go. Anyways, I did not look for much when I started because it is fairly easy for me to do the derivations. Explaining them to people with a less mathematical background is more challenging.
I do not know your background, but it sounds like Circuits and Systems more than my background in Circuits as far as the IEEE goes. Since my career was not audio, I do not have a lot of in-depth books on audio definitions and measurements, just the usual stack of more general signals and systems texts. For general stuff, Mathworks (Matlab) has a number of articles that are free and open, and there are any number of textbooks on signal processing.

The question of it being correct was about you going through the equations. I don't have much of an issue with the simplification leading to statements that are strictly false but illustrate a true point. What motivated my original response was that the simplification you chose was not clear to me as such and I corrected what I considered was deliberately part of your model.
RMS provides a better average response and I believe is what the AES and others use to define THD. It is easy to measure RMS values these days, whereas years ago RMS meters were less common (and much more expensive). DSP makes many things easy... RSS tends to provide higher numbers since peak values are used, which is better for worst-case analysis but can be overly pessimistic. As an engineer, I tend to worst-case things, and the difference in my experience was small, a few dB. When I started, doing circuits for radar systems, RSS was the default for distortion analysis, so I didn't really question it. Looking back, I'd guess because radar signal chains are complex enough that harmonics through the chain can be treated as decorrelated enough that it works.

Note THD uses ratios so the difference in practice between RSS and RMS is small if not nil. Most of my previous threads actually do use RMS for signals and RSS for noise, FWIW. I use average power, however, since "RMS power" is not a valid unit.

And of course I have already mentioned laziness; I had the RSS functions already in place, and since this was also a learning exercise for me (in Python, not distortion analysis), I just used it. I could have grabbed RMS functions but didn't think of it at the time. These threads take a lot of work (and time) that isn't obvious once posted.
 
Last edited:
Probably protecting me; I've been swamped and sudden "attacks" (too strong but you get the idea) on old posts can be vexing. At times (not now) it turns into a long-winded pissing contest for which I have no interest. My standing in the forum does not mean I am always right; I have my wife and kids to remind me of that.

My simplifications have come up before and the engineers and scientists here understand why I do what I do even if they do not always agree. It takes some effort to present things at a practical level for lay readers without overwhelming them with things not in their background, and whilst I avoid falsehoods AFAIK, things may be (are) simplified more than an engineer or scientist would want to see. I generally assume a junior high or high school level of math, so at least one course in algebra and trigonometry, and try to include lots of pictures.


Mean can get complicated; some signals have non-zero mean and yet the mean is not completely orthogonal. My career started dealing with radar signals and then spread-spectrum communications where things get nasty. I was (am) a hairy-knuckled analog IC designer, not a theoretical scientist, so usually dove in just deep enough to understand the problem (and hopefully solution).

Note that, while I used RSS for simplicity, that often provides worse numbers that RMS in the real world. Also, IIRC most standards do use RMS and not RSS when calculating THD. As I said, I do not disagree with you, just did not feel it worthwhile for this thread.


I do not know your background, but it sounds like Circuits and Systems more than my background in Circuits as far as the IEEE goes. Since my career was not audio, I do not have a lot of in-depth books on audio definitions and measurements, just the usual stack of more general signals and systems texts. For general stuff, Mathworks (Matlab) has a number of articles that are free and open, and there are any number of textbooks on signal processing.


RMS provides a better average response and I believe is what the AES and others use to define THD. It is easy to measure RMS values these days, whereas years ago RMS meters were less common (and much more expensive). DSP makes many things easy... RSS tends to provide higher numbers since peak values are used, which is better for worst-case analysis but can be overly pessimistic. As an engineer, I tend to worst-case things, and the difference in my experience was small, a few dB. When I started, doing circuits for radar systems, RSS was the default for distortion analysis, so I didn't really question it. Looking back, I'd guess because radar signal chains are complex enough that harmonics through the chain can be treated as decorrelated enough that it works.

And of course I have already mentioned laziness; I had the RSS functions already in place, and since this was also a learning exercise for me (in Python, not distortion analysis), I just used it. I could have grabbed RMS functions but didn't think of it at the time. These threads take a lot of work (and time) that isn't obvious once posted.

I see. Since you replied, there was no loss.

Orthogonality is possible with non-zero means but requires that the signals are correlated.

I did not know RSS but just looked it up. I thought based on your original posts that it was the sum of squared values - in this case the RMSs for the components. Do you mean RSS as sqrt(sum(S_i^2, i =1, N))? This is simply sqrt(N) times the RMS. I assumed you meant RMS since that is all I see in audio, but skimming all the post you never seem to mention it.

Harmonics are orthogonal over an integer number of cycles for both - the means and the covariance are both zero. As long as the frequencies of a sine pair can be expressed as the harmonics of the same fundamental, meaning their ratio is a rational number, they are orthogonal over an integer number of cycles for both.

My background is in economics and physics. I know some electromagnetism and mathematical statistics that way. Anything else I learned by myself.
 
I see. Since you replied, there was no loss.

Orthogonality is possible with non-zero means but requires that the signals are correlated.

I did not know RSS but just looked it up. I thought based on your original posts that it was the sum of squared values - in this case the RMSs for the components. Do you mean RSS as sqrt(sum(S_i^2, i =1, N))? This is simply sqrt(N) times the RMS. I assumed you meant RMS since that is all I see in audio, but skimming all the post you never seem to mention it.

Harmonics are orthogonal over an integer number of cycles for both - the means and the covariance are both zero. As long as the frequencies of a sine pair can be expressed as the harmonics of the same fundamental, meaning their ratio is a rational number, they are orthogonal over an integer number of cycles for both.

My background is in economics and physics. I know some electromagnetism and mathematical statistics that way. Anything else I learned by myself.
I want to leave this here since it's moved outside the topic of the thread. A number of things in the engineering world are RSS'd, where the S in your equation can be RMS, peak, or whatever values. For a perfectly linear system it is a constant, but distortion is nonlinear, and the system comprised of a chain of signal blocks is not necessarily linear. Each block in a signal chain changes the signal, including the harmonics, with changing amplitude, phase, and offset so things like perfect correlation are not guaranteed, and by definition distortion is a nonlinear operation so you cannot in general apply linear principles to it. We also cannot guarantee an integer number of cycles and thus FFTs are usually windowed (something I did not have to do here since I can force the signal to align on an integer number of cycles for a given sample size, another thing I did not mention -- 1 kHz is usually close but not exact to 1000.000... Hz since I tweak the frequency to avoid windowing). Again, since distortion is a ratio to the fundamental, in practice and particularly for this theoretical analysis, it does not really matter.

I have not gone back to look at my code; I usually pull RMS values from the FFT, adjust for gain (scaled depending on if I am input- or output-referred) to attain the signal level at the point of calculation, then RSS the terms from all the other blocks in the chain. The fundamental is just scaled and its value (usually RMS, but again doesn't matter if peak or whatever as long as I am consistent) compared to the harmonic content to generate things like SNR, THD, SINAD, and so forth. Without going back and looking at the code, I think I used peak values in this case, since there was no need to calculate the RMS value (peak being the amplitude A for a signal A*sin(wt+phase) ).

Signal levels for audio components are usually specified in RMS voltage, with power specified as average watts (Vrms * Irms, though technically power factor and thus phase is needed or you get VA instead of W as the unit of power). For a sine wave, the difference is a constant (Vpk = sqrt(2) * Vrms) so cancels out in the ratio for THD.
 
I want to leave this here since it's moved outside the topic of the thread. A number of things in the engineering world are RSS'd, where the S in your equation can be RMS, peak, or whatever values. For a perfectly linear system it is a constant, but distortion is nonlinear, and the system comprised of a chain of signal blocks is not necessarily linear. Each block in a signal chain changes the signal, including the harmonics, with changing amplitude, phase, and offset so things like perfect correlation are not guaranteed, and by definition distortion is a nonlinear operation so you cannot in general apply linear principles to it. We also cannot guarantee an integer number of cycles and thus FFTs are usually windowed (something I did not have to do here since I can force the signal to align on an integer number of cycles for a given sample size, another thing I did not mention -- 1 kHz is usually close but not exact to 1000.000... Hz since I tweak the frequency to avoid windowing). Again, since distortion is a ratio to the fundamental, in practice and particularly for this theoretical analysis, it does not really matter.

I have not gone back to look at my code; I usually pull RMS values from the FFT, adjust for gain (scaled depending on if I am input- or output-referred) to attain the signal level at the point of calculation, then RSS the terms from all the other blocks in the chain. The fundamental is just scaled and its value (usually RMS, but again doesn't matter if peak or whatever as long as I am consistent) compared to the harmonic content to generate things like SNR, THD, SINAD, and so forth. Without going back and looking at the code, I think I used peak values in this case, since there was no need to calculate the RMS value (peak being the amplitude A for a signal A*sin(wt+phase) ).

Signal levels for audio components are usually specified in RMS voltage, with power specified as average watts (Vrms * Irms, though technically power factor and thus phase is needed or you get VA instead of W as the unit of power). For a sine wave, the difference is a constant (Vpk = sqrt(2) * Vrms) so cancels out in the ratio for THD.
Your approach seems reasonable under your assumption that the terms from the blocks are orthogonal. The THD ratio is independent of peak or RMS of sines but SNR is 3 dB higher for peak compared to RMS for the reference signal if the RMS of the noise is used. Anyways, that difference is not significant for your analysis.

I'm fine with leaving it here. I will make my own thread when I am ready and you can join the discussion there if you want to.
 
Back
Top Bottom