Научная статья на тему 'Generation of a sequence of ultrasonic signals for measuring liquid flow velocity based on the use of Gold codes'

Generation of a sequence of ultrasonic signals for measuring liquid flow velocity based on the use of Gold codes Текст научной статьи по специальности «Физика»

CC BY
47
12
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
УЛЬТРАЗВУКОВОЙ ДАТЧИК / М-ПОСЛЕДОВАТЕЛЬНОСТЬ / КОДЫ ГОЛДА / ЭФФЕКТ ДОПЛЕРА / ОБРАБОТКА СИГНАЛА / БЫСТРОЕ ПРЕОБРАЗОВАНИЕ ФУРЬЕ / ULTRASONIC SENSOR / M-SEQUENCE / GOLD CODE / DOPPLER EFFECT / SIGNAL PROCESSING / FAST FOURIER TRANSFORM

Аннотация научной статьи по физике, автор научной работы — Chentsov Evgeny P.

In this paper a creation method of a sequences of acoustic signals is provided. These sequences have a very small cross-and auto-correlation for a specific ultrasound sensor. Using acquired results, a new method of measuring liquid flow velocity is proposed, based on the use of ultrasonic signals.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «Generation of a sequence of ultrasonic signals for measuring liquid flow velocity based on the use of Gold codes»

УДК 53.083, 51-74

Generation of a Sequence of Ultrasonic Signals for Measuring Liquid Flow Velocity Based on the Use of Gold Codes

Received 02.07.2013, received in revised form 10.08.2013, accepted 03.09.2013 In this paper a creation method of a sequences of acoustic signals is provided. These sequences have a very small cross- and auto-correlation for a specific ultrasound sensor. Using acquired results, a new method of measuring liquid flow velocity is proposed, based on the use of ultrasonic signals.

Keywords: ultrasonic sensor, M-sequence, Gold code, Doppler effect, signal processing, fast Fourier transform.

High-precision determination of a liquid flow rate is an important task in such areas as gateway construction, renovation and construction of industrial enterprises with a very complex structure. Nowadays there are different ways of finding velocity, but in different cases devices (sensors) can not be placed in measured area because of unsuitable sensor size or inaccessability of needed pipes. Other sensors are small, but they have a very low accuracy. Since the decrease in size is expensive and impossible in some cases, optimization of the sensors is of a great interest to researches. This paper proposes a new approach to the organization of the signals in ultrasonic sensors which measure velocity using Doppler effect. Using Gold codes, which has unique cross-and auto-correlation properties, a specific signal is built. As a result, sensor has small dimensions: it can measure flow velocity with sufficient accuracy.

1. Statement of the problem

Evgeny P. Chentsov*

Institute of mathematics and computer science, Siberian Federal University, Svobodny, 79, Krasnoyarsk, 660041

Russia

An ultrasonic sensor transmits a signal Tx of carrier frequency fT and receives reflected and Doppler shifted signal Rx. The sensor is located on the surface of a liquid flow; this flow has constant velocity. There is a big amount of particles (such as bubbles, etc.) in the flow; these particles are located on the surface and move there with no slip. The problem is to find out the velocity of particles-reflectors in terms of Doppler frequency. The sensor cannot receive any data while transmitting a signal. Therefore Tx must be designed, consisting of a pulse modulated carrier and receiving is possible during transmit pause. Rx is downconverted by multiplying Rx with fT and suppressing of sum frequency by a low pass filter. After downconversion, a downsampling is possible. The frequency shift fR vs fT is calculated using fast Fourier transform. The time shift Rx vs Tx can be calculated by cross correlation of both signals.

The task is to design a sequence of pulse modulated signals, such, that the cross correlation provides good time delay estimate and the fast Fourier transform the Doppler frequency. Also the problem of multiple simultaneous echoes and of partially shadowing of Rx-signals by simultaneous transmission has been investigated.

The task is divided into several modules. All the modules are stated in their implementation: Gold code generation; modeling Rx; signal processing and downsampling; fast Fourier transform calculation; optimization problem solution.

