Decoding of Barker-coded incoherent scatter measurements by means ofmathematical inversion

The standard analysis of Barker-coded incoherent scatter experiments is based on a matched filter with an im- pulse response which is a mirror image of the code itself. The method produces small sidelobes which cause contamination from regions outside the nominal range gate. A correspond- ing effect is also encountered in the lag direction, where indi- vidual lag estimates are biased by the variation of the plasma autocorrelation function around the nominal lag value. The present paper introduces a new method of analysing Barker- coded experiments by means of stochastic inversion. Since it does not apply a decoding filter, it does not suffer from drawbacks caused by the sidelobes of the range ambiguity function. The method combines the profile of each full lag and a number of surrounding fractional lags into a single in- version problem. Error analysis also indicates that the statis- tical accuracy given by inversion is better than that obtained by means of standard decoding. Furthermore, the inversion method gives a possibility to reduce the bias due to the vari- ation of the autocorrelation around the nominal lag. In this paper the method is described and applied to data obtained by means of the EISCAT Svalbard radar. In addition, it is shown that mathematical inversion can be used instead of the the conventional height integration. Important parameters in measuring the ACF are its range and lag resolution. The range resolution determines the di- mensions of the smallest details which can be resolved in the ionosphere. Due to the varying scale height of the iono- sphere, the required range resolution is different at different heights. For example, the range resolution in the E-region should be a couple of kilometres or better, while a resolution of 10 20 km is sufficient in the F-region. The lag resolution is determined by the need to sample the ACF densely enough so that the plasma parameters can be obtained from its shape. The ACF is shorter in the F-region than in E-region, so that a more dense sampling is needed in the F-region. In addition to the sampling interval, a sufficient number of lags must also be determined. Different types of transmitter modulations are used in in- coherent scatter experiments in order to meet these require- ments. Typical modulations are single pulses, multipulses (Farley, 1969, 1972), random codes (Sulzer, 1986) and alter- nating codes (Lehtinen and H¨ ¨


Introduction
The task of the incoherent scatter radar is to measure the range profile of the plasma autocorrelation function (ACF henceforth) in the ionosphere. Physical parameters of the ionosphere, such as electron density, electron and ion temperatures, composition, collision frequency and line of sight plasma velocity, are obtained by fitting the theoretical ACF to the measured one (for the incoherent scatter theory, see, e.g. Dougherty and Farley, 1960;Hagfors, 1961).
Correspondence to: B. Damtie (dbaylie@koivu.oulu.fi) Important parameters in measuring the ACF are its range and lag resolution. The range resolution determines the dimensions of the smallest details which can be resolved in the ionosphere. Due to the varying scale height of the ionosphere, the required range resolution is different at different heights. For example, the range resolution in the E-region should be a couple of kilometres or better, while a resolution of 10 − 20 km is sufficient in the F-region. The lag resolution is determined by the need to sample the ACF densely enough so that the plasma parameters can be obtained from its shape. The ACF is shorter in the F-region than in E-region, so that a more dense sampling is needed in the F-region. In addition to the sampling interval, a sufficient number of lags must also be determined.
Different types of transmitter modulations are used in incoherent scatter experiments in order to meet these requirements. Typical modulations are single pulses, multipulses (Farley, 1969(Farley, , 1972, random codes (Sulzer, 1986) and alternating codes (Lehtinen and Häggström, 1987;Sulzer, 1989Sulzer, , 1993. A standard way of obtaining range resolutions of a few hundreds of metres is Barker coding (Barker, 1953). This has been applied to single pulses to obtain power profiles of high range resolution (Ioannidis and Farley, 1972), to multipulses to obtain all lags of the ACF with the same high resolution (Turunen et al., 1985;Huuskonen et al., 1986;Turunen et al., 1988) and later to alternating codes (Wannberg, 1993).
The standard way of analysing Barker-coded incoherent scatter measurements is decoding the data in the amplitude domain. This is made by means of a decoding filter which is usually called a matched filter. The impulse response of the matched filter is simply the mirror image of the transmitted Barker code. As a result of decoding, the range resolution is improved so that it will be determined by the bit length rather than by the pulse length. This is best understood in terms of the range ambiguity functions. A complete presentation of incoherent scatter ambiguity functions is given, for example, by Lehtinen (1986) and Lehtinen and Huuskonen (1996). The range ambiguity function of a Barker code contains a narrow centre peak and a set of sidelobes. Contribution from the sidelobes is not necessarily small, if the applied Barker code is short. For the 5-bit Barker code, for instance, the total area of the sidelobes is 16% of that of the main lobe. This means that the measurement can be contaminated by a signal from the sidelobes. Although the corresponding fraction for the 13-bit code is only 7.1%, it is still possible that a signal from an intense sporadic-E lying within a sidelobe distorts the ACF measurement. In lag direction the sampling of the ACF is determined by the lag ambiguity function. In the case of a Barker code it has sidelobes as well, but they are less serious, since the plasma ACF is a smoothly behaving function of lag.
Techniques for suppressing the range sidelobes of Barker codes have been described by several authors (e.g. Key et al., 1959;Rihaczek and Golden, 1971;Mudukutore et al., 1998; see also the textbook by Blinchikoff and Zverev, 1987). Decoding Barker coded incoherent scatter measurements without sidelobes can be made using an infinitely long filter. This was suggested by Sulzer (1989), who also pointed out that this process decreases the signal-to-noise ratio (SNR). A practical formulation of the method in terms of Fourier transforms was presented by Lehtinen et al. (2002).
This paper presents a different analysis method for Barkercoded incoherent scatter experiments which applies no decoding filter. The idea is to formulate the incoherent scatter radar measurement as an inversion problem. The solution is then obtained by applying Bayesian stochastic inversion.

Incoherent scatter measurement as an inversion problem
We limit ourselves to the monostatic case. Rewriting Eq. (16) by Lehtinen and Huuskonen (1996), the ACF of the baseband scattering signal z(t) is Here, t and t are two times of observation, R is the receiver input impedance, r is a radius vector with its origin at the transmitter, P 0 is scattering power from a single electron (illuminated by a continuous monochromatic transmission), σ e is the plasma ACF, W tt is the two-dimensional ambiguity function, τ is the lag variable, and S(r) = 2r/c is the signal flight time from the transmitter to the scattering point at r and back.
The two-dimensional ambiguity function is non-zero within some region around the lag value t − t. The weighted mean value of the plasma ACF within this region is is the range ambiguity function for a lag t − t. The range ambiguity function depends on the receiver impulse response p and the modulation envelope according to the formula where convolution is indicated by the asterisk. Here, we have assumed that both p and are real-valued functions of time. By means of Eq.
(2), Eq. (1) can be written as In this presentation P 0 contains the range dependence of the signal power, as well as the directional dependence of the antenna gain. If the plasma ACF is constant within each cross section of the radar beam, Eq. (5) can be integrated in spherical coordinates over the angle variables. Since P 0 (r) ∝ 1/r 2 , the result is where C 0 is a constant. Here, the range ambiguity function is presented as a function of range rather than of flight time. Even in principle, the use of Eq. (6) only allows for the determination of the average σ e (t −t, r), instead of the value of the plasma ACF at the nominal lag t − t. We define the bias as b(t − t, r) = σ e (t − t, r) − σ e (t − t, r).
The bias appears due to the use of the range ambiguity function, instead of the full two-dimensional ambiguity function. The baseband radar signal s(t) consists of the scattering signal z(t) and the filtered noise signal z n (t), i.e.
Since the scattering signal and the noise do not correlate, This means that an ACF estimate is needed for the noise signal in order to obtain an ACF estimate for the scattering signal. However, the non-zero extent of the noise ACF is much shorter than that of the scattering signal, and therefore, the noise term in Eq. (9) is zero for lags which are long enough.
In standard experiments the first recorded lag is longer than the noise ACF. Then it is sufficient to measure the noise power and subtract it from the zero lag profile. One should not confuse this and the effect of noise on measurement errors; although no noise term is subtracted from the other lags, noise still affects their statistical accuracy. Using the definition Eq. (9) gives After each transmission starting at t = 0, signal samples s i = s(t i ), i = 1, 2, . . . will be taken at equal intervals t = t i+1 − t i . The kth lag is then defined as t − t = k t and the profile of the kth lag is given by s i s * i+k , i = 1, 2, . . . . An estimate of s i s * i+k is obtained as a mean value of s i s * i+k after a great number of repeated transmissions. The successive elements in each lag profile are separated by r = c t/2 in range.
We choose m range gates in steps of r in such a manner that scattering from ranges below r 1 and above r m is negligible. Furthermore, the first sampling time t 1 is chosen to make the front end of the zero lag ambiguity function W t 1 t 1 (r) lie at r 1 + r/2. Then s 1 s * 1+k contains information from the first gate only. Similarly, at the upper end of the lag profiles, those parts of range ambiguity functions which reach beyond r m , do not make a contribution to the measured signal ACF.
We denote the estimate of s i s * i+k by where s (n) i refers to the ith signal sample taken after the nth transmission, and N is the number of transmissions used in calculating the estimate. For lags longer than the length of the noise ACF, this is also an estimate of z i z * i+k . Then, according to Eq. (6), the lag profile of the kth lag is given by where i = 1, 2, . . . , m and ε (k) i is the measurement error. Here, we use the simplified notations and σ (k) j = RC 0 σ e (k t, r j ) r r 2 j . ( In matrix form, Eq. (13) can be written as where ρ (k) is an m dimensional column vector containing the measured lag profile, σ (k) is an m dimensional column vector containing the lag profile of the (scaled) plasma ACF at the m range gates, W (k) is an m × m matrix containing values of the range ambiguity functions at the range gates and ε (k) is an m dimensional column vector containing the measurement errors. The upper end of the range ambiguity function moves upwards step by step with increasing i, and therefore, W (k) ij = 0 when j > i. The range ambiguity function has also a finite length. Thus, starting from some value i = i k , W (k) ij = 0 when j < i − i k . This makes W (k) into a band matrix with a non-zero main diagonal and i k − 1 side diagonals below it. Since the shape of W (k) ij is the same for all values of i, all elements on a given diagonal of W (k) are identical.
Equation (16) contains m equations and m unknowns, so that it could, in principle, be directly solved for the lag profile σ (k) . However, the solution is probably unstable. For obtaining stable solutions, the method must be developed further.
If t is not too great, the range profile of the plasma ACF changes only little from lag to lag. Then it is possible to assume σ (k) to remain constant within a few neighbouring lags around k. According to Eq. (16), this leads tõ wherẽ and This is the direct theory of the inversion problem. The theory of calculating covariances for the errors of the signal ACF estimates is presented by Lehtinen (1986) and Lehtinen and Huuskonen (1996). By means of Eqs. (61)-(65) by Lehtinen and Huuskonen (1996), one can write a priori covariance The variance is then given by It is possible to expanded Eq. (22) to obtain Substituting Eq. (11) in Eq. (23), one readily obtains The error covariances can be collected into a matrix where T indicates the transpose. Obviously,W (k) is a (2n + 1) · m × m matrix, so that we have m unknowns and (2n + 1) · m measurements in Eq. (17). The best values of the unknowns can then be determined by means of stochastic inversion, as explained by Damtie et al. (2002). The result is and the a posteriori covariance matrix of the resulting range profile of the plasma ACF estimate is given by Although the above formulation is applicable to a general modulation envelope, we shall apply it in this paper to Barker-coded modulations. If the time separation of the front ends of two Barker-coded pulses in the transmission envelope is k t, where k is an integer, kth lag is a full lag; otherwise, it is a fractional lag . All full lags have range ambiguity functions of similar shapes, but the shapes of the ambiguity functions of fractional lags are different.

Bias and variance of a lag estimate
According to Eq. (7), a bias is created when range ambiguity functions are used instead of the two-dimensional ambiguity functions. An analogous bias appears, if several lag profiles are combined to a single nominal lag, as indicated in Eq. (17).
The a posteriori variances are affected by the SNR and by the temporal resolution, which determines N to be used in Eqs. (12) and (21). Combining measurements in the manner shown in Eq. (17) reduces the variances but, obviously, it also increases the bias. One can then ask whether the bias is greater or smaller than the a posteriori error when the time resolution and the SNR are fixed. It seems clear that there is no benefit in reducing the a posteriori error to a value smaller than the bias. In this context one should notice that the bias is a systematic error, which always has a fixed sign in a given case, while the a posteriori standard deviation is a measure of a stochastic error, which can be either positive or negative.
In this section an example is given in order to demonstrate how this problem can be investigated. We use a simple approach which assumes a thin ionospheric layer covering a single range gate only and zero electron density at the other gates. In this manner the effect due to the plasma at a single height can be studied without contributions from other altitudes. This model is not so unrealistic as one might first think. The electron density of a thin sporadic-E layer can be nearly ten times that of the surrounding plasma and the layer itself may cover only a few range gates. Hence, the model can be considered as an idealisation of a sporadic E.
The plasma ACF is fixed within the thin layer. We carry out the study by applying five different plasma ACFs, which are plotted in the top panel of Fig. 1. The continuous line is the real part of a plasma ACF representative of the ionosphere at a height of 150 km (Alcaydé et al., 1994). The other lines are obtained by changing the ion temperature in such a manner that the time axis will be approximately scaled by factors 0.25, 0.5, 2 and 4. Hence, these functions cover a wide range of correlation times. In all cases the functions are scaled to unity at zero lag so that, in addition to different ion temperatures, they also correspond to different electron densities.
Next, a modulation envelope is chosen, consisting of two pulses. The separation of their front ends is 90 µs, which defines the full lag. Each pulse is further phase coded by a 13-bit Barker code with a sign sequence + + + + + − − + + − + − +. The bit length and the sampling interval are both 1 µs. The receiver impulse response is a boxcar with the same length (this is a reasonable assumption in a digital receiver, see Sect. 4.2). The range ambiguity functions are then obtained from Eq. (4) using the modulation and the impulse response. When the range ambiguity functions are known, simulated lag profiles for the full lag and several surrounding fractional lags are calculated from Eq. (13). The time resolution is fixed by choosing N = 1000. For instance, if the transmissions were repeated at 10-ms intervals, this choice of N would mean a 10-s time resolution. No random errors are added to the lag profiles. This corresponds to an unlikely case that, in spite of noise in the signal, the measurements are accidentally correct. The purpose is to determine the best possible values of σ (k) j , in order to calculate estimates of the bias according to Eq. (7). As indicated by Eq. (26), the inversion result is affected by ε , and therefore, the bias determined in this manner will also depend on SNR.
In order to investigate the bias and the a posteriori error, the full lag profile at 90 µs and a varying number of fractional lag profiles around it are first combined into a single nominal lag according to Eq. (17). Then several values of SNR are chosen and a priori variances for each SNR are calculated according to Eq. (24). Next, an estimate of the plasma ACF within the thin layer is determined using Eq. (26). Because the true value of the ACF at the nomi- nal lag is known, an estimate of the bias can be calculated according to Eq. (7). Finally, the a posteriori variances are calculated from Eq. (27) for different values of SNR. One should notice that the variances do not depend on the inversion result, and therefore, the assumption of an "accidentally" correct measurement does not affect the a posteriori variances. In this manner the magnitudes of the bias and the a posteriori error can be separately determined.
The bottom panel of Fig. 1 shows the bias as a function of the number of lag profiles included in the analysis. Since the modulation is a 13-bit Barker code, 25 lag profiles are available for this purpose. The nominal lag value in this figure is 90 µs and SNR = 0.5. As expected, the bias increases with increasing number of lag profiles. The bias, of course, also depends on the shape of the plasma ACF around the nominal lag. The closer to linear the ACF is, the smaller the bias, since the biases tend to cancel eachother out, due to fractional lags on opposite sides of the full lag. On the other hand, when the nominal lag is close to a minimum of the plasma ACF, the biases on the opposite sides have the same signs and they enhance the total bias. Figure 2 shows the absolute values of the bias and the a posteriori errors for different values of SNR. All these results are calculated for the plasma ACF plotted by the continuous curve in Fig. 1. The a posteriori error first decreases steeply with increasing number of lags, but at about 9 it levels out. This means that no essential improvement can be achieved by including more lags in the analysis. The a posteriori error also decreases with increasing SNR in the expected manner. Since the error depends on time resolution, the error curves could be shifted by varying the value of N.
The bias is also affected by SNR. For large values of SNR the bias is first positive, decreasing with SNR and turns to negative values at about SNR = 0.3. When SNR approaches zero, the bias remains negative, converging towards a curve which is essentially that indicated by SNR = 0.1 in Fig. 2 (notice that the absolute value is plotted in the figure).
When SNR = 0.1, the absolute value of the bias is always smaller than the a posteriori error. For large SNR values the error and bias curves cross, so that the crossing points give advice on the practical number of lag profiles which should be combined in the analysis. An interesting observation is that, in this case, the statistical accuracy achieved by increasing SNR to 2 is partly destroyed by the growing bias.
In evaluating this method, the a posteriori errors and biases should actually be compared with those produced by standard Barker decoding. However, this is not done here, because standard Barker decoding is not well suited for measuring profiles with steep gradients. The reason is that signals from the sidelobes may be significant when electron density within the main lobe is much smaller than the density within some of the sidelobes. The present method does not suffer from such drawbacks. The comparison of statistical accuracies of the two methods is made in the following section, which is based on true measurements of the ionosphere.

Experimental demonstration
In this section we demonstrate the inversion method using Barker-coded data from the EISCAT Svalbard radar (for the radar system, see Wannberg et al., 1997). The experiment was conducted on 16 November 1999. The data were collected using an additional hardware connected to the standard radar receiver. This hardware stores the complex baseband data samples rather than the ACF estimates, which gives a greater freedom in data analysis. The data collection system and the applied radar modulation are described by Lehtinen et al. (2002).

Inversion method
The experiment applies two phase codes transmitted at different frequencies. Only one of them, consisting of a phase pattern of 22 bits, is used in this paper. Each bit is further modulated by a 5-bit Barker code with a 6-µs bit length. This transmission pattern is shown in Fig. 3. The baseband complex signal samples containing data from both frequency channels are stored on hard disk. The sampling interval is 1 µs. The off-line data processing consists of channel separation and clutter removal, and it produces a separate data stream for each channel. The details of signal processing are explained by Lehtinen et al. (2002) and Damtie et al. (2002).
We decimate the data to 2-µs time resolution and choose a 5-min data sequence for the analysis. The average lag profiles for this time interval and their experimental variances are then calculated from the data. Since the sampling interval is 2 µs after decimation, the lag increment is also 2 µs. Full lags are obtained at 30-µs lag increments, all the others are fractional lags.
The three top panels of Fig. 4 show the real part of the observed mean profile of the first full lag at 30 µs and those of the neighbouring fractional lags at 28 µs and 32 µs. The bottom panels show the corresponding profiles of measured standard deviation. The three profiles look quite similar. The structure at the bottom of the profiles is due to a thin sporadic E and that above 400-km altitude is probably due to a satellite, space debris or a meteor. The regions of strong echoes above 400 km are characterised by a high level of experimental variance. Figure 5 portrays the corresponding range ambiguity functions, calculated according to Eq. (4), using the modulation in Fig. 3. The figure presents a situation with the top of the range ambiguity function at 400-km altitude. The ambiguity functions at other time instances are obtained from these by shifts along the range axis. It is worth noticing that the range ambiguity functions of the fractional lags are much more structured than that of the full lag.
All lag profiles, their standard deviations and the corresponding range ambiguity functions can now be calculated in a similar manner. Then one can merge a varying number of lag profiles into a single full lag, as explained in Sect. 2, and solve the inversion problem. The result gives a profile of the plasma ACF estimate at the full lag, together with its covariance matrix. If only the three profiles in Fig. 4 are used in the inversion, the accuracy of the result is very poor. The left panel in Fig. 6 shows the 30-µs ACF profile estimate obtained from all measured lag profiles from 2 to 58 µs. The quantity plotted is σ (k) j , which means that a range correction by r 2 is needed to put the values at different ranges into the same scale. The choice from 2-58 µs is made, because the standard 5-bit Barker decoding with a 6-µs bit length makes use of the same lag extent. The result shows that the sporadic E and the satellite echo, which are visible within wide ranges in Fig. 4, are compressed into thin layers. The lag profile due to the background electron density is mainly positive with a minimum near 200-km range.
The right-hand panel of Fig. 6 displays the profile of the a posteriori standard deviation of the inversion result. In addition, two error curves are also shown, which are obtained by taking a smaller number of measured lag profiles in the analysis. This set of curves indicates the improvement of statistical accuracy with increasing number of lag profiles. The error first decreases with height but then increases, reaching a maximum close to the satellite echo. This maximum is probably due to the large a priori variance of the satellite echo, which is spread to a wider region in the inversion.

Comparison with standard decoding
The new method can now be compared with standard Barker decoding. The conventional way of decoding a Barker-coded signal is to filter it by means of an impulse response which is a mirror image of the code itself. In our case of a 5-bit code and oversampling at a rate of three samples per bit, the impulse response is + + + − − − + + + + + + + + +. This filtering is done after channel separation and decimation of the signal. Then clutter suppression is carried out in the manner described by Lehtinen et al. (2002), and each lag profile is calculated in the conventional way. The lag ambiguity function of each full lag is non-zero on both sides of the nominal lag within a lag range equal to the length of the decoding filter. Hence, the 30-µs lag obtained by standard decoding contains information from the lag range 2-58 µs.
Due to the basic modulation pattern (top panel in Fig. 3), lag profiles calculated after standard decoding contain range ambiguities. Therefore, the next step would be inversion of the profiles in the manner described by Damtie et al. (2002). However, in order to keep the effects of standard decoding separate from the effects of inversion, instead we transform the inversion results to correspond to the results of standard decoding. We calculate the weighted sum where σ (k) j is the profile of lag k given by the inversion method and W (k) ij is the range ambiguity function of the Barker-coded modulation and the matched filter. By analogy with Eq. (13), the resulting lag profile elements have the same relative contributions from all heights as the lag profile elements after standard decoding. In calculating the range ambiguity functions (and, later, the a priori covariance matrix of the lag estimates), a boxcar impulse response is assumed.
The assumption is valid, since our final digital samples are obtained as sums of consecutive and disjointed sequences of more dense samples obtained from the digital receiver (see Lehtinen et al., 2002). This means that a boxcar function is a very good approximation of the true filter impulse response in the time domain. This is also the reason why a boxcar impulse response was used in calculating the bias and the a priori errors in Sect. 3.
The left-hand panel of Fig. 7 shows the 30-µs range ambiguity function of the modulation in Fig. 3, assuming the standard Barker decoding filter. Due to the 5-bit Barker code, the ambiguity function contains narrow positive and negative peaks with sidelobes, and the height of the peaks is 225 units. Since the length of the basic modulation is 22 bits and this is the first full lag, the number of peaks in the ambiguity function is 21. Instead of this ambiguity function, we use the function in the right-hand panel of Fig. 7. This is otherwise similar to the range ambiguity function, but the sidelobes have been removed. Hence, the effect of the sidelobes will not be present in the resulting lag profile.
The left-hand panel of Fig. 8 shows the height profile of the 30-µs lag obtained by standard decoding, together with corresponding profiles given by the inversion method with lag ranges 2-58 and 18-42 µs after filtering the inversion output using Eq. (30) in order to simulate the effects of standard decoding. In order to avoid overlapping, the latter two profiles are shifted by 20 units to the right and left, respectively. The curves indicate that both the sporadic E and the satellite echo generate a spiky pattern, which is due to the 22-bit basic modulation. The same pattern appears in the profiles obtained from the inversion results. The right-hand panel of Fig. 8 shows the differences of the profile obtained by standard decoding and those given by the inversion results. The differences are greatest at ranges where the spiky structures are present. This is probably due to the sidelobes, which are present only in standard decoding. Elsewhere, the 2-58-µs profile lies very close to that given by standard decoding, but the 18-42-µs profile is clearly smaller. This must be a bias effect; standard decoding and 2-58-µs inversion make use of the same lag range, whereas the lag range of the 18-42-µs inversion is smaller.
The essential point in estimating the value of the inversion method is to compare its accuracy with that of the standard method. An estimate of the variance profile given by standard decoding can be calculated directly from the data. The a posteriori covariance matrix σ of the inversion results σ (k) j in Eq. (28) is obtained from Eq. (27). The task is to calculate the covariance matrix σ of the inversion results filtered according to Eq. (28). We rewrite Eq. (28) in matrix form where σ (k) is a column vector containing the inversion results of nominal lag k, the rows of matrix W (k) contain the range ambiguity functions of the Barker-coded modulation, andσ (k) is a column vector containing the filtering results. Then a straightforward calculation shows that where T indicates transpose. Range profiles of the standard deviation of the lag profiles in Fig. 8 are plotted in the left-hand panel of Fig. 9. Due to the effect of sidelobes, the error of the standard method has high values and oscillates violently close to the sporadic-E and satellite echo. The error curves of the inversion results behave much more smoothly. When a lag range of 18-42 µs is used in inversion, the error in the middle part of the profile is approximately similar to that given by the standard method while the wide lag range of 2-58 µs gives clearly smaller errors. The ratio of the errors due to standard decoding and the inversion method with a 2-58-µs lag range is shown in the right-hand panel. It is observed that, in the non-oscillating part of the profile, the error of standard decoding is always greater, maximally about 1.5 times that given by the inversion method.

Height integration by means of mathematical inversion
The 2-µs sampling interval in the data means that the lag profile in Fig. 6 has a 300-m range resolution. Such a high resolution is not needed in most of the profile, of course, and therefore, it is reasonable to carry out height integration. A conventional way of height integration is averaging over a certain number of range gates and putting the centre point of the integration interval as the nominal range. A more advanced method would be to apply mathematical inversion to this problem as well. This means that the direct theory connecting the high-resolution lag profile to a lower-resolution profile should be defined, and the resulting inversion prob- lem should be solved using the covariance matrix of the highresolution profile.
Since the solution given by Eq. (26) gives the best values of σ (k) j , a range correction σ e (k t, r j ) = C 1 σ (k) j r 2 j r 2 0 (31) must first be carried out, in order to put the ACF lag estimates at different ranges into the same scale. Here, r 0 is an arbitrary reference height and C 1 is a constant, which is determined by means of the noise calibration of the measurement. A corresponding correction must also be made to the a posteriori covariance matrix.
Next, a set of ranges R m , m = 1, 2, 3, . . ., is defined which give a desired resolution at each altitude. Normally, these ranges are a chosen set from the original high-resolution ranges. Then a direct theory is defined which connects the values of the signal ACF estimates at these ranges to the range-corrected values in Eq. (26), i.e.
where σ r is a column vector with elements σ e (k t, r j ), σ R is a column vector with elements σ e (k t, R m ), and ε r is the error vector of σ r . The theory matrix A R defines how each component of σ R depends on the components of σ r . In analogy with Eq. (26), the best values of σ R are then given by and their errors are given by the covariance matrix Here, r is the covariance matrix of ε r .
A direct theory which is closest to the conventional height integration is obtained by a theory matrix with the number one in the appropriate parts of the matrix's columns and zeros elsewhere. For instance, a theory matrix corresponds to conventional height integration over three range gates. The solution given by Eq. (33) is not a simple average, however, but it takes into account the variances and covariances of the components of σ r . Strictly, a theory matrix like that in Eq. (35) assumes that the plasma ACF does not change in those gates r j which are included in the same gate R m . It is possible to construct more complicated theory matrices which take into account the variation of the plasma ACF from gate to gate. Figure 10 shows a comparison of the results obtained by means of conventional height integration and inversion. The height resolution is varied with altitude so that it is first 900 m (integration over 3 gates), then 10.5 km (integration over 35 gates) and finally 30.5 km (integration over 101 gates). The theory matrix is of the type in Eq. (35), with an appropriate number of ones in the proper places of its columns. The results of conventional height integration are shown in the same picture, with error limits calculated in the same manner as those in Eq. (30).
With the present long-time integration, the results are nearly similar, except at the peak of the sporadic-E layer and at those heights where the satellite echo affects the results. However, the error limits given by inversion are always somewhat smaller than those in the conventional height integration. Although the difference between inversion and conventional height integration is not great in this case, it still demonstrates the fact that the proper method in height integration is mathematical inversion.

Discussion
For thirty years, Barker codes have provided a means for improving the range resolution of incoherent scatter measurements. This phase coding method has become a standard submodulation when range resolutions of the order of a few hundreds of metres have been needed. However, the existence of sidelobes in the range ambiguity functions of Barker codes poses a problem, which is greatest when the plasma density within the sidelobes is much higher than in the main lobe. Such a case is often encountered in the E-region, where thin sporadic-E layers may be present.
The disadvantages of Barker codes can be reduced by means of various methods designed for suppressing the sidelobes (e.g. Blinchikoff and Zverev, 1987, and references therein). The sidelobes can be completely removed by means of a decoding filter with an impulse response of an infinite length (Sulzer, 1989). In practice, a limited length is sufficient to suppress the sidelobes to a negligible size. Other binary phase codes can also be decoded in a similar manner. As stated by Sulzer, a drawback is that removing the sidelobes reduces the SNR. The deterioration can be very small for some codes and very large for others. Another possibility of removing the sidelobes is to use Fourier transform in the manner described by Lehtinen et al. (2002). In this method the Fourier transform of the signal is first divided by the Fourier transform of the Barker code. Then the decoded signal is obtained by calculating the inverse Fourier transform of the quotient. Although not investigated properly, it is possible that this method also reduces the SNR.
In this paper we present a completely different approach to the analysis of Barker-coded data. In brief, a sequence of data samples is first used to calculate the range profiles of the full and fractional lags, and then a nominal full lag profile is obtained by solving a mathematical inversion problem, which makes use of a full lag and a number of neighbouring fractional lags. The inversion takes into account the measurement errors and it gives the most probable value of the lag profile under the assumption that the value of the plasma ACF remains the same within the lag range covered by the full lag and fractional lags included in the analysis. The applied stochastic inversion also gives the standard deviations of the inversion results. When the statistical error of the new method is compared with that of standard decoding, it turns out that the new method actually gives more accurate results. Hence, stochastic inversion both removes the sidelobe effects and improves the statistical accuracy.
The two-dimensional ambiguity function of a Barker code covers a lag range twice the length of the code itself. Although most of the contribution to a lag measurement comes from the centre of the ambiguity function, the contribution from the edges may affect the result if the plasma ACF varies considerably within this lag range. The bias thus created is expected to be strongest if the nominal lag lies close to a maximum or a minimum of the plasma ACF. The bias is also greater for short Barker codes since their sidelobes are higher. Standard decoding has no means of correcting this bias. Figure 8 demonstrates that the inversion method gives a possibility to investigate the bias and also to reduce it by decreasing the number of lags included in a single lag profile. Information is lost if some lag profiles are rejected, and therefore, reducing the bias in this manner also reduces the statistical accuracy. Rejection of fractional lags is not necessary, however. There is no obvious reason why all fractional lags should be combined to some full lag. One can choose a set of neighbouring fractional lags and combine them into a single nominal lag by means of the same inversion method. In this manner all fractional lags can be used and a larger number of less accurate nominal lag profiles are obtained. Then the bias becomes smaller and it is also expected that the accuracy of the plasma parameters to be determined is not seriously affected.
Height integration by means of inversion seems to be the proper way of reducing range resolution. In Sect. 5 a direct theory closest to the conventional height integration was applied as a demonstration, but more advanced theory matrices could be constructed, which take into account the variation of the lag profile between the low-resolution range gates. The simplest possibility would be to assume linear variation but, for example, cubic spline interpolation could also be used.