• Search in book...
• Toggle Font Controls

# SIGNAL PROCESSING IN QUASI-DIGITAL SMART SENSORS

Digital signal-processing techniques are being used in a wide range of industrial and consumer products due to their accuracy and repeatability. According to Texas Instruments digital signal processing is defined as ‘The science concerned with representation of signals by sequences of numbers and the subsequent processing of these number sequences’ [131]. Processing involves either extracting certain parameters from a signal or transforming it into a form that is more applicable. The digital implementation of signal processing has several distinct advantages:

• It is possible to accomplish many tasks inexpensively that would be either difficult or impossible in the analog domain, for example, Fourier transforms.
• Digital systems are insensitive to environmental changes and component tolerances and ensure predictability and repeatability.
• Reprogrammability features.

Most signal-processing algorithms for quasi-digital smart sensors involve a multiply, divide and an add (subtract) operation which can be written in its general form as Equation (5.26). Before the appearance of embedded microcontrollers and DSP processors, these operations were realized in the quasi-digital domain with frequency–pulse signals. Because a smart sensor uses a microcontroller or a DSP microprocessor in its architecture, it is expedient to perform these operations in the digital domain. However, sometimes in time-critical applications as well as in automatic control, pulse-frequency systems mathematical transformations with pulse-frequency signals are still used. We shall consider some basic transformations peculiar to the frequency-(period)-to-code conversion as well as to signal processing, used for sensor accuracy improvement (quantization error reduction) and to increase sensor noise stability.

## 6.1 Main Operations in Signal Processing

Often in frequency signal processing it is necessary to subtract one frequency from another or to add two or more frequencies. As the initial information is coming into the adder as continuous sequences of pulses with the frequency Fi(t), proportional to instant values xi(t), the summation will be reduced to a new sequence of pulses with the frequency F(t) formed according to the following equation:

where F1(t) = kx1(t), F2(t) = kx2(t) is the initial information in a pulse-frequency form; k is the constant coefficient. In its turn, subtraction is reduced to the sequence of pulses with the frequency F(t) formed according to the equation:

From the two initial equations for frequency determination according to the method of the dependent count, the following equations of algorithmic transformations and determination of the absolute sum of two frequencies are constructed

the absolute sum of two periods

Similar equations can be obtained for the determination of an absolute and relative difference of two frequencies (periods), which will differ only in the minus sign in equations (6.3) and (6.4). Besides, knowing the quantization time Tq it is possible to determine the rate of a change in time of absolute and relative sums and differences of periods and frequencies.

Frequency adders and subtraction devices are used as components in complex devices such as frequency multipliers with a positive and negative feedback [132].

### 6.1.2 Multiplication and division

In frequency measurements, frequency multipliers play the same role as amplifiers of electric signals in amplitude measurements: they increase the sensitivity of measuring devices and extend measuring ranges for smaller values. They are able to improve frequency-to-code converters simultaneously in several directions. First, at a given speed they allow reduction of the quantization error. Second, by a given quantization error it is possible to reduce the time of measurement and, hence, to use the measuring device to control many slowly varied parameters or to reduce dynamic errors by the measurement of one quickly varied parameter. Finally, frequency multipliers can be used for frequency signal unification, allowing the same measuring device to be used with sensors of different output frequencies. Let us consider this in detail.

Despite the fact that frequency multipliers are well known and have been applied in radio engineering and metrology (by phase and time measurements) for a long time, the appearance of frequency-measuring techniques with rather specific requirements to multipliers has resulted not only in the creation of new multipliers, but also in a new understanding of the multiplication itself [4].

The frequency multiplication is a conversion of the input electric oscillation with the frequency fxi into the output oscillation with the average frequency:

where km is the multiplication factor, representing an exact integer number (or in some cases an improper fraction). Thus, the average frequency of a signal is an average crossing by this signal at a certain level (for example, zero) into one side during a time unit. This definition differs from that used in radio engineering and reflects the specificity of frequency-digital devices. Hereby, the multiplication can be reduced to the frequency scaling. This can be realized with the help of widespread frequency dividers and multipliers controlled by the code equivalent of the scale factor km. Among a similar class of devices, it is necessary to mark down the so-called binary frequency multipliers as more perspective. A fractional scale multiplier is its main advantage.

The working range of a multiplier, or a band is characterized by the relation of the maximum frequency to the minimum:

and also its binary logarithm log2 D (the range in octaves) or the decimal logarithm lgD (the range in decades). For input frequencies outside the working range of a multiplier, lgD does not change the multiplication factor.

A preliminary frequency multiplication is an effective means of increasing the conversion time for low and infralow frequencies. The output frequency of a multiplier exceeds its input frequency km times. Then this multiplied frequency will be converted into a code. Hereupon, by a given quantization error the quantization time Tq can be reduced in km times, which increases the number of slowly varying parameters that can be measured with the help of one multichannel data acquisition system. By measuring one quickly varying parameter the dynamic error by the given quantization error will be decreased times. Frequency multipliers, using a given quantization time Tq, allow reduction of the quantization error km times.

Frequency multipliers unify output signals of frequency sensors and transducers. This is especially important when a variety of sensors are used in a data acquisition system. Thus, it is desirable, that the output frequencies of all, or even parts of, sensors are multiplied by one frequency multiplier. Therefore, the multiplication factor should be able to change over a wide range without the loss of speed. Frequency multipliers can also carry out different functional transformations of the input frequency, thus they may be used for the non-linearity correction of sensor characteristics. At km < 1 we have a frequency divider.

The main aspects of frequency multipliers are the multiplication factor, the speed and the frequency range. Frequency multipliers used in frequency-to-code converters, should provide first of all a greater multiplication factor, high speed and a wide working frequency range. These requirements are inconsistent. Really, the increase of km is accompanied usually by a narrowing of the frequency range, in its turn, the extension of a frequency range controls the speed reduction.

Alongside these three basic requirements for frequency multipliers, there are additional requirements. First of all, functional transformations of the input frequency, etc.

Frequency multipliers with the pulse form of the input and output signal have received the greatest distribution [95]. If the form of the input signal differs, additional forming should be carried out. However, because of noise interferences during pulse forming, the multiplied period is extracted from the input voltage of the sine wave form with some error. The value of this error determines the achievable value of the multiplication factor km.

If the sensor signal has a sawtooth form, then counting pulses are formed at some set levels by the input voltage. The constant slope of the sawtooth voltage and the constant actuation level make the multiplier unsuitable for work in a wide frequency range because the pulses' arrangement in time becomes non-uniform by the frequency deviation from the nominal value due to changes of the sawtooth voltage amplitude. Besides, it is possible to lose part of output pulses in a high frequency range.

Using a symmetric triangular form of the input signal, the multiplication is realized by the repeated full-wave rectification. The dc component is subtracted from the input signals, then the full-wave rectification is carried out. After that, we will have the triangular voltage but with double the frequency. The dc component is subtracted again from this signal and full-wave rectification is realized and so on. Such a multiplier does not require any reactive elements and theoretically can have any large multiplication factor in any frequency range by the constant amplitude of the input signal.

If the form of the input signal differs from the symmetric triangular form it is necessary to form preliminary a signal of multiplied frequencies.

For the sine wave form of the input signal, multiplication with spatial coding with the help of the non-linear signal transformation (for example the squaring or cube involution) is most frequently used:

The dc component due to the squaring, is eliminated by the appropriate bias. The ac frequency component after the cube involution is eliminated by the subtraction of a certain part of the input signal. Multipliers of this type also suppose the cascade connection of any number of cascades by the not limited frequency range.

Frequency multipliers by the rectangular form of input pulses can be realized most simply. Original structures of such multipliers are described in [133].

### 6.1.3 Frequency signal unification

Let us consider an example of the multiplier application for frequency signal unification. The large variety of frequency output sensors allows the measurement of various physical and chemical quantities. Depending on the measurand and sensor type the output frequency can vary for a wide range: from fractions of Hz up to several MHz. In multichannel data acquisition systems, with various frequency output sensors, the wide range of input frequencies complicates the use of unified devices which are intended, as a rule, for the input unified frequency signal 4–8 kHz or the standard interface signal 2–22 kHz.

In this case, it is expedient to use devices for preliminary unification of the frequency signal, which play the same role as scaling amplifiers in voltage or current measurements.

The frequency matching device can be constructed on the basis of a digital frequency multiplier, conventional to modern requirements of high accuracy, speed, reliability and stability for a wide range of frequencies. Their multiplication factors can be chosen automatically depending on the ratio between input and unified frequencies.

