Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: The effect of thresholds and masking on the audibility of audio produc (Read 18005 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

The effect of thresholds and masking on the audibility of audio produc

Reply #25
How can you ask me for specifics when you haven't even answered or can't remember how specifically you created that odd order file?


It turned out that the specifics you apparently gave me earlier, and for which I apologize for not noticing made a big difference.

I don't remember a lot about how I made those files 15 years ago, except that basic method. It was done using paste/modulate but the detals after that get really fuzzy.

The obvious thing to do was to recreate some files using that same basic technique plus any refinements that I picked up in the intervening 15 years.

I'm working on that and will upload them soon.

Quote
How much did you attenuate, what did you mix? I gave one example based on assumptions that would fail and produce something similar to the file that can be found in your zip.


The attenuation depends on the amount of THD that is desired. According to the geometric identity: sin^3(x) = 3 sin(x)/4 + sin (3x)/4 the amount of THD in the pure cubed term is 33%.  If I add half of that with half of the original, t theory says that the resulting THD is 14%  and so on.

The actual numbers from the simulations are pretty close to theory.

Quote
No, I'm not confusing things. x^3 gives you a third harmonic at a fixed level relative to the fundamental.


For example the simulation of cubing gives a fundamental at 2.54 dB down as compared to the theoretical answer of 2.5 dB down.  The third harmonic is 12.34 dB down as compared to the theoretical number of 12 dB down.

Yes, its like 33% THD. Run the numbers!

Quote
You seem to have tried to fix that with applying some gain and mixing stuff, but that obviously didn't work.


It is not a matter of fixing, its a matter of using the definition of harmonic distortion to get what you want from what you have.

The effect of thresholds and masking on the audibility of audio produc

Reply #26
No, I said it doesn't work the way you imagine for music just because it works for a single sine.

Just show how you push the 3rd harmonic down to 30%, 1%, 0.1% ... relative to the fundamental.

The math:
Code: [Select]
sin(x)^3
=>
-(sin(3*x) - 3*sin(x))/4

Here you'd need to subtract 3/4*input.


If you take the time to actually work out the percentages which I just did in a very recent post, the percentage of THD is 33% and that comes out of both the theory and the observed results I have posted for processing that I have done. To obtain 30% THD a little of the origional file needs to be added back in not subtracted as you erroneously claim above.

Quote
Code: [Select]
(sin(x)/2)^3
=>
-(sin(3*x) - 3*sin(x))/32

Here it's 3/16*input, so you should already see the problem.


What problem? Why would I need to divide the input by 2?

Quote
Code: [Select]
(sin(x)/2+sin(y)/3)^3
=>
sin(2*x - y)/16 - sin(x + 2*y)/24 - sin(2*x + y)/16 - sin(3*x)/32 - sin(3*y)/108 - sin(x - 2*y)/24 + (17*sin(x))/96 + (11*sin(y))/72

Here you can decide what you want to cancel, sin(x) or sin(y)?


Looks like unecessary complexity.  I  think that the point these equations make clear is that the actual percentage of nonlinear distortion artifacts depends on the size of the output signal, which is constantly varying for music. Obviously, making files with actual constant THD or something like it is mission impossible. A problem that can be solved is to make a file whose maximum distortion follows the same pattern as real world audio gear, which is to say that the size of the distortion artifacts varies with the amplitude of the signal up to some specified full-output maximum.

Quote
This is just with two pure tones that never change frequency or amplitude...


Are you suggesting the credibilty of the idea that adding multiple tones is required to detect forms of distortion that would otherwise go undetected?

There is a case of that, where the nonlinearity creates a harmonic that exceeds the bandpass of the system, but that is not relevant here.

Quote
This has nothing to do with blind testing. How would I prove to you that e.g. the 3rd harmonic 30% file does not sound right if you insist it does?


Create a file that I am convinced that is properly prepared that sounds different in a DBT.

Note, I'm uncertain as to the exact details of the files in question as they are like 15 years old. I am preparing new files just because.

The other thing is that this test has turned out to be about what happens in the range from 1 to 5% distortion, not 10 to 30 pct. I'm very much in favor of things being done as right as possible, but I also can know a case of reduced criticality when see one.

The effect of thresholds and masking on the audibility of audio produc

Reply #27
Just a very quick reply:
I am under the assumption that you first tried to cancel the non-linearly scaled fundamental frequencies (which doesn't work) and then added the input back to that, for the 3rd_30pct file and very likely similar files that is.

If you add half of sin(x)/2+sin(y)/3 to 17/96*sin(x)+11/72*sin(y) then you will have still changed the amplitude difference between those two tones by ~1 dB. You have changed the amplitude ratio of tones in the input. Also, distortion would go down relatively speaking.


Btw, such nonlinear operations will cause a lot of aliasing if you do not oversample.
"I hear it when I see it."

The effect of thresholds and masking on the audibility of audio produc

Reply #28
Just a very quick reply:
I am under the assumption that you first tried to cancel the non-linearly scaled fundamental frequencies (which doesn't work) and then added the input back to that, for the 3rd_30pct file and very likely similar files that is.


False, and already explained. For odd order distortion, the straight cubing operation yields 33% distortion. If you pick 30% as your max distortion as I did, there is no need to cancel any part of the fundamental.

The even distortion generation runs produce no fundamentals at all so the baseline distortion is basically infinite. Again, no need to cancel any fundamental, only the need to add some of it back in.

Secondly, you haven't shown that adding (or if one chose subtracting) the fundamental does't work. What you have shown is that nonlinear distortion is nonlinear which seems to be a truism. IOW for outputs below full scale, the magnitude of the artifacts due to nonlinear distortion decrease nonlinearly. That happens (actually it is foreordained by the math, no chance involved) to be how nonlinear distortion functions in audio gear, so it is part of a reasonable simulation of nonlinear distortion in audio gear, which is the goal.

Quote
If you add half of sin(x)/2+sin(y)/3 to 17/96*sin(x)+11/72*sin(y) then you will have still changed the amplitude difference between those two tones by ~1 dB. You have changed the amplitude ratio of tones in  the input. Also, distortion would go down relatively speaking.


The goal is to make the distortion and the artifacts decrease, so the above is a very positive move in the right direction.

Quote
Btw, such nonlinear operations will cause a lot of aliasing if you do not oversample.


Already covered in a previous post. The operations on 44/16 files were done after they were upsampled to 24/192 and the possibility of aliasing was further monitored by watching what happened to the twin tones at 20 and 21 KHz.  This is shown in these posts from yesterday:

Post showing how nonlinear distortion is created

and A previous post - same basic topic. Note sample format on several screen and obvious frequency scale going up to 96 kHz

The effect of thresholds and masking on the audibility of audio produc

Reply #29
So there's only one thing left that you do not seem to understand.

I'll try to make it simple: a device that just adds some harmonic distortion to the input will still output a -10 dB tone at roughly -10 dB and a -30 dB tone at roughly -30 dB plus the harmonics. Music is made up of countless tones of wildly varying amplitudes.
But x^3 etc. is no such device. The -30 dB tone will be output easily 30 to 40 dB lower relative to the output of the -10 dB tone.

Even if you theoretically get 33% THD with a single sine, you're killing the music if you process it the same way.
"I hear it when I see it."

The effect of thresholds and masking on the audibility of audio produc

Reply #30
So there's only one thing left that you do not seem to understand.

I'll try to make it simple: a device that just adds some harmonic distortion to the input will still output a -10 dB tone at roughly -10 dB and a -30 dB tone at roughly -30 dB plus the harmonics. Music is made up of countless tones of wildly varying amplitudes.
But x^3 etc. is no such device. The -30 dB tone will be output easily 30 to 40 dB lower relative to the output of the -10 dB tone.

Even if you theoretically get 33% THD with a single sine, you're killing the music if you process it the same way.


I'll ignore all of the unsupported hand waving.

But I will point out that the results show that 33% THD as applied pretty well kills the music regardless, and I don't think that really surprises many.

The effect of thresholds and masking on the audibility of audio produc

Reply #31
Unsupported hand waving? Wtf? I've even provided the maths!

If you don't believe me then why don't you create a tone at -10 dB, ^3, then look at the spectrum. Now repeat the same with a tone 20 dB lower ... at -30 dB, ^3 that. In this spectrum the fundamental will not be just 20 dB lower relative to the previous spectrum, but easily 30 to 40 dB lower.

"33% THD as applied pretty well kills the music regardless" ... that's hand waving.
"I hear it when I see it."

The effect of thresholds and masking on the audibility of audio produc

Reply #32
Unsupported hand waving? Wtf? I've even provided the maths!

If you don't believe me then why don't you create a tone at -10 dB, ^3, then look at the spectrum. Now repeat the same with a tone 20 dB lower ... at -30 dB, ^3 that. In this spectrum the fundamental will not be just 20 dB lower relative to the previous spectrum, but easily 30 to 40 dB lower.


Done that, seen the results, agree with your comments, and contemplating my alternatives.

Quote
"33% THD as applied pretty well kills the music regardless" ... that's hand waving.


Come on, its a parphrase of this: "Even if you theoretically get 33% THD with a single sine, you're killing the music if you process it the same way."  ;-)

The effect of thresholds and masking on the audibility of audio produc

Reply #33
Okay, good.

The problem is that I don't think that there is a simple alternative. Even if you generated a simple transfer function that outputs harmonics at exactly the level you want for a full-scale sine, as soon as you drop the levels, the output will look (very) different from what you'd expect.

In reality there is no simple mapping between input and output values.
"I hear it when I see it."

The effect of thresholds and masking on the audibility of audio produc

Reply #34
Okay, good.

The problem is that I don't think that there is a simple alternative. Even if you generated a simple transfer function that outputs harmonics at exactly the level you want for a full-scale sine, as soon as you drop the levels, the output will look (very) different from what you'd expect.

In reality there is no simple mapping between input and output values.


While the simple relationship may not exist, real world audio gear provides a reasonable guide to such differences from a theoretical ideal that are reasonable when it is real world audio gear that we wish to simulate the operation of.