Dynamic recalculation of spectral samples at each sampling clock. Modified algorithm

Lecture



Content
Introduction
Formulation of the problem
Recurrence ratio for spectral reading
Filter for calculating the spectrum of a given harmonic
Selecting a set of fixed harmonics from the signal spectrum
Selection of amplitudes of multiple harmonics with nonlinear distortion of the signal
findings
Introduction
In this article, we will look at the rather specific task of analyzing a change in a given spectral reference over time. Such a problem is relevant when decoding a DTMF signal or when monitoring a given set of multiple harmonics in time, when the use of FFT algorithms is impractical due to the small number of spectral samples.
Formulation of the problem
Let us say a few words about the notation that will be used in this article. The samples of the original discrete signal (in the general case complex) will be denoted by small Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm , Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm - reference number. Spectral signal counts Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm we will denote by capital letter Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm , Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm - number of spectral counting corresponding to frequency Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm , Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm - sampling frequency, Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm - the number of points of the DFT.
Figure 1 shows a three-dimensional picture. On the vertical axis, we have the values ​​of the signal spectrum Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithmDynamic recalculation of spectral samples at each sampling clock.  Modified algorithm - number of the spectral reference. Over time, we get more and more new samples and spectrum Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm is changing. So in Figure 1 blue shows the change in the spectrum Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm for three time slices corresponding to the signal sample numbers Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm .
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm
Figure 1: Three-dimensional representation of a time-varying signal spectrum
Then for some specific spectral reading Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm we can get a frequency cut Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (shown in red) from which we can analyze the amplitude and phase of the spectral reading Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm in time. In this article we will deal with the analysis of changes in a given spectral sample in time when new signal samples are received.
For DTMF decoding, the Goertzel algorithm, which allowed us to calculate a given spectral count using the recurrence relation, which we represented as an IIR filter, became widespread. But we said that when using the Goertzel algorithm, we were not interested in all intermediate results of the recurrence formula, therefore we could not get the value of the spectral count more than every Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm counts. We will consider an algorithm that allows for spectrum recalculation “on the fly,” that is, upon receipt of each successive reference. We will see that the resulting algorithm will be a modification of the Goertzel algorithm for recalculating the spectral count at each sampling clock.
Consider the discrete Fourier transform (DFT), which is given by the expression:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (one)
To calculate the DFT value for one fixed spectral reference (one harmonic) with the number Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm DFT expression takes the form
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (2)
Calculations of one fixed harmonic with a number Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm can be done using the structure shown in Figure 2. In essence (2) this is the output of an FIR filter.
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm
Figure 2: Fixed harmonic calculation
Thus, to calculate a single spectral reference, it is required Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm complex multiplications and additions.
Let the input samples Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm enter the buffer length Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm and with each new reference Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm it is necessary to recalculate the value of the fixed harmonic as shown in Fig. 3. In other words, when the next sample arrives, the buffer is shifted and the output of the FIR filter changes.
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm
Figure 3: Recalculation of the fixed harmonics for the sampling interval
Figure 3 shows harmonic values. Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm on the previous clock cycle, i.e. when a reference signal arrives Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm :
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (3)
and Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm on the current clock when the original signal is received Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm .
For the sampling interval must be performed Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm complex multiplications and additions, which is impossible in real time at high sampling rates. However, from Figure 3 it can be noted that the recalculation of the entire spectral reference is extremely inefficient, since the same samples are used as in the previous cycle, except for Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm which is not involved in the calculation Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm and Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm which is not involved in the calculation Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm . Thus, it can be assumed that there is a way to recurrently recalculate the spectral count at the current and previous ticks.
Recurrence ratio for spectral reading
Consider more carefully the calculation Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm . Figure 4 shows that upon receipt of the next reference Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (shown in green), the buffer is shifted and the countdown Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (marked in yellow) goes out of the buffer, or it can be said that it goes beyond the impulse response of the FIR filter.
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm
Figure 4: Buffer shift on the next cycle
Then the expression for calculating the harmonics at the next cycle can be written:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (four)
Note that
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (five)
In addition, from expression (3), it can be noted that
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (6)
Then you can finally write down:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (7)
Expression (7) is nothing more than a recurrence relation that relates the value of the DFT of one harmonic for the previous and next clock cycle. Recalculation of the previous clock to the next requires only one complex multiplication and two complex additions, which can be implemented in real time. It is very important that the complexity of the recalculation of the spectral reference does not depend on Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm - always one complex multiplication and two additions.
Filter for calculating the spectrum of a given harmonic
The recurrence relation (7) can be interpreted as the difference equation of the IIR filter:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (eight)
Where Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm - delayed by Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm samples input signal Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (complex or real), in expression (7) Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm corresponds to Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm . The ratio (7) is obtained from (8) with Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm .
Thus, we have managed to move from the FIR structure to the recurrence relation of the corresponding IIR filter. The structure of an IIR filter corresponding to the difference equation (8) is shown in Figure 5.
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm
Figure 5: IIR filter for calculating the spectral count
The transfer characteristic of the resulting filter is:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (9)
All input, output filter counts, as well as coefficient Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm are complex.
Note that (9) is very similar to the transfer characteristic. Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm IIR - the filter corresponding to the algorithm of Goetzel:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (ten)
Then the resulting transfer characteristic Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm IIR - a filter that “can recalculate” the previous value of the spectral reference to the current one when the next sample of a discrete signal arrives, can be represented through the transfer characteristic of the IIR - filter of the Goertzel algorithm:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (eleven)
Thus, we obtained a modification of the algorithm of Hörzel in the form of a non-recursive branch Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm , which allows to conduct a dynamic recalculation of the spectral sample when a signal is received in real time.
Let the complex input signal Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm equals:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (12)
The spectral counts at the filter output are:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (13)
The filter coefficient is:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (14)
Then the expression (8) can be written:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (15)
Converting (15) you can get:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (sixteen)
Then the calculation of the spectral reference can be represented by the structural scheme shown in Figure 6 using only real multiplications and additions.
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm
Figure 6: IIR filter for calculating the spectral count with real multiplications
Selecting a set of fixed harmonics from the signal spectrum
We will consider an example of the selection of two harmonics with frequencies Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm and Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm at sampling rate Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm . Consider how to choose the right number of points DFT Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm as well as numbers of spectral samples Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm and Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm corresponding frequencies Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm and Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm .
In order for us to distinguish these signals in the spectrum, the number of DFT points Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm should be such that frequency Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm and Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm “Did not merge” into one harmonic, i.e.
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (17)
Then number Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm spectral count for frequency Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm will be equal to:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (18)
and number Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm spectral count for frequency Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm will be equal to:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (nineteen)
Let the sampling rate be Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm , Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm and Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm . Then the number of DFT points should be:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (20)
Let be Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm then Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm , but Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm . The location of the harmonics is shown in Figure 7.
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm
Figure 7: The location of the signal harmonics between the DFT points
As can be seen from Figure 7, the harmonics are located midway between the DFT points, which means their amplitudes will be distorted due to the spreading effect of the spectrum. To eliminate this, you need Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm round up then Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm and according to (18) Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm . Then at Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithmDynamic recalculation of spectral samples at each sampling clock.  Modified algorithm practically coincides with the 35th number of the spectral reference, as shown in Figure 8.
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm
Figure 8: Buffer length selection, to reduce the spread spectrum effect
With the coincidence of the frequency of the harmonic and the frequency of the spectral reference, we obtain that the buffer length Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm an integer number of repetition periods of the signal falls, which will reduce the spreading effect when calculating the spectral count.
Figure 9 shows the graphs for measuring the amplitude of the harmonics. Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm and Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm when alternating signals with frequencies Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm and Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm sampling rate Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm and Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm . Frequencies Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm and Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm replace each other every second.