The circuit of a multirange frequency matching device providing the reduction of a low-frequency range (4–8 kHz) working with a 58-channel multiplexer of frequency signals is shown in Figure 6.1 (Patent No. 798 831, 847 505 (USSR)), [96].

The transformation of the low frequency to this range is carried out by multiplication of a certain factor km = 2m, which is set up automatically. For this aim, the period of the input signal is measured in view of the automatic choice of the optimum measuring range, and then the received number is used for forming the output frequency.

The device works in the following way. Each pulse of the input frequency starts the univibrator, developing the short duration pulse. The counter CT1 and the frequency divider are reset by this pulse to the state ‘0’, and the shift register is set ‘1’. Pulses of the highest clock frequency f0 come into the counter through the logical circuit AND-OR. After the limiting number Nmax enters the counter, the output pulse of the multiplexer writes down the number Nmax/2 into the counter. The same pulse enters the clock input of the shift register and shifts the ‘1’ in the register into the single place. The frequency of pulses coming into the counter is decreased two times. The repeated toggle of the logic circuit results in the writing of the number Nmax/2 in the counter and in decreasing clock frequency.

Such a process continues up to the next pulse of the input frequency, which starts the univibrator. The number NTx, written at this moment into the counter and proportional to the period duration, is rewritten into the third register by the wavefront of the univibrator's pulse. The number of the chosen range, fixed in the shift register, is rewritten into the second register. Then the counter CT1 and the frequency divider are reset to ‘0’, and the shift register to ‘1’ and the quantization of a new period of the input frequency begins again.

Figure 6.1 Frequency matching device

The number NTx stored in the third register, through switches, is written in the decrement counter and the trigger T1. Pulses of the clock frequency, coming into the decrement counter from the generator G, reduce the number written in the counter. When this number becomes equal to zero, the circuit AND toggles. Its output signal sets up the trigger T2 to ‘0’. Hereupon, switches are opened and the number NTx is written in the decrement counter CT2 again. After half a period of the clock frequency the trigger T2 is toggled to ‘1’.

The subtraction of clock frequency pulses from the number NTx repeats. The frequency of pulses from the trigger T2 is divided by two with the help of the trigger T3 in order to provide the off-duty factor of multiplied pulses, equal to two.

The decrement counter CT2 has one bit less than the third register. The whole part of the number NTx/2 is written in it through switches. The trigger T1 is intended for registration of the least significant digit of the number NTx. The switch for its toggle to ‘0’ opens the trigger T3 only once per two switchings of other switches. If the least significant digit of the number NTx is ‘1’, the trigger T1 is toggled into ‘0’, forming the forbidding signal on (J–K) inputs of the decrement counter. Thus, the first clock frequency pulse after that will not change the condition of the decrement counter but will only toggle the trigger T1 to ‘1’. After that, the forbidden potential from (J–K) inputs of the counter is removed and the pulse subtraction will continue.

Let us determine the output frequency of the matching device. The number, which is fixed in the third register, equals

where m is the number of the frequency range.

The duration of two neighbouring cycles between switches toggle is determined in the following way:

where T0 is the period of the clock frequency.

The period of the output frequency Tx equals Ti + Ti+1, and the output frequency considered with Equation (6.7) is

It is expedient to estimate the error of a frequency-matching device by the instability of the period of the reference frequency, when the maximum value does not exceed one period of the clock frequency. Hence, in order to increase the accuracy, it is necessary to choose a high value of the clock frequency. If the limiting frequency of the electronic components functioning fmax is accepted as such a frequency, then at the minimum period Tx min, the maximum value of the relative error will be equal to

The counter CT1 and the third register should have the number of bits determined by the following equation:

For example, at fmax = 10 MHz and a unified frequency signal in the 4–8 kHz range, the maximum relative error for a frequency-matching device does not exceed 0.05%. The transition time for the output frequency is one period of the input frequency. The dependence of the multiplication factor on the input frequency is shown in Table 6.1.

The use of the trigger T1 and the decrement counter CT2 allows for the minimum possible error, thus providing the duty-off factor of output pulses equal to two.

The number of the range m of frequencies fx in the described device is in the second register, and such information is absent from the output frequency signal.

In some cases, the number of the range m can be transferred by the duty-off factor or pulse duration. For this aim, it is necessary to rebuild the unit for forming output pulses. Other parts of a frequency-matching device remain the same.