* chencov.evg@gmail.com © Siberian Federal University. All rights reserved

The model can be schematically represented as (Fig. 1):

Fig. 1. Model scheme

2. Gold codes generation

Gold codes have been selected as the basis of pulse modulated signals sequence. Gold codes are the type of pseudorandom binary sequences (they can take only two possible values: "0" and "1", or "-1" and "1"). This type of sequences was chosen for the reason that cross- and autocorrelation of Gold codes are very low. These codes provide a large set of sequences; moreover, using this type of sequences, homogeneous and limited value of cross-correlation function can be acquired. These are the reasons why mentioned codes are suited to the task as well as possible.

Gold codes are generated by the sum modulo two of corresponding elements of two M-sequences, which have the same length [1]. M-sequence is pseudorandom binary sequence that is generated by the shift register with linear feedback and have a maximum period.

Shift register with linear feedback consists of two parts: a shift register and a feedback function. The register consists of bits, its length equals the number of bits. All the bits in the register are shifted to the right for one position when bit is needed to be extracted. The new first bit is determined by function, which is in dependence on other bits.

Mathematically, the function of remaining bits is represented as

h(x) = ao + ai • x + ... + ak • xk + ... + a^ • xN

where a0 = aN = 1; other a4 can take two values: "0" or "1". Such polynomials are usually written as a binary vector h = (h0, h1,..., hN).

M-sequences have the following properties [2]:

1. M-sequences are periodic with period N = 2n — 1.

2. Amount of "1" on the length of one period is one greater than amount of "0".

3. Every combination of characters of length n on the length of one period of the M-sequence (except for the combination of n zeros — it is forbidden) does not occur more than once.

4. The sum modulo two of every M-sequence with its cyclic shift is also an M-sequence.

However, not every sum modulo two of M-sequences creates Gold codes, so the new term "preferred pairs of M-sequences" occurs. These are the couples of sequences with functions of remaining bits that have well-defined form. For every length of Gold codes there are unique preferred pairs. Finding these pairs is not a trivial problem to solve; it takes a lot of computational

resources. One should point out that length of each Gold Code equals the length of folded M-sequences: N = 2n-1. On the basis of constructed algorithm 2n+1 Gold codes can be generated.

In applied problems the resulting sequences are usually transmitted as a series of positive and negative pulses of unit amplitude. It is considered to transmit signal by replacing each "1" of the original sequence to " — 1" and "0" to "1".

Example (Fig. 2) shows that values of autocorrelation function are homogeneous and limited. The emission level for n = 10 is equal or less than 6%.

1023 chip Gold code autocorrelation 100,-■-,-■-,-

100 L--1-1-1-1-J--

0 20 40 SO 30 100 120

shifts

Fig. 2. Autocorrelation of Gold codes with n = 10 Mentioned autocorrelation function here is defined as

N-1

^ ^ xnxn+k , (1)

n=0

where k should be understood as a shift, because for all l 6x(l) = 6x(l + N).

3. Doppler effect

Before creating a model of signal distribution, such term as Doppler effect should be considered [3]. Doppler effect is a change in frequency and wavelength, registered by receiver and caused by the movement of the transmitter and (or) the receiver. At rapprochement frequency increase is detected; at alienation frequency falls. Using Doppler effect, flow velocity can be determined by means of considered sensor.

Velocity detection is divided into three stages. On the first stage we consider the following situation: transmitted signal goes from the sensor in particles direction. Then transmitted signal reflects from the particles and transforms to reflected signal : fR = fT (1 + v/c), where fR is the frequency of reflected signal from particles, fT is the frequency of transmitted signal from sensor, v is an average flow velocity, c is the speed of sound in water. On the second stage particles (from which transmitted signal reflects) are considered to be a transmitter and the sensor is considered to be a receiver. It is worth emphasizing the fact that the direction of the flow has already changed relatively to the current model. Hence

