Abstracts Statements Story

Oscillations. Harmonic vibrations

Excitation of harmonic mechanical vibrations

Animation

Description

If the oscillatory system is in any way brought out of equilibrium and then left to itself, then it will perform harmonic oscillations, provided that there is no friction in the system, and the potential energy depends quadratically on the generalized coordinate (the so-called free or natural oscillations ). To remove a system from an equilibrium state, it needs to be given energy. To do this, it is necessary to displace the system from its equilibrium position, or give it some speed, or do both at the same time. In the presence of Newtonian viscous friction, the oscillatory system can also perform harmonic oscillations, but only under the influence of a harmonic driving force (so-called forced oscillations).

Let us consider a mechanical oscillatory system, the free movement of which is described by the function

x(t) = A cos (w t + a) . (1)

Such a system is called harmonic oscillator. Function (1) describes the so-called harmonic oscillations. Here the positive value A is called the oscillation amplitude, w is the circular or cyclic frequency. Function

j = w t + a (2)

is called the oscillation phase, and the value a is called the initial phase. The period of oscillations is related to their frequency by the relation

T = 2 p/w. (3)

The function graph is shown in Fig. 1.

Dependence of coordinates on time for harmonic oscillations

Rice. 1

Function (1) is the solution differential equation second order

d 2 x /dt 2 + w 2 x = 0, (4)

which expresses some physical law that determines the behavior of the system under consideration (usually Newton’s second law or, in the case of using curvilinear generalized coordinates, its consequences such as the Euler-Lagrange equations or Hamilton’s equations). The amplitude and initial phase of oscillations can be found from the initial conditions

x(0) = x o ; d x(0) /dt = v o ,

which determine the state of the oscillatory system at time t = 0. Under these conditions, x o and v o are arbitrary constants. The initial conditions lead to the formulas:

A = sqrt (x o 2 + (v o / k) 2 ) ; tg a = - v o / w x o .

The external influence on the oscillatory system can be described by the reduced force f = f (t). For spring pendulum reduced force f = F (t)/m, where F is the external force. In this case, the function x = x(t) will satisfy the equation:

d 2 x /dt 2 + 2 b dx /dt + w o 2 x = f(t) . (5)

The second term on the left side of this equation describes the effect of friction on a moving body. Free vibrations of the body in this case will not be harmonic. Let the reduced force f = f (t) be a harmonic function of time, i.e. depends on time according to the law:

f (t) = f m cos W t,

where f m is the amplitude of the driving force,

W is the frequency of its change.

In this case, forced oscillations will be described by the function:

x (t) = A cos (W t + a),

those. will represent harmonic oscillations with frequency W of the driving force. The amplitude A of forced oscillations depends on the frequency W according to the formula:

A(W) = f m / sqrt ((w o 2 - W 2 ) 2 + 4 b 2 W 2 ) .

The initial phase of forced oscillations a is determined by the formula

a = - arctg (2 bW / (w o 2 - W 2 )).

Timing characteristics

Initiation time (log to -3 to 1);

Lifetime (log tc from 13 to 15);

Degradation time (log td from -4 to -3);

Time of optimal development (log tk from -3 to -2).

The choice of the initial phase allows us to move from the sine function to the cosine function when describing harmonic oscillations:

Generalized harmonic oscillation in differential form:

In order for free vibrations to occur according to the harmonic law, it is necessary that the force tending to return the body to the equilibrium position be proportional to the displacement of the body from the equilibrium position and directed in the direction opposite to the displacement:

where is the mass of the oscillating body.

A physical system in which harmonic oscillations can exist is called harmonic oscillator, and the equation of harmonic vibrations is harmonic oscillator equation.

1.2. Addition of vibrations

There are often cases when a system simultaneously participates in two or several oscillations independent of each other. In these cases, a complex oscillatory motion is formed, which is created by superimposing (adding) oscillations on each other. Obviously, cases of addition of oscillations can be very diverse. They depend not only on the number of added oscillations, but also on the parameters of the oscillations, on their frequencies, phases, amplitudes, and directions. It is not possible to review all the possible variety of cases of addition of oscillations, so we will limit ourselves to considering only individual examples.

Addition of harmonic oscillations directed along one straight line

Let us consider the addition of identically directed oscillations of the same period, but differing in the initial phase and amplitude. The equations of added oscillations are given in the following form:

where and are displacements; and – amplitudes; and are the initial phases of the folded oscillations.

Fig.2.

It is convenient to determine the amplitude of the resulting oscillation using a vector diagram (Fig. 2), on which the vectors of amplitudes and added oscillations at angles and to the axis are plotted, and according to the parallelogram rule, the amplitude vector of the total oscillation is obtained.

If you uniformly rotate a system of vectors (parallelogram) and project the vectors onto the axis , then their projections will perform harmonic oscillations in accordance with the given equations. Mutual arrangement vectors, and at the same time remains unchanged, therefore the oscillatory motion of the projection of the resulting vector will also be harmonic.

