• 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!

Beta Test: DISTORT - audibility of distortions

Pluto

Addicted to Fun and Learning
Forum Donor
Joined
Sep 2, 2018
Messages
990
Likes
1,631
Location
Harrow, UK
Is it time to separate the custom transfer function box from the controls on the "harmonics" tab? I feel that the former is becoming something of a Frankenstein's monster that now appears to be rather outgrowing its original purpose.

The custom transfer function window sometimes (not sure exactly when, sorry) appears behind the main window following fiddling with other controls. Now that you have established the tab paradigm, why not give the custom transfer function a tab of its own? Duplicate those controls that are 'in common' with the "harmonics" tab so that all the controls relevant to the current operation are always visible and available!
 

flipflop

Addicted to Fun and Learning
Joined
Feb 22, 2018
Messages
927
Likes
1,240
When I'm listening to a recording through DISTORT, the program distorts the sound, making it sound overly bright, even when no distortion has been applied.

Top right window settings:
Distort v1.0.18

Parameters: α=1,0000, β=1,0000
Custom Harmonics: H2=-300 H3=-300 H4=-300
H5=-300 H6=-300 H7=-300 H8=-300

C:\Users\flipflop\Desktop\track4-48.wav
Rate=48000Hz Bits=24 Length=17513,6875ms (840657 samples) chn=L

The file has been automatically resampled by DISTORT, from 48 kHz to 44.1 kHz, to match my driver settings.
I also find it odd that the channel is set to 'L' instead of 'L+R' or 'stereo', but the sound is still coming from both channels. IIRC, it was like this by default.
 
OP
pkane

pkane

Master Contributor
Forum Donor
Joined
Aug 18, 2017
Messages
5,675
Likes
10,306
Location
North-East
When I'm listening to a recording through DISTORT, the program distorts the sound, making it sound overly bright, even when no distortion has been applied.

Top right window settings:


The file has been automatically resampled by DISTORT, from 48 kHz to 44.1 kHz, to match my driver settings.
I also find it odd that the channel is set to 'L' instead of 'L+R' or 'stereo', but the sound is still coming from both channels. IIRC, it was like this by default.

You can chose 'stereo' option instead of L or L+R to play both channels. L plays left channel over both left and right speaker. L+R plays the synthesized mono track by combining left and right channels and playing it over both speakers.

DISTORT uses Windows resampler when playing back through speakers, which means all the audio settings, DSP, volume control, etc. are also involved. I suggest you save the (un?)distorted file and then try to listen to it using your favorite player software that provides greater control over the Windows audio stack.
 

flipflop

Addicted to Fun and Learning
Joined
Feb 22, 2018
Messages
927
Likes
1,240
You can chose 'stereo' option instead of L or L+R to play both channels. L plays left channel over both left and right speaker. L+R plays the synthesized mono track by combining left and right channels and playing it over both speakers.
That makes sense.
DISTORT uses Windows resampler when playing back through speakers, which means all the audio settings, DSP, volume control, etc. are also involved. I suggest you save the (un?)distorted file and then try to listen to it using your favorite player software that provides greater control over the Windows audio stack.
Listened to both in foobar side by side, then ran an ABX DBT to prove to myself I'm not imagining things. The problem persists.
foo_abx 2.0.6c report
foobar2000 v1.3.16
2020-01-08 16:07:40

File A: track4-48 - DISTORT.wav
SHA1: ecc8bd4c2f1747b8cc7eb2005275479ad8797903
File B: track4-48.wav
SHA1: 4fcb99823ba1473fa0b4e6bf8687cbdc78499dfa

Output:
DS : Primær lyddriver
Crossfading: NO

16:07:40 : Test started.
16:07:57 : 01/01
16:08:05 : 02/02
16:08:10 : 03/03
16:08:17 : 04/04
16:08:21 : 05/05
16:08:26 : 06/06
16:08:34 : 07/07
16:08:44 : 08/08
16:08:44 : Test finished.

----------
Total: 8/8
p-value: 0.0039 (0.39%)

-- signature --
c411a917141a048f1616c7cd104ee824225a9dc5
Uploaded the files to MEGA in case you want to listen to them yourself: https://mega.nz/#!1tZWBASR!xWvyIeKkTgB8TFOM64W_Z5QqwhweC3mvJDGfPkqvafU
 
OP
pkane

pkane

Master Contributor
Forum Donor
Joined
Aug 18, 2017
Messages
5,675
Likes
10,306
Location
North-East
That makes sense.

Listened to both in foobar side by side, then ran an ABX DBT to prove to myself I'm not imagining things. The problem persists.
foo_abx 2.0.6c report
foobar2000 v1.3.16
2020-01-08 16:07:40

File A: track4-48 - DISTORT.wav
SHA1: ecc8bd4c2f1747b8cc7eb2005275479ad8797903
File B: track4-48.wav
SHA1: 4fcb99823ba1473fa0b4e6bf8687cbdc78499dfa

Output:
DS : Primær lyddriver
Crossfading: NO