fp c f3 _ fT _ £P_c_

f R =i / = f T

1 — v/c

Third stage. Considering the fact that in the first case particles receive signal and in the

f p

It .

second one they transmit it, the following equality is obtained: fR = fT. Received equations

lead to Doppler frequency shift: fD = fR — fS and fR + ff = 2fR + fD, where fD is the Doppler frequency. The resulting formula is

c/d _ c/d

•S .

t

2 fS + /d 2fS

(2)

v =

4. Modeling the reflected signal

4.1. Signal generation

Let us suppose that time resolution is defined. There is an array of data, consisting of one Gold code. At the moment t = 0 the first element of the array is transmitted by sensor. Voltage transfer, emitted by the sensor is translated into pressure by an analog-to-digital converter.

Each time the element in Gold code contains "1", a defined number of function periods is transmitted. The function has the following view:

Tx(t) = e2nifT(3)

As a result, generated signal has approximately the following view (Fig. 3).

Fig. 3. Form of the generated signal that is distributed in water

4.2. Modeling the signal in water

An ultrasonic signal, moving in the water at speed c, reaches moving particles and reflects from them. The frequency of the signal changes according to the Doppler effect. In should be pointed out that in this case time intervals of each element of the array will shrink (hence, time resolution will shrink, too). However, this fact can be ignored due to insignificancy of this compression. Let us calculate the time at which the begining of the reflected signal returns. To do this, signal movement should be divided into two parts:

First part. Sensor signal is emitted and distributed in water at velocity of c, heading in the direction of the particles. At the initial time all the particles (in the easiest case) are located at a distance of s of the sensor. The signal is moving against the flow with fixed velocity v. Given this together with the fact that mentioned particles move to the sensor with average flow velocity, we find that particles will reach sensor at ti = s/c.

Second part. Signal reflects from particles and moves toward the sensor with velocity v + c. But since particles have been moving in the flow during t1 seconds, the distance between the sensor and the particle has decreased to s' = s — vt1. Hence the time of the signal pass from the particle to the sensor equals

s' s — vti t2 = - = -1.

c + v c + v

Adding up t1 and t2, the following result is obtained:

s s — vti 2sc + v(s — cti) , ,

t = ti + t2 = - + 1 =-( + . 1. (4)

c c + v c(c + v)

Starting from the moment t, sensor transmits and receives signal at the same time. Signal reception is carried out in each timeslice, which is equal to the reciprocal value of sapling rate. If in some timeslice reflected signal reached sensor during transmission, its value is ignored and the corresponding element of the array is written as "0".

During research more difficult situations were considered. For example, a random amount of particles was randomly distributed in water (at random distances from the sensor). Moreover, particles may have different speed and therefore different Doppler shift occurs. This suggestions gave great opportunities to test sensor in different models (dirty or very clear water, case when particles in the middle of a tube move slower than near boundaries, etc.) But for greater understanding the easiest case is considered here.

5. Signal processing

Signal processing is divided into several stages.

First stage. Since reflected signal has reached sensor, it is partially written. But to extract value of Doppler shift it is necessary to mix received signal with initial one. To implement this operation the multiplicative digital mixer is proposed to use. Mentioned mixer multiplies signal Rx by frequency oscillator in each node. Output signal contains both on the initial frequency and frequency of the received (by sensor) signal.

Second stage. After mixer usage, signal has different side components, which are formed by the harmonics of the signal and local oscillator. These noises are to be suppressed using low-pass filter (LP-filter). LP-filter skips the frequency spectrum of a signal below cut-off frequency and suppresses the frequency of the signal above this value. Suppression level depends on filter type and its order. In this research a filter with a finite impulse response or FIR-filter was considered.

The most common form of first-order digital filter is determined by the following difference equation:

p

Vi = bkXi-k — aiyi-i. k=0

The current output of the filter is determined by: a) a linear combination of P preceding values of input; b) the current value of input; c) one output value of the previous output. Such filter is usually called a first-order filter, because new value of the output is determined using only one previous value of an output.