From this it follows that the total motion is a harmonic oscillation having a given cyclic frequency. Let's determine the amplitude modulus A the resulting oscillation. Into a corner (from the equality of opposite angles of a parallelogram).

Hence,

from here: .

According to the cosine theorem,

The initial phase of the resulting oscillation is determined from:

Relations for phase and amplitude allow us to find the amplitude and initial phase of the resulting movement and compose its equation: .

Beats

Let us consider the case when the frequencies of the two added oscillations differ little from each other, and let the amplitudes be the same and the initial phases, i.e.

Let's add these equations analytically:

Let's transform

Rice. 3.
Since it changes slowly, the quantity cannot be called amplitude in the full sense of the word (amplitude is a constant quantity). Conventionally, this value can be called variable amplitude. A graph of such oscillations is shown in Fig. 3. The added oscillations have the same amplitudes, but the periods are different, and the periods differ slightly from each other. When such vibrations are added together, beats are observed. The number of beats per second is determined by the difference in the frequencies of the added oscillations, i.e.

Beating can be observed when two tuning forks sound if the frequencies and vibrations are close to each other.

Addition of mutually perpendicular vibrations

Let material point simultaneously participates in two harmonic oscillations occurring with equal periods in two mutually perpendicular directions. A rectangular coordinate system can be associated with these directions by placing the origin at the equilibrium position of the point. Let us denote the displacement of point C along the and axes, respectively, through and . (Fig. 4).

Let's consider several special cases.

1). The initial phases of oscillations are the same

Let us choose the starting point of time so that the initial phases of both oscillations are equal to zero. Then the displacements along the axes and can be expressed by the equations:

Dividing these equalities term by term, we obtain the equations for the trajectory of point C:
or .

Consequently, as a result of the addition of two mutually perpendicular oscillations, point C oscillates along a straight line segment passing through the origin of coordinates (Fig. 4).

Rice. 4.
2). The initial phase difference is :

The oscillation equations in this case have the form:

Point trajectory equation:

Consequently, point C oscillates along a straight line segment passing through the origin of coordinates, but lying in different quadrants than in the first case. Amplitude A the resulting oscillations in both considered cases is equal to:

3). The initial phase difference is .

The oscillation equations have the form:

Divide the first equation by , the second by :

Let's square both equalities and add them up. We obtain the following equation for the trajectory of the resulting movement of the oscillating point:

The oscillating point C moves along an ellipse with semi-axes and. With equal amplitudes, the trajectory of the total motion will be a circle. In the general case, for , but multiple, i.e. , when adding, mutually perpendicular oscillations, the oscillating point moves along curves called Lissajous figures.

Lissajous figures

Lissajous figures– closed trajectories drawn by a point that simultaneously performs two harmonic oscillations in two mutually perpendicular directions.

First studied by the French scientist Jules Antoine Lissajous. The appearance of the figures depends on the relationship between the periods (frequencies), phases and amplitudes of both oscillations(Fig. 5).

Fig.5.

In the simplest case of equality of both periods, the figures are ellipses, which, with a phase difference, either degenerate into straight segments, and with a phase difference and equal amplitudes, they turn into a circle. If the periods of both oscillations do not exactly coincide, then the phase difference changes all the time, as a result of which the ellipse is deformed all the time. At significantly different periods, Lissajous figures are not observed. However, if the periods are related as integers, then after a period of time equal to the smallest multiple of both periods, the moving point returns to the same position again - Lissajous figures of a more complex shape are obtained.
Lissajous figures fit into a rectangle, the center of which coincides with the origin, and the sides are parallel to the coordinate axes and located on both sides of them at distances equal to the oscillation amplitudes (Fig. 6).

Equation of harmonic vibration

The equation of harmonic oscillation establishes the dependence of the body coordinates on time

The cosine graph at the initial moment has a maximum value, and the sine graph has a zero value at the initial moment. If we begin to examine the oscillation from the equilibrium position, then the oscillation will repeat a sinusoid. If we begin to consider the oscillation from the position of maximum deviation, then the oscillation will be described by a cosine. Or such an oscillation can be described by the sine formula with an initial phase.

Change in speed and acceleration during harmonic oscillation

Not only the coordinate of the body changes over time according to the law of sine or cosine. But quantities such as force, speed and acceleration also change similarly. The force and acceleration are maximum when the oscillating body is at the extreme positions where the displacement is maximum, and are zero when the body passes through the equilibrium position. The speed, on the contrary, in extreme positions is zero, and when the body passes through the equilibrium position, it reaches its maximum value.

If the oscillation is described by the law of cosine

If the oscillation is described according to the sine law

Maximum speed and acceleration values