16:07:40 : Test started.
16:07:57 : 01/01
16:08:05 : 02/02
16:08:10 : 03/03
16:08:17 : 04/04
16:08:21 : 05/05
16:08:26 : 06/06
16:08:34 : 07/07
16:08:44 : 08/08
16:08:44 : Test finished.

----------
Total: 8/8
p-value: 0.0039 (0.39%)

-- signature --
c411a917141a048f1616c7cd104ee824225a9dc5
Uploaded the files to MEGA in case you want to listen to them yourself: https://mega.nz/#!1tZWBASR!xWvyIeKkTgB8TFOM64W_Z5QqwhweC3mvJDGfPkqvafU

Don't know what to tell you.. One file is 24 bit, the other 32-bit floating point. When compared using DeltaWave, both files match perfectly for 99.7% of all samples at 24 bits, and 99.99% at 16 bits. Can't imagine that these sound different. Perhaps the audio driver handles different sample sizes differently?

EDIT: Oops, wait! I see a large difference in the right channel. What was the channel selection in DISTORT? It should be 'stereo', otherwise the right channel will not match the original.

In fact, that's the problem. You had 'L' selected, so the left and the right channel of the distorted file
 
Last edited:

flipflop

Addicted to Fun and Learning
Joined
Feb 22, 2018
Messages
927
Likes
1,240

flipflop

Addicted to Fun and Learning
Joined
Feb 22, 2018
Messages
927
Likes
1,240
track4-48 is stereo, track4-48 - DISTORT is mono.
Yes, and for some reason, so is the new file with the 'stereo' setting in DISTORT:
General
Complete name : C:\Users\flipflop\Desktop\track4-48 - DISTORT2.wav
Format : Wave
File size : 3.21 MiB
Duration : 17 s 513 ms
Overall bit rate mode : Constant
Overall bit rate : 1 536 kb/s

Audio
Format : PCM
Format profile : Float
Codec ID : 3
Codec ID/Hint : IEEE
Duration : 17 s 513 ms
Bit rate mode : Constant
Bit rate : 1 536 kb/s
Channel(s) : 1 channel
Sampling rate : 48.0 kHz
Bit depth : 32 bits
Stream size : 3.21 MiB (100%)
 
OP
pkane

pkane

Master Contributor
Forum Donor
Joined
Aug 18, 2017
Messages
5,675
Likes
10,306
Location
North-East
Yes, and for some reason, so is the new file with the 'stereo' setting in DISTORT

I found one issue with channel scaling, where the scale applied to left and right channel could be slightly different. Please try the fix and let me know if this helps (v1.0.19). There are a few other changes in this version, I'll post the description a bit later:

https://distortaudio.org
 

flipflop

Addicted to Fun and Learning
Joined
Feb 22, 2018
Messages
927
Likes
1,240
I found one issue with channel scaling, where the scale applied to left and right channel could be slightly different. Please try the fix and let me know if this helps (v1.0.19). There are a few other changes in this version, I'll post the description a bit later:

https://distortaudio.org
Thanks. The file is now being correctly saved in stereo and it sounds identical to the original when played through foobar. It still sounds wrong when it's played through DISTORT, but I found out this is because Equalizer APO isn't working with DISTORT despite the fact that my EQ is systemwide.
 
OP
pkane

pkane

Master Contributor
Forum Donor
Joined
Aug 18, 2017
Messages
5,675
Likes
10,306
Location
North-East
Thanks. The file is now being correctly saved in stereo and it sounds identical to the original when played through foobar. It still sounds wrong when it's played through DISTORT, but I found out this is because Equalizer APO isn't working with DISTORT despite the fact that my EQ is systemwide.

Interesting. How is Equalizer APO inserted into the audio stack? Is it a driver?
 
OP
pkane

pkane

Master Contributor
Forum Donor
Joined
Aug 18, 2017
Messages
5,675
Likes
10,306
Location
North-East
Sorry, I really don't know.

I've never heard anyone refer to it as such.

If it's any help, the software is free, so you can have easily have a look at it yourself.

After some research, I understand why it's not working with Equalizer APO. DISTORT is using WASAPI exclusive mode, and that prevents any kind of DSP, including Equalizer APO. I'll add an option for WASAPI shared mode in the next update.
 

flipflop

Addicted to Fun and Learning
Joined
Feb 22, 2018
Messages
927
Likes
1,240
After some research, I understand why it's not working with Equalizer APO. DISTORT is using WASAPI exclusive mode, and that prevents any kind of DSP, including Equalizer APO. I'll add an option for WASAPI shared mode in the next update.
Alright, thanks. Could you also make sure 'stereo' is the default setting if it's not the case already?
 
OP
pkane

pkane

Master Contributor
Forum Donor
Joined
Aug 18, 2017
Messages
5,675
Likes
10,306
Location
North-East
An interesting demonstration of the effect of dither using DISTORT:

Waveform (50Hz sine wave) quantized to 8 bits, with no dither:
1578579663757.png


Adding TPDF dither:
1578579819478.png