The main advantages of this filter are nonrecursiveness and absolute sustainability. For mentioned FIR-filter ai = 0Vi = 0, and a0 = 1 [4]. Filter may be mathematically represented as

p

Vi = ^2 bkXi-k. (5)

k=0

Figure 4 shows a part of the signal before (and after, respectively) filtering.

Third stage. After filtration signal is downsampled. Downsampling is used to increase processing speed of received signal. One of the most important parameters is downsampling factor, which is responsible for multiplicity reduction of signal quantums.

Obviously, there is a high possibility of aliasing after downsampling the signal [5]. Aliasing is an effect that leads to imposition and indistinguishability of various continuous signals at their discretisation. Therefore, if downsampling factor is large and filter has a very low order, a

Fig. 4. Mixed and filtered (using FIR-filter) signal

situation can happen when high frequency components will overlap low frequency components. As a result, the signal will be totally distorted. The main postulate which insures aliasing absence is the Nyquist-Shannon theorem. It establishes necessary conditions that exclude the emergence of aliasing.

Theorem 5.1 (Nyqist-Shannon sampling theorem (Kotelnikov form)). Every continuous signal s(t) with bounded spectrum can be precisely recovered (interpolated) on sampled at s(k A t), taken

at intervals of At = -f, where F is an upper frequency spectrum of the signal.

The final stage of signal processing is fast Fourier transform [6,7]. Fast Fourier transform is an economic version of discrete Fourier transform, which transforms a discrete time function x(t) to frequency function X(f) by the following relation:

N-1

Xk =£ xne-^

(6)

where Xk is a signal frequency, xn is time and N is an amount of signal values, measured over the period. Discrete Fourier transform is performed in O(n2) operations; complexity of fast Fourier transform is a lot less — it is equivalent to O(N(p1...pn)) for N = p1 ■ ... ■ pn. In particular, if N = 2n, only O(N ■ log2(N)) operations are needed.

0

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

n

6. Example: numerical implementation, calculation results, analysis

An example whether Gold codes can be used to solve initial problem is considered. Let us suppose there is an ultrasonic sensor and the following parameters are given: fT = 1 to 10 MHz carrier frequency; Rx — digital signal with sampling frequency fR = 10 MHz; Doppler shift fT — fR = 0.3-8 KHz; Single pulse duration is 2-6 carrier cycles (2-6 us); Time shift Rx vs Tx is 0-10 ms; Duration of pulse train is 2-4 ms.

Given initial data are approximate and are not related to actual ultrasonic sensor.

To test the hypothesis of possible use of Gold codes as the basis of sequence of pulse modulated signals, a program in MATLAB was created. This program consists of the following modules:

Gold codes (of 255, 511, 1023 and 2047 elements length) generation; signal distribution simulation in water flow with constant average velocity (given the fact that the flow has no-uniform velocity in cross section); signal processing (mixing, filtering and downsampling); Doppler shift determination using fast Fourier transform.

Implemented model has different parameters: pulse width, downsampling factor, time grid resolution, length of Gold codes, carrier frequency. Thus, the task was not only to develop sequence of pulse modulated signals but to select optimal values for these parameters; hence, Doppler shift can be found precisely.

The following fact was experimentally found during research: the frequency of simulated signal can be reduced from 10 MHz to 20-40 KHz and aliasing does not occur.

Before running optimization the test was carried out with average simulation parameters (pulse with = 4 ms, downsampling factor is 250, time grid step is 0.5e-8 seconds, Gold code length is 1023 elements). Also it has been suggested that there is only one particle in water and it moves with no slip in water flow. Given different speeds (from 0.5 to 6 m/s), average error of calculation of the Doppler shift is 4.5%.

To find optimal parameters, optimization was held using cluster with CPUs. It was also suggested that there is only one particle that moves with no slip in water flow. As a result, the program has calculated the following values: single pulse duration equals 4 • 10-6 seconds; time grid step equals 1 • 10-7 seconds; length of Gold codes — 1023 elements (m = 10); downsampling factor equals 290.