Figure 9: Alternating Signals with Controlled Frequencies
From Figure 9 it can be seen that when the frequencies change, a “transient process” is observed whose duration is equal to Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm . This must be considered when processing.
Selection of amplitudes of multiple harmonics with nonlinear distortion of the signal
In this section, we will give an example of measuring multiple harmonics using an IIR filter shown in Fig. 6. To isolate amplitudes of multiple harmonics of a non-linearly distorted signal with a frequency Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm .
Let the signal at the output of the nonlinear element is described by the expression:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (21)
Figure 10 shows the waveform. Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm at the output of the nonlinear element. The sampling rate is Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm .

Figure 10: The signal at the output of the nonlinear element
At the output of the nonlinear element, we get a set of multiple harmonics separated from each other by Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm .
The buffer length required to distinguish multiple harmonics is equal to:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (22)
For better discrimination, you can take a buffer length Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm points. Then the numbers of spectral samples corresponding to the first four harmonics Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm are equal:
Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm (23)
All harmonics fall on the DFT points, therefore spreading of the spectrum will not be observed. Figure 11 shows the signal spectrum. Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm , and in figure 12, the amplitudes of the first four harmonics are estimated using the modified Goertzel algorithm.

Figure 11: The spectrum of the signal at the output of the nonlinear element

Figure 12: Dynamic tracking of amplitudes of multiple harmonics of a signal
Figure 12 shows that the first Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm points the modified algorithm completely repeats the algorithm of Goetzel, but after the buffer is completely filled, and the non-recursive branch of the IIR filter begins to work, we obtain a dynamic recalculation of the amplitudes of the harmonics at each sampling clock. This allows us to conduct continuous tracking of the amplitudes of multiple harmonics at the output of the nonlinear element. The measured amplitudes are exactly equal to the amplitudes of the harmonics shown in Figure 11, but we can observe their change over time as shown in the three-dimensional projection (Figure 1).
findings
In this article, we reviewed a modification of the Goertzel algorithm, which allows us to recalculate a given spectral sample at each discretization cycle using the recurrence relation (7). It was shown that a modification of the Goertzel algorithm consists of adding a non-recursive branch with a delay of Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithm samples to IIR - filter of Goertzel algorithm and allows to take into account all intermediate results when calculating a given harmonic of the signal spectrum.Also shown are examples of choosing the buffer length Dynamic recalculation of spectral samples at each sampling clock.  Modified algorithmwhen analyzing two spectral components, as well as harmonics of a multiple frequency at the output of the nonlinear element.
created: 2015-05-23
updated: 2021-07-12
132684



Rating 9 of 10. count vote: 2
Are you satisfied?:



Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Digital signal processing

Terms: Digital signal processing