Ga naar Nederlandstalige tekst
The trouble with Headphones
CDRipper, GUI voor cdparanoia
Send in letter “Elektuur”
addition to letter
The Linux version is a .deb installation program also used by Ubuntu. It also installs a simple audioplayer(HP Player) what could be started from the menu. This program chooses automatically the right converter for the 6 0r 2 channel audio file. It can almost play any audio format (except the wma format). For this program a fast computer is necessary (more than 1.7 GHz duo core simple notebook). The windows version of HP_Player is limited. The best results are expected with 5.1 audio files, but this version only works with stereo files and only with limited formats. The implementation of all the functions was to difficult or impossible in Windows. For windows and Linux, there is also a VST version. When working with a DAW, good monitors are necessary to listen the result. With this filter plugged in the master, it is also possible to mix and master with headphones (and remove the filter in the final result else the recording only sounds great when listened with headphones and not with speakers).
Updated 11 juli 2018:Dependencies libav-tools and libqt4pas5 removed because not available in modern repository of Linux Mint.Download LADSPA and VST plugin for Windows 7,8 and 10 (VST 32 bits version and 64 bits version).
DVDtoHP is meant to extract audio tracks from music DVD's. This is about
the Linux version, but the Windows version is almost the same. There is
also a Windows and a Macintosh version to download. The audio information
on DVD is mostly available in different forms. The best quality is the
.dts(5.1) track, second choice is the .ac3(5.1) track. Sometimes there is
a stereo track available (in ac3 or lpcm format). The stereo tracks are
often not the best quality, too much compression and even clipping. First
experiment I have tried to down-mix the 6 channels to a 2 channel
recording with audacity. When the rear channels were mixed with the front
channels sometimes weird sound-effects or messy stereo image were created.
When the rear channels where just left out, some important sound
information was missing.
A different approach was necessary. It isn’t possible to recreate the sound-image of 6 speakers with 2 speakers or it should be an "artificial head" recording (or binaural recording) in a surround-sound setup, listened with headphones. DVDtoHP simulates an "artificial head" recording. Sound from a left channel reaches first the left ear and with a delay it also reaches the right ear. Higher frequencies are muffled more than lower frequencies. This is simulated by deliver the signal from the left side filtered and delayed to the right side and visa versa. The rear and front channels get a different delay and filter. The rear channels get a longer delay and are more muffled than the front channels.
It is difficult to predict how this will sound to different people. Every person has a different HRTF, Head Related Transfer Function caused by different size and build of head and ears. In fact a normal stereo recording shouldn't be listen-able with a headphone. Sound is delivered totally independent to the ears, in normal situations this only happening when a bee is buzzing in one of your ears. The human brain is still capable of processing these sounds. I believe the human brain is even better capable to process the sound from the artificial human head used in this program.
An example: take a recording of a low frequency signal with one channel in anti-phase with the other channel. When listening with speakers you will hear almost nothing (sometimes this actual happen when the wires of a speaker are wrongly connected), when listening with headphone you will hear the full power of the recording. A proof that a recording can sound totally different when listened with headphone. When processed by this program you will hear almost nothing as if you listen it with speakers.
The program is able to convert not only 5.1 audio but also stereo files ( wav, flac, mp3 etc.). Listening to the converted files, sound as if you are listening to speakers, giving the intended sound experience as meant by the mixer. The CD's are mixed for speakers in the normal configuration, not for headphones.
The program is capable of converting multiple files at the same time, using the multi-core processors optimal. The converting could be done in the background of normal computer use.
The program has three buttons. The first start a window in which you can choose which audio track you want to extract from the DVD. It will be saved in the original format, no conversion will take place. The file will be saved in the original dts, ac3 or wav format. The program uses mplayer program to extract, so package mplayer must be installed.
The second button starts the conversion, first it asks for audio input file, second it asks for the saving file name. If the extension is mp3 or flac it will ask for meta data, and automatically compress the audio file. Then a wait screen will start with the progress. This is an independent window, allowing you to start another conversions from the control program. The program uses ffmpeg ( from ffmpeg package )to decompress the file to a 6 channels floating points file.
Then my program will convert this file to a 2 Channels floating points file. Then it will normalize and convert it to an ordinary microsoft wav 16 bits, 2 channels file. Last step it could be compressed with lame program or flac program if extension was flac or mp3.
The program depends on the program ffmpeg of package ffmpeg for decompressing dts and ac3 files to floating points, sox of package sox for eventually resampling the file to 44100 (the quality of sox seems better than ffmpeg for resampling). For ripping the DVD it uses mplayer of package mplayer. For compression it use Lame of package lame and Flac of package flac. All these programs will automatic installed by the deb installation program. For other Linux versions the bare program is provided. The dependencies must be provided by the user.
It is unclear for me if Package libdvdread4 (you have to activate it with "sudo /usr/share/doc/libdvdread4/install-css.sh" in terminal) needs to be installed. This is necessary for descrambling DVD. Somehow this package was installed always automatically on my computer, so I never checked the necessity of this Package (I had even forgotten the existence of the package).
Added the ability to create and load a personalized version of the HRTF (head related transfer function). In the first version I had used a HRTF obtained from the Internet, randomly taken from a graphic found by coincidence. First version I had no big attention for an exact HRTF, because this would be a different function for every human and it is not easy to measure a personalized version of the HRTF. All listening with headphones sounds as if you were sitting with your back to the orchestra (a phenomenon normal for listening with headphone!). This problem should be caused by a not exactly correct HRTF, sadly this problem is not solved. I have tried versions with extra phase control and extra delay control, but this didn't solved it. The spreading of the sound over the space is now improved and it sounds more natural.
Delayfront: the delay caused by the longer distant from the left front
speaker to the right ear in comparison from the distance to the left ear.
2.5e-4 seconds is 11 samples at 44100 samplerate, and it means 7.5 cm
extra distant. I suggest not to change it, if to large all the sounds
seems to come from very near.
DelayBack: The delay from the speaker on the left side to right ear in comparison to the left ear. 6.12e-4 sec. Is 27 samples with 44100 samplingrate and means 18 cm.
Beeplength:Length of the testbeep.
SampleFreq: Sampling frequency of testbeep, not important.
Testlength: Testbeep is repeated from left to right, this is the total length of testsound.
The list headed “List of HRTF”: The actual HRTF ,first number is frequency, second number is the damp for the front speakers, the third is the damp of the speakers on the right and left side. Last frequency in list is always 24000 Hz, because DVD recordings has a bandwidth of 24000 Hz .
The list headed “Testfreq Width”:First number is frequency of testbeep, second number is bandwidth of testbeep. More frequencies (lines) are possible. I suggest to keep a bandwith of 1 hz and only one frequency.
HalfPulse checkbox:gives testbeep sharp attack, only use it in final testing because it increases bandwidth
Nameof:Here you can choose a name for the HRTF
Use headphone, push button “Test Front Audio”. If adjustment is correct,
the sound you hear should originated from speakers at an angle of 30
degrees behind of you. If the sounds seems to come more from the center,
you had to make the second number for that frequency in the HRTF list
smaller. If the sound seems to come from to far sideway, you have to make
it larger. Repeat this for every frequency in the HRTF list. If necessary
add extra frequencies to the list. The test signal should sound
symetrical. At frequencies between 1000 HZ and 4000Hz something strange
could happen. For my ears the test signal was not longer symmetrical. This
was caused by a wrong HRTF for this frequency. The delay leads to another
sound direction than the information of the damping. The brain could not
solve this sound-image and comes for every ear with a different solution.
Adjusting the level of damping to the right HRTF level made this more
symmetrical, because the information from delay and the information of
damping are no longer conflicting. Exactly this is the reason for creating
your own HRTF, and why headphone listening with the sound-processing from
this program is more pleasant.
With “Test Side Audio” button the testbeep should become from your side. First try to make the number of the last column for the testfreq larger. If the sound seems to come from a point not exactly from the side (more centred) then make this number again smaller. Find this boundary. If you make it to small the origin seems to getting to close to your head, and this is difficult to hear from the test signal. (These numbers are not used with stereo recordings, only DVD has this channels). Repeat this for all the frequencies in the HRTF list.
Test both buttons for all frequencies again with the “HalfPulse checkbox” checked.
In the list of test frequencies you can set the testfrequency, The second number is the bandwidth of the testfrequency. The testfrequency is generated by filtering a delta function or white noise width the bandwidth. The source is chosen by checkbock "white noise".
Save the result with the “save file” button. If saved with the name”default.hrtf” in the home directory, the HRTF will be automatically loaded every time with the start of program.
The examples are just from stereo recordings, because it should be royalty free. The best quality should come from DTS recordings. The recording(Example1) is made with Hydrogen drumcomputer, just the stick and the kick moving from left to the right. The original sound as if the first hit comes from a point near your left ear, the next from an unclear point in the middle, the last from a point near the right ear. The converted file sounds as if the instrument made a normal trajectory. The most extreme positioning (absolutely left or right) doesn't come from a point near to your ear. The converted to binaural audio examples sound much more natural. The original versions sound annoying if listened with headphone. Sometimes it sounds as 2 mono signals. A more extreme example is Example2, Noise on one channel. In the original, the sound originate in your ear and is totally unnatural. The converted version sound as if its originate of a speaker at an angle of 30 degrees right behind you, and is much natural. It is still coming from behind you, but nicely placed in space. At home I listen only to converted recordings with headphone because I find it more pleasant. If the original was a 5.1 recording the binaural converted recording should sound much wider. There exists a version of "Aero" of Jean Michel Jarre specified as a "Dolby headphone" version. I think for making this, they used a similar process. I thought my version from ripping the DVD sounds better.
Example1: Origineel and Converted BinauralExample2 (Extreme example):Original and converted Binaural
For the same effect I have created a LADSPA filter version. In goes the normal stereo or 5.1 version, out comes a version adapted for listening with headphone. Windows version is 32bits also working in windows 64 bits. For working with Audacity, place the stereotobinaural.dll file in the directory “C:\Program files(x86)\Audacity\Plug_Ins” . Enable it in the Effect menu. The effect is now visible as “stereo to binaural”. In Linux, just double click the deb installation file. For visibility in Audacity, enable it in the Effect menu. In OSX place the libstereotoheadphone.so in the directory "Application/Audacity/Plug-Ins". For visibility in Audacity, enable it in the Effect menu. The effect is now visible as “stereo to binaural”.
Updated 11 july 2018:(Linux)Dependencies libav-tools and libqt4pas5 removed because not available in modern repository of Linux Mint.
Updated 14 august 2018:(Linux,Windows)Added support for DSF and DFF files (from Super Audio CD's)
Updated 07 july 2019:(Linux,Windows)Added support for not only stereo and 5.1, but also every format between (like 5.0)
Update 05 august 2019: Added support for sofalizer from ffmpeg. For experimenting with sofa files. First try, I found ClubFritz1.sofa gives a good result. I tried with ClubFritz6 and ClubFritz11 with gives distortion. I tried dtf_nh2.sofa which gives a result without frequencies below 300Hz. So be careful which sofa files you choose. Solved: problem was with type=time, now use type=freq option.
Update 07 september 2019:added support for opus format, import and export.
Download dvdtohp3_2_amd64.deb, sofalizer version
dvdtohp3_2win64, sofalizer version with all dependencies
Download address for sofa files
Download LADSPA plugin for Windows.
Download Linux Ubuntu or Mint 64 bits dvdtohp_3_amd64.deb
Download Linux 64 bits executable dvdtohp_3_amd64
Download Linux Ubuntu or Mint 32 bits dvdtohp_3_i386.deb
Download Linux 32 bits executable dvdtohp_3_i386
DVDtoHP version For Windows (64 bits and 32 bits) with all dependencies
!!!!! If link for Windows version doesn't work then download from freewarefiles.com (search for dvdtohp,older version without DSF support and without 5.0 support)
The windows version uses ffmpeg.exe, mplayer.exe, sox.exe, lame.exe and
flac.exe. They are all placed in the download file because their locations
and versions are more controllable. Downloads and info of the used programs
are on the next websites.
Download location for ffmpeg (ffmpeg.exe)
Download location for mplayer.exe (I used the generic version)
A location to download lame.exe
Download location flac.exe
Download location sox
Macintosh Maverick instruction
First download dvdtohpMaverick3.zip
Linux Ubuntu or Mint deb installation file 64 bit Download
Linux Ubuntu or Mint deb installation file 32 bit Download
Small screen images
Large screen image
Iaddi (1+1 in letters) Calculator with text input, 3 variables.
Calculates numerical integration and numerical differentiation. Creates a
graphic of the function. Does not need any permissions.
Functions: *, / , + , - , ^ ( power of), sin(), cos(), tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, sqr, sqrt, exp, ln, log, abs, rnd, random, rndg (random met Gaussian distribution), cot, csc, sec, acot, acsc, asec, coth, csch, sech, acoth, acsch, asech, sign, round, torad (from degree to rad), todegr (from rad to degree).
Boundaries for drawing graphic and integration can be given by using Start x, End x, start y and end y.
If start x and end x are the same, the boundaries for y are calculated automatically.
If start y and end y are the same, the boundaries for y are calculated automatically.
Warning:Integration can not recognize singularities, input of infinity is not possible. When a graphic with a singularity is drawn it is necessary to restrict the y boundaries by fill in start y and end y
Download android version (zipped) iaddi_android
Download Java version (zipped) iaddi_java
A send in letter from me was publicized in the Dutch magazine “Elektuur” January 2001. This letter regards the recording quality of cd's, especially about clipping. On the Internet I found there where a few translations or summarizing in German ,French and English. Recently I found a few references in Germany to this letter. That's why I placed the original letter and English translation on this site.
Dear Editor — roughly a year ago you had an article in Elektor Electronics about CDs that were supposedly recorded with overdriven signals. An oscilloscope was used to look at the outputsignal of a CD player playing Jean Michel Jarre’s ‘Oxygen 7- 13’. It was clear that the peaks of the waveform were flat where the signal was greater than what could be reproduced by the CD. This is also known as clipping. Using an oscilloscope in this way can’t really tell us how much the CD player affects the signal quality. Between the CD and oscilloscope will be an oversampling digital filter, a digital-to-analogue converter and finally an analogue filter. The most accurate way to check a CD is to extract the track digitally and store it as a WAV file. This will be an exact digital copy of the CD, assuming there were no read errors. The creation of the WAV file shouldn’t be a problem since it is a function that is found in most current CD ‘rippers’. A computer program can then be used to analyse the contents of this WAV file. A WAV file consists of a header followed by the thousands of samples that make up the digitised sound. The 16-bit format used on CDs gives these samples a range from -32768 to 32767. In order to have a closer look at these WAV files I have written a program that can analyse them. As the first step, the program creates a histogram of the WAV file. This counts how often each sample value occurs in the WAV file, and gives a display as shown in Figure 1.
The values near zero occur most often; the more you go to the extremes of –32768 and 32767, the less often they occur. If there was any clipping at the recording stage, all strong signals will be rounded to the extremes of -32768 and 32767, which results in two peaks at the ends of the histogram. This way you can see if there is any clipping present and at what level (it is possible for it to occur at different values than -32768 and 32767, due to badly set up A/D converters). Next, the program displays the actual waveform stored in the WAV file. This window has a search facility that searches for clipping values, as determined by the previous histogram function. I have used this program to analyse the track “...Baby One More Time” by Britney Spears, from her CD “...baby one more time”. It was obvious that there was a lot of clipping in this track, but the display returned by the histogram was the most surprising. This is shown in Figure 2.
It contains the number of occurrences in the WAV file for samples with values from 4 to 515. After every two values that occur over a 1000 times, there follows a value that rarely or never occurs at all. You could only get such a histogram when a 16-bit recording is re-recorded after amplification by a factor of 1.5. Samples with values of 1, 2, 3, 4, 5, 6, 7 etc. are multiplied by 1.5 to give 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5 etc. These values then have to be rounded to integers before being written to the CD. This gives the result 2, 3, 5, 6, 8, 9, 11 etc. You’ll see that every third value is missing from this series of numbers. By looking at the waveform where clipping occurs, it is possible to deduce by how much the recording of the CD was overdriven. I estimate this to be a factor of about 1.5. From this I conclude that the original mix, which was recorded perfectly, was remixed with an amplification of 1.5, causing clipping in the new recording. The track “Gloria, lonely boy” on the CD “Metamorphose” by Jean Michel Jarre was then analysed, in order to see if his latest CD had signs of clipping. Here too it seemed that the recording was overdriven. But once more it was the histogram that returned some fascinating information (Figure 3).
The smallest and largest samples found in the recording were -32022 and 32021 respectively (0.977 of the maximum range). These were also the levels at which clipping occurred. From the histogram it can be seen that every fortieth value is twice as large as its neighbours are. From these observations you can conclude that this CD is a remix of an original CD recording. The samples have been multiplied by 0.977 before being converted back into CD format. This raises the question why this meaningless conversion was carried out on the recording. The only reason I can think of is that the remix was made to hide the fact that the recording was overdriven. Anybody who uses an oscilloscope to look for clipping would set the trigger level at the largest possible signal level, about 99.9% of the maximum signal possible. The remix would cause the signal to remain below this level so the oscilloscope would never trigger and the clipping would remain undetected. The person making the remix would have known that clipping occurred and was determined to hide this fact. The correct procedure would have been to make a slightly softer remix from the master tape and avoid any clipping that way. The record industry is currently promoting the new Super Audio CD (SACD), which has an improved quality. They would be better off stopping the messing around with the recordings. These fudges also sound bad in SACD format and making careful recordings in CD format will result in bigger improvements than the change to SACD format.
A. Kappert, Deventer
Some people think that these results are caused by compression. But at making cd's, compression means reinforcing the weak passages, reinforcing the strong passages is not possible because these already reach their limit. With a sound editing program the wave shape can be examined. Here is the result made with the provided program of”… baby one more time” at the position 114.885 sec.
Every pixel to the right is a new sample. One of the channels shows clear clipping over a large length and in severe degree. The wave shape have been clearly damaged because of this. Compression will change the envelope of a signal but won't affect the shape. Long before the signal becomes to large the volume will be slowly turned down to prevent clipping. An estimation can be made over the original signal size,I estimate it 1.5 larger. Remains the question about why this signal is strengthens. It appears that by comparison of sound quality of Hi Fi signals, the first preference goes out to the strongest signal. Also at radio broadcasts, the recordings with the largest sound strength attract the most attention.
To addition in figure 5 “oxygen 7”of J. M. Jarre on 27.37 seconds. Here clearly the “saw tooth” is cut off, in this way losing a lot of harmonics in the sound. At “Methamorphoses” the signal appeared to be weakened with 2,5%. It appeared that cd mastering equipment is protected against clipping. To get around this protection, it is necessary to weaken the signal, but at that moment it is known that clipping occurred.
To Download ( updated ) analyse program
(cdwavanalyse,windows 7, 32bits)
To Download ( updated ) analyse program (cdwavanalyse,linux Ubuntu or Mint, 64 bits deb)
To Download ( updated ) analyse program (cdwavanalyse,linux Ubuntu or Mint, 32 bits deb)
This program draws Mandelbrot fractals. With a left mouse click you can zoom in, with a right mouse click you can zoom out. It is possible to zoom in with factor 1E16.
Download Linux Ubuntu 64 bits
Download Linux Ubuntu 32 bits
For training Python programming I made a Python version of Mandelbrot program. I used numpy module for the calculation, Pil (or actually Pillow fork ) for the image building and PyInstaller for creating an one file executable. The best version I made was 2 times slower then the Lazarus (Free Pascal) version. But this version used multiprocessing, so actually it was 6 times slower. The multiprocessing module had problems after being processed by PyInstaller (strangely no problem in the uncompiled version). The python file needed an extra addition for the right form of spawning. Another problem was the inability to use a more precise version of float64 in Windows. Intel processors use internally float80. Free pascal has not a problem with this (extended type), so using the intel processor more efficient. Under Linux Mint I had to use float128, while internally the precision was only float80. A strange use of types? It makes it unclear what floating version to use and the actual precision version used.
Download Windows Python version
Download Python Linux version