Computers Windows Internet

Development of an algorithm for analyzing signal filtering. Linear digital filtering algorithm. Structural diagram of a recursive digital filter

Physically feasible digital filters that operate in real time can use the following data to generate the output signal at a discrete moment in time: a) the value of the input signal at the moment of sampling, as well as a certain number of "past" input samples a certain number of previous samples of the output signal Integers the type determines the order of the CF. The classification of CFs is carried out in different ways, depending on how information about the past states of the system is used.

Transversal CFs.

This is the name given to filters that work in accordance with the algorithm.

where is a sequence of coefficients.

The number is the order of the transversal digital filter. As can be seen from formula (15.58), the transverse filter carries out a weighted summation of the previous samples of the input signal and does not use the past samples of the output signal. Applying the z-transformation to both sides of expression (15.58), we make sure that

Hence it follows that the system function

is a fractional rational function z, having a multiple pole at and zeros, the coordinates of which are determined by the filter coefficients.

The algorithm for the functioning of the transversal DF is illustrated by the block diagram shown in Fig. 15.7.

Rice. 15.7. Scheme for constructing a transversal DF

The main elements of the filter are blocks of delay of sample values ​​for one sampling interval (rectangles with symbols), as well as scale blocks that perform digital multiplication by the corresponding coefficients. From the outputs of the scale blocks, the signals go to the adder, where they add up to form a sample of the output signal.

The form of the diagram presented here explains the meaning of the term "transverse filter" (from the English transverse - transverse).

Software implementation of the transversal DF.

It should be borne in mind that the block diagram shown in Fig. 15.7 is not schematic diagram electrical circuit, but only serves graphic image signal processing algorithm. Using the means of the FORTRAN language, let us consider a fragment of a program that implements transverse digital filtering.

Let in random access memory The computer formed two one-dimensional arrays of length M cells each: an array named X, which stores the values ​​of the input signal, and an array named A, containing the values ​​of the filter coefficients.

The contents of the cells in array X change each time a new sample of the input signal is received.

Suppose that this array is filled with the previous samples of the input sequence, and consider the situation that arises at the moment of the arrival of the next sample, which is given the name S in the program. This sample should be placed in cell number 1, but only after the previous record is one position to the right, that is, towards the lagging side.

The elements of the array X formed in this way are multiplied term-by-term by the elements of the array A and the result is entered into a cell named Y, where the sample value of the output signal is accumulated. Below is the text of the transversal digital filtering program:

Impulse response. Let's return to formula (15.59) and calculate the impulse response of the transversal digital filter by performing the inverse z-transformation. It is easy to see that each term of the function makes a contribution equal to the corresponding coefficient, shifted by positions towards the delay. So here

This conclusion can be reached directly, considering the block diagram of the filter (see Fig. 15.7) and assuming that a "single pulse" is fed to its input.

It is important to note that the impulse response of a transversal filter contains a finite number of terms.

Frequency response.

If we change the variable in formula (15.59), then we get the frequency transmission coefficient

With a given sampling step A, a wide variety of frequency response forms can be realized by appropriately selecting the filter weights.

Example 15.4. Investigate the frequency characteristics of a second-order transverse digital filter that averages the current value of the input signal and two previous samples according to the formula

The system function of this filter

Rice. 15.8. Frequency characteristics of the transversal DF from example 15.4: a - frequency response; b - PFC

whence we find the frequency transmission coefficient

Elementary transformations lead to the following expressions for the frequency response in the phase response of this system:

The corresponding graphs are shown in Fig. 15.8, a, b, where the value is plotted along the horizontal axes - the phase angle of the sampling interval at the current frequency value.

Suppose, for example, that, that is, there are six samples per one period of the harmonic input oscillation. In this case, the input sequence will have the form

(the absolute values ​​of the samples do not matter, since the filter is linear). Using algorithm (15.62), we find the output sequence:

It can be seen that a harmonic output signal of the same frequency as at the input corresponds to it, with an amplitude equal to the amplitude of the input oscillation and with an initial phase shifted by 60 ° towards the delay.

Recursive DFs.

This kind digital filters is characterized by the fact that for the formation of the output count, the previous values ​​of not only the input and output signals are used:

