📜 ⬆️ ⬇️

Resampling. Digital brick wall against conspiracy theories. Christmas tale for lovers of pure sound

There are not so many myths in any area of ​​electronics,
both in the field of hi-fi and hi-end devices for audio playback.
Let's hit the Christmas Story on one of them!



When the old year was already being celebrated, New was met first in a narrow family circle, and then with more distant relatives, when the New Year salads ended or became useless and began to release the hangover ...
')
Those who did not want or could not celebrate the New Year abroad, are beginning to feel the call of a personal computer.

It is for them that my Christmas story is intended, about the basics of resampling, a technology that made it possible to significantly improve the quality of playback of Audio CDs at the beginning of the millennium. It was then that 18 and even 20-bit digital-to-analog converters began to be used to play 16-bit records. At first glance, it looked like a marketing ploy by manufacturers, aimed at extracting an additional portion of money from the wallets of gullible audiophiles, but this time supporters of conspiracy theories can smoke on the sidelines. In fact, it was a successful attempt to improve the quality of reproduction and reduce the price of expensive professional equipment. The story is old, but instructive, in many respects relevant to this day.

The digital-to-analog converter Digital-to-analog DAC is the heart of any audio production system that uses CDs as its source. It is entrusted with the complex and delicate task of decoding a sequence of 16-bit numbers and converting it into a format perceived by the human ear.



Back in 1983, the first iconic Magnavox CD player with a dual 14-bit converter appeared, but by the turn of the century many high-quality CD playback systems had 18 or even 20-bit converters. Why?

A bit of theory, almost no formulas


The concept of digital-analog conversion rests on two pillars: sampling frequency and quantization bit.

To reproduce sound in PCM format, we must at regular intervals convert digital values ​​to their corresponding analog voltage or current values. The frequency of these transformations is the sampling rate. According to the Nyquist theorem, it is thus possible to reproduce signals with a frequency of no more than half the sampling rate. The most common formats that are capable of reproducing signals with the frequency perceived by the human ear are generally accepted figure of 20 kHz , have a sampling frequency of 44.1 and 48 kHz.

image
The first is still widely used in audio compact discs (CDDA, English Compact Disc Digital Audio, also called Audio CD and Red Book), and the second originated in a number of standards for professional recording equipment.

Let's imagine that when recording a sound signal hits the perfect analog-to-digital converter. It has no intrinsic noise and distortion and converts the instantaneous value of the incoming signal to digital into a digital one with a given bit depth, for example, 16 bits, as is customary in Audio CD format. In this case, the theoretically achievable dynamic range of the signal (the ratio between the digitized signals with the largest and smallest levels) will be 98.1 dB. To calculate this value, an approximate formula is often used, according to which every extra bit adds 6 decibels to the theoretically achievable dynamic range. For the 16 bit signal we get:

6dB / bit * 16bits = 96dB .

The real musical signal most often consists not of pure tone, but of a mixture of a large number of harmonics rapidly changing its frequency and amplitude. For harmonics having an amplitude of less than one digit of the ADC, it is impossible to restore the correlation with the original signal and they turn into white noise as a result of the encoding-decoding operation. In addition, the noise generated by rapidly changing signals with a large amplitude, which we say a lot in pop music.

From ideal approximations to real life. The problems of the first CD players


Since the beginning of the use of digital technologies in sound recording, there has been a constant race for increasing their productivity and reducing their cost. The first CD players had a single parallel DAC and two input circuits, which in turn gave him signals of either the right or the left channel. The instantaneous levels of analog signals at the DAC output were fixed with the help of special circuits for the time between two readings and alternately acted on separate amplifiers of the right and left channels. This generated additional distortions, the magnitude of which depended on the difference in the instantaneous sound levels of the channels. Under the pressure of criticism of auidophiles, manufacturers were forced to switch to a scheme with separate DACs for each of the channels.

image At the DAC output there is a stepped signal, which is not too similar to the smooth source signal, there are distortions that are unpleasant to the ear. Let us, for simplicity, imagine that a single harmonic with a frequency of 1 KHz was fed to the input. The operation of restoring a digitized signal actually leads to the appearance of intermodulation distortion between the original signal and the sampling frequency - in our case, 44.1 KHz. (The mechanism of occurrence of intermodulation distortion and educational program on harmonics, if necessary, look in my previous article ).

