Information Non-linear distortion factor (THD). Nonlinear distortion
Nonlinear distortions are signal distortions caused by the nonlinearity of the relationship between the secondary and primary signals in stationary mode. As a result of nonlinear inertia-free distortions of the input signal of a sinusoidal shape, an output signal is obtained complex shape y = y0 + v1x + v2x2 + v3x3 + ... where: x - input value; y0 - constant component; v1 - linear coefficient amplification; v2, v3 ... - nonlinear distortion coefficients.
In a system with nonlinear transfer characteristic spectral components arise that were not at the input - products of nonlinearity. When a signal with a single frequency f1 is applied to the input of such a system, components with frequencies f1, 2f1, 3f1, etc. will appear at the output. If a signal consisting of several frequencies f1, f2, f3, ... is supplied to the input, then at the output of the system, in addition to harmonic components, so-called “combination components” with frequencies n1f1 ± n2f2 ± n3f3 ± ... will additionally appear, where n=1, 2, 3, ... When feeding sounds with a continuous spectrum, a continuous spectrum is also obtained, but with a changed shape of the spectrum envelope.
Nonlinear distortions are usually assessed by the nonlinear distortion factor, which is the ratio of the effective values of harmonics to effective value total output signal and is measured as a percentage. Here An are the amplitudes of components with frequencies nf. The simplified formula given next is valid for cases where the distortions are small (K<=10%). Различают два типа нелинейности: степенную и нелинейность из-за ограничения амплитуды. Последняя делится на ограничение сверху и ограничение снизу (центральное). При первом виде ограничения искажаются только громкие сигналы, при втором - все сигналы, но более слабые искажаются сильнее, чем громкие. Нелинейность искажения гармонического вида и комбинационных частот ощущается как дребезжание, переходящее в хрипы при значительном искажении на высоких частотах. Нелинейные искажения в виде разностных комбинационных частот вызывают ощущение модуляции передачи. При сужении полосы частот нелинейные искажения становятся менее заметными. Линейные искажения изменяют амплитудные и фазовые соотношения между имеющимися спектральными компонентами сигнала и за счет этого искажают его временную структуру. Такие изменения воспринимаются как искажения тембра или «окрашивание» звука.
During sound transmission, the primary relationships between the frequency components of sound must be preserved. In this regard, the quality of any section of the audio channel is assessed by its amplitude-frequency (abbreviated frequency) characteristic, which is often denoted by the abbreviation frequency response. Frequency response is understood as a graph of the dependence of the transmission coefficient on the frequency of the signals supplied to the input of a given section of the channel or a separate audio device. The transmission coefficient is the ratio of the magnitudes of the signals at the input of the amplifier and its output.
The frequency response of the transmission path (frequency dependence of the transmission coefficient) changes the relationships between the amplitudes of the frequency components. This leads to a subjective sensation of timbre change. An indicator of the degree of frequency distortion that occurs in any device is the unevenness of its amplitude-frequency characteristic; a quantitative indicator at any specific frequency of the signal spectrum is the frequency distortion coefficient.
Nonlinear distortions are caused by the nonlinearity of the signal processing and transmission system. These distortions cause the appearance in the frequency spectrum of the output signal of components that are absent in the input signal. Nonlinear distortions are changes in the shape of vibrations passing through an electrical circuit (for example, through an amplifier or transformer), caused by violations of proportionality between the instantaneous voltage values at the input of this circuit and at its output. This occurs when the output voltage characteristic varies nonlinearly with the input voltage. Nonlinear distortion is quantified by the total harmonic distortion factor or harmonic distortion factor. Typical SOI values: 0% - sinusoid; 3% - shape close to sinusoidal; 5% - a shape close to sinusoidal (shape deviations are already visible to the eye); up to 21% - trapezoidal or stepped signal; 43% is a square wave signal.
Our correspondent Ayur Sandanov met with Sergei Kharuta, arranger, composer and producer, and found out what he thinks about Apple products. In addition, they discovered common musical roots and discussed how to write music for films, what professionalism is in the harsh world of pop music, what does Peter Gabriel write in, and what is more difficult to manage - “Brilliant” or a folk choir?
Mastering is one of the most interesting topics in the audio industry. With this article we begin a large series covering issues related to it. Approximately our cycle will consist of ten articles. In them, the author will try to give answers to the most common technical questions related to mastering, and will interview famous mastering and sound engineers.
The new design possibilities for active spaces should not be confused with the 'assisted reverberation' that has been used since the 1950s at the Royal Festival Hall and later at Limehouse Studios. These were systems that used tunable resonators and multi-channel amplifiers to distribute natural resonances to the desired part of the room.
It seems that the topic of computer acoustic calculations among audio professionals will never exhaust itself.
Despite the fact that fundamental science does not undergo changes, and mathematical models are improved evolutionarily, among colleagues there are both completely different views on acoustic modeling in general, and sometimes opposite interpretations of the same absolute values.
Alexander Perfilyev, sound engineer of the singer Yolka: “I have been full-time mastering for more than 10 years, and I really like this type of sound engineering. Although I almost never master the projects that I mix myself: this is wrong, as it seems to me, there should be a fresh look, a kind of OTK. I had a similar opinion about concert sound, but when the opportunity arose to try it, I decided to take a risk. It turns out that I am involved and interested in all types of musical sound engineering.”
The topic of our today’s publication is “How and who shapes the ridership of equipment.”
This is a joint project of the Show Technology Rental Club (see page on Facebook)
and the website www.site. Surveys were conducted on these resources, as well as on the Colisium network,
their results are below. Participants of the “Show Technology Rentals Club” actively discussed this topic.
We offered to answer several questions to specialists who have been in our business for many years,
and their opinion will certainly be interesting to our readers.
Andrey Shilov: “Speaking at the 12th winter conference of rental companies in Samara, in my report I shared with the audience a problem that has been greatly troubling me for the last 3-4 years. My empirical research into the rental market led to disappointing conclusions about a catastrophic drop in labor productivity in this industry And in my report, I drew the attention of company owners to this problem as the most important threat to their business. My theses raised a large number of questions and a long discussion on forums on social networks."
Harmonic vibrations
Those. in fact, the sine graph is obtained from the rotation of the vector, which is described by the formula:
F(x) = A sin (ωt + φ),
Where A is the length of the vector (oscillation amplitude), φ is the initial angle (phase) of the vector at zero time, ω is the angular velocity of rotation, which is equal to:
ω=2 πf, where f is the frequency in Hertz.
As we see, knowing the signal frequency, amplitude and angle, we can construct a harmonic signal.
The magic begins when it turns out that the representation of absolutely any signal can be represented as a sum (often infinite) of different sinusoids. In other words, in the form of a Fourier series.
I will give an example from the English Wikipedia. Let's take a sawtooth signal as an example.
Ramp signal
Its amount will be represented by the following formula:
If we add up one by one, take first n=1, then n=2, etc., we will see how our harmonic sinusoidal signal gradually turns into a saw:
This is probably most beautifully illustrated by one program I found on the Internet. It was already said above that the sine graph is a projection of a rotating vector, but what about more complex signals? This, oddly enough, is a projection of many rotating vectors, or rather their sum, and it all looks like this:
Vector drawing saw.
In general, I recommend going to the link yourself and trying to play with the parameters yourself and see how the signal changes. IMHO I have never seen a more visual toy for understanding.
It should also be noted that there is an inverse procedure that allows you to obtain frequency, amplitude and initial phase (angle) from a given signal, which is called the Fourier Transform.
Fourier series expansion of some well-known periodic functions (from here)
I won’t dwell on it in detail, but I will show how it can be applied in life. In the bibliography I will recommend where you can read more about the materiel.
Let's move on to practical exercises!
It seems to me that every student asks a question while sitting at a lecture, for example on mathematics: why do I need all this nonsense? And as a rule, having not found an answer in the foreseeable future, unfortunately, he loses interest in the subject. Therefore, I will immediately show the practical application of this knowledge, and you will already master this knowledge yourself :).
I will implement everything further on my own. I did everything, of course, under Linux, but did not use any specifics; in theory, the program will compile and run under other platforms.
First, let's write a program to generate an audio file. The wav file was taken as the simplest one. You can read about its structure.
In short, the structure of a wav file is described as follows: a header that describes the file format, and then there is (in our case) an array of 16-bit data (pointer) with a length of: sampling_frequency*t seconds or 44100*t pieces.
An example was taken to generate a sound file. I modified it a little, corrected errors, and the final version with my edits is now on Github here
Let's generate a two-second sound file with a pure sine wave with a frequency of 100 Hz. To do this, we modify the program as follows:
#define S_RATE (44100) //sampling frequency #define BUF_SIZE (S_RATE*10) /* 2 second buffer */ …. int main(int argc, char * argv) ( ... float amplitude = 32000; //take the maximum possible amplitude float freq_Hz = 100; //signal frequency /* fill buffer with a sine wave */ for (i=0; i Please note that the formula for pure sine corresponds to the one we discussed above. The amplitude of 32000 (32767 could have been taken) corresponds to the value that a 16-bit number can take (from minus 32767 to plus 32767). As a result, we get the following file (you can even listen to it with any sound reproducing program). Let's open this audacity file and see that the signal graph actually corresponds to a pure sine wave: Let's look at the spectrum of this sine (Analysis->Plot spectrum) A clear peak is visible at 100 Hz (logarithmic scale). What is spectrum? This is the amplitude-frequency characteristic. There is also a phase-frequency characteristic. If you remember, I said above that to build a signal you need to know its frequency, amplitude and phase? So, you can get these parameters from the signal. In this case, we have a graph of frequencies corresponding to amplitude, and the amplitude is not in real units, but in Decibels. I understand that in order to explain how the program works, it is necessary to explain what the fast Fourier transform is, and this is at least one more article. First, let's allocate the arrays: C = calloc(size_array*2, sizeof(float)); // array of rotation factors in = calloc(size_array*2, sizeof(float)); //input array out = calloc(size_array*2, sizeof(float)); //output array Let me just say that in the program we read data into an array of length size_array (which we take from the header of the wav file). While(fread(&value,sizeof(value),1,wav)) ( in[j]=(float)value; j+=2; if (j > 2*size_array) break; ) Array for fast conversion The Fourier must be a sequence (re, im, re, im,… re, im), where fft_size=1<< p - число точек БПФ. Объясняю нормальным языком: Int p2=(int)(log2(header.bytes_in_data/header.bytes_by_capture)); The logarithm of the number of bytes in the data divided by the number of bytes at one point. After this, we calculate the rotation factors: Fft_make(p2,c); // function for calculating rotation factors for FFT (the first parameter is a power of two, the second is an allocated array of rotation factors). And we feed our just array into the Fourier transformer: Fft_calc(p2, c, in, out, 1); //(one means we are getting a normalized array). At the output we get complex numbers of the form (re, im, re, im,… re, im). For those who don’t know what a complex number is, I’ll explain. It’s not for nothing that I started this article with a bunch of rotating vectors and a bunch of GIFs. So, a vector on the complex plane is determined by the real coordinate a1 and the imaginary coordinate a2. Or length (this is amplitude Am for us) and angle Psi (phase). Please note that size_array=2^p2. The first point of the array corresponds to a frequency of 0 Hz (constant), the last point corresponds to the sampling frequency, namely 44100 Hz. As a result, we must calculate the frequency corresponding to each point, which will differ by the delta frequency: Double delta=((float)header.frequency)/(float)size_array; //sampling frequency per array size. Allocation of the amplitude array: Double * ampl; ampl = calloc(size_array*2, sizeof(double)); And look at the picture: amplitude is the length of the vector. And we have its projections onto the real and imaginary axis. As a result, we will have a right triangle, and here we remember the Pythagorean theorem, and count the length of each vector, and immediately write it into a text file:<(size_array);i+=2) {
fprintf(logfile,"%.6f %f\n",cur_freq, (sqrt(out[i]*out[i]+out*out)));
cur_freq+=delta;
}
…
11.439514 10.943008
11.607742 56.649738
11.775970 15.652428
11.944199 21.872342
12.112427 30.635371
12.280655 30.329171
12.448883 11.932371
12.617111 20.777617
...
Let's try! ./fft_an ../generate_wav/sin\ 100\ Hz.wav format: 16 bits, PCM uncompressed, channel 1, freq 44100, 88200 bytes per sec, 2 bytes by capture, 2 bits per sample, 882000 bytes in data chunk= 441000 log2=18 size array=262144 wav format Max Freq = 99.928 , amp =7216.136 And we get a text file of the frequency response. We build its graph using a gnuplot Script for building: #! /usr/bin/gnuplot -persist set terminal postscript eps enhanced color solid set output "result.ps" #set terminal png size 800, 600 #set output "result.png" set grid xtics ytics set log xy set xlabel "Freq, Hz" set ylabel "Amp, dB" set xrange #set yrange plot "test.txt" using 1:2 title "AFC" with lines linestyle 1
!} Please note the limitation in the script on the number of points along X: set xrange . Our sampling frequency is 44100, and if we recall Kotelnikov’s theorem, then the signal frequency cannot be higher than half the sampling frequency, therefore we are not interested in a signal above 22050 Hz. Why this is so, I advise you to read in specialized literature. Note the sharp peak at 100 Hz. Don't forget that the axes are on a logarithmic scale! The wool on the right is what I think are Fourier transform errors (windows come to mind here). Come on! Let's look at the spectra of other signals! Double d_random(double min, double max) ( return min + (max - min) / RAND_MAX * rand(); ) It will generate a random number within the given range. As a result, main will look like this: Int main(int argc, char * argv) ( int i; float amplitude = 32000; srand((unsigned int)time(0)); //initialize the random number generator for (i=0; i Let's generate a file (I recommend listening to it). Let's look at it in audacity. Let's look at the spectrum in the audacity program. And let's look at the spectrum using our program: I would like to draw your attention to a very interesting fact and feature of noise - it contains the spectra of all harmonics. As can be seen from the graph, the spectrum is quite even. Typically, white noise is used for frequency analysis of bandwidth, such as audio equipment. There are other types of noise: pink, blue and others. Homework is to find out how they differ. Now let's look at another interesting signal - a meander. I gave above a table of expansions of various signals in Fourier series, you look at how the meander is expanded, write it down on a piece of paper, and we will continue. To generate a square wave with a frequency of 25 Hz, we once again modify our wav file generator: Int main(int argc, char * argv) ( int i; short int meandr_value=32767; /* fill buffer with a sine wave */ for (i=0; i As a result, we get an audio file (again, I advise you to listen), which you should immediately watch in audacity Let's not languish and look at its spectrum: It’s not very clear yet what it is... Let’s take a look at the first few harmonics: It's a completely different matter! Well, let's look at the sign. Look, we only have 1, 3, 5, etc., i.e. odd harmonics. We see that our first harmonic is 25 Hz, the next (third) is 75 Hz, then 125 Hz, etc., while our amplitude gradually decreases. Theory meets practice! This picture is just like the picture from Wikipedia, where for the example of a meander, not all frequencies are taken, but only the first few. The meander is also actively used in radio engineering (it must be said that this is the basis of all digital technology), and it is worth understanding that with long chains it can be filtered so that the mother does not recognize it. It is also used to check the frequency response of various devices. Another interesting fact is that TV jammers worked precisely on the principle of higher harmonics, when the microcircuit itself generated a meander of tens of MHz, and its higher harmonics could have frequencies of hundreds of MHz, exactly at the operating frequency of the TV, and the higher harmonics successfully jammed the TV broadcast signal. In general, the topic of such experiments is endless, and you can now continue it yourself. For those who don’t understand what we’re doing here, or vice versa, for those who understand but want to understand it even better, as well as for students studying DSP, I highly recommend this book. This is a DSP for dummies, which is the author of this post. There, complex concepts are explained in a language accessible even to a child. In conclusion, I would like to say that mathematics is the queen of sciences, but without real application, many people lose interest in it. I hope this post will encourage you to study such a wonderful subject as signal processing, and analog circuitry in general (plug your ears so your brains don’t leak out!). :) Tags: Measuring nonlinear distortion on a noise signal
In the article, the author draws the readers' attention to one practically unused method for measuring the nonlinearity of amplifiers. The results of objective measurements of nonlinear distortions of UMZCH using this method surprisingly coincide with the results of their subjective assessments during expert listening. Known methods for measuring nonlinear distortions in sound transmission paths are very diverse. The harmonic method has become widespread as the simplest method for experiments and convenient for calculations. Other less common methods are difference tone, modulated tone, intermodulation (intermodulation). Transient intermodulation distortion is also measured. The methods listed above have their own areas of application. Moreover, each of them uses special signals that provide the greatest efficiency in detecting distortion products. However, this is precisely the reason for their low information content regarding the integral assessment of distortions introduced into the audio path and significantly influencing the subjective (expert) assessment of the quality of transmission of real sound signals. The noticeability of nonlinear distortions of a real signal is related to how often, if we consider the process over time, or with what probability, if we apply a statistical measure to it, its instantaneous values fall into the region of significant nonlinearity of the sound transmission path. Many people have probably observed how, when the signal level in an overloaded channel is reduced, the hoarseness of the sound disappears. The less often signal spikes fall into the overload area, the smaller it is. A typical characteristic of the signal transmission function s in the sound transmission path is shown in Fig. 1, a. Here: sin, sout - input and output signals normalized by power; W(s) - probability density of instantaneous signal values sin. Section A corresponds to a relatively small nonlinearity, and sections B corresponds to a large one. For convenience of analysis, in Fig. Figure 1b shows graphs of the probability density distribution W(s) of instantaneous values of two signals of the same power: white (Gaussian) noise (curve 2) and harmonic (curve 1). As follows from Fig. 1a, all values of the input signal limited by the function W(s) for a sinusoid fall in the section of the transmission characteristic with less nonlinearity, while for a noise signal 16% of the time its values are in sections of the transmission characteristic with high nonlinearity. It is clear that the noise signal is subject to much greater distortion than the sinusoidal one. The results of studies of the probability density of instantaneous values of natural sound signals (speech and music) are presented. In terms of their level distribution, they turned out to be much closer to a noise signal than to a harmonic one. Consequently, estimation of nonlinear distortions based on the methods listed above gives incorrect representations of the actual nonlinear distortions of real signals. Less known measurement methods that use noise signals are significantly more informative. One of the methods is used in cinematography and television to measure nonlinear distortions in a photographic soundtrack. The measurement block diagram and spectral diagrams for this method are shown in Fig. 2. The measuring signal is created by a white noise generator GBSH, limited using a PF bandpass filter to a frequency band of 3...12 kHz, which is fed to the input of the object of measurement OM. The products of nonlinear distortion PNI (intermodulation) of the noise signal are measured with a voltmeter V after the low-pass filter with weighting in the frequency band 30 Hz... 1.2 kHz. The numerical indicator of nonlinearity is the ratio, expressed in decibels, of the root-mean-square voltage of the distortion products (UC) to the voltage of the reference signal (UV) generated by the generator built into the device with a frequency of 1 kHz: KISH = 20 lg (UС/UВ). (1) The described measurement method is implemented in the 7E-67 device and is successfully used in film studios. On television, a similar device is the INIF meter. Distortion measurements are also carried out using the harmonic method using a measuring signal in the form of a one-third octave noise band. The block diagram and spectral diagrams are shown in Fig. 3. From the pink noise generated by the GRS generator by a block of FFT bandpass filters, bands are alternately selected to study the object of measurement of the ROI, and a decrease in the level of 3 dB per octave with increasing frequency ensures constant power of the measuring signal in any one-third octave band. Of the voltage distortion products of signal U1, only its harmonics U2, U3 located in one-third octave bands with average frequencies nf1 are taken into account, where n = 2, 3...,f1 is the average frequency of the measuring signal band. Measurements are carried out with an speaker spectrum analyzer connected to the output of the measurement object. The numerical indicator of the harmonic distortion coefficient of the noise signal is determined by the formula: It should be taken into account that the reliability of measurements with this method significantly depends on the limitation of the bandwidth of the measurement object. There are other, more complex measurement methods using noise signals. The widespread use of such signals in measurements in audio equipment, according to the author, is hampered by a number of factors: the scarcity and high cost of equipment for analyzing random signals, the need to revise standards (for example, output power in amplifiers), and the inertia of thinking of many engineers accustomed to sinusoidal signals. For a practical assessment of the effectiveness of using noise signals, the author carried out comparative measurements of nonlinear distortions in several UMZCHs using a standard technique (the harmonic method) and on a noise signal using a 7E-67 device at the same amplifier overload values. For testing, UMZCHs of different circuit design and element base were selected, intended for sounding large rooms (power 100 W or more, all models had overload indicators). In addition, subjective quality assessments (SQA) of sound reproduction were carried out on a ten-point scale. The results of amplifier nonlinearity tests are given in the table. Power amplifiers 1 - 4 are transistor with different feedback depths (A), amplifier 5 is tube. The table shows the values of the harmonic distortion coefficient at a frequency of 1 kHz and the noise intermodulation coefficient for the 7E-67 device. The high level of distortion in transistor amplifiers with deep overall feedback when measuring nonlinearity with a noise signal is due to the fact that the measuring signal in the form of noise has a high crest factor and contains a fairly wide range of frequencies, creating an even wider range of distortion products, and a significant difference in terms of CG /KISH for all amplifiers - an increase in intermodulation distortion during short-term overload. It follows from the table that UMZCH with a greater depth of OOS also have a higher ratio of CG/ISH, receiving, accordingly, low SOC scores. As a result of the tests, the following conclusions can be drawn: 1. Monitoring nonlinear distortions on a noise signal is much more informative and allows one to get closer to a subjective assessment of the quality of sound reproduction. 2. When designing all parts of the sound transmission path, one should strive not only to reduce the harmonic coefficient, but also the noise intermodulation coefficient. The described method was originally proposed for measuring the nonlinearity of the photographic phonogram of films (when monitoring the quality of the technological process of their replication), therefore, in relation to measurements in high-quality sound transmission paths, including loudspeakers, it is advisable to adjust the bandwidth of the measuring signal. Measurements of noise intermodulation of UMZCH for professional purposes differ in this case in that this equipment is often used at maximum power, allowing short-term overload. Compared to tube amplifiers, in transistor amplifiers, when overloaded, the maximum current limitation is often more pronounced, which corresponds to a sharp increase in nonlinear distortion. In UMZCHs used in a home environment, the signal limiting mode with correctly selected power is practically not achieved, so it is advisable to consider the option of using a technique that limits the maximum noise signal level. In this case, the difference between amplifiers with different element bases is likely to decrease significantly. In addition, it should be taken into account that there are a number of critical parameters - frequency band, phase and transient characteristics, noise level... Literature
Pure tube sine
Spectrum graph
is an array of complex numbers. I’m even afraid to imagine where the complex Fourier transform is used, but in our case, our imaginary part is equal to zero, and the real part is equal to the value of each point of the array.
Another feature of the fast Fourier transform is that it calculates arrays that are multiples only of powers of two. As a result, we must calculate the minimum power of two:
Vector on the complex plane
For(i=0;iAs a result, we get a file something like this:
So (drumroll), run the script and see:
Spectrum of our signalLet's indulge?
There is noise around...
First, let's plot the noise spectrum. The topic is about noise, random signals, etc. worthy of a separate course. But we will touch on it lightly. Let's modify our wav file generation program and add one procedure:
Signal in audacity
Range
Our spectrumWhat about compote?
His Majesty - the meander or meander of a healthy person
Meander spectrum
First harmonics
Now attention! In real life, a square wave signal has an infinite sum of harmonics of higher and higher frequencies, but as a rule, real electrical circuits cannot pass frequencies above a certain frequency (due to the inductance and capacitance of the tracks). As a result, you can often see the following signal on the oscilloscope screen:
Smoker's meander
The sum of the first harmonics, and how the signal changes
BookConclusion
Good luck!
Add tags
Conditional number of the amplifier
Coeff. harmonics, KG, %
Coeff. noise intermodulation, IRR, %
KG/CHISH ratio
Total OSS depth, A (dB)
SOK (point)
1
0,01
9,8
980
78
2
2
0,02
9,3
465
72
3
3
0,01
10
100
81
1
4
0,1
0,9
9
19
5
5
0,13
0,8
6,15
14
9