The calculation error of the Doppler effect (in simulation with different speeds) on the average is 4%. For velocities above 1 m/s error do not exceed 2%.

Fig. 5 show the resulting graph with mean velocity v = 5 m/s. in this case, the exact value of Doppler shift is fd = 6, 6667 Hz, and the calculated value is fd = 6618 Hz (Error approximately equals 0.8%).

Frequency, Hz xio"

Fig. 5. Program results with mean velocity at v = 5 m/s

Error dynamics in dependence on velocity (using optimal parameters) is shown on Fig. 6.

But in real case a very big (or a very small) amount of particles may be located in water flow. Moreover, flow velocity is a difficult term due to turbulence: almost all the particles (hence, the corresponding part of the flow) have their own speed. Another simulation was held for 2, 10 and 100 particles in water flow with deviation up to 10%. Fig. 7 shows mean error with velocity deviation up to 5% (velocity of each particle is randomly (normal distribution) chosen).

The results show that the more particles are, the better result is. It can be explained in the following way: if, for example, there are only 2 particles, the possibility of amplitude damp is high. With the increasing number of particles this possibility rapidly falls down to zero. In author's opinion, 5-10 particles in the flow is enough to get needed results.

It is essential that program results are in a strict dependence of a deviation parameter.For fixed velocity mean error is about 1-4%, while for velocity deviation up to 20% mean error is

Velocity,

Fig. 6. Error graph in dependence of mean velocities

Velocity, m/s

Fig. 7. Mean error for velocities deviation up to 5%

above 8-10%. For small velocities error rapidly grows, which is essential, too (for very small velocity values problem is hidden in fast Fourier transform): absolute error holds approximately at the same level, while Doppler frequency falls down. Hence, relative error grows up.

Acknowledgments: the author is grateful to Prof. Vladimir M.Sadovskii (ICM SB RAS, Krasnoyarsk, Russia) and Prof. Wolfgang Schroer (Hochschule Ulm, Germany) for provided assistance.

This paper is supported by The Russian Foundation of Basic Researches (grant 11-01-00053) and Deutscher Akademischer Austausch Dienst (Euler Project).

References

[1] V.V.Losev, E.B.Brodskaya, Search and decoding of complex digital signals, Moscow, Radio i Svyaz, 1988, 93-97 (in Russian)

[2] Rodriguez Henriquez, Cruz Cortes, J.M.Rocha-Perez, F.Amaro Sanchez, Generation of Gold-sequences with application to spread spectrum systems [electronic sourse], USA, Institute of Electrical and Electronics Engineers.

[3] G.W.Stimson, Introduction to Airborne Radar, USA, Mendham, SciTech Publishing Inc, 1998, 189-199.

[4] P.Horowitz, W.Hill, The Art Of Electronics, 2nd edition, Cambridge, Press Syndicate of the University of Cambridge, 1989, 1037-1038.

[5] D.E.Dudgeon, R.M.Mersereau, Multidimensional Digital Signal Processing, Moscow, Mir, 1988, 142-187 (in Russian).

[6] D.S.Evans, G.R.Jessop, VHF/UHF Manual - 3rd edition, London, Radio Society of Great Britain, 1976.

[7] R.K.Otnes, Loren Enochson, Applied time series analysis. Vol. 1 Basic techniques, New York, Wiley, 1978.

Генерация последовательности ультразвуковых сигналов для измерения скорости потока жидкости с помощью кодов Голда

Евгений П. Ченцов

В статье представлен способ создания последовательности акустических сигналов, имеющей малую кросс- и автокорреляцию, для специального ультразвукового датчика.

Ключевые слова: ультразвуковой датчик, М-последовательность, коды Голда, эффект Доплера, обработка сигнала, быстрое преобразование Фурье.

i Надоели баннеры? Вы всегда можете отключить рекламу.