Despite the fact that parasitic harmonics lie outside the human ear, they have an adverse effect on the amplifying tract and it is better to get rid of them.



In the early models of equipment for playing digital content, filters were used for this, which had a flat characteristic up to a frequency of 20 kHz, and then a sharp weakening of the level by 80 dB and more. In English terminology, such filters are called brick-wall, in Russian they are sometimes called by analogy “brick wall”. The problem was that high-order analog low-pass filtering devices are very sensitive to the accuracy of the values ​​of the passive components of which they are composed. The situation is further complicated by the required nominal values ​​that are out of the standard range and the special requirements for the quality of these components, which are necessary to achieve the minimum contribution to signal distortion. As a result, the cost of these filters was prohibitive, but the saddest thing was that they could not satisfy the demands of the audiophiles, since these filters had large phase distortions, especially at the edges of the reproduced range. Therefore, the sound of earlier versions of CD players, despite the high cost of audiophiles, was described as “sand” ( gritty ).

Digital filters rush to the rescue. Oversampling on the fingers


A serious step towards improving the quality of sound, and most importantly its availability, was the introduction of signal oversampling technology, which this article is actually about.

In order to clarify its essence, let's imagine the process of signal recovery with a frequency of 1 KHz, so beloved by GOST. Figure A shows a series of samples of the signal components that appear at the DAC output, and to the right the spectral components of the second and third orders contained in the signal at the DAC output. You can see that the signal is nothing more than a product of intermodulation distortion between the original 1 KHz tone and the frequent digitization of 44.1 KHz.



Let us increase the signal sampling rate four times by elementary operation - adding extra three samples between two neighboring ones, each of which has zero values, as shown in Figure C. At the same time, we add two lower digits to each sample, also filling them with zeros. Now we got 18 bit sample values. As a result of this operation, the signal spectrum did not actually change, but in fact a fundamental change occurred. Second-order harmonics caused by the sampling frequency have become part of the spectrum of the main signal. Derivative harmonics have moved above the frequency of 44.1 kHz. This is shown in Figure D.



In the area of ​​the spectrum of the main signal, digital filtering can be successfully applied, which we will do using a high-order digital filter with the frequency response shown in Figure F. Physically, we get additional intermediate points between the available signal samples, which smooth the transitions between two values ​​due to the appearance of an additional two bits in the amplitude representation.



Now, when all the heavy and dirty work has been done by the digital filter, we send the resulting signal with a sampling frequency of 44.1 * 4 = 176.4 KHz, to the DAC.

It remains to add a cherry on our cake - let the signal through the simplest analog filter of the third order, which will perfectly cope with the suppression of harmonics in a given range and will not introduce noticeable phase distortions.



The result - the spectrum of the received signal became much closer to the original one, the parasitic components in it are greatly attenuated, and phase distortions are minimized due to the digital filtering capabilities.


Hardware implementation


The figure shows the hardware implementation of the above solution. The oversampling and digital filtering operations are performed by the CXD1088Q chip manufactured by SONY, one of the progenitors of the Audio CD format. A simple logic circuit sequentially triggers the conversion of two separate 18-bit DAC AD1860.



What advantages did we get as a result of our digital tricks?



Every apple has a place to fall, every thief has an opportunity to steal ...


Like any good Christmas story, this one has a happy ending. From the introduction of new technology seems to have won everything:


Manufacturers of professional equipment and CD players in the Hi Fi segment were able to improve the sound quality and significantly increase the repeatability of the parameters of their products during the production process.

Fans of quality sound got disc players with improved parameters for a reasonable price.

Finished audiophiles can now grumble about how cool the sound of old devices with analog filters was until they ruined the number and hunt for vintage equipment.

Well, selected manufacturers of the Highland can create single instances of devices, carefully selecting the components of an analog filter with the characteristic name “brick wall”, while receiving devices with individual sound due to phase filters and not only distortion and tear up their price tag to heaven.

For a more detailed comparison of the operation of analog and digital filters and answers to specific questions, see the following article.

.

In preparing the publication, we used materials from the article DAC ICs: How Many Bits is Enought? by Robert Adams

Source: https://habr.com/ru/post/400383/


All Articles