What is wrong with op-amps?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
If you want to search for intersample overs, try this :

Code:
$ sox fs4.wav -r 192000 fs4192.wav
sox WARN rate: rate clipped 6000 samples; decrease volume?
sox WARN dither: dither clipped 5279 samples; decrease volume?

This reads a file names "fs4.wav" (could be any format, sox can read your flac compressed files directly of course), oversamples it to 192k (you can also use any other sample rate), and saves it into "fs4192.wav".

As the name implies "fs4" contains a fs/4 sinewave which will generate intersample overs. Sox properly warns of clipped samples and tells you how many there were.

Another option is to tell it to perform the resampling and simply discard the output by using "-n" as the output file name.

Code:
sox fs4.wav -r 192000 --encoding signed-integer --bits 16 -n

Note that resampling is much faster if using an integer multiple. Here is an example on a song which is a victim of the loudness wars:

Code:
$ sox 01-Triumphant.flac -r 176400 --encoding signed-integer --bits 16 --show-progress -n

Input File     : '01-Triumphant.flac'
Channels       : 2
Sample Rate    : 44100
Precision      : 16-bit
Duration       : 00:04:20.91 = 11505984 samples = 19568 CDDA sectors
File Size      : 31.0M
Bit Rate       : 951k
Sample Encoding: 16-bit FLAC
Comments       : 
TITLE=Triumphant
ARTIST=Röyksopp
ALBUM=The Understanding
DATE=2005
TRACKNUMBER=01
TRACKTOTAL=12
GENRE=Electronic
CONTACT=Swiftbow
YEAR=2005
ORGANIZATION=
ISRC=
REPLAYGAIN_REFERENCE_LOUDNESS=89.0 dB
REPLAYGAIN_TRACK_GAIN=-9.40 dB
REPLAYGAIN_TRACK_PEAK=0.94412231
REPLAYGAIN_ALBUM_GAIN=-8.17 dB
REPLAYGAIN_ALBUM_PEAK=1.00000000

In:100%  00:04:20.91 [00:00:00.00] Out:46.0M [      |      ] Hd:0.0 Clip:1.64k
sox WARN rate: rate clipped 882 samples; decrease volume?
sox WARN dither: dither clipped 761 samples; decrease volume?
Done.

So, yes this song does contains intersample overs. Notice "Clip:1.64k" at the end of the output. Examining the original waveform reveals no flat-top clipping (it is however strongly compressed and without any dynamic range...) but it does get very close to 0dB very often, hence the intersample overs.

They're all concentrated in the loudest 1'30" of the song, so you'll get 7-15 overs a second. I would suppose a DAC which overflows into the opposite polarity on clipping would produce audible effects. If it was just clean clipping, probably not.
 
Last edited:
So my sentence gives the premise and yours the conclusion, based on the premise and i simply don´t understand why the conclusion should follow, could you elaborate a bit?

I am sorry for the misunderstandings. A convenient example is provided above, SoX can easily be configured to reduce the gain ahead of resampling/dither, no clipping/overs. That's all I'm talking about it's an identified problem with a known solution. BTW I have not inexpensive DAC's that have far worse problems such they can't even do a 1kHz 0db sine wave.

It is also easy if not careful to design a multi-pole analog filter with internal clipping while input and output are fine, certainly a high order FDNR anti-imaging filter will have internal voltages that would qualify as "overs" but usually the rails are well over the output level i.e. the headroom comes for free (or you could look at it as the designer luckily got off free). ;)
 
Last edited:
I upgraded the script.

Here are two songs compared. The first is a very compressed Royksöpp piece, which is only listenable in the car. This is a pity, because the album is quite good, except for the terrible mastering. The second is high dynamic range drums from Sheffield Drum&Track record.

Graph explanation:

On top we have a histogram of sample values. Amplitude is on X axis, from -1 to 1. The Y axis shows how many samples have this amplitude.

Royksöpp: Histogram is quite flat, which means the signal spends lots of time at high amplitudes. Also, there are peaks a bit below full scale (around +/- 0.9) which means the sneaky bastards applied some hard clipping then turned down the volume a bit to fool software which would detect samples pegged to the maximum value.

The orange curve, which extends past full scale in amplitude, comes from the sample values after 4x upsampling. Intersample overs show up.

Next curves are computed on oversampled data.

Graph #2 is RMS and peak amplitude over 1-second intervals. One curve per channel. Notice how well the peak value stays pegger to 0dB (and sometimes a bit above) while the RMS is also constant, ie, compressed to death.

Graph #3 is dynamic range (ie, difference between peak and RMS).

Graph #4 is number of intersample overs per second. It does not include samples clipped in mastering...

I can share the source code, if someone wants to play with it. It's python, so quite slow. If someone wants to make a fast C++ version....
 

Attachments

  • royksopp-triumphant.png
    royksopp-triumphant.png
    204.3 KB · Views: 248
  • sheffield-rontutt.png
    sheffield-rontutt.png
    275.4 KB · Views: 243
Last edited:
Member
Joined 2014
Paid Member
I was about to say 'what a rehash', but at last they have listed some tracks to test with and given some statistics. That is something that we can at least check against a real DAC to see if the processing really produces the same effect. As all the 'argh horror' stuff was done in audacity its still not clear if it actually happens when you feed red book into a modern DS chipset.
 
The article is a mishmash of assumption and simplistic assertion. A few examples:
- Showing "intersample overs" with two positive digital samples and two negative, then arbitrarily declaring the right waveform is a sine wave. If you are reconstructing a digital waveform - you don't know what the intersample values are.
- This makes a nice picture on a website, but is signal processing "huffery"
- What they are asserting is that they wish to reconstruct the waveform in the digital domain using some filters (with parameters they have chosen but not stated). The filtering clearly has a gain of > 1.
- Then there is the implication that the original 44.1KHz samplig should also have this filter. This error will not happen in the digital domain in the 4.1KHz region.
- There is an assumption that the analogue filter that forms part of the DAC doesn't play a role in here - it is all digital argument. This is not true. Indeed an analogue filter with the same characteristics as has been assumed in their article would result in the same voltage - i.e. it will have overshoot that leads to output ANALOGUE voltages in excess of the FSD voltage. --> if you chose to implement it.

Oversampling in the digital domain has great utiliy, and what they propose is not wrong / impossible in terms of math and the output. I just dont sit happily with the spin they put on it.

The real point of oversampling as they propose id that you can get the same analogue voltage out of the system with a simpler reconstruction filter in the analogue domain.
 
Well, they do need to make it sound scarier and simpler for their clientele, which probably haven't taken too many discrete math or signals and systems type classes. :)

It's a whole load better than a lot of other ad-copy type stuff. But, yes, there's some implicit assumptions that should be make explicit.
 
Member
Joined 2002
Paid Member
Hi George, in your attached picture, on the right side, there's some kind of SW showing a signals corresponding value in bits, can we know the name of the SW used and where can we find it, thanks. :)

Hi maiko.
The SW is Steinberg Wavelab.
I’ve used version 4 and version 6. Both have the Bit meter under the “Analysis” tab.
Bit meter has two modes:
The “True mode” shows the bit depth of the file (fixed indication along the full length of the file).
The “Intuitive mode” shows how many bits are used during the flow of the program (this is what I showed in my post).

George
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.