• Welcome to ASR. 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!

ISP Analyzer - When true peak scan cannot represent what happens in a real DAC

OHtaru

Member
Joined
Oct 3, 2021
Messages
72
Likes
100
I think we've ignored one thing: Can true peak scan really represent what happens in the DAC?

The commonly used BS.1770 for true peak scan comes with a simple 4x oversampling, and its performance is indeed inferior compared to the oversampling filters built into modern DACs.
Moreover, it sticks to linear phase. If a minimum phase filter is used, the results of the true peak scan cannot well represent what happens in your DAC:

filterbs1770.png
filterbs1770spectrum1.png

index.php

Let's see how the minimum phase filter increases the peak level. If you prefer minimum phase filter, you may even need more headroom than Archimago's study. As for how much is needed, I think research in this area is still a blank. I want to be the first person to fill in this blank. So through some programming, we have this:
ISP Analyzer.png

This ISP Analyzer is probably the first one that allows you to customize the oversampling filter and also has an IR import function. If you can get the IR of your DAC, it will accurately predict what happens inside your DAC, which will guide you to better set your headroom. This program can generate 3 files to help you better observe, listen, or perform an ABX:
Version A:XXXXXX_Oversampling factor_Phase_float32.wav (Oversampled)
Version B:XXXXXX_Oversampling factor_Phase_int16.wav (ISP is clipped).
Null test: XXXXXX_Oversampling factor_Phase_isp_only_int16.wav (Version A minus Version B).
index.php

Enjoy it and welcome to discuss! The main program is located at ISP_Analyzer\dist\ISP_Analyzer.exe

Related links:
 
Great work. Thanks for sharing it with us!

The problem of inter-sample overs/peaks (ISOs/ISPs) is very much like DRE-induced distortion. Both are transient peaks/saturation in the digital domain, affecting a broadband audio spectrum. I am pretty sure we can come up with some ideal test signal of ISP that can be used in a listening test, which would sound like 'clicks' or 'grainy noise'.

I somehow underestimated the ISP problem. Of course, audibility in real audio contents is a different issue. It should be impossible to accurately evaluate effects in real audio considering all possible factors. In fact, quite a few nonlinearity phenomena that are clearly seen in tests would not be clearly audible when appearing in real audio contents. This does not mean the phenomena are not real. Most likely some of those effect can still make holistic, integrated impression of sound quality when processed in our brain.
 
Last edited:
I am pretty sure we can come up with some ideal test signal of ISP that can be used in a listening test, which would sound like 'clicks' or 'grainy noise'.
This might not be easy to find. Where there is an ISP, there is usually high-frequency, high-loudness and transient, so this distortion is well masked.
 
Can true peak scan really represent what happens in the DAC?
I don't think it's possible... And that's the main question... How does the DAC handle inter-sample peaks.

And... Since original waveform isn't sampled between peaks it's impossible to know what was there. ;) Sampling theory says you can reconstruct a continuous waveform but real world audio isn't continuous. It changes moment-to-moment and the reconstruction is "imperfect." (Even continuous waveforms can be "imperfect" because of the way real DACs work.)
 
And... Since original waveform isn't sampled between peaks it's impossible to know what was there. ;) Sampling theory says you can reconstruct a continuous waveform but real world audio isn't continuous. It changes moment-to-moment and the reconstruction is "imperfect."
Sorry, but that is completely wrong. Sampling theory says any signal can correctly be captured and reproduced faithfully, from DC up to fs/2... with proper anti-alias and anti-imaging filters, or course. Ideally, infinite sinc() function but in practice a few thousand taps approximation is all that is required for 24bit perfection.
 
Sorry, but that is completely wrong.
How do you know the wave shape? Maybe the original sample was clipped... It's impossible to know what was in-between the samples. If the signal is continuous the peak will eventually be "captured".

Or do you have Audacity? Generate a 11,024Hz sine wave at 22050Hz sample rate. The wave will be modulated at 1Hz and you can hear the modulation.

Theoretically/mathematically all of the information is there to re-create the near-Nyquist waveform but the DAC output is modulated. It's impossible to know if this is a near-Nyquist sampling artifact or it the original signal was modulated before sampling.

You'll also get obvious modulation near half of the Nyquist limit but it's not 100% modulation so it's as easy to hear, but you can see it in with the right amount of zoom.
 