### 6.1.4 Derivation and integration

Differentiation and integration are frequently used in an automatic control system. Differentiation is one of the most difficult operations. In general, it can be presented in the following way:

where F1(t) = kx(t) is the input pulse frequency signal; dF1(t)/dt is the first derivation from F1(t).

Table 6.1 Dependence of multiplication factor on input frequency

In an ideal case, the equation for a derivative of some function of time can be written as the following ratio:

However, with continuous information, represented in the pulse-frequency form, tending Δt to zero, strictly speaking, loses a physical sense, from the moment when Δt becomes equal to 1/F1(t). Hence, in this case it is possible to speak about tending Δt not to zero, but to some fixed small value Δτ, much smaller in comparison with the period Tx. Instead of the infinitely small quantity dF1(t), it is possible to use the small, but final increment ΔF1(t), i.e. in this case, the following ratio will be valid:

Thus, for the pulse frequency signal it is possible to speak only about approximate differentiation of time functions. Thus, the accuracy of differentiation will be higher, if the following inequality is more strictly carried out:

Many measuring tasks, connected with the determination of fluid or gas flows, for example, can be reduced to the integration of some continuous signal. The integration for a pulse frequency signal is reduced to pulse counting with the help of usual or bidirectional counters. The realization of the so-called virtual counters inside a functional-logic architecture of a microcontroller enables such counters to have a large capacity, i.e. the feasible time of integration will be limited in this case only by the internal memory size of a microcontroller. The number of pulses, integrated by the counter, can be expressed by the following dependence:

## 6.2 Weight Functions, Reducing Quantization Error

Averaging windows allow the error reduction of the average value determination of some signal on its realization, which is limited in time. Averaging windows are weight functions of the finite (duration) impulse response (FIR) low frequency filter with the bandwidth, tending to zero.

The task, which is solved by frequency-to-code converters, can be considered as the dc component determination for some signal containing undesirable pulsations. The counter included in such a converter, counts the number of input pulses during the time Ti (gate time). If the frequency of input pulses is equal to fx, the number M equal to the product fxTi, rounded up to the nearest integer value, will be accumulated in the counter. The frequency measurement is shown in Figure 6.2(a). It can be considered as the dc component (average value) determination for pulse sequences with the help of the Π-shaped weight function, or with the help of averaging Dirichlet windows [134].

Figure 6.2 Quantization error determination for frequency-to-code converter with Π-shaped (a) and graded-triangular (b) weight function

Let's consider, that pulses, entering the frequency-to-code converter's counter, have much smaller duration than the period, i.e. can be approximately considered as δ-pulses:

where Tx = 1/fx is the period of δ-pulses. These pulses enter the counter during a time limited by the moments t0 and t0 + Ti. Then the result of the measurement can be found according to the following formula

Let's present a sequence of δ-pulses (Equation 6.19) as the inverse Fourier transform:

Substituting Equation (6.21) for (6.20), after simple transformation:

From the received ratio, the measurement result contains the desirable information fxTi and the error caused by harmonics with frequencies kfx in the input signal (Equation 6.21). This error of frequency-to-code converters is known as a quantization error. In reality, during the pulse count the integer number can be received, so the product fxTi is rounded to the nearest smaller or greater integer number. In the example in Figure 6.2(a), the product fxTi is equal to 16.7. According to this, 16 pulses (the absolute quantization error is −0.7) or 17 pulses (the quantization error is +0.3) will enter the counter. Solid and dashed lines showing the Π-shaped weight function in Figure 6.2(a) correspond to these two cases accordingly.

The quantization error is caused by presence of the time interval α0 and α1 in Figure 6.2(a) between the wavefront of the Π-shaped weight function and the nearest next pulse of the sequence φx(t) and between the wavetail of the weight function and the nearest next pulse. We shall consider how the quantization error is connected to the values α0 and α1. The frequency-to-code conversion in this case can be presented as the determination of a number of periods Tx, during the time Ti. The number M in the counter is the number of pulses with delimiting periods Tx in the time interval Ti. It is one more than the integer number of periods Tx in the interval Ti. It is obvious, that this time interval equals

As only the value TxM is taken into account, the absolute quantization error will be equal to

Generally, α0 and α1 represent the independent random variables distributed according to the uniform distribution law with mean equal to Tx/2 and dispersion equal to /12. The mean of the quantization error δ = α0α1 is equal to zero, and the dispersion is equal to /6. The relative mean-root square quantization error for frequency-to-code converters with the Π-shaped weight function can be determined according to the following equation:

The averaging Dirichlet window (the Π-shaped weight function) is not the best averaging window. In this case, we are dealing with the signal containing a certain set of higher harmonics. Here, the criterion for windows estimation (the greatest amplitude of the amplitude–frequency characteristic lobe) is impossible to use when the window is intended for the reduction of the mean-root square quantization error of frequency-to-code converters.

Weight factors of the optimum graded window reducing the relative mean-root square quantization error, are determined by the ratio:

In particular, at N = 8 we have a0 = a7 = 8; a1 = a6 = 14; a2 = a7 = 18; a3 = a4 = 20 (Figure 6.3(a)).

Figure 6.3 Weight functions reducing the quantization error: optimal (a), triangular with even (b) and odd (c) step number, trapezoidal (d)

The absolute quantization error in the case the graded weight function can be calculated according to the equation (Figure 6.2(b)):

The mean-root square error will be equal to:

The number of pulses, which have been counted by the counter of the converter, can be calculated according to:

Thus, the relative mean-root square quantization error will be equal to:

The ratio of the error to the error , received in the case of the Π-shaped weight function is represented as:

For the optimum weight function described by Equation (6.26), it is possible to obtain the following:

As can be seen, the optimum weight function reduces the relative mean-root square quantization error and this reduction increases with the growth of N of the weight function.

The graded-triangular weight function (Figure 6.3(b) and (c)), is close to optimum. For this weight function by the even number N

and by the odd N

By the use of these weight functions in frequency-to-code converters the ratio of the mean-root square quantization error to the mean-root square error of a converter with the Π-shaped weight function will be equal (by the odd and even number of steps N accordingly):

The trapezoidal weight function provides slightly better results than the triangular weight function. It represents the triangular weight function calculated according to Equations (6.34) or (6.35), but with a cut-off point (Figure 6.3(d)). The analysis shows that the best result is reached when the ratio of the base of trapezoid to the top is approximately equal to three (N/N0 ≈ 3).

According to Equation (6.33) at N 1 and by transition from the Π-shaped to the optimum weight function the relative mean-root square quantization error is reduced Vopt times:

The same ratio

for triangular weight functions can be calculated on the basis of Equations (6.36) and (6.37):

For the trapezoidal weight function at N/N0 ≈ 3 and N 1 it is possible to calculate the ratio:

Thus, in all considered cases, the more steps N that the weight function contains the less the quantization error will be. Thus, triangular and trapezoidal weight functions give the quantization error, only in and in times more, than the optimal weight function. Taking into account that triangular and trapezoidal weight functions can be realized (by hardware or software) a slightly easier than the optimum weight function, we can arrive at the conclusion that these weight functions are expedient for quantization error reduction in frequency-to-code converters.

In the classical direct counting method for frequency-to-code conversion, the conversion time Ti is casually located in relation to pulses, with frequency fx measured (Figure 6.2(a)). However, sometimes the wavefront of the time interval Ti is synchronized with one of the specified pulses. In this case, there is no need to reproduce the weight function as a whole. It is enough to reproduce only the second half of the triangular, trapezoidal or optimum weight function.

In this section, we have considered weight functions which reduce the quantization error in frequency-to-code converters. The weight method of averaging frequency (period) conversion results is also useful, when the transformation is carried out in the low and infralow frequency range and under the influence of industrial noises.

The quantization error reduction can be reached also by using weight functions in period, phase shift converters as well as in integrating analog-to-digital converters with a pulse-frequency or time-pulse intermediate conversion. Therefore, using the weight function in the phase-shift-to-code converter, the limiting absolute error for Dirichlet window averaging is 3.6°, and for the triangular weight function −0.1°, for a frequency of 50.5 Hz and conversion time 1 s. Modern DSP microprocessors allow the use of more complex weight functions, for example, synthesized with trigonometrical components.

## Summary

Signal processing from the quasi-digital smart sensor point of view can be performed in a frequency-time domain using pulse-frequency signals as well as in a digital domain after frequency (period)-to-code conversion.

The use of optimum weight functions (for example, triangular) as advanced signal processing increases the accuracy of smart sensors (by reducing the quantization error) and increases the noise stability.

• No Comment
..................Content has been hidden....................