(15.63)

and the coefficients that determine the recursive part of the filtering algorithm are not equal to zero at the same time. To emphasize the difference between the structures of the two types of digital filters, transversal filters are also called non-recursive filters.

System function of recursive digital function.

Performing the z-transformation of both sides of the recurrence relation (15.63), we find that the system function

describing the frequency properties of a recursive DF, has poles on the z-plane. If the coefficients of the recursive part of the algorithm are real, then these poles either lie on the real axis or form complex conjugate pairs.

Structural diagram of a recursive digital filter.

In fig. 15.9 shows a diagram of the algorithm of calculations carried out in accordance with the formula (15.63). The upper part of the block diagram corresponds to the transverse (non-recursive) part of the filtering algorithm. For its implementation, in the general case, large-scale blocks (multiplication operations) and memory cells are required in which input samples are stored.

The lower part of the block diagram corresponds to the recursive part of the algorithm. It uses successive output values, which are shifted from cell to cell during filter operation.

Rice. 15.9. Structural diagram of a recursive digital filter

Rice. 15.10. Structural diagram of the canonical recursive DF of the 2nd order

The disadvantage of this implementation principle is the need for a large number of memory cells, separately for the recursive and non-recursive parts. The canonical schemes of recursive digital functions are more perfect, in which the minimum possible number of memory cells is used, equal to the largest of the numbers. As an example, Fig. 15.10 shows a block diagram of the second-order canonical recursive filter, which corresponds to the system function

In order to make sure that this system implements a given function, consider an auxiliary discrete signal at the output of the adder 1 and write down two obvious equations:

(15.67)

Performing the -transformation of equation (15.66), we find that

On the other hand, in accordance with the expression (15.67)

Combining relations (15.68) and (15.69), we arrive at the given system function (15.65).

Stability of recursive digital functions.

A recursive CF is a discrete analogue of a dynamical system with feedback, since the values ​​of its previous states are stored in memory cells. If some initial conditions are given, that is, a set of values, then in the absence of an input signal, the filter will form elements of an infinite sequence that plays the role of free oscillations.

A digital filter is called stable if the free process arising in it is a non-increasing sequence, i.e., the values ​​at do not exceed some positive number M, regardless of the choice of the initial conditions.

Free oscillations in a recursive digital function based on algorithm (15.63) are a solution to the linear difference equation

By analogy with the principle of solving linear differential equations we will seek a solution to (15.70) in the form of an exponential function

with a still unknown value. Substituting (15.71) into (15.70) and canceling by a common factor, we see that a is the root of the characteristic equation

Based on (15.64), this equation exactly coincides with the equation that is satisfied by the poles of the system function of the recursive CF.

Let the root system of equation (15.72) be found. Then the general solution of the difference equation (15.70) will have the form

The coefficients must be selected so that the initial conditions are satisfied.

If all poles of the system function, i.e., the numbers do not exceed one in absolute value, being located inside the unit circle centered at a point, then on the basis of (15.73) any free process in the CF will be described by terms of decreasing geometric progressions and the filter will be stable. It is clear that only stable digital filters can be practically applied.

Example 15.5. Investigate the stability of a recursive 2nd order digital filter with a system function

Characteristic equation

has roots

The curve described by the equation on the coefficient plane is the boundary above which the poles of the system function are real and below which they are complex conjugate.

For the case of complex conjugate poles, therefore, one of the boundaries of the stability region is straight line 1.

Rice. 15.11. Stability region of the 2nd order recursive filter (the poles of the filter are complex conjugate in the region marked with a color)

Considering the real poles at, we have the stability condition in the form

LABORATORY WORK

SIGNAL FILTERING ALGORITHMSIn the process control system

Target. Acquaintance with the algorithms for filtering measured random signals, most common in the process control system, conducting a comparative analysis of their accuracy and implementation features in a computer.

Exercise

1) for the given characteristics of random signals, calculate the optimal filter parameters,

2) simulate the filtration system on a computer and calculate the filtration error for each of the considered methods,

3) to carry out a comparative analysis of the effectiveness of the considered algorithms.