The main reason we see this resistance (or ignorance) about the ISP problem is pure practical and fairly new.

It's the fact that people run out of gain, soon or have no way to reduce level in a way to skip the problem.
These new, low gain amps (lower than 20dB) driven only by a DAC will often run out of level pretty soon.

Suggesting another 3dB reduction for example (specially the last three ones) already halves this level.

So they choose to ignore?

Thanks for the tool!
 
Or do you have Audacity? Generate a 11,024Hz sine wave at 22050Hz sample rate. The wave will be modulated at 1Hz and you can hear the modulation.
If the DAC supports 22050 sample rate and its filter does not attenuate at Nyquist then yes. If the DAC doesn't support 22050 sample rate (which is likely the case) then it will depend on the upsampling filter of the player or the operating system's audio stack. With Audacity (3.7.4) you'll hear the modulation with the Fast filter:

fft.zoom-out.png


but you shouldn't hear anything with Medium, High or Best:

fft.zoom-in.png


If you export the file and play through some player that leaves resampling to Windows WASAPI then you'll hear the modulation again, although quieter than with Audacity's Fast filter.

It's impossible to know if this is a near-Nyquist sampling artifact or it the original signal was modulated before sampling.
If Nyquist criteria are not fulfilled then all bets are off.
 
How do you know the wave shape? Maybe the original sample was clipped... It's impossible to know what was in-between the samples. If the signal is continuous the peak will eventually be "captured".
Everything that was "in between the samples" affects the actual sample points, this is what the anti-imaging filter does. You don't sample the original waveform at your sample points and therefore you don't miss any information that was in between -- of course only up to, but not including, fs/2.
Generate a 11,024Hz sine wave at 22050Hz sample rate. The wave will be modulated at 1Hz and you can hear the modulation.
When you have a sample stream at a pure sine frequency 1Hz below fs/2 you obviously need a reconstruction filter which is capable to create the original steady-state sine which means it must be (much) longer than one second otherwise the DAC's analog output will indeed show a modulation that "is not in the data". Same goes for an anti-imaging filter for an ADC.
 
Sorry, but that is completely wrong
What he means is probably this: the signal that starts at some time moment and finishes at another moment (= is not continuous, but transient) has infinite spectrum. And this is a fact. We only approach, in better or worse extent, to band limited transient signals.
 
What he means is probably this: the signal that starts at some time moment and finishes at another moment (= is not continuous, but transient) has infinite spectrum. And this is a fact. We only approach, in better or worse extent, to band limited transient signals.
Yes. Nyquist works in the real, band-limited, world, despite the "theoretically" Impossibly long timescales.

@DVDdoug other point is also meritorious - if the signal is clipped at the ADC stage, it may not be possible to know what the reconstructed signal should look like.

The fact that we have all probably experienced inter sample overs and most of us have not complained (probably because the sounds surrounding the ISP are loud), means that the "guessed" reconstruction is not too far off the original.
 
We are talking DACs here, right?
The input for a DAC is the sample stream and this is the source data, the original we want to reproduce, no matter what it is and how it was created (or corrupted in case a clipped ADC was involved).

I have to thank @OHtaru for the new-to-me insight that reconstruction filters that are not strictly linear phase may render even higher peak values.
 
I think we've ignored one thing: Can true peak scan really represent what happens in the DAC?
Up to now I have assumed (and seen in real life) that the higher quality of the typical lin-phase reconstruction filter the larger the possible IS-overs. Therefore using a long sinc filter for upsampling should represent the worst-case, also one would typically pick a "non-perfect" half-band filter as that is what's commonly used in actual DACs.
Extreme brickwall filters that are not linear-phase seem to pose new issues.

Overall, the only way one could establish a safe attenuation level for any possible DAC is to start with the most conservative approach and then add a reasonable safety margin on top of that.

Without a list of how real DACs behave precisely, that is, whether they simply just clip the IS-over at some point or whether they show more severe ill-effects, it is not easy to say if the potentially quite severe attenuation really offers an audible benefit. Many DACs simply soft-clip IS-Overs at like 1..2dB above FS which I do consider completely inaudible.
 