Now adding shaped dither (and low-pass filter at 20kHz):
1578579873816.png
 

pma

Major Contributor
Joined
Feb 23, 2019
Messages
4,602
Likes
10,769
Location
Prague
Hello Paul,

I have installed your distort program and after installing also NET framework 4.6 it works properly. I seem to have no issues with single sine tones. But I found a problem when trying to make distortion to the CCIF 19+20kHz IMD test tone, similar problem that I found years ago with Keith Howard's Addistortion software. My original file was in 48/16 and distortion levels as shown in one of the attachments. The problem are the 8,9,10,11,12kHz lines which should not be there. I am also attaching my zip files.

Otherwise congratulations to your nice job, it is a big improvement against Addistortion which was only able to work with mono 16-bit files.

Edit: my guess is they are aliases of harmonic distortion frequencies. 48-2*20=8, 48-2*19=10 .... maybe brickwall filtering on intermediate math products is needed.

ccif-orig.png


ccif-DISTORT.png


ccif_setting.png
 

Attachments

  • 19+20kHz_-1dB_48_16.zip
    145 KB · Views: 78
  • CCIF1920-DISTORT_L.zip
    175 KB · Views: 97
Last edited:
OP
pkane

pkane

Master Contributor
Forum Donor
Joined
Aug 18, 2017
Messages
5,675
Likes
10,306
Location
North-East
https://appbus.zoom.us/j/494643372
Hello Paul,

I have installed your distort program and after installing also NET framework 4.6 it works properly. I seem to have no issues with single sine tones. But I found a problem when trying to make distortion to the CCIF 19+20kHz IMD test tone, similar problem that I found years ago with Keith Howard's Addistortion software. My original file was in 48/16 and distortion levels as shown in one of the attachments. The problem are the 8,9,10,11,12kHz lines which should not be there. I am also attaching my zip files.

Otherwise congratulations to your nice job, it is a big improvement against Addistortion which was only able to work with mono 16-bit files.

View attachment 45138

View attachment 45139

View attachment 45140

Thank you, Pavel! Can you please explain why these components should not be there? Adding distortion using non-linear transfer function causes IMD. IMD applied to a two-tone test signal will generate components at x*f1 + y*f2 frequencies, where x and y are positive and negative integers. In fact, if you increase the non-linear distortion a bit more, you'll see nearly every combination of these frequencies in the spectrum (sorry, I'm in the middle of changing the UI a little, so this is in a slightly different format):

1578583823948.png
 

pma

Major Contributor
Joined
Feb 23, 2019
Messages
4,602
Likes
10,769
Location
Prague
https://appbus.zoom.us/j/494643372

Thank you, Pavel! Can you please explain why these components should not be there? Adding distortion using non-linear transfer function causes IMD. IMD applied to a two-tone test signal will generate components at x*f1 + y*f2 frequencies, where x and y are positive and negative integers. In fact, if you increase the non-linear distortion a bit more, you'll see nearly every combination of these frequencies in the spectrum (sorry, I'm in the middle of changing the UI a little, so this is in a slightly different format):

Paul, if you take the simplest case, F1+F2 and a pure H2 distortion, and F1 and F2 are close to Fs/2, as in our case (19kHz, 20 kHz and Fs/2=24kHz), then we get only one distortion component, F2-F1 = 1kHz below Fs/2. Everything above Fs/2 is prohibited by Nyquist theorem, which says that input signal can be properly reconstructed from its samples if the signal frequency is <Fs/2. So the components 2F1, 2F2 that all lie above Fs/2 and are H2 product are prohibited and are normally removed by a brickwall filter tuned just below Fs/2. This is for H2.
H3 creates equally spaced skirts around F1 and F2 at 2F1-F2 and 2F2-F1 frequencies, i.e. at 18kHz and 21kHz. These products are OK. So the lines of even harmonic distortion we can see at the left side as multiples of 2 x (F2-F1), 2kHz as a product of H2, 3kHz of H4 etc. Same for skirts that are created by odd harmonic distortion components. But, we have set H2 to -60dB approx and H3 to -80dB approx, all else H4 etc. below -200dB, so we have only H2 and H3 distortion. We may see thus only the F2-F1 (1kHz) at -60dB and 2F1-F2 and 2F2-F1, i.e. 18 and 21kHz skirts at -80dB. There must be no 8-12kHz lines in the 16dB signal which has a noise bottom at about -132dB. Those lines would be somewhere at -200dB, thus invisible in this plot. This is very basic information and we who work with analog circuits know and are able to identify distortion components immediately. Your 8-12kHz lines are a product of calculation only.

Attached is a measured CCIF distortion of a tube amplifier with similar H2 and H3 as described above, plus a small H4. Attached is also a Burr Brown paper on IMD.

1578586542409.png

With ADC sampling 96kHz we may look to 48kHz but not higher.

http://www.ittc.ku.edu/~jstiles/622/handouts/Two-Tone Intermodulation.pdf
 

Attachments

  • IMD_BurrBrown.pdf
    83 KB · Views: 174
Top Bottom