Post by solderdude on May 31, 2015 15:44:14 GMT
My little digital filtering experiment done after a discussion on Archimago's blog.
You often read all over the forum how digital filters alter the sound and that 'pre-ringing' gives artefacts in the audible range.
When looking at the typical 'ringing' on needle (Dirac) pulses and squarewaves this ringing is clearly visible but when looking at the timebase that ringing is above the audible band.
Reading so many 'reports' that ringing would also be present in the audible band and that (amongst other things) would account for 'sonic degradation' seems widely spread.
Yes, the slow filters, without pre-ringing but with extensive post ringing are audibly different.
This is simply because of the roll-off and phase shifts in the higher frequencies.
Not talking about those filters as to me these filters are 'flawed' in that they ALTER the original signal.
The ringing is visible when artificial signals are applied to a filter. The response to that signal tells us something about the filter behaviour around the cut-off frequency.
I am not interested in altering the sound at all, I just want to know if after resampling there is 'pre- and post-ringing present WITHIN the audible band.
So a short experiment where a known 'decent' file format where a good quality recording on 24/192 is used as a source.
Miles Davis 24/192 kind of blue taken directly from the masters (not remastered).
I used song #2 (Freddy Freeloader) as it has lots of transients, dynamics etc.
It has HF contents right up to 40kHz.
Took a small excerpt from this song and used Awave studio to downsample it to 48kHz/24.
During this resampling process a (sharp) 24 bit FIR low pass filter is used (which took quite a bit of time to resample that excerpt).
This creates some pre- and post-ringing.
Subsequently upsampled that 48/24 file again to 192/24 so I have an equal amount of samples.
It should have the same waveforms as the original except for the HF above 23 kHz which was removed by the filter during downsampling.
Also any 'ringing' of the sharp low pass filter used is 'added' to the converted 48kHz file.
All music content above 23kHz should be causing ringing which wasn't in the original signal.
Below the spectrum between 10kHz and 60kHz for the left channel only.
The upper trace shows that spectrum for the original file.
The lower trace shows the spectrum of the downsampled and subsequently upsampled file (so 2 operations).
The spectrum below 10kHz is not of importance here.
Those 2 files were 'mixed' in Soundforge 10 (the down- and up-sampled file was inverted).
This nulls out the 2 files and everything that differs (be it phase, time or amplitude differences) will be present in the now created 'difference' file.
That file should contain all the harmonics above say 22kHz as that would be the difference plus any ringing that wasn't in the original file.
If that ringing or (feared) pre-echo occurs in the audible band it must be visible in the difference file and will reveal itself in the FFT.
You can also play back that difference file (using equipment that is known to reproduce > 20kHz).
I did play back this file on equipment that is verified to reach at least 30kHz (flat) yet, even when the playback is amplified by 40dB (so has contents reaching almost 0dB) you hear absolutely NOTHING.
Of course some people claim you can only 'perceive' that extra info when it is related to the original signal. I cannot verify that claim.
Below the spectrum (10kHz and higher) plus the actual signal (amplified by 40dB)
This only shows contents with frequencies above 23kHz and nothing below it.
Below a screenshot of the excerpt of the original music.
Below the 'difference' file in the same dB- and time-scales.
As there is little to see (and hear) in this file and to show that there is indeed an actual signal present in this file the amplitude scale was 'amplified' by 40dB.
It shows amplitudes of the ultrasonic content having peaks around -40dB and average levels around -60dB.
One should realise that if the above music was played in the living room at say 90dB average (which is loud and contains peaks up to 100dB) that those HF contents (all above the audible band) will be reproduced at levels of just 40dB SPL.
90dB SPL = Traffic on a busy roadway at 10 m (32 feet)
40dB SPL = Library, bird calls, lowest limit of urban ambient sound
Then you also need to realise that our hearing becomes much less sensitive above 10kHz and the signals we are talking about are > 23kHz (a lot of speakers/headphones won't even reproduce it)
Let's zoom in on the time scale of the large peaks at the beginning of the file, this is a sharp 'attack' in the music by the way.
It consists of short 'chirps' … let's zoom in further to sample on the highest sample shown below.
The time between the peaks of the impulse there takes around 7 samples. As the sample frequency is 192kHz this works out as a frequency of 27kHz (peaking at -40dB FS).
It appears to have pre- and post-ringing.
That ringing is at around 22kHz (about 8.5 samples) so may well be caused by the filter during the downsample process.
Have you noticed that we are looking at a real world sharp sounding 'attack' and that it takes 4 samples (at 192kHz) and is a very small amplitude.
When compared to the artificial square-wave that rises 100x bigger in amplitude in a 4x shorter time period you may realise that looking at the filter's behaviour of such signals is a bit pointless.
The audibility of these ultrasonics is something one would have to think about for themselves.
To me it has become clear that (well designed) low pass filters do not alter the signal below 22 kHz (48kHz sample frequency). Of course when using inferior filters some ultrasonic contents may be 'mirrored' into the audible band which I didn't test for.
You often read all over the forum how digital filters alter the sound and that 'pre-ringing' gives artefacts in the audible range.
When looking at the typical 'ringing' on needle (Dirac) pulses and squarewaves this ringing is clearly visible but when looking at the timebase that ringing is above the audible band.
Reading so many 'reports' that ringing would also be present in the audible band and that (amongst other things) would account for 'sonic degradation' seems widely spread.
Yes, the slow filters, without pre-ringing but with extensive post ringing are audibly different.
This is simply because of the roll-off and phase shifts in the higher frequencies.
Not talking about those filters as to me these filters are 'flawed' in that they ALTER the original signal.
The ringing is visible when artificial signals are applied to a filter. The response to that signal tells us something about the filter behaviour around the cut-off frequency.
I am not interested in altering the sound at all, I just want to know if after resampling there is 'pre- and post-ringing present WITHIN the audible band.
So a short experiment where a known 'decent' file format where a good quality recording on 24/192 is used as a source.
Miles Davis 24/192 kind of blue taken directly from the masters (not remastered).
I used song #2 (Freddy Freeloader) as it has lots of transients, dynamics etc.
It has HF contents right up to 40kHz.
Took a small excerpt from this song and used Awave studio to downsample it to 48kHz/24.
During this resampling process a (sharp) 24 bit FIR low pass filter is used (which took quite a bit of time to resample that excerpt).
This creates some pre- and post-ringing.
Subsequently upsampled that 48/24 file again to 192/24 so I have an equal amount of samples.
It should have the same waveforms as the original except for the HF above 23 kHz which was removed by the filter during downsampling.
Also any 'ringing' of the sharp low pass filter used is 'added' to the converted 48kHz file.
All music content above 23kHz should be causing ringing which wasn't in the original signal.
Below the spectrum between 10kHz and 60kHz for the left channel only.
The upper trace shows that spectrum for the original file.
The lower trace shows the spectrum of the downsampled and subsequently upsampled file (so 2 operations).
The spectrum below 10kHz is not of importance here.
Those 2 files were 'mixed' in Soundforge 10 (the down- and up-sampled file was inverted).
This nulls out the 2 files and everything that differs (be it phase, time or amplitude differences) will be present in the now created 'difference' file.
That file should contain all the harmonics above say 22kHz as that would be the difference plus any ringing that wasn't in the original file.
If that ringing or (feared) pre-echo occurs in the audible band it must be visible in the difference file and will reveal itself in the FFT.
You can also play back that difference file (using equipment that is known to reproduce > 20kHz).
I did play back this file on equipment that is verified to reach at least 30kHz (flat) yet, even when the playback is amplified by 40dB (so has contents reaching almost 0dB) you hear absolutely NOTHING.
Of course some people claim you can only 'perceive' that extra info when it is related to the original signal. I cannot verify that claim.
Below the spectrum (10kHz and higher) plus the actual signal (amplified by 40dB)
This only shows contents with frequencies above 23kHz and nothing below it.
Below a screenshot of the excerpt of the original music.
Below the 'difference' file in the same dB- and time-scales.
As there is little to see (and hear) in this file and to show that there is indeed an actual signal present in this file the amplitude scale was 'amplified' by 40dB.
It shows amplitudes of the ultrasonic content having peaks around -40dB and average levels around -60dB.
One should realise that if the above music was played in the living room at say 90dB average (which is loud and contains peaks up to 100dB) that those HF contents (all above the audible band) will be reproduced at levels of just 40dB SPL.
90dB SPL = Traffic on a busy roadway at 10 m (32 feet)
40dB SPL = Library, bird calls, lowest limit of urban ambient sound
Then you also need to realise that our hearing becomes much less sensitive above 10kHz and the signals we are talking about are > 23kHz (a lot of speakers/headphones won't even reproduce it)
Let's zoom in on the time scale of the large peaks at the beginning of the file, this is a sharp 'attack' in the music by the way.
It consists of short 'chirps' … let's zoom in further to sample on the highest sample shown below.
The time between the peaks of the impulse there takes around 7 samples. As the sample frequency is 192kHz this works out as a frequency of 27kHz (peaking at -40dB FS).
It appears to have pre- and post-ringing.
That ringing is at around 22kHz (about 8.5 samples) so may well be caused by the filter during the downsample process.
Have you noticed that we are looking at a real world sharp sounding 'attack' and that it takes 4 samples (at 192kHz) and is a very small amplitude.
When compared to the artificial square-wave that rises 100x bigger in amplitude in a 4x shorter time period you may realise that looking at the filter's behaviour of such signals is a bit pointless.
The audibility of these ultrasonics is something one would have to think about for themselves.
To me it has become clear that (well designed) low pass filters do not alter the signal below 22 kHz (48kHz sample frequency). Of course when using inferior filters some ultrasonic contents may be 'mirrored' into the audible band which I didn't test for.