Linear phase filter does not change the phase relationship of the waveform. For the filter steepness vs peak, there is always a law of diminishing marginal returns here. That is, after the steepness reaches a certain level, continuing to increase the steepness will not significantly increase the peaks. However, the higher peaks brought by non-linear phase filter are due to its phase rotation. The more phase rotation, the more peak levels.

This explains the fact: even if the performance of the BS.1770 filter is not good, the results it produces compared with the linear phase filters in DACs are not day and night. However, BS.1770 cannot provide any valid reference for the minimum phase mode at all.

You can do two interesting experiments:
1) Stack linear phase filters continuously and stack minimum phase filters continuously. You will find that after stacking linear phase filters several times, the peak value will stabilize. But this is not the case when continuously stacking minimum phase filters.
2) Prepare the audio with a linear phase low-pass filter of a lower frequency (16k for example), then do 1) but use filters of a higher frequency (20k for example). You will find that stacking linear phase filters makes no change at all. But for the minimum phase one, there is endless phase rotation. :)
 
Anti-imaging/reconstruction filtering is a perfect application example of a linear phase filter.

For the purpose of acoustic frequency response correction (not for XO), minimum phase filters are fine (or better in some sense).
 
How do you know the wave shape? Maybe the original sample was clipped
Because - band limiting.

A waveform clipped between the two samples requires higher bandwidth than FS/2. That is the whole point of the sampling theorem. A signal band limited to FS/2 is *fully* defined by the samples - we know, mathematically, what it is.
 
Linear phase filter does not change the phase relationship of the waveform. For the filter steepness vs peak, there is always a law of diminishing marginal returns here. That is, after the steepness reaches a certain level, continuing to increase the steepness will not significantly increase the peaks. However, the higher peaks brought by non-linear phase filter are due to its phase rotation. The more phase rotation, the more peak levels.
Thanks for the explanation, it makes perfect sense.
 
You can do two interesting experiments:
1) Stack linear phase filters continuously and stack minimum phase filters continuously. You will find that after stacking linear phase filters several times, the peak value will stabilize. But this is not the case when continuously stacking minimum phase filters.
2) Prepare the audio with a linear phase low-pass filter of a lower frequency (16k for example), then do 1) but use filters of a higher frequency (20k for example). You will find that stacking linear phase filters makes no change at all. But for the minimum phase one, there is endless phase rotation. :)
Now the filter stacker function has been integrated into the tool:
Filter stack.png

Additionally, this function can amplify the differences between linear phase and minimum phase, allowing you to better hear the differences without being confused by vague audiophile descriptions. The figure below shows the spectrum of a single-sample impulse after being filtered 1000 times:
Filtered Impulse.png
 
The problem of inter-sample overs/peaks (ISOs/ISPs) is very much like DRE-induced distortion. Both are transient peaks/saturation in the digital domain, affecting a broadband audio spectrum. I am pretty sure we can come up with some ideal test signal of ISP that can be used in a listening test, which would sound like 'clicks' or 'grainy noise'.
I created a test signal for listening tests. It's a shaped noise in which most of the energy is distributed above 20kHz and there are enough samples near 0dBFS to overdrive the DAC.
shaped noise.png

And it's the result of ISP clipping, the 'clicks' or 'grainy noise' are in the audible range:
shaped noise ISP clip.png

But the interesting thing is that my Neutron HiFi DAC V1 failed this test. Even when I turned the volume up to the maximum, I could only hear a little click. And my Babyface Pro FS was completely immune to this. It implied that what happens inside the DAC is far more complex than hard clipping (here is a clue). I think although I successfully HEARD the ISP distortion (only a little bit), It seems that the scales are tipping towards that we don't need to worry about ISP, unless I can find a better test signal.:)

Update: After I loaded a minimum-phase filter I made into the Neutron HiFi DAC V1, there were a lot of 'clicks' or 'grainy noise'.
Here is this filter. Just replace FIR #1 in NConfigurator, there's no need to modify FIR #2.

By the way, It overdrived my Genelec 8320A, the noise is very audible. I have to turn down my sound card by 12dB to make the noise disappear. This must be due to other mechanisms in the Genelec, because the maximum output level of my sound card is lower than Genelec's limit (+19dBu vs +24dBu). It's like mocking me: there are obviously other mechanisms that can produce greater distortion, so why are you still worried about ISP?:D
 
Last edited:
Back
Top Bottom