Basic provisions. 1 Statement of the optimal filtration problem. Signals from measuring devices often contain a random error - interference. The task of filtering is to separate the useful signal component from the interference to one degree or another. As a rule, both the useful signal and the interference are assumed to be stationary random processes for which their statistical characteristics are known: mathematical expectation, variance, correlation function, spectral density. Knowing these characteristics, it is necessary to find a filter in the class of linear dynamic systems or in a narrower class of linear systems with a given structure so that the signal at the output of the filter differs as little as possible from the useful signal.

Fig. 1. On the statement of the filtration problem

Let us introduce the notation and formulate the filtration problem more precisely. Let the input of the filter with an impulse response To(t) and the corresponding (due to the Fourier transform) 0

AFKh W() useful signals are received x(t) and interference that is not correlated with it z(t) (fig. 1). The correlation functions and spectral densities of the useful signal and interference are denoted by R x (t), S x (t), R z (t) and S z (t) ... It is required to find the characteristics of the filter k (t) or W (t) so that the rms value of the difference ε between the signal at the filter output and the useful signal x was minimal. If the filter characteristic is known with an accuracy of one or several parameters, then the optimal values ​​of these parameters must be chosen.

Error ε contains two components. The first ( ε 1 ) is due to the fact that some part of the noise will still pass through the filter, and the second ( ε 2 ) - so that the shape of the useful signal will change when passing through the filter. Thus, the determination of the optimal filter characteristic is a search for a compromise solution that minimizes the total error.

Let's represent the frequency response of the filter in the form:

W (iω) = A (ω) exp.

Using the formulas connecting the spectral densities of random processes at the input and output of a linear system with its frequency response, we calculate the spectral densities of each of the error components.

For the error associated with the skipping of the noise, we obtain

S ε1 (ω) = S z (ω ) A 2 (ω )

The spectral density of the error associated with the distortion of the useful signal is

S ε2 (ω) = S x (ω )|1 – W()| 2

The sum of these components S ε has the spectral density

S ε (ω ) = S ε1 (ω ) + S ε2 (ω )

Considering that

|1 – W()| 2 = 2 + A 2 (ω ) sin 2 f(ω ),

S ε (ω ) = S z (ω) A 2 (ω) + S x (ω) A 2 (ω ) + S x (ω) - 2S x (ω) A(ω) cosf(ω) . (1)

The root mean square error is related to the spectral density by the expression

By minimizing S ε (ω ) on f(ω) and A (ω), we arrive at the equations

cosf * (ω ) = 1
f *(ω ) = 0

2S z (ω ) A (ω) - 2S x (ω) = 0

(2)

The found characteristics of the optimal filter correspond to the spectral error density

Minimum root mean square error

(3)

Unfortunately, the found filter is not realizable, since the condition of equality to zero at all frequencies of the phase-frequency response means that the impulse response of the filter is an even function, it is nonzero not only for t>0 , but also at t(Figure 2, a).

For any physically realizable filter, the following requirement is true: To(t) = 0 at t (Fig. 2, b). This requirement should be introduced into the problem statement. Naturally, the achievable error σ at the same time would increase. The problem of optimal filtering taking into account the physical feasibility has been solved.

Rice. 2. Impulse characteristics of unrealizable (a) and realizable (b) filters

Rice. 3. Spectral densities of the useful signalS x (ω) and noiseS z (ω) and the amplitude-frequency characteristic of the optimal filter A * (ω) with non-overlapping (a) and overlapping (b)S x (ω) andS z (ω)

N. Wiener. Its solution is much more complicated than the one given above, therefore, in this work, we will look for physically realizable filters only in the class of filters whose characteristics are specified accurate to parameter values. The quantity calculated by formula (3) can serve as a lower estimate of the attainable filtering error.

The physical meaning of relation (2, b) is illustrated in Fig. 3. If the spectra of the useful signal and interference do not overlap, then A (ω) should be equal to zero where the spectral density of the interference is different from zero, and equal to one for all frequencies at which S x (ω)>0 ... In fig. 3, b shows the character A * (ω) in the case when the spectral densities of the signal and interference overlap each other.

Among filters with a given structure, the most widespread are filters based on the moving average operation, as well as an exponential filter and the so-called statistical filter of zero order. An exponential filter is a first-order aperiodic filter, and a zero-order statistical filter is an amplifying link. Let's consider each of the mentioned filters in more detail.

Moving average filter. The filter output is related to its input by the ratio

The impulse transient function of the filter is shown in Fig. 4, a. Frequency characteristics are equal


The impulse response can be expressed in terms of the Heaviside function 1(t)

k(t) = k.

Adjustable filter parameters are gain k and memory T.

Exponential filter(Fig. 4, b). The output signal is determined by the differential equation

y/ γ + y = kg

The impulse response is:

Frequency characteristics


The filter parameters are the gain k and the time constant inverse to γ .

Rice. 4. Impulse transient functionsk(t) and amplitude-frequency characteristics А (ω) of typical filters: а - current average; b - exponential; c) static zero order

Zero-order statistical filter. This filter, as mentioned above, is an amplifying link. Its characteristics

y(t) = kg(t) ; A(ω) = k; f(ω) = 0

The weight of the listed filters does not allow achieving ideal filtering even with disjoint signal and interference spectra. Minimize error σ ε you can select the parameters k, T, γ... This requires filter characteristics A (ω) and f(ω) as a function of frequency and parameters, substitute into formula (1), take the integral of the resulting expression, which will be a function of the filter parameters, and find the minimum of this integral over the parameters.

For example, for a statistical filter of Coulomb order, the spectral density of the error will have the form:

S ε (ω ) = S z (ω ) k 2 + S x ω (1 – k 2 )

Integral S ε is equal to the variance of the interference multiplied by π ... We get

Let us take into account that the integrals on the right-hand side of this equality are equal to the variances of the useful signal and the noise, so that

The condition for the minimum of this expression with respect to k leads to equality

After substitution of the found value k into the expression for the variance of the error, we get:

The filters of the current average and the exponential have two adjustable parameters each, and their optimal values ​​cannot be expressed so easily through the characteristics of the useful signal and noise, but these values ​​can be found by numerical methods for finding the minimum of a function in two variables.

Fig. 5 Block diagram of computer simulation of a random signal filtering system

2. Description of the simulated system. The work is carried out by modeling on a computer a system consisting of the following blocks (Fig. 5).

1. Input signal generator I, including a random signal generator (GSS) and two shaping filters with specified characteristics W x () and W z () , at the output of which a useful signal is received x(t) and hindrance z(t) ... Between the random signal generator and the shaping filter W z included a delay link Δ, providing a shift of two to three clock cycles. In this case, the input of the filter that forms the noise and the input of the filter that forms the useful signal are uncorrelated with each other.

2. Block for calculating correlation functions
.

3. Filtration unit (II), including the actual filter
and a block for calculating the filtering error
.

Useful signal generated in the system x(t) and hindrance z(t) are stationary random processes, the correlation functions of which can be approximately approximated by exponents of the form (Fig. 6)

(6)

where

Signal variance estimates and calculated using a block (at τ = 0); parameters α and α z are set by the teacher.

3. Discrete Implementation of Continuous Filters. We use discrete implementations of the continuous filters described above. Discreteness step t o take significantly less than the decay time of the correlation functions of the useful signal and noise. Therefore, the above expressions (1) for calculating σ ε through the spectral characteristics of the input signal and noise can also be used in the discrete case.

Let us first find discrete analogs of filters that form random processes with correlation functions from the signal received from the GSS (6). The spectral densities corresponding to these correlation functions have the form


(7)

The transfer functions of the shaping filters for the case when the variance of the signal at the output of the GSS is equal to one, are


It is not hard to see that

If the signal at the input of each of the shaping filters is denoted by ξ , then the differential equations corresponding to the transfer functions written above have the form


The corresponding difference analogs will be written in the form;


Thus, the algorithm of the filter, which forms the useful signal, has the form:

(8a)

Likewise for the noise-shaping filter

(8b)

Analogs of continuous filters designed to isolate interference are as follows:

for moving average filter

(9)

where the value l choose from the condition (l + 1) t O = T;

for exponential filter

(10)

for the statistical filter of the zero order

at i = kg i (11)

Execution order. 1. Create and debug the subroutines of the block for filtering current information and calculating filtering errors.

2. Obtain realizations of random processes at the output of the shaping filters and use them to find estimates of the variances of the useful signal and noise, as well as correlation functions R x (τ) and R z (τ) ... Approximately define α NS and α z and compare with the calculated ones.

3. Calculate by S x (ω) and S z (ω) analytically or on a computer lower bound for the rms filtering error.

4. Using formula (4), find the optimal gain of the zero-order statistical filter and the corresponding value which is compared with.

5. I use one of the well-known methods of finding the minimum of a function of two variables and a program compiled in advance to find the optimal parameters of the moving average and exponential filters and the root-mean-square filtering errors. In this case, a specific combination of filter parameters corresponds to the spectral error density S ε (ω) defined by formula (1), and from it find the value after numerical integration.

6. Enter the filtering program into the computer, determine experimentally the root-mean-square error for the optimal and non-optimal filter parameters, compare the results with the calculated ones.

7. Conduct a comparative analysis of the effectiveness of various filtering algorithms for the following indicators: a) the minimum achievable root-mean-square error; b) the required amount of RAM; c) computer counting time.

The report should contain: 1) a block diagram of the system (see Fig. 5);

2) subroutines of shaping and synthesized filters;

3) calculation of the optimal parameters of the filters and the corresponding values ​​of the root-mean-square error;

4) the results of the analysis of the considered algorithms and conclusions.