Having analyzed the equations of dependence v(t) and a(t), we can guess that speed and acceleration take maximum values ​​in the case when the trigonometric factor is equal to 1 or -1. Determined by the formula

Harmonic oscillation is a phenomenon of periodic change of any quantity, in which the dependence on the argument has the character of a sine or cosine function. For example, a quantity oscillates harmoniously and changes over time as follows:

where x is the value of the changing quantity, t is time, the remaining parameters are constant: A is the amplitude of oscillations, ω is the cyclic frequency of oscillations, is the full phase of oscillations, is the initial phase of oscillations.

Generalized harmonic oscillation in differential form

(Any non-trivial solution to this differential equation is a harmonic oscillation with a cyclic frequency)

Types of vibrations

    Free vibrations occur under the influence of the internal forces of the system after the system has been removed from its equilibrium position. For free oscillations to be harmonic, it is necessary that the oscillatory system be linear (described by linear equations of motion), and there is no energy dissipation in it (the latter would cause attenuation).

    Forced vibrations occur under the influence of an external periodic force. For them to be harmonic, it is enough that the oscillatory system is linear (described by linear equations of motion), and the external force itself changes over time as a harmonic oscillation (that is, that the time dependence of this force is sinusoidal).

Harmonic Equation

Equation (1)

gives the dependence of the fluctuating value S on time t; this is the equation of free harmonic oscillations in explicit form. However, usually the vibration equation is understood as a different representation of this equation, in differential form. For definiteness, let us take equation (1) in the form

Let's differentiate it twice with respect to time:

It can be seen that the following relationship holds:

which is called the equation of free harmonic oscillations (in differential form). Equation (1) is a solution to differential equation (2). Since equation (2) is a second-order differential equation, two initial conditions are needed to obtain a complete solution (that is, determining the constants A and   included in equation (1); for example, the position and speed of the oscillatory system at t = 0.

A mathematical pendulum is an oscillator, which is a mechanical system consisting of a material point located on a weightless inextensible thread or on a weightless rod in a uniform field of gravitational forces. The period of small natural oscillations of a mathematical pendulum of length l, motionlessly suspended in a uniform gravitational field with free fall acceleration g, is equal to

and does not depend on the amplitude and mass of the pendulum.

A physical pendulum is an oscillator, which is a solid body that oscillates in a field of any forces relative to a point that is not the center of mass of this body, or a fixed axis perpendicular to the direction of action of the forces and not passing through the center of mass of this body.

There were several articles on the hub on the Fourier transform and about all sorts of beauties such as Digital Signal Processing (DSP), but it is completely unclear to the inexperienced user why all this is needed and where, and most importantly, how to apply it.

Frequency response of noise.

Personally, after reading these articles (for example, this one), it did not become clear to me what it was and why it was needed in real life, although it was interesting and beautiful.
I want to not just look at beautiful pictures, but, so to speak, to feel in my gut what and how it works. And I will give a specific example with the generation and processing of sound files. It will be possible to listen to the sound, and look at its spectrum, and understand why this is so.
The article will not be of interest to those who know the theory of functions of a complex variable, DSP and other scary topics. It is more for the curious, schoolchildren, students and those who sympathize with them :).

Let me make a reservation right away: I am not a mathematician, and I may even say many things incorrectly (correct them with a personal message), and I am writing this article based on my own experience and my own understanding of current processes. If you're ready, let's go.

A few words about materiel

If we remember our school mathematics course, we used a circle to plot the sine graph. In general, it turns out that rotational movement can be turned into a sine wave (like any harmonic oscillation). The best illustration of this process is given in Wikipedia


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. So I'll show you right away practical use this knowledge, and you will 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:


Pure tube sine

Let's look at the spectrum of this sine (Analysis->Plot spectrum)


Spectrum graph

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; )

The FFT array must be a sequence (re, im, re, im,… re, im), where fft_size=1<< p - число точек БПФ. Объясняю нормальным языком:
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:

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).


Vector on the complex plane

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:

For(i=0;i<(size_array);i+=2) { fprintf(logfile,"%.6f %f\n",cur_freq, (sqrt(out[i]*out[i]+out*out))); cur_freq+=delta; }
As a result, we get a file something like this:

… 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!

Now we feed the resulting program that sine sound file

./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 construction:

#! /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.
So (drumroll), run the script and see:


Spectrum of our signal

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).

Let's indulge?

Come on! Let's look at the spectra of other signals!

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:

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.


Signal in audacity

Let's look at the spectrum in the audacity program.


Range

And let's look at the spectrum using our program:


Our spectrum

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.

What about compote?

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


His Majesty - the meander or meander of a healthy person

Let's not languish and look at its spectrum:


Meander spectrum

It’s not very clear yet what it is... Let’s take a look at the first few harmonics:


First 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!
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

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 sum of the first harmonics, and how the signal changes

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.


Book

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.

Conclusion

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!). :)
Good luck!