Analog-Digital Processing


Free Download Mp4Gain
picture

Analog-Digital Processing

Digital vs Analog

A digital signal is obtained from analog or is directly synthesized into digital (in electric musical instruments).

DIGITAL ANALOG AUDIO

Converting from analog to digital involves two basic operations: sampling and quantizing. Discretization is the replacement of a continuous signal with a series of samples of its instantaneous values ​​taken at regular intervals. According to the Kotelnikov-Chenon theorem, a discrete signal can be completely restored later, as long as the sampling frequency is at least twice the upper frequency of the signal spectrum. The samples are then quantized according to level: each of them is assigned a discrete value closer to the real one. The precision of quantization is determined by the bit width of the binary representation. The higher the bit depth, the more quantization levels (2N,

The audio CD format has a sampling frequency of 44.1 kHz and 16 bits. This gives 44 thousand samples per second, each of which can take one of 216 = 65536 levels (for each of the stereo channels).

In addition to the 44.1 kHz / 16-bit format, others are used in digital recording. Studio recording is generally done in 20-24 bit, then the data is converted to audio CD by recalculation. The extra bits are then discarded or (better) rounded, sometimes pseudo-random noise is added to reduce quantization noise (dither).

The most advanced custom audio formats are DVD Audio and Super Audio CD (SACD). DVD Audio adopts the MLP lossless data compression algorithm developed by Meridian. And SACD, unlike other formats, does not use pulse code modulation (PCM or PCM), but one-bit encoding of the DSD (Discrete Pulse Width Modulation) stream. SACDs come in single or double layer (hybrid) discs with a normal CD layer.

The most popular audio medium today is compact disc, despite certain limitations in sound quality seen by audiophiles. The reason for them is in the low sample rate: for an accurate reconstruction of signals near the upper limit of the audio range, a filter that is not physically workable is needed (its impulse response covers the negative time area). This is compensated to some extent by digital filtering with higher sampling and bit depth. The data on the disc is redundantly encoded (Reed-Solomon code) to ensure smooth playback in real time.

Broadband communication is required for digital audio transmission, especially for uncompressed high definition multichannel transmissions.

Figure: 1. Digitizing an analog signal and obtaining digital samples on CD Audio and SACD (right)

DIGITAL AUDIO TRANSMISSION

The communication lines for digital audio transmission can be cables, optical lines, and overhead radio.

For the transmission of PCM signals over wired lines, AES / EBU (balanced, coaxial), S / PDIF (unbalanced coaxial) interfaces have been developed, which provide transmission of various signals (clock frequency, digital word rate, channel data) over a cable. Inside the devices, these signals are transmitted separately, at the output of the transport mechanism they are encoded and at the input of a digital-to-analog converter (in two-block systems) they are separated again in a digital receiver.

Typically, a high-quality coaxial cable is used for digital audio transmission. There are also S / PDIF converters for fiber optic lines: AT&T ST and Toslink (the latter is standard in consumer equipment). And also, for the use of twisted pairs in Ethernet cable networks. The medium of distribution for compressed audio in the form of archived files is the Internet.

Like any digital signal, digitized audio is distributed and switched by special devices: distribution amplifiers, matrix switches, and conventional.

There is one factor that negatively affects digital signals, and often negates almost all of the advantages of digital audio over analog, including the ability to repeatedly copy, stream, and archive programs without any loss of quality: we are talking about jitter. Jitter is jitter, or the uncertainty of a transition from 0 to 1 and vice versa.


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

How to digitize sound quality

How to digitize sound quality

digital sound

Many books and articles have been written on how to use a sound card, including on our website.

DIGITAL SOUND

However, this time we will not talk about what every regular reader of the Multimedia section already knows, but about what is called the practice of digital sound recording. Surely any owner of a multimedia computer sooner or later starts this exciting activity. Actually, for this (and not only) you buy a computer. However, this process is not that simple and requires some skill to achieve the highest quality. The purpose of this article is to give the readers of the site (and the owners of SB Live! Among them in particular) some useful recommendations in this area, which for one reason or another are not adequately covered by the press or the Web. .

To begin with, at one point I was faced with the question of converting my music library on cassettes to MP3 files, and I had to spend more than one night for the process of transferring audio information to a computer to be the highest quality. and as versatile as possible for most audio recordings. I will say right away that despite my solid experience in recording (both analog and digital), this, at first glance, an innocent occupation required a lot of mobilization of my forces and knowledge.

However, the user of a decent sound card is by no means obliged (as I am) to have a higher education in radio engineering and yet has the right to demand a decent quality of the received recording. I consider it my duty to provide the iXBT audience with that minimum of information which, I hope, will avoid many of the problems associated with digitizing audio (such as interference, interference, etc.). I think some of the information in this material will be useful for advanced users. In order not to go beyond the limits of decency, I will also say that everything that is written below is the result of generalizing the experience of many people, but of course it does not claim to be the ultimate truth. Reasonable reviews from readers are always good! (You can also write your comments on our conference articles About Site Materials.)

General remarks
Most of the time, multimedia users have to digitize the following sources:

Vinyl records . The main thing here is a good turntable and a preamplifier-corrector (the one that is built into expensive amplifiers). Of home turntables, I recommend Phoenix EP 009S (diamond ellipse head, auto arm). And then, we record the record on a computer, clean it from clicks (Click Elimination), filter the infrasound below 16 Hz (to eliminate noise), and cut the recording into songs. It is better not to eliminate the noise, since the noise of 65-70 dB at the output of the player (or the equalizer) is not that great. For example, 65-70 dB is the analog output of most CD-ROMs and nothing. But with the background (an unpleasant low-frequency tone of 50, 100, 150, etc.) it is better to find out before digitizing: the earth is hanging somewhere or the poles inside the player are confused.

Microphone I mean a good mic and mic amp. And about that, and about another, you can find a lot of information in print media, and also on the Web. I will give advice on only one thing.

The point is, in the practice of the study, there is a very clever principle for patch cords. Everyone already knows the twisted pair of signal lines, but here is how to solder the cables at the ends of the cables, only the dedicated ones, and even then not all.

The following image shows how to properly make a cable that will not contribute to the recording quality if it consists of quality cables. A copper braid is used as a screen (copper is desirable everywhere!). The signal wires inside the shield are a twisted pair of copper twisted wires. It is better to buy such a cable from a store that sells professional microphones, guitars, etc. (the cable will cost less than the interference). It is worth noting that only with a microphone it is necessary to be so scrupulous with the cable, otherwise you will switch microphone amplifiers and microphones to the Greek calendars.

How digital sound works. (Part 1)

How digital sound works. (Part 1)

digital sound

In this post, I’d like to talk about digital sound and, along the way, expose such a popular form of freestyle as audiophilia.

Digital Sound

Unfortunately, lately I see more and more manifestations of this phenomenon, penetrating the minds of even quite reasonable people and causing them to spend money on technological analogues of homeopathic pills. I say “sadly” because everything that I will write in this article should, in principle, be known to all the people who graduated from school. But for some reason that I do not understand, they forget or do not want to apply in practice the knowledge they once acquired. The belief in audiophilia at this point has even penetrated and spread widely among engineers, although that’s really who, and they should understand these things thoroughly.

I originally wanted to write this article in a more aggressive style. But in the end I decided that it would be better for me to do without curses and provocations. On the contrary, I really hope that audiophiles read this article and reflect on what they believe and if they have enough reason to believe. Therefore, I will do so without provocation and will focus solely and exclusively on the facts.

And the most important thing I want to say right now: the audiophile arguments are not arguments related to any technical or engineering aspect. Audifilov’s arguments contradict science, specifically physics and mathematics. They also contradict technical and engineering aspects and audiophiles don’t know how their audio systems work, but this is a small problem compared to how they contradict physical or mathematical laws, showing a complete ignorance of the basics. It is the scientific aspects that I will focus on instead of explaining what the different types of CAD are and other details that are not of fundamental importance.

1. Basics: how sound is reproduced on a computer and any other electronic device

To begin with, an audio file is on a digital medium, such as a hard drive. This audio file has a certain internal format, but they are all a set of zeros and ones (0110010101 …), that is, any file can be represented as a very large number. This number can be easily converted to the usual decimal number system (189208 …).

The direct consequence of this is that the copies of the same file are all exactly the same. It doesn’t matter what medium they are in or how they were transferred or created: if the copies are correct, then they are exactly the same. The difference in playing the same file can only be caused by some other element in this play chain.

And this string is like this:

File -> audio player program -> digital to analog converter (DAC) -> amplifier -> speakers or headphones.

It works like this:

First, the player program loads (or receives from outside) an audio file into memory.

The software then decodes it, if necessary, into an uncompressed digital stream, which is digital audio. We will simply call this uncompressed digital audio .WAV and assume that this is the format in which music is delivered on conventional audio discs (two-channel stereo, 16-bit, 44.1 kilohertz per channel).

After that, this sound enters a digital to analog converter, which takes each number and converts it to an analog value that corresponds to it, most of the time it is a voltage measured in volts (from a certain minimum value that corresponds to a digital number 0 and up to a maximum value that corresponds to the number 65,536 – this is the maximum number that can be written in 16 bits).

After that, the sound, already in the form of electric current, enters the amplifier, the task of which is to raise the voltage to a value that suits the speakers. The amplifier must amplify the signal linearly, that is, each value that reaches it at the input must increase in the same proportion at the output.

In the speakers, the electric current is converted into physical vibrations, which are transmitted to the air and thus the sound we hear is obtained.

This chain, which from now on we will call the audio path, is present in one form or another in any digital audio system. The elements themselves may look very different on different systems (MP3 players, smartphones, computers, etc.), but they are necessarily present. When it comes to a computer, the DAC and amplifier are on the sound card (which is often built into the motherboard). Speakers often have their own built-in amplifier, and some of them may have their own DAC (and connecting to them bypasses the sound card).

Working with sound

Working with sound

Analog and Digital

Analog and digital audio

 Analog and Digital

Analog sound recording is based on the conversion of acoustic waves into electrical waves using a microphone. A microphone consists of a small membrane that can vibrate and a mechanism to convert the vibrations of the membrane into an electrical signal. (The exact electrical mechanism differs depending on the type of microphone.) Generally, a higher pressure corresponds to a higher voltage and vice versa.

The recorder transmits the waveform one more time, this time from an electrical signal through a wire to a magnetic signal on tape. When the recording is played back, the opposite process occurs: the magnetic signal is converted into an electronic signal, which makes the speaker vibrate (usually electromagnetic).

The main device for digital recording is an analog-to-digital converter (ADC, analog-to-digital converter, ADC). The ADC captures a chunk of electrical voltage on the audio path and presents it as a number, which is then transmitted to the computer. By capturing the voltage several thousand times per second, you can get a signal quite close to the original. The unit of capture is called a sample (each number in a sound file represents corresponds to a sample in a waveform).

There are two factors that determine the quality of a digital recording:

Sampling rate
The frequency at which samples are captured or played, measured in Hertz (Hz) or samples per second. A typical audio CD is recorded at a sample rate of 44100 Hz, more commonly known as 44 kHz for short. This is the same default sample rate used for most digitals.

Sample format (size)
The number of digits in the digital representation of each sample. Imagine that the sample rate is plotted horizontally and the sample size is plotted vertically. Audio CD is 16 bits wide, which corresponds to approximately 5 decimal places.

Higher sample rates for digital recording provide accurate recording at higher frequencies. The sample rate must be at least twice the highest desired sample rate. The average human ear is believed to be unable to distinguish frequencies above 20,000 Hz, so 44,100 Hz was chosen as the standard for audio CDs. Now the transition to the frequencies of 96 and 192 kHz is taking place gradually, in particular within the DVD-Audio format. However, many people just don’t hear the difference between 44.1 kHz and 192 kHz audio.

Larger sample sizes provide a greater dynamic range, that is, the ability to present louder and quieter sounds. If you are familiar with the decibel (dB) scale, you can give an example from ordinary audio CDs – its dynamic range is theoretically 90 dB, but it actually sounds lower than -24 dB. Audacity supports two more sample sizes: 24-bit, which is most often used in digital studio recording, and 32-bit floating point, whose dynamic range covers all imaginable needs, despite the fact that the data with these parameters occupies just twice the disk space compared to 16-bit audio.

When playing digital sound, a digital-to-analog converter (DAC) is used. In this case, to recreate the original signal and then digitized with the ADC, a sample is taken, from which a certain voltage is established at the analog outputs. The first CD players did just that, so the sound quality was not very good. Modern players also smooth out the audio signal by sampling within a range of the sampling frequency. The quality of the filters on the DAC also affects the sound signal that is recreated. The filter is one of the signal adaptation stages in the DAC.

The inevitable loss in the transition from analog to digital audio can be offset by a number of advantages of digital recording. Digital data can be copied as much as you like and there is no loss of quality. This data can be burned to a music CD or posted on the Internet as compressed files. Also, digital recordings are much easier to edit than analog tapes.

A personal computer has all the necessary devices to convert audio data from analog to digital and vice versa. First of all, it’s a sound card, an additionally installed separate device like Creative SBLive !, and maybe a sound chip built into the motherboard. In both cases, the audio device contains an analog-to-digital converter (ADC) to record sound and a digital-to-analog converter (DAC) to play it back. The operating system you are using interacts with the sound card,

How digital sound is reproduced

How digital sound is reproduced

digital sound

Have you ever wondered how sound is reproduced on digital devices?

Digital Audio

How is a sound signal formed from a combination of ones and zeros? I’m sure I was thinking, since I started reading! But often, even professionals have only a general idea of ​​the modern sound route. In this article, you will learn how the different formats appeared, what a digital-to-analog converter is, what types of DACs exist, and what determines the quality of sound reproduction.

PCM
As you know, in digital audio, almost any format, with rare exceptions, is recorded using a pulse code stream or a PCM stream – pulse code modulation. FLAC, MP3, WAV, Audio CD, DVD-Audio and other formats are just ways to pack, “preserve” the PCM stream.

How it all began
The theoretical foundations of digital sound transmission were developed at the dawn of the 20th century, when scientists tried to transmit an audio signal over a long distance, but not by telephone, but in a rather strange way for that time.

By dividing the sound wave into small parts, it could be sent to the receiver in some kind of mathematical representation. The recipient, in turn, could restore the original waveform and listen to the recording. In addition, scientists were faced with the task of increasing the bandwidth of the “ether”.

In 1933, the theorem of V.A. Kotelnikov. In Western sources, it is called the Nyquist-Shannon theorem. Yes, Harry Nyquist was the first to raise this issue: in 1927 he calculated the minimum sampling frequency for transmitting a waveform, which later received his name “Nyquist frequency”, but Kotelnikov’s theorem was published 16 years earlier.

The essence of the theorem is simple: a continuous signal can be represented as an interpolation series, consisting of discrete reports, from which the signal can be reconstructed. In order to roughly restore the original state of the signal, the sampling frequency must be at least twice the upper cutoff frequency of this signal.

For many years, the theorem was not in demand, until the advent of the digital age. It was then that it found a use. In particular, the theorem was useful in the development of the CDDA (Compact Disc Digital Audio) format, in common people it is called Audio CD or Red Book. The format was released by engineers at Philips and Sony in 1980 and has become the standard for audio CDs.

Format characteristics:

sampling frequency – 44.1 kHz;
quantization capacity – 16 bits.

INFO
Sampling rate: the number of samples of the signal “taken” during its sampling. Measured in Hertz.
Quantization bit: the number of binary digits that express the amplitude of the signal. Measured in bits.
The 44.1 kHz sampling rate was calculated from Kotelnikov’s theorem. It is believed that the hearing of the average person cannot pick up sound beyond 19-22 kHz. The frequency was probably 22 kHz and was chosen as the upper limit.

22,000 × 2 = 44,000 + 100 = 44,100 Hertz

Where does the 100 Hertz come from? There is a version that this is a small margin in case of errors or oversampling. In fact, Sony chose this frequency for its compatibility with the PAL transmission standard.

The bit depth of the CDDA format is 16 bits, or 65,536 samples, which equates to a dynamic range of approximately 96 dB. Such a large number of samples were not chosen by chance. Firstly, due to the strong influence of quantization noise, and secondly, to provide a formal dynamic range superior to that of the main competitors at the time: cassette records and vinyl records. I’ll cover this in more detail in the section on digital to analog converters.

Development of PCM continued on the principle of multiplying by two. Other sample rates appeared: first, the 48 kHz sample rate was added, and then the frequencies based on it were 96, 192, and 384 kHz. The 44.1 kHz frequency was also doubled to 88.2, 176.4 and 352.8 kHz. Bit width increased from 16 to 24 and then to 32 bits.

The next after CDDA in 1987 appeared the DAT format – Digital Audio Tape. The sample rate was 48 kHz, the quantization bit did not change. And although the format failed, the 48 kHz sample rate caught on in recording studios, as they say, due to the convenience of digital processing.

In 1999, the DVD-Audio format was released, which made it possible to record on a disc six stereo tracks with a sampling frequency of 96 kHz and a bit depth of 24 bits, or two stereo tracks with a frequency of 192 kHz, 24 bits.

Analog and digital sound sources

Analog and digital sound sources

analog and digital audio

Digital music comes from two main sources: analog and digital.

Analog and Digital

Analogous sources
An analog music source must use an analog-to-digital converter, such as a sound card, to convert the physical changes of the analog medium into a digital file that can be read by a computer. An analog medium is an object that stores music in itself through physical changes.

For example:

A cassette recorder changes the degree of magnetization of a cassette tape to record sound. Connecting a cassette deck to a recording device allows you to make a digital copy of an analog cassette.
The recorder cuts grooves in the vinyl record to create a physical representation of the sound. Ripping vinyl with a preamp and sound card allows you to make a digital copy of an analog record.
Analog recordings can be converted to digital music files in various formats, such as FLAC and MP3. Vinyl recordings can always be posted to the site, but posting tape recordings and other analog sources requires approval from the moderator.

Digital music sources
Music from digital sources is already encoded in a computer-compatible format, so no additional conversion is required. A digital medium is an object that stores music digitally (as a sequence of binary numbers).

For example:

CD
DVD
Super Audio CD (SACD)
Content from online stores (iTunes, Amazon, etc.)
Music from digital sources can be uploaded to RED after analyzing the spectrograms of the files to verify lossy transcoding.

Comparison of analog to digital music sources
Controversy still exists as to whether music sounds differently from analog and digital sources. Some people prefer the feel of vinyl and find that music on vinyl sounds “warmer” and “brighter.” On the other hand, some believe that digital sources provide true, pure and authentic sound. Both are represented in RED, so you can compare and make your own choice!

Analog and digital

First of all, a fundamental distinction is necessary: ​​what is meant by an analog signal and what is meant by a digital signal. Sampling is in fact an analog-to-digital conversion, and to understand how this is accomplished, it is necessary to understand what the subjects of this transformation are.

The classic definition of “analog” and “digital” is as follows.
The analog signal is one in which the variation is continuous in time.
The digital signal is one in which the variation in time occurs in a discrete way.
Pay attention to this definition because it expresses a very simple concept but at the same time misunderstood.

Let’s use some examples to get the concept down.
As a first example, let’s think of a watch with hands (suppose it is of the type in which the second hand moves continuously and not broken).

This clock not only marks the hours, minutes and seconds, but also any other type of fraction that we want to imagine: half seconds, tenths, hundredths, etc. As difficult as it is for the eye to distinguish the different moments, we know that the clock continuously passes through every instant of time that we can imagine.

Let’s think instead of a digital clock, those that indicate the time with numbers on a screen. This clock will mark the hours, minutes and seconds, activating the latter one by one; We do not see half seconds, tenths and so on: from 10:10:01 to 10:10:02 (for example) the clock will always read 10:10:01.

The watch with hands can be defined as an analog device, while the other watch, which provides only discrete, but not continuous measurements, is called digital.

A second example: let’s think about two different ways to monitor the level of a signal: the first, the classic needle VU-meter, typical of old mixers; the second, the column of bright LEDs, typical for example of equalizers.

The VU-meter, for reasons exactly analogous to those of the hand watch, is an analog device; The LED column, which only provides discrete data, is a digital device.

So what does it mean to sample a signal?

It means finding a discrete representation for something that originally has continuous variation.
The purpose is obvious: where, for example, to modify the analog recording of a voice, we must first convert the sound energy into electrical energy (through a microphone), then transform the electrical energy into the magnetic property of a tape ( through a tape recorder) and finally intervene with mechanical modifications to the tape itself (editing operations with manual cutting and pasting of the tape), with a digital recording, in which the electrical energy supplied by the microphone is converted directly In digital samples, that is, in discrete number data, it will be possible to modify the register through an electronic calculator capable of analyzing and modifying the data.

Sampling and time (frequency and Nyquist theorem)

The first practical problem that sampling is faced with is establishing how many times in a given period of time the signal must be measured for the sampling to be accurate, and the resulting digital signal can be converted back into an analog signal without losing or changing certain characteristics of the original signal.

Take as an example the classic elementary sinusoid, like the one in the figure.

Let’s say we have a device that takes, over a certain period of time, a certain number of samples of the signal: for example, 14 samples per period of the sinusoid.
We will obtain a series of samples like the one in the figure:

We see that the original sinusoid is still intuitive, so it is possible to reconstruct it and reverse the procedure.
But imagine halving the sample rate, that is, doubling the time between one measurement and another.
We will obtain a different series of samples, less dense than the previous one:

The sine wave can still be guessed, but it is clear that we have lost some of the original information.
Halving again, the situation becomes almost critical:

Here it is already very difficult to trace the original signal.
By reducing more by half, all traces of the sine wave are lost:

Therefore, we understood that there is a critical point, below which the sampling frequency cannot fall, under penalty of total loss of information.