Booth 6.2. Project creation 6.3. Study APCS at the training laboratory... certain goals their activities. Goals activities ...

  • Name Surname "" 20 g

    Document

    Mode work) ;. … […) [Mode name work] ... according to laboratory analyzes; 5) ... requirements for APCS... Technological processes ... processing and analysis of information ( signals, messages, documents, etc. ... algorithms filtration and algorithms eliminate noise from aim ...

  • Intelligent automation in coursework and diploma projects

    abstract

    The wire. target... product ... signal HART for integration into systems APCS ... filtration there are different types of dust sensors. DT400G works ... algorithm... the chemical industry. Technical means and laboratory work/ G.I. Lapshenkov, L.M. ...

  • Work program of the discipline "automation of technological processes"

    Working programm

    ... GOALS AND OBJECTIVES OF LEARNING THE DISCIPLINE The purpose... the main components APCS- controllers ... views signals c ... bug fixes, filtration messages, ... algorithms and programs, discussions, performance of control works. Laboratory classes. Laboratory ...

  • Physically feasible digital filters that operate in real time can use the following data to generate the output signal at the i-th discrete moment of time: a) the value of the input signal at the moment of the i-th sample, as well as a certain number of "past" input samples; b) some number of preceding samples of the output signal Integers m and n define the order of the CF. The classification of CFs is carried out in different ways, depending on how information about the past states of the system is used.

    Traisverse CF. This is the name given to filters that work in accordance with the algorithm.

    where -sequence of coefficients.

    Number T is the order of the transversal digital filter. As can be seen from formula (2.138), the transverse filter carries out a weighted summation of the previous samples of the input signal and does not use the past samples of the output signal. Applying the z-transformation to both sides of expression (2.138), we see that

    Hence it follows that the system function

    is a fractional rational function z , having an m-fold pole at z = 0 and T zeros whose coordinates are determined by the filter coefficients.

    The algorithm for the functioning of the transversal DF is illustrated by the block diagram shown in Fig. 2.17.

    Rice. 2.17. Scheme for constructing a transversal digital filter

    The main elements of the filter are blocks of delay of sample values ​​for one sampling interval (rectangles with symbols z -1), as well as scale blocks that perform digital multiplication by the corresponding coefficients. From the outputs of the scale blocks, the signals go to the adder, where, adding up, they form a sample of the output signal.

    The form of the diagram presented here explains the meaning of the term "transverse filter" (from the English transverse).

    Impulse response. Let us return to formula (2.139) and calculate the impulse response of the transverse CF by performing the inverse z-transformation. It is easy to see that each term of the function H (z) makes a contribution equal to the corresponding coefficient , displaced by NS positions towards the lagging side. So here

    This conclusion can be reached directly, considering the block diagram of the filter (see Fig. 2.17) and assuming that a "single pulse" (1, 0, 0, 0, ...) is fed to its input.

    It is important to note that the impulse response of a transversal filter contains a finite number of terms.

    Frequency response. If in formula (2.139) we change the variable , then we get the frequency transmission coefficient

    For a given sampling step A it is possible to realize a wide variety of frequency response forms by appropriately selecting the filter weights.

    Digital filter synthesis methods. Three methods, described below, are most widely used in the practice of synthesizing digital filters.

      Method of invariant impulse responses.

    This method is based on the assumption that the synthesized digital filter should have an impulse response, which is the result of sampling the impulse response of the corresponding analog filter prototype. Meaning the synthesis of physically realizable systems for which the impulse response vanishes at t<0 , we obtain the following expression for the impulse response of the CF:

    where T time sampling step.

    It should be noted that the number of individual terms in the expression for the impulse response of the CF can be either finite or infinite. This determines the structure of the synthesized filter: a transverse filter corresponds to an impulse response with a finite number of samples, while a recursive DF is required to implement an infinitely long impulse response.

    The relationship between the impulse response coefficient and the structure of the DF is especially simple for a transverse filter. In the general case, the synthesis of the filter structure is carried out by applying z-conversion to a sequence of the form given above. Finding the system function H (z) filter, you should compare it with the general expression and determine the coefficients of the transverse and recursive parts. The degree of approximation of the amplitude-frequency characteristic of the synthesized digital filter to the characteristic of an analog prototype depends on the selected sampling step. If necessary, you should calculate the frequency transmission coefficient of the digital filter by performing in the system function H (z) change variable by formula
    , and then compare the result with the frequency gain of the analog circuit.

      DF synthesis based on discretization of the differential equation

    analog circuit.

    The structure of a digital filter, approximately corresponding to a known analog circuit, can be obtained by discretizing the differential equation describing an analog prototype. As an example of using this method, consider the synthesis of a CF corresponding to a second-order oscillatory dynamic system, for which the relationship between the output oscillation y (t) and input wobble x (t) is set by the differential equation

    (2.142)

    Suppose that the sampling step is t and consider the collection of discrete samples at 1 and NS 1 ... If the derivatives in the formula are replaced by their finite-difference expressions, then the differential equation turns into a difference equation

    Rearranging the terms, we get:

    (2.144)

    The difference equation defines a 2nd order recursive filter algorithm that simulates an analog oscillatory system and is called a digital resonator. With an appropriate choice of coefficients, the digital resonator can act as a frequency-selective filter, similar to an oscillatory circuit.

      Method of invariant frequency characteristics .

    It is fundamentally impossible to create a digital filter, the frequency response of which would exactly repeat the frequency response of some analog circuit. The reason is that, as you know, the frequency transfer coefficient of the DF is a periodic function of frequency with a period determined by the sampling step.

    Speaking about the similarity (invariance) of the frequency characteristics of the analog and digital filters, we can only require that the entire infinite interval of frequencies ω a, related to the analog system, be transformed into a segment of frequencies ω q of the digital filter that satisfy the inequality
    while maintaining the general view of the frequency response.

    Let be K a (R) transfer function of an analog filter defined by a fractional rational expression in powers p... If you use the relationship between variables z and p, then you can write:

    . (2.145)

    With this law, the relationship between p and z it is impossible to get a physically realizable system filter function, since the substitution into the expression K a (R) will give a system function that is not expressed as a quotient of two polynomials. Therefore, for the synthesis of low-pass filters, a connection of the form

    , (2.146)

    which also maps the points of the unit circle in the z-plane to the points of the imaginary axis on the p-plane. Then

    , (2.147)

    whence follows the relationship between frequency variables  analog and digital systems:

    . (2.148)

    If the sampling rate is high enough ( c T<<1), then, as is easily seen from formula (2.147), a  c... Thus, at low frequencies, the characteristics of the analog and digital filters are practically the same. In general, it is necessary to take into account the scale transformation along the frequency axis of the digital filter.

    In practice, the procedure for synthesizing a CF consists in the fact that in the function K a (R) the analog circuit is replaced by a variable according to the formula (2.145). The resulting system function of the DF turns out to be fractional-rational and therefore makes it possible to directly write down the digital filtering algorithm.

    Self-test questions

      Which filter is called matched.

      What is the impulse response of the filter.

      What is the signal at the output of the matched filter.

      What filters are called digital.

      What is the difference between the algorithms for the operation of the recursive and transversal filters.

      What are the main methods for the synthesis of digital filters? .

      What are the main properties of the discrete Fourier transform.

    Algorithms for analytical graduation, digital filtering using exponential smoothing and moving average methods. Robust, high pass, band pass and notch filters. Discrete differentiation, integration and averaging of measured values.

    A filter is a system or network that selectively changes the shape of a signal (amplitude-frequency or phase-frequency response). The main goals of filtering are improving signal quality (for example, eliminating or reducing interference), extracting information from signals or separating several signals that were previously combined for, for example, efficiently using the available communication channel.

    Digital filter - any filter that processes a digital signal in order to isolate and / or suppress certain frequencies of this signal.

    Unlike a digital filter, an analog filter deals with an analog signal, its properties are non-discrete (continuous), respectively, the transfer function depends on the internal properties of its constituent elements.

    A simplified block diagram of a real-time digital filter with analog input and output is shown in Fig. 8a. The narrowband analog signal is periodically sampled and converted to a set of digital samples, x (n), n = 0.1, The digital processor filters, mapping the input sequence x (n) to the output y (n) according to the computational filter algorithm. The DAC converts the digitally filtered output to analog values, which are then analog filtered to smooth out and remove unwanted high frequency components.

    Rice. 8a. Simplified block diagram of a digital filter

    The operation of digital filters is provided mainly by software, so they turn out to be much more flexible in their application compared to analog ones. With the help of digital filters it is possible to implement such transfer functions that are very difficult to obtain by conventional methods. However, digital filters cannot yet replace analog filters in all situations, so there remains a need for the most popular analog filters.

    In order to understand the essence of digital filtering, first of all, it is necessary to determine the mathematical operations that are carried out on signals in digital filtering (DF). For this it is useful to remember the definition of an analog filter.

    Linear analog filter is a four-port network, in which the linear transformation of the input signal into the output signal is realized. Mathematically, this transformation is described by an ordinary linear differential equation N-th order



    where and are coefficients that are either constants or functions of time t; - filter order.

    Linear discrete filter is a discrete version of an analog linear filter, in which the quantized (sampled) is the independent variable - time (- sampling step). In this case, an integer variable can be considered as "discrete time", and signals as functions of "discrete time" (the so-called lattice functions).

    Mathematically, the function of a linear discrete filter is described by a linear difference equation of the kind

    where and are the readings of the input and output signals, respectively; and - coefficients of the filtering algorithm, which are either constants or functions of "discrete time" n.

    The filtering algorithm (2.2) can be implemented by means of analog or digital technology. In the first case, the readings of the input and output signals by level are not quantized and can take any values ​​in the range of their variation (i.e., have the power of the continuum). In the second case, the samples of signals and are quantized by level, and therefore they can only take "allowed" values ​​determined by the bit depth of digital devices. In addition, the quantized signal samples are encoded, therefore the arithmetic operations performed in expression (2.2) are performed not on the signals themselves, but on their binary codes. Due to the quantization in terms of the signal level and, as well as the coefficients and the equality in algorithm (2.2) cannot be exact and is only approximately fulfilled.

    Thus, a linear digital filter is a digital device that approximately implements the filtering algorithm (2.2).

    The main disadvantage of analog and discrete filters is that when operating conditions change (temperature, pressure, humidity, supply voltages, aging of elements, etc.), their parameters change. This leads to uncontrolled output signal errors, i.e. to low processing accuracy.

    The error of the output signal in the digital filter does not depend on the operating conditions (temperature, pressure, humidity, supply voltages, etc.), but is determined only by the signal quantization step and the algorithm of the filter itself, i.e. internal reasons. This error is controlled, it can be reduced by increasing the number of bits to represent the samples of digital signals. It is this circumstance that determines the main advantages of digital filters over analog and discrete ones (high accuracy of signal processing and stability of the DF characteristics).

    DFs by the type of signal processing algorithm are subdivided into stationary and non-stationary, recursive and non-recursive, linear and nonlinear.

    The main characteristic of the CF is filtering algorithm, according to which the implementation of the CF is carried out. The filtering algorithm describes the operation of CFs of any class without restrictions, while other characteristics have restrictions on the class of CFs, for example, some of them are suitable for describing only stationary linear CFs.

    Rice. 11. Classification of CF

    In fig. 11 shows the classification of digital filters (DF). The classification is based on the functional principle, i.e. Digital filters are subdivided based on the algorithms they implement, and not taking into account any circuitry features.

    DF of frequency selection. This is the most famous, well-studied and tested in practice type of CF. From an algorithmic point of view, frequency selection DFs solve the following problems:

    · Allocation (suppression) of one a priori specified frequency band; depending on which frequencies are suppressed and which are not, a low-pass filter (LPF), a high-pass filter (HPF), a band-pass filter (PF) and a notch filter (RF) are distinguished;

    · Separation of the spectral components of the signal with a line spectrum on separate frequency channels, equal and evenly distributed over the entire frequency range; distinguish between CFs with decimation in time and decimation in frequency; and since the main method of reducing hardware costs is the cascading of lower-selective sets of PFs than the initial one, the multistage pyramidal structure obtained as a result was called a preselector-selector DF;

    · Separation of spectral components of the signal into separate frequency channels, whose spectrum consists of sub-bands of different widths, unevenly distributed within the operating range of the filter.

    A distinction is made between a finite impulse response filter (FIR filter) or an infinite impulse response filter (IIR filter).

    Optimal (quasi-optimal) CFs. This type of filters is used when it is required to evaluate certain physical quantities characterizing the state of a system subject to random disturbances. The current trend is the use of the achievements of the theory of optimal filtering and the implementation of devices that minimize the mean square of the estimation error. They are subdivided into linear and nonlinear, depending on which equations describe the state of the system.

    If the equations of state are linear, then the optimal Kalman CF is applied; if the equations of state of the system are nonlinear, then various multichannel CFs are used, the quality of which improves with an increase in the number of channels.

    There are various special cases when algorithms implemented by optimal (quasi-optimal) CFs can be simplified without significant loss of accuracy: this is, firstly, the case of a linear stationary system leading to the well-known Wiener's CF; secondly, the case of observations only at one fixed time instant, leading to a DF that is optimal according to the criterion of the maximum signal-to-noise ratio (SNR); thirdly, the case of equations of state of the system close to linear leading to nonlinear filters of the first and second order, etc.

    An important problem is also ensuring the insensitivity of all of the above algorithms to the deviation of the statistical characteristics of the system from the predetermined ones; synthesis of such DFs, called robust.

    Adaptive CFs. The essence of adaptive digital filtering is as follows: for processing the input signal (usually adaptive DFs are built with one-channel), a conventional FIR filter is used; however, the IR of this filter does not remain set once and for all, as it was when considering the frequency selection DF; it also does not change according to the a priori given law, as it was when considering the Kalman CF; They are corrected with the arrival of each new sample in such a way as to minimize the root mean square error of filtering at this step. An adaptive algorithm is understood as a recurrent procedure for recalculating the vector of IH samples at the previous step into a vector of “new” IH samples for the next step.

    Heuristic CFs. Situations are possible when the use of mathematically correct processing procedures is impractical, since it leads to unjustifiably large hardware costs. The heuristic approach is (from Greek and lat. Evrica- “looking for”, “discovering”) in the use of knowledge, studying the creative, unconscious thinking of a person. Heuristics are associated with psychology, physiology of higher nervous activity, cybernetics and other sciences. The heuristic approach is "generated" by the desire of developers to reduce hardware costs and have become widespread despite the lack of a rigorous mathematical justification. These are the so-called CFs with the author's circuit solutions, one of the most famous examples is the so-called. median filter.