Digital Filter

What is a digital filter?A digital filter is an algorithm or device composed of a digital multiplier, an adder and a delay unit. The function of the digital filter is to process the digital code of the input discrete signal to achieve the purpose of changing the signal spectrum.Definition of digital

What is a digital filter?

A digital filter is an algorithm or device composed of a digital multiplier, an adder and a delay unit. The function of the digital filter is to process the digital code of the input discrete signal to achieve the purpose of changing the signal spectrum.

Definition of digital filter
Digital filters correspond to analog filters, and we use digital filters in commonly used discrete systems. Its main function is to use the characteristics of the discrete time system, where time is a variable, and then process the external input signal. The input signals here are generally waveform models in a broad sense, and the signals can be voltage, current, power, etc. Of course, there are similar frequency and so on. In actual operation, we can also turn the input signal waveform into an output, that is, invert the input and output. So as to achieve our purpose of modifying the frequency spectrum of the signal.

Digital filter implementation technical means
There are many ways for digital filters to realize signal processing, and we introduce the two most used in practice. One is that our integrated circuit method combines various components of the integrated circuit into a dedicated device. This kind of equipment is called a digital signal processor, and a digital processor similar to an arm architecture or a single-chip microcomputer architecture is one of the commonly used ones. This method has a relatively high commercial value for the demand for complete sets of batches, because the cost of construction is relatively low, and it is welcomed by the market;
The other is to use the x86/x64 commercial or industrial computers we usually use for simulation, which is completely simulated using application software. This approach is also used in laboratories or large digital filtering projects. This method has a higher cost and is not suitable for mass production and matching. But it is the best simulation method in the laboratory, and it has great advantages in high-level simulation and calculation.
 FIR filter matlabComparison of Digital Filters
There are two main types of digital filters, one is IIR, which we call an infinite impulse response filter, and the other is FIR, which corresponds to IIR, and this is a finite impulse response filter device. Both systems have their own characteristics. The FIR filter is a loop signal without closed-loop feedback. Its structure is relatively simple, and it can realize the calculation of the phase of a relatively strict linear equation. In general, if the phase requirements are not strict, this filter will not be used. On the contrary, this filter will be used. Of course, in many scenarios, we need to perform some real-time processing on the signal. When there are more and more signal data on the scene, our requirements for hardware performance are getting higher and higher. Many single-chip microcomputers on the market can no longer meet our actual functional requirements. General 8-bit, 16-bit or even 32-bit microcontrollers and ARM chips can no longer support the algorithm. The efficiency of our filters has been improved due to the advent of DSP controllers specially designed for digital processing. In many cases, DSP can use multiple sets of buses to process multiple sets of real-time data in parallel. The full use of some independent algorithms greatly improves the efficiency of our filters. The short board on the hardware can be completely made up by the DSP chip, so as to realize the real-time processing and calculation of the digital signal. Compared with ordinary microprocessors, DSP has great advantages in digital signal processing. It is the successor of single-chip microcomputer and ARM, and has made some local development and improvement for signal processing, which greatly enhances the ability of digital processing. It has a specific data flow format, a specific algorithm, and a special system structure that provides many superior conditions and foundations for solving complex digital signal processing. The IIR filter can be realized by programming the DSP. FIR filters actually have certain defects. This type of system only has zero points. It will not be as easy to obtain better attenuation characteristics as IIR systems, but it also has more obvious advantages. He is realized through non-hardware circuit. Compared with hardware circuits, there are many main advantages of implementing filters, for example, high efficiency, poles, and feedback.

Features of digital filters
The most common method of IIR digital filter is by means of the design method of analog filter. There are quite mature technologies and methods for analog filter design, complete design formulas, and relatively complete charts that can be queried, so designing digital filters can make full use of these rich resources.
The specific steps for the design of the IIR digital filter are as follows:
(1) Convert the technical index of the given digital filter into the technical index of the analog low-pass filter according to certain rules.
(2) Design an analog low-pass filter G(s) (G(s) is the transfer function of the low-pass filter) according to the converted technical index.
(3) Convert G(s) into H(z) according to certain rules (H(z) is the transfer function of the digital filter). If the designed digital filter is a low-pass, the above process can be completed, if the design is a high-pass, band-pass or band-stop filter, then the following steps are required:
Convert the technical specifications of high-pass, band-pass or band-stop digital filters to low-pass analog filters, then design low-pass G(s), and then convert G(s) to H(z).
The system function of IIR digital filter can be written in the form of closed function.
The IIR digital filter adopts a recursive structure, that is, there is a feedback loop on the structure. The IIR filter operation structure is usually composed of basic operations such as delay, multiplication coefficient and addition, which can be combined into four structural forms: direct type, positive type, cascaded type, and parallel type, all of which have feedback loops. Due to the rounding process in the operation, the errors are continuously accumulated, and sometimes weak parasitic oscillations are generated.
IIR digital filters can be designed with the help of mature analog filter results, such as Butterworth, Chebyshev and elliptic filters, etc., and there are ready-made design data or charts to check. Its design workload is relatively small, and the requirements for computing tools are not high. When designing an IIR digital filter, we first write the formula of the analog filter according to the index, and then convert the formula of the analog filter into the formula of the digital filter through a certain transformation.
The phase characteristics of the IIR digital filter are not easy to control. When the phase requirements are high, a phase calibration network needs to be added.
Designing an IIR filter under MATLAB can use the Butterworth function to design a Butterworth filter. Chebyshev type I filters are designed using the Cheby1 function. Use Cheby2 to design a Chebyshev type II filter, and use the ellipord function to design an elliptic filter. The following mainly introduces the use of the first two functions.
Different from the design of FIR filter, the order of IIR filter design is not specified by the designer, but according to the various filter parameters (cutoff frequency, passband filter pattern, stopband attenuation, etc.) input by the designer. The minimum filter order that satisfies these parameters is designed by software. Designing different types of IIR filters under MATLAB has corresponding functions for order selection.
IIR units respond to infinite pulse trains, FIR units respond to finite pulse trains
The IIR amplitude-frequency characteristic has high accuracy and is not linear phase, so it can be applied to audio signals that are not sensitive to phase information;
The accuracy of FIR amplitude-frequency characteristics is lower than that of iir, but the linear phase, that is, the time difference between signals of different frequency components after passing through the FIR filter remains unchanged. This is good nature.
In addition, the limited unit response is also beneficial to the processing of digital signals, which is convenient for programming, and the time delay for calculation is also small, which is very important for real-time signal processing.

Classification of digital filters

Digital filters can be classified into one-dimensional, two-dimensional or multi-dimensional digital filters according to the dimension of the processed signal. The signal processed by a one-dimensional digital filter is a sequence of univariate functions, such as the sampling value of a time function. The signal processed by a two-dimensional or multi-dimensional digital filter is a sequence of two or more variable functions. For example, a two-dimensional image discrete signal is a sampled value on a plane coordinate.

1D digital filter
Algorithms or devices for processing one-dimensional digital signal sequences. The relationship between the output signal sequence y(n) of a linear and time-invariant one-dimensional digital filter and the input signal sequence x(n) is described by a linear and constant coefficient difference equation: (as shown in Figure 1)
Corresponding Z-domain transfer function Figure 2 where ar and bk are digital filter coefficients, Z[y(n)] and Z[x(n)] are the Z transformations of the output and input signal sequences, respectively. The inverse Z transformation of the transfer function H(z) is called the unit impulse response of a one-dimensional digital filter, that is, h(n)=Z-1【H(z)】. The output signal sequence can also be expressed as a discrete convolution of the input signal sequence x(n) and the unit impulse response h(n) of the digital filter (see Figure 3).
If the unit impulse response h(n) of a digital filter has only a finite number of non-zero values, it is called a finite impulse response digital filter. If the unit impulse response has an infinite number of non-zero values, it is called an infinite impulse response digital filter.
The finite impulse response digital filter generally adopts a non-recursive algorithm structure, so it is also called a non-recursive digital filter. The infinite impulse response digital filter can only adopt a recursive algorithm structure, so it is also called a recursive digital filter.

2D digital filter
Algorithms or devices for processing two-dimensional digital signal sequences. The relationship between the output y(m, n) of the linear and time-invariant two-dimensional digital filter and the input x(m, n) is described by two variable linear constant coefficient difference equations: (as shown in Figure 4).
The corresponding transfer function is shown in Figure 5. In the formula, a b is the filter coefficient, Z [y (m, n)] and Z [x (m, n)]. are the two-dimensional Z-transforms of the output and input signal sequences, respectively. The two-dimensional Z inverse transformation h(m, n)=Z-1 [H(z1, z2] of the transfer function H(z1, z2) is called the unit impulse response of the two-dimensional digital filter.
The output y(m,n) of a two-dimensional digital filter can also be expressed as a two-dimensional discrete convolution of the input signal sequence x(m,n) and the unit impulse response h(m,n) (Figure 6).
Two-dimensional digital filters are also divided into two types of unit impulse responses: finite impulse response and infinite impulse response. The two-dimensional finite impulse response digital filter is a non-recursive algorithm structure, so it is also called a two-dimensional non-recursive digital filter. The two-dimensional infinite impulse response digital filter is a recursive algorithm structure, so it is also called a two-dimensional recursive digital filter.