RADAR PLANT AND MEASUREMENT TECHNIQUE FOR DETERMINATION OF THE ORIENTATION AND THE DEPTH OF BURIED OBJECTS

Abstract: A plant for generation of information indicative of the depth and the orientation of an object positioned below the surface of the ground is adapted to use electromagnetic radiation emitted from and received by an antenna system associated with the plant. The plant has a transmitter and a receiver for generation of the electromagnetic radiation in cooperation with the antenna system mentioned and for reception of the electromagnetic radiation reflected by the object in cooperation with the antenna system, respectively. The antenna system comprises a plurality of individual antenna elements having substantially linear polarization, especially dipole antennas, which are positioned in relation to the geometric center of the antenna system with the various centers of the antenna element displaced in relation to the geometric sensor of the antenna system as the plant has means for rotation, either mechanically or electrically, of the antenna system and thus polarization of the electromagnetic field around or in relation to the geometric center of the antenna system.

Description: Radar plant and measurement technique for determination of the orientation and the depth of buried objects . The present invention generally relates to a technique for detection of objects in the ground by means of ground radars. More specifically, the invention relates to a plant for generation of information indicative of the depth and the orientation of an object positioned below the surface of the ground which plant is adapted to use electromagnetic radiation emitted from and received by an antenna system associated with the plant and which plant has a transmitter and a receiver for generation of the electromagnetic radiation in cooperation with the antenna system mentioned and for reception of an electromagnetic radiation reflected from the object in cooperation with the antenna system, respectively. Various technical solutions and embodiments of such ground radar plants and various embodiments of methods for generation of information about the depth and position of the object in question from a detection by means of ground radars are known. Examples of such technical solutions are described in the following publications: US-patents Nos. 5,339,080, 5,192,952, 5,499,029, 4,504,033, 5,325,095, 4,430,653, 4,698,634, 4,062,010, 4,839,654 and 5,130,711. These US patents are referred to and they are hereby incorporated in the present specification by reference. Especially US-patent No. 4,728,897 describes a technique which is relevant in the present context as this US patent discloses an antenna construction in which a number of dipoles are positioned symmectically around a common centre and are brought to pivot either mechanically or electrically for generation of and reception of electromagnetic radiation. This technology enables to a large extent achievement of relevant information about the position and orientation of the object in question, but the technique is still open to improvements and modifications rendering it possible to obtain an even substantially improved generation of information and thus a safer and more reliable identification of the depth and orientation of the object to be identified. It is an object of the present invention to provide an ground radar plant, i.e. a plant of the type described in the introduction, which plant provides an improved functionality regarding identification of the object in question, compared to technical solutions of the prior art, and consequently provides an improved measuring technique, compared to technical solutions of the prior art. This object together with numerous other objects, advantages and special features of the present invention which will be evident from the following detailed description is obtained by means of a plant of the type mentioned in the introduction, which plant is characterized by being adapted to use electromagnetic radiation emitted from and received by an antenna system associated with the plant and having a transmitter and a receiver for generation of the electromagnetic radiation in cooperation with the antenna system mentioned, and for reception of an electromagnetic radiation reflected from the object in cooperation with the antenna system, respectively, characterized in that the antenna system comprises a plurality of individual dipole antennas, which are positioned in relation to the geometrical centres of the antenna system with the centres of the various dipole antennas displaced in relation to the geometrical centre of the antenna system and that the plant has means for rotation, either mechanically or electrically, of the antenna system around or in relation to the geometric centre of the antenna system. The embodiment of the antenna system characteristic of the present invention with the various dipole antenna displaced in relation to the geometric centre of the antenna system enables a substantially more complex radiation of electromagnetic radiation and at the same time a more precise and subtle reception of electromagnetic radiation which makes the obtaining of a substantial improvement of the measuring technique possible. The antenna system characteristic of the present invention may in accordance with two alternative embodiments be produced in a manner so that the individual dipole antenna are positioned radially from the geometric centre of the antenna system, still with the centres of the various dipole antenna positioned displaced in relation to the geometric centre of the antenna system and especially with the centres of the various dipole antennas positioned on a circle or on several circles with different radii and with the geometric centre of the antenna system coincident with the centres of the circles in question, or the various dipole antenna may alternatively form a triangle structure positioned symmetrically around the geometric centre of the antenna system, i.e. with dipoles positioned in a triangle and with the vertex of a triangle positioned in the geometric centre of the antenna system or with composite triangle structures forming a configuration positioned symmetrically around the geometric centre of the antenna system. Alternatively , these two dipole antenna embodiments may be combined, similarly provision of another radiation pattern, other geometric configurations than triangle structures may also be used, e.g. quadrangle or polygonal structures or combinations of several different multiangle structures. The individual antenna elements of the antenna system of the plant according to the present invention, being characteristic of the present invention, forming parallel orientered sets of transmitter and receiver, or alternatively the individual antenna elements forming orthogonally oriented transmitter and receiver pairs. Furthermore, the individual antenna elements of the antenna system may be co-polar or alternatively cross-polar. These special features enable the use of a broad variety of embodiments. The plant according to the present invention may comprise means for production of rotation of the antenna system and thus produce a rotation, either mechanically or electrically of the antenna system. Preferably, in the present invention electronic rotation is applied in order to obtain a thorough control of the roation and a substantial reduction of the total weight of the plant. The electronic rotation may be produced by shifting between the individual antenna elements of the antenna system and thus providing polarization of the electromagnetic field around the geometric centre in angular increments which typically may be in the order of 22.5°, 30°, 36° or divisions or multiples of such angles. The antenna system of the plant according to the present invention may in accordance with one embodiment generate electromagnetic radiation and receive electromagnetic radiation at several individual frequences, preferably in the range of 100MHz to 1GHz in steps of 5MHZ. The obtained advantage is the provision of a broad spectrum of reflections. The plant according to the invention may comprise signal processing means for measurement of a transferring function, e.g. a voltage transfer function, current transfer function or combinations thereof or power transfer functions between signals between the radiation emitted by the antenna system and the radiation received by the antenna system. In the present invention a voltage transfer function for connected values of the angular change of the antenna system and the frequency of the signal emitted by the antenna system and the signal received by the antenna system is preferably measured. The signal processing means of the plant according to the present invention may perform the transformation from frequency to time by Fourier transformation or by application of a mathematic exponential model with corresponding rational transfer function on the transfer function associated with a specific angle, for generation of a continuous-in-time function for each angle which is calculated at a predetermined number of discrete times with identical calculation moments for each angle. Furthermore, the signal processing means may perform a transformation from frequency to time by Fourier transformation or by use of a mathematic exponential model with corresponding rational transfer function for each angular harmonic a time dependent, in-time-continuous function at a predetermined number of discrete times, with identical calculation moments for every angular harmonic, generating a set of numbers corresponding to a mathematic function having the angular harmonic discreted and the time discreted as independent variables. This enables a reliable determination of the strength and time delays of substantial reflectors even though ideal circumstances are not present. The signal processing means of the plant according to the present invention may perform signal analysis by Fourier transformation on the for each of the employed moments associated with each angle, continuous in time, function having the time as a constant and the angle as independent variable for generation of a representation in the angle domain. Furthermore, the signal processing means may perform a signal analysis by Fourier transformation for each frequency having the frequency as a constant and the angle as independent variable for generation of a set of numbers having the angular harmonic and the measuring frequency as independent variables. The purpose of applying Fourier transformation is to emphasize the angular harmonic content of the signal at various time delays (and depths). In the plant according to the present invention, the signal processing means may perform various operations on the processed signals. The signal processing means may preferably perform a scanning of local and global maxima indicating angular periodic reflections of objects, in representation in the angular domain, and where the peak value indicates the time delay of associated reflections from an object. Moreover, the signal processing means may perform calculations of angular position in relation to the antenna system for the angular periodic reflections and the signal processing means may furthermore perform a utilization of collated measurements, made during horizontal movement, for damping of clutter. The present invention furthermore relates to a method for generation of information indicative of the depth and the orientation of an object positioned below the surface of the ground which method is characterized by comprising the application of electromagnetic radiation emitted from and received by an antenna system by means of a transmitter and a receiver for the generation of the electromagnetic radiation in cooperation with the antenna system, and for the reception of an electromagnetic radiation reflected from the object in cooperation with the antenna system, respectively, characterized in that for transmission and reception of the electromagnetic radiation a plurality of individual dipole antennas are employed which are positioned in relation to the geometrical centre of the antenna system with each of the centres of the antenna elements displaced in relation to the geometrical centre of the antenna system and that the antenna system is rotated, either mechanically or electrically, around or in relation to the geometric centre of the antenna system. The method characteristic of the present invention has an embodiment of the antenna system with the various dipole antennas displaced in relation to the geometric centre of the antenna system, enabling a substantially more complex generation of electromagnetic radiation and at the same time a more precise and subtle reception of electromagnetic radiation which makes the obtaining of a substantial improvement of the measuring technique possible. In the method according to the present invention, in accordance with two alternative embodiments of the antenna system, embodiments of the antenna system may be applied so that the individual dipole antennas are positioned radially from the geometric centre of the antenna system, still with the centres of the various dipole antennas in a displaced position in relation to the geometric centre of the antenna system and especially with the centres of the various dipole antennas positioned on a circle or on serveral circles having different radii and with the geometric centre of the antenna system coincident with the centres of the circles in question, or the various dipole antennas may alternatively form triangle structure positioned symmetrically around the geometric centre of the antenna system, i.e. with dipoles positioned in triangle configuration and with the vertex of a triangular positioned in the geometric centre of the antenna system or with composite triangle structures forming a configuration symmetrically positioned around the geometric centre of the antenna system. Alternatively, these two dipole antenna embodiments may be combined. Similarly, for provision of another radiation pattern other geometrical configurations than triangle structures may also be used, e g quadrangle or polygonal structures or combinations of several different multiangle structures. In the method according to the present invention, the individual antenna elements of the antenna system, especially the dipole antennas forming orthogonally sets of transmitter and receiver, alternatively oriented in parallel, may be used for transmission and reception of the electromagnetic radiation. Furthermore, transmitter and receiver antennas which are co- polar or alternatively cross-polar may be used for transmisstion and reception of the electromagnetic radiation. These special features enable the use of a broad variety of embodiments. In the method according to the present invention, means for provision of rotation of the antenna system may be used, thus providing a turning either mechanically or electrically of the antenna system. Preferably, in the present invention electronic rotation is applied, in order to obtain a thorough control of the rotation and a substantial reduction of the total weight of the plant. The electronic rotation may be provided by shifting between the individual antenna elements of the antenna system and thus providing polarization of the electromagnetic field around the geometric centre in angular increments which typically may be in the order of 22.5°, 30°, 36° or divisions or multiples of such angles. In the method according to the present invention, an antenna system in accordance with the above mentioned embodiment may be used for generation of electromagnetic radiation and reception of electromagnetic radiation at several individual frequences, the typical order of which may be within the area 100MHz to 1GHz in steps of 5MHZ. The advantage obtained is a broad specter of reflections. In the method according to the present invention, signal processing means may be used for measuring a transfer function, e.g. a voltage transfer function, current transfer function or combinations thereof or power transfer function between signals between the radiation emitted by the antenna system and the radiation received by the antenna system. In the present invention a voltage transfer function for connected values of the angular change of the antenna system and the frequency of the signal emitted by the antenna system and the signal received by the antenna system is preferably measured. In the method according to the present invention the signal processing means may be used for transformation from frequency to time by Fourier transformation or by application of a mathematic exponential model with corresponding rational transfer function on the transfer function associated with the specific angle, for generation of a function continuous in time and time dependent for each angle which is calculated at a predetermined number of discrete times with identical calculation moments for all the angles. Furthermore, the signal processing means may be used for transformation from frequency to time by Fourier transformation or by use of a mathemathical exponential model with corresponding rational transfer function for each angular harmonic a time dependent function, continuous in time, at a predetermined number of discrete times, with identical calculation moments for all angular harmonic, generating a set of numbers corresponding to a mathematical function having the angular harmonic in discrete form and the time in discrete form as independent variables. This enables a reliable determination of the strength and time delays of important reflectors even though ideal circumstances are not present. In the method according to the present invention, the signal processing means may be used for signal analysis by Fourier transformation for each of the used employed moments associated with each angle, continuous in time function having the time as a constant and the angle as independent variable for generation of a representation in the angle domain. Furthermore, the signal processing means may perform a signal analysis by Fourier transformation for each frequency having the frequency as a constant and the angle as independent variable for generation of a set of numbers having the angular harmonic and the measuring frequency as independent variables. The purpose of applying Fourier transformation is to emphasize the angular harmonic content of the signal at various time delays (and thus depths). In the method according to the invention the signal processing means may be used for several operations on the processed signals. The signal processing means may be used for search of local and global maxima indicating angular periodic reflections of objects, in representation in the angular domain, and where the peak value indicates the time delay of associated reflections from an object. Moreover, the signal processing means may be used for calculations of the angular position in relation to the antenna system, for the angular periodic reflections, and the signal processing means may furthermore be used for a utilization of collocated measurements made during horizontal movement, for damping of clutter. In the following, the invention will be described in further detail with reference to the figures. The figures 1 to 12 refer to the above description of prior art. Fig. 1 illustrates how the antennas are moved along an arbitrary path along the surface of the ground during rotation of the antennas or by rotation of the polarization by means of constant electric shifting between the antenna elements. Fig. 2 illustrates a possible configuration of two-terminal antennas symbolized by thin electric dipoles having the centres displaced. By an electric shifting between the 8 antennas a rotating polarization may be provided. Fig. 3. Fig. 3a illustrates a single pair of co-linear two-terminal antennas one of which is used as a transmitter and the other as a receiver and fig. 3b illustrates 4 such pairs. Fig. 3c illustrates a single pair of parallel two-terminal antennas and fig. 3d illustrates 4 such pairs. By electric shifting between the antennas in figs. 3b and 3d, a polarization may be provided rotating in increments of 45 . Fig. 4. Fig. 4a illustrates a single pair of two-terminal antennas having displaced centres and orthogonal polarization one of which is used as a transmitter and the other as a receiver. Fig. 4b illustrates 8 such pairs. By electric shifting between the antennas in 4b, a polarization may be provided rotating in increments of 45 during measuring having pairs as in fig. 4a. Fig. 4c illustrates a single pair of two-terminal antennas having displaced centres and orthogonal polarization and asymmetric mutual coupling one of which is used as a transmitter and the other is used as a receiver. Fig. 4d illustrates 4 such pairs. By electric shifting between the antennas in fig. 4d, a polarization may be provided rotating in increments of 45 during measuring having pairs as in fig. 4c. Fig. 5. Fig. 5a illustrates a single dipole that may be used as a transmitter as well as a receiver antenna corresponding to the measuring of the s-parameter S π , representing a measurement of reflection (contrary to a transmission measurement which is used in all cases where transmitter and receiver antenna are separated). Fig. 5b illustrates 8 such dipoles. By electric shifting between the antennas in fig. 5b, a polarization may be provided rotating in increments of 45 during measuring having pairs in fig. 5a. Fig. 6. Fig. 6a illustrates two orthogonal dipoles, one of which is used as a transmitter and the other as a receiver. Fig. 6b illustrates two such pairs. A theoretical application of the configuration in fig. 6b is measurement of reflection (S π ) during application of only one dipole at a time. Fig. 7. Fig. 7a illustrates the angle of elongated objects in relation to a set of type-2 antennas. Fig. 7b illustrates the angle of elongated objects in relation to a set of type- 1 antennas. Fig. 8 illustrates a set of antennas in two positions in relation to an object. For clarity purposes only 4 dipoles are included in the set. Fig. 8a illustrates a side-view of the set in the two positions, fig. 8b is a corresponding top view. Fig. 9 illustrates configurations of dipoles in which the sides are not parallel. Such embodiment of a single dipole may be an advantage with regard to the frequency band width of the dipole. Fig. 10 is a schematic view of a possible construction of dipoles in which splitted metal sheets 1 are applied being electrically connected by means of resistive coupling elements a. Fig. 10a illustrates the half of such a dipole. The number of elements may be varied. Fig. 10b illustrates two such halfs with feeding balun 2. Fig. 11 is a schematic view of a possible construction of dipoles in which splitted metal sheets 1..5 are applied being electrically connected by means of resistive coupling elements a. The sides are not parallel and the width of the dipole increases at increasing distance from the centre. Fig. 11a corresponds to the half of such dipole. The number of elements may be varied. Fig. l ib illustrates two such halfs with feeding balun 2. Fig. 12 illustrates the fundamental construction of the antenna in its entirety in a cross section along a line corresponding to a diameter in fig. 9a or 9b. The antenna elements e lies on a supporting plate d of a suitable dielectric material. The entire construction is carried by an uppermost plate a which may be of any material in regard to electricity. Below the supporting plate a a shielding foil or metal plate b is situated preventing inward and outward radiation upwardly, c is a suppressing materiale, for instance of the types $$ECCOSORB ls$$ or ls$$ of the brand Emerson Cuming or combinations thereof. Below the active elements a plate of a dielectric material exists. The antenna elements e consist of plane metal parts connected by resistive coupling elements as indicated in fig. 10 or in fig. 11. /is a dielectric materiale which protects the active elements mechanically as well as provides electric adjustment. The relative permittivity of such material will typically be between 3 and 10. The figures 13 to 19 relate to measurements made by the preferred embodiment. Fig. 13 illustrates the result of procedure No. 1 up to and including step 1.6. Fig. 13a illustrates signal strength as a function of angle index n and time ns in the form of a 3D-plot. Fig. 13b illustrates signal strength as a function of angle index n and time in ns as contour plot. Figs. 13c and 13d illustrate the result of the described procedure No. 1 up to step 1.5 inclusive. Fig. 13c illustrates measured signal strength as function of angle index n and frequency in GHz in a 3D-plot. Fig. 13d illustrates measured signal strength as function of angle index n and frequency in GHz in a contour plot. Figs. 13e and 13f illustrate the result of the described procedure No. 2 up to step 2.2 inclusive. Fig. 13e illustrates calculated signal strength as function of angular harmonic index k and time in ns in a contour plot. Figs. 13g and 13h illustrate detection curves as the result of procedure No. 6 up to step 6.3 inclusive. Fig. 13g illustrates D in absolute values, 13h illustrates D in dB. Figs. 13i and 13 j illustrate detection curves as the result of procedure No. 2 up to step 2.3 inclusive. Fig. 13i illustrates D in absolute values, Fig. 13 j illustrates D in db. Fig. 14 illustrates the result of the described procedure No. 1 up to step 1.6 inclusive. Fig. 14a illustrates a signal strength as function of angle index n and time ns in the form of a 3D- plot. Fig. 14b illustrates signal strength as function of angle index n and time in ns as a contour plot. Figs. 14c and 14d illustrate the result of described procedure No. 1 up to step 1.5 inclusive. Fig. 14c illustrates measured signal strength as function of angle index n and frequency in GHz in a 3D-plot. Fig. 14d illustrates measured signal strength as a function of the angle index n and frequency in GHz in a contour plot. Figs. 14e and 14f illustrate the result of the described procedure No. 2 up to step 2.2, inclusive. Fig. 14e illustrates calculated signal strength as a function of angular harmonic index k and time in ns in a 3d- plot. Fig. 14f illustrates calculated signal strength as a function of angular harmonic index k and time in ns in a contour plot. Fig. 14g and 14h illustrate detection curves as the result of procedure No. 6 up to step 6.3 inclusive. Fig. 14g illustrate D in absoute values, 14h illustrates D in dB. Figs. 14i and 14j illustrate detection curves as the result of procedure No. 2 up to step 2.3 inclusive. Fig. 14i illustrate D in absolute values, 14j illustrates D in dB. Fig. 15 illustrates the result of the described procedure No. 1 up to step 1.6 inclusive. Fig. 15a illustrates signal strength as a function of angle index n and time ns i the form of 3D plot. Fig. 15b illustrates signal strength as a function of angle index n and time in ns as a contour plot. Figs. 15c and 15d illustrate the result of described procedure No. 1 up to step 1.5 inclusive. Fig. 15c illustrates signal strength as a function of angle index n and frequency in GHz in a 3D plot. Fig. 15d illustrates measured signal strength as a function of angle index n and frequency in GHz in a contour plot. Figs. 15e and 15f illustrate the result of described procedure No. 2 up to step 2.2 inclusive. Fig. 15e illustrates calculated signal strength as function of angular harmonic index k and time ns in a 3D plot. Fig. 15f illustrates calculated signal strength as a function of angular harmonic index k and time in ns in 3D plot. Fig. 15g and 15h illustrate detection curves as the result of procedure No. 6 up to step 6.3 inclusive. Fig. 15g illustrates D in absolute values, fig. 15h illustrates D in dB. Fig. 15i through 15o illustrate detection curves as a result of procedure No. 2 up to step 2.3, inclusive. Fig. 15i illustrates D in absolute values, fig. 15j illustrates D in dB, fig. 15k and 151 illustrate calculation results comprised by the described procedure 3. Fig. 16 illustrates the result of the described procedure No. 1 up to step 1.6 inclusive. Fig. 16a illustrates signal strength as a function of angle index n and time ns in the form of a 3D plot. Fig. 16b illustrates signal strength as a function of angle index n and time ns in a contour plot. Figs. 16c and 16d illustrate the result of the described procedure No. 1 up to step 1. inclusive. Fig. 16c illustrates measured signal strength as a function of angle index n and frequency in GHz in a 3D plot. Fig. 16d illustrates measured signal strength as a function of angle index n and frequency GHz in a contour plot. Figs. 16e and 16f illustrate the result of the described procedure No. 2 up to step 2.2 inclusive. Fig. 16e illustrates calculated signal strength as a function of angular harmonic index k and time ns in a 3D- plot. Fig. 16f illustrates calculated signal strength as function of angular harmonic index k and time in ns in a contour plot. Figs, log and 16h illustrate detection curves as the result of procedure No. 6 up to step 6.3 inclusive. Fig. 16g illustrate D in absolute values, fig. 16h illustrates D in dB. Figs. 16i and 16j illustrate detection curves as the result of procedure No. 2 up to step 2.3 inclusive. Fig. 16i illustrates D in absolute values, fig. 16j illustrates D in dB. Figs. 17, 17a and 17b illustrate the result of the described procedure No. 1 up to step 1.6 inclusive. Fig. 17a illustrates signal strength as a function of angle index n and time in ns as a contour plot. Figs. 17c and 17d illustrate the result of described procedure No. 1 up to step 1.5 inclusive. Fig. 17c illustrates measured signal strength as a function of angle index n and frequency in GHz in a 3D-plot. Fig. 17d illustrates measured signal strength as a function of angle index n and frequency in GHz in a 3D plot. Fig. 17d illustrates measured signal strength as a function of angle index n and frequency in GHz in a contour plot. Fig. 17e og 17f illustrate the result of described procedure No. 2 up to step 2.2 inclusive. Fig. 17e illustrates calculated signal strength as a function of angular harmonic index k and time in ns in a 3D plot. Fig. 17f illustrates calculated signal strength as a function of angular harmonic index k and time in ns in a contour plot. Figs. 17g and 17h illustrate detection curves as the result of procedure No. 6 to step 6.3 inclusive. Fig. 17g illustrates D in absolute values, fig. 17h illustrates D in dB. Figs. 17i og 17j illustrate detection curves as the result of procedure No. 2 up to step 2.3 inclusive. Fig. 17i illustrates D in absolute values, Fig. 17j illustrates D in dB. Fig. 18 illustrates a collection of detection curves each being taken from the prototype and thereafter positioned in the figure - it is seen how the detection curve alters when passing above an object. The object indicated in the figures 18, 19a and 19b is known and is a tube made of a plastics PVC material and being filled with water and having a diamter of 110 mm and being burned in a depth of approx. 140 cm. In fig. 18, time delay is converted to estimated depth under the assumption of an estimated average value for the propagation velocity of the radio waves in the earth. Fig. 19a illustrates a typical detection curve from the display of the proto type. A clear indication is seen in a depth corresponding to the time delay approx. 31 ns. Fig. 19b illustrates a detection curve indicating no cable or tube. The figures 20-44 illustrate the present embodiment of the invention. Fig. 20 illustrates the entire plant comprising transmitter and receiver antennas mounted on a circular disc, battery case, transmitter and receiver electronics and data processing plant, including monitor. Fig. 21 illustrates a system diagram for the hardware of the prototype. The system consists of three main parts: Antenna array, RTVA (Real Time Vector Analyzer) electronics and a PC provided with a signal processing module. Fig. 22 illustrates an action chart of the RTVA electronic part. Fig. 23 illustrates an action chart of the receiver electronic part (Receiver). Fig. 24 illustrates a circuit diagram of receiver 2 (Receiver: Board 'a'). Fig. 25 illustrates a circuit diagram of receiver 3 (Receiver: Board 'b'). Fig. 26 illustrates a circuit diagram of receiver 4 (Receiver: Board V). Fig. 27 illustrates a circuit diagram of receiver 5 (Receiver: Board 'd'). Fig. 28 illustrates a circuit diagram of a transmitter. Fig. 29 illustrates a circuit diagram of a synthesis unit. Fig. 30 illustrages a circuit diagram of the supply unit of the synthesis unit. Fig. 31 illustrates a circuit diagram of a permanent (quick) synthesis unit. Fig. 32 illustrates a circuit diagram of a variable synthesis unit. Fig. 33 illustrates a circuit diagram of a reference unit for the synthesis unit. Fig. 34 illustrate a circuit diagram of a switch unit for the synthesis unit. Fig. 35 illustrates a circuit diagram of a detection circuit consisting of logic digital inlet/outlet lines for control of the synthesis unit, antenna unit and supporting units. Fig. 36 illustrates a circuit diagram of a detection circuit consisting of analog-to-digital converters. Fig. 37 illustrates a circuit diagram of an antenna switch board. Fig. 38 illustrates a circuit diagram of an antenna switch decode/level switch. Fig. 39 illustrates a circuit diagram of a dipol antenna. Fig. 40 is an illustration of the top part of a two-sided printed circuit board layout of a dipole antenna circuit. Fig. 41 is an illustration of the lower part of a two-sided printed circuit board layout of a dipole antenna circuit. Fig. 42 illustrates a serial cable interface. Fig. 43 illustrates a serial interface (SHARC). Fig. 44 illustrates a serial interface (EZLITE). Figs. 45-47 illustrate alternative configurations of the antenna elements. Fig. 45 illustrates an arrangement comprising four pairs of antennas, all the dipole centres are displaced from the geometric center. The elements are of the butterfly type which construction almost corresponds to the one shown in fig. 11 and the total arrangement corresponds to the configuration shown in fig. 12. Fig. 46 illustrates an arrangement including five pairs of antennas, all the dipole centres are displaced from the geometric center. The elements are of the butterfly type which construction almost corresponds to the one shown in fig. 11 and the total arrangement corresponds to the configuration shown in fig. 12. Fig. 47 illustrates an arrangement including five pairs of antennas, all the dipole centres are displaced from the geometric center. The elements are of the butterfly type the construction of which almost corresponds to the one shown in fig. 11 and the total arrangement corresponds to the configuration shown in fig. 12. For a more detailed explanation of the invention, the following tables are presented. The tables 1-8 contain information about the present embodiment of the invention. Table 1 contains terminal indications and list of components for the receiver electronics. Table 2 contains terminal indications and list of components for the transmitter electronics. Table 3 contains terminal indications and list of components for the synthesis unit. Table 4 contains terminal indications and list of components for the detection unit. Table 5 contains terminal indications and list of components for the antenna switch unit. Table 6 contains terminal indications and list of components for the antenna switch decode/level switch. Table 7 contains list of components for serial interfaces for figs. 42-44. Table 8 contains list of components for dipole antenna element. The tables 9-11 contain information about possible embodiments of the invention. Table 9 contains a summary of a number of possible antenna configurations. Table 10 contains examples of number of rotations of the antenna system. ΔΘ is the angle of rotation between each measurement, N is number of measurements. Table 11 contains examples of k-indexes corresponding to two periods per rotation, r values indicated in pairs (k^k 2 ), ΔΘ is the angle of rotation between each measurement, N is number of measurements. Table 12 contains measuring information from a present embodiment of the invention. Table 12 contains a summary of objects illustrated in the examples 1 to 5. Referring to fig. 20 a preferred embodiment 10 of the invention is illustrated. The embodiment 10 consists of a body for mobilization comprising a set of wheels 32, a support 26 and a U-shaped handle 30 to which the support 26 is fixed to the open end of the U, and the wheels 32 are fixed to a shaft carried by a number of projections from the handle 30 in the open end of the U. A house 12 is mounted on the platform 26 containing the individual antenna elements designed as described in the following. The individual antenna elements are fixed to the top side of the house 12 by retainers 18 comprising a frame connection. Metal screws 24 provide further fixation of the individual antenna elements. Bolts 22 of a plastics material keep the topplate and the bottom plate of the house 12 together. Transmitted signals are applied and received signals are received as described in the following, to and from the individual antenna elements through conduits 20 to switch cases 16 comprising, in combination with an electronic logic unit 14, the control of the switching between the transmitting and receiving function of the individual antenna elements. The electronic logic unit 14 is positioned beneath the switch boxes 16. The communication between the individual antenna elements and the electronics 34 of the plant, comprising synthesis electronics, frequency measuring electronics and transmitter-receiver electronics as described in the following is maintained through a set of conduits 28. The signal processing means comprises a computer 38 coupled to a monitor 42 and a keyboard 40. For current supply of the computer 38, the monitor 42, the keyboard 40 and to the electronics 34 of the plant a power supply 36 is positioned on the opposite side of the handle 30 in relation to the computer 38. A further description of the invention will follow. 1. Background of the invention The present invention relates to methods and apparatuses for detection of objects in the ground by means of a ground radar. Ground radars or raders "looking" into the ground or into other materials have been known and used for centuries and are also known as georadars, ground penetrating radars and subsurface radars. For a long time it has been attempted to use ground radars to find buried objects in the ground, such as cables, tubes and optical fibres. However, prior art embodiments of ground radars are not especially useful for this purpose which may be considered the reason why no commercial break- through for radar based cable and pile detectors has taken place - in spite of a recognized requirement and many experiments. Under favorable conditions, commercially available ground radar systems enables detection of cables and pipes, but only in case the radar antenna is carried forward in one or more straight lines transversely to the objects to be found - and only by interpretation of the registered measurements which require a high level of qualification of the interpreter. Radio waves have a polarization connected to the spatial orientation of the associated electromagnetic fields. Utilization of the polarization adds a further dimension to ground radars and thus to the manner in which objects may be distinguished from the surroundings - in addition to the traditional time resolution. Use of polarization as a means for discriminating objects, especially elongated objects, has not led to easily operated radar equipment for detection of cables and pipes. In fact, previous patents and publications used polarization - not least the early work by Young et al. from Ohio State University, vide example [8]. Others have followed in these footsteps, including the group comprising Gunton et al. In Great Britain, vide example [1], [2] and [10]. Furthermore, at number of tests have been made to transfer the methods known as synthetic aperture or synthetic array and used as air and satelite borne radar systems to ground radars. The application of polarization is also known from these systems - often designated polarimetry. It is common features of the polarimetry and the synthetic aperture methods that they require a fairly homegeneous medium, that the illuminated objects are positioned in the far field of the antenna and that the mutual phase of the radar signals is not substantially influenced by contingencies in the propagation medium. When an antenna is positioned close to the ground or by wave propagation in soil altogether, a strong influence of the phase and amplitude of the waves from contingenties in the form of stones, metal objects, uneven surface, moisture and such, will almost always be present. The influence of such contingencies may result in significant variations when moving the antenna just a few centimeters. Methods for utilization of polarization as described in [1] and [2] fail in relation to the inevitable contingencies in the signals mentioned above. The periodicity applying to radar signals from thin, elongated objects in the ground under ideal circumstances as described in [1] og [2] is in practice (most) often hidden behind incidental variations of substantial strength. The noise introduced as a result of the contingencies makes it too unsafe in practice to base detection on simple algebraic combinations of measured radar signals. Rotation of polarization is a useful and powerful means for improving the characteristics of ground radars. In [1] the following mathematic model for the dependency of the polarization angle for long thin objects Gunton et al indicates: F(t) = A(t) + B(t)sin(X) + C(t)cos(X) +D(t)sin(2X) +E(t)cos(2X) Where X is the angle of rotation of the antenna system. It is not totally clear how the phases of A(t) ...E(t) are associated in this equation. In any case it may be concluded that mathematical equations as this one which may be considered as a first part in a Fourier series cannot in practice be used to describe the signals measured in an ground radar with any usable approximation. We find that proper Fourier analysis of the angular dependencyr together with other matematical operations is a very useful tool for detection of objects. Regarding the othogonal two-terminal antennas with coincident electrical centers which are used in the patents [8], [1] og [2] we have observed that these are not the most suitable for detection of objects such as cables and pipes. The argument for using co-located two- terminal antennas which are mutually perpendicular (eg crossed dipoles) is according to the patent specifications mentioned that the mutual electromagnetic coupling between these are theoretically zero - and that thus no direct signal coupling takes place from transmitter to receiver (called "breakthrough"). We find that antennas with displaced centers are preferred in most cases. The reason for this is that the symmetry which is necessary in a construction with crossed dipoles is in practice disturbed by the surroundings, especially by roughness in the surface of the ground. As the near fields of co-located antennas to a great extent are coincident, small deviations from the symmetry are destroying and result in substantial mutual coupling. Therefore separation of the centres of the antennas is better. Our preferred antenna configuation is co-linear or parallel dipoles with displaced centres contrary to the patent speficiations [1] and[8] where antennas as well as detection methods are based on orthogonality. But it has to be emphasized that our detection method, including signal processing, is extremely useful together with orthogonal antennas. Our preferred signal form corresponds to the so-called "stepped-frequency CW radar" in which sinusodial wave signals are emitted having the frequency altered stepwise. CW means "continuous wave" and indicates that the sinusodial wave is emitted for as long as during each measurement transient phenomenons may be considered to have disappeared. In an ground radar presented by the inventors, frequencies in the interval 100 MHz to 1,000 MHz with frequency increments of 5 MHz are emitted (but the methods of the invention may be used in any frequency range). This signal form requires a method for transformation into the time domain. We have observed that the electromagnetic attenuation in the ground is substantially an exponential function of the frequency in the relevant frequency range. Based thereon we have constructed an exponential signal model to be used as basis for estimating the time delays of the radar signal. The method has certain similarities to the methods called Prony methods, vide e.g. [7]. Methods derived from the original Prony method are already known in analysis of radar signals. A new feature in the present method is that in a mathematically coherent manner it takes the dispersive characteristics of earth materials into account. In principle, it is possible by means of this method to determine the strength of a reflector regardless of the reflector being buried in strongly attenuating material. Furthermore it provides a better time resolution than the Fourier transformation which is often performed by means of FFT algorithms. The classical relation between band width and time resolution saying that the smallest time difference detectable is inversely proportional to the band width of the signal does apply, as known, when Fourier-based method are used. Under certain circumstances a better resolution is obtained by the Prony method. We have observed that it is a completely necessary condition for satisfactory detection of objects that the polarization determined angular dependencyr is investigated separately at different time delays - or in other words: reflectors appearing in different distances from the antennas with respect to time are investigated for polarization separately. Consequently a two-dimensional signal analysis is necessary in which the two dimensions correspond to the angle and time domain. Moreover we have observed that a translational movement of the antennas during rotation has the useful effect of destroying the periodicity in the angular dependencyr of the very close object, whereas the periodic dependency of more distant (and possibly larger) objects is maintained. Therefore, Fourier analysis in the angle of rotation of a signal measured under such circumstances will show that signals from objects near the surface will have the energy distributed over a broad spectrum of harmonics whereas for instance cables and pipes will result in a considerably more concentrated spectrum around the harmonics corresponding to 2 periods per rotation. Thus a damping of the undesired reflections from objects and roughness in the surface is obtained. This suits perfectly to the practical use of an ground radar for scanning which is carried forward manually or mounted on a vehicle or a machine during mechanical or electrical rotation of the polarization. The analysis of the signals and thus the detection method as described in [1] and [2] are based on comparison with reference measurements - in [2] in the form of 'matched filters', which is equivalent to the correlation with known curves. The problem with use of reference measurements is that two objects with associated surroundings and giving the same reflection do not exist. Therefore, a method based on reference measurements is difficult to use in practice. This invention seeks to solve these problems by means of existing methods and apparatuses. As it is evident from some attached examples illustrating processed data from measurements made under realistic circumstances, a signal/noise relation of 20 dB or more under general conditions may be obtained by means of the methods as described here. For comparison, an ground radar scan over a cable or pipe transversely hereto by means of a prior art apparatus typically presents an echo of approximately the same strength as those from various objects in the surroundings - i.e. approximately a signal/noise relation of 0 dB under the same circumstances. Use of the Prony method for transformation from frequency to time together with the angle Fourier analysis and polarization rotation gives a detection reliability which have not been seen previously. 2.Introduction The present invention is demonstrated in an embodiment which purpose it is to find and determine the direction of elongated objects in earth which in practice comprise pipes of all materials, cables containing metallic conductors and optical fibres. However, the method described, including the mathematical parts and the application of electromagnetic waves with rotating polarization may be used for other purposes. For instance detection of anti-personnel mines. The method described for determination of direction is however limited to elongated objects. When in the following earth and detection of objects in earth are mentioned this is for the sake of convenience. The invention is also suitable for detection of objects hidden in other materials, for instance in concrete, other building materials or rocks which may all be considered earth materials with respect to electromagnetism. Also objects in the air may advantageously be detected by means of the methods described. The invention is based on use of electromagnetic waves (in the following called EM-waves) which are transmitted into the material into which one or more objects are hidden. Thus, the invention is based on a RADAR-like principle. The electromagnetic waves may also according to general language usage be called radio waves. The invention is based on emission of EM-waves by means of an antenna for this purpose and measurement, registration and further processing of the electromagnetic responses or reflections which the objects give rise to. A radar as known from airports and from many other places is often situated at a rather large distance to the reflecting objects, seen in relation to the wave length of the EM-waves used and/or the duration of the pulses emitted. In the immediate neighbourhood of the antenna of a radar of the presently relevant type objects will often be present - often the surface of the ground will be present in what according to present language usage is called the near field of the antenna. The electromagnetic influence of objects this close is often not construed as reflections because so-called reactive fields are prevailing. In the following the designation "reflections" is used - without detailed differentiation - about all the registered influences made by objects outside the antenna - close or distant. The present invention is based on a utilization of a combination of a time resolution of electromagnetic responses and on the polarization dependency thereof. It is of no importance whether time delays and polarization dependency originate from elements designated transmission, reflection, near fields or far fields, inductive coupling, capacitive coupling or "real" radar reflections. A preferred embodiment of the invention is arranged so that the objects to be detectet are present outside the near field of the antenna, but it is a substantial advantage of the invention that it is able to suppress near field phenomenons even though they present a larger strength than "desired" reflections. In a radar system in connection with the present invention one antenna is used for emitting EM-waves and one antenna is used for receiving the responses on the emissions, or a multiple of such antennas are used. A possible embodiment may very well comprise one or more antennas which are used for transmission and reception - possibly on the same time. In the following the transfer function between transmitter and receiver is used regardless of the construction of the antenna. The important point is that in the system a distinction is made between emitted and received signal and that these are compared. The comparison is made indirectly by the emitted signal - or just the AC voltage - is determined and known and that the received signal is measured and registered. In the following a signal means an electromagnetic response or a connection between the emitted and the received signal. In the following objects may - apart from well defined objects such as pipes, cables etc - also mean differences in material characteristics, i.e. inhomogenieties in the medium in which EM-waves are propagating. By rotation of antennas, rotation of polarization derived by physical (mechanical) rotation as well as entirely electrical means, including electrical shifting between a number of antenna elements, is meant. Measurements mean manual as well as automatic determination of physical sizes by means of suitable equipment. Registration and storing may likewise be manual or automatic. The invention utilizes analysis of electromagnetic response signals for the polarization dependency and time delays (or one of them) of the electromagnetic response signals. Analysis means calculations based on measured sizes. In practice, possible embodiments of this invention are best realized by means of digital equipment and certain physical elements such as the frequency of the emitted EM-waves are often altered at intervals. Therefore, to a great extent set of numbers will in the following be utilized for representation of physical elements which may by nature be considered continuous. In the following are mentioned two-dimensioned set of numbers which are concentrations of discrete values. These sets of numbers may also be construed elements in a matrix and each of the rows or colums herein may be construed series of numbers. Synonymously herewith equations such as curves or functions and function values are used. Possible embodiments demonstrated by the inventors are based on discrete frequencies, angles, angular harmonic and times which is motivated by the use of digital store units and calculation units. - Even though the presented examples come forward as continuous images. The principles of the invention apply for continuous frequencies, angle rotations, angular harmonic and times as well as for discrete corresponding features. The precise embodiment of mathematical formulas given in the following is not the only one possible. For instance, formulas exist for continuous as well as discrete Fourier transformation, but according to well-reputable text-books, Fourier transformations and Fourier sequences may be calculated in various ways. The indicated formulas are used by the inventors to demonstrate possible embodiments of the new principles of the invention in practice. The illustrated examples of curves and calculations based on measured, physical elements are also only possible illustrations of the principles of the invention. Numbers of references (vide list) are indicated in square brackets: [ ] Numbers of equations in the document are indicated in common parentheses: ( ) 3. Rotating polarization If during propagation an electromagnetic wave hits an object the electrical characteristics of which diverge from those of the surroundings some of the energy of the wave is deflected or reflected when hitting the object. It is a well-known fact that under certain circumstances this reflection (scattering) depends on the polarization of the wave in relation to the spatial orientation of the object. By the polarization of the electromagnetic wave, the direction of the electrical field vector is understood. This polarization may be varying, diffuse or it may be approximately linear in a given direction, or it may be circular which means that it turns around an axis. A possible embodiment of the present invention which is demonstrated by the inventors, utilizes linear polarization. Furthermore, other types of polarization, including circular and elliptical, may be generated physically and may be analysed as linear combinations of linear polarized parts - therefore linear polarization is dealt with separately in the following. 3.1 Linear polarization By linear polarized waves, electromagnetic waves are understood which are intendedly made as linearly polarized in a (most often) horizontal direction as practically possible. It is part of the method that the approximately linear, (often) horizontal polarization of the waves is rotated around an (most often) perpendicular axis. A possible embodiment of the method applies waves which are to as great an extent as possibly characterized by: - Linear polarization in several directions which is parallel to a level parallel with the longitudinal axis of the elongated object(s) to be detected and located. Rotation of the linear polarization direction around an axis perpendicular to the level mentioned (and perpendicular to the longitudinal axis of the object), but not necessarily crossing the longitudinal axis of the object. Since detection and location of cables, optic fibres or pipes burried in the ground are substantial purposes of this invention, the designed linear polarization directions will often be horizontal and be rotated around a vertical axis. When in this context such electromagnetic waves are not described as circularly polarized waves it is due to the fact that in this method it is not necessary that the linear polarization is in all possible angles or that the rotation is continuous. A further reason for this is that the invention is based on the substantial realization that in practice it is very hard to obtain a well-defined circular or elliptical polarization under propagation in earth due to the often very important inhomogeneous composition of the soil medium. The EM-waves mentioned here are produced by applying a high frequent electrical voltage to an antenna with an appropriate construction. Often electrical dipoles or two-element antennas are used for obtaining an EM-wave which is almost linearly polarized. Then one or more dipoles are positoned for instance above the surface of the ground with a horizontal orientation of its or their longitudinal axis. Vide Fig. 2, 3 and 4. In the following description, two-element dipole antennas are dealt with for convenience, but other types of antennas may also be used, for instance so-called slot- antennas. For the purpose of detection of cables and pipes in the ground, horizontally oriented dipole antennas are often applied because cables and pipes normally lie horizontally in the ground. It is not a condition for the present method that the objects lie precisely horitontally in the ground - and it is not necessary, either, that the antennas applied are kept precisely horizontally above the ground. It is a well-known fact that if an elongated object such as a cable or a pipe in the ground is hit by an electromagnetic wave the polarization of which is almost horizontal, the strength of the signal reflected from the object will be a periodic function of the angle θ between the polarization direction of the wave and the longitudinal direction of the object. This is described in [3] and in other textbooks and is also described in [1]. Finally, it is also a well-known fact that when a linear polarized antenna such as a dipole is hit by a linear polarized EM-wave, the size of the voltage induced on the terminals of the antenna is proportionate to cosine of the angle between the polarization directions of the antenna and the wave, respectively. The generally known facts mentioned here are utilized in the present invention to enable detection, location and direction determination of elongated objects in the earth without use of reference measurements of the type described in flj. An embodiment of the present method applying linear polirization does not require the use entirely linearly polarized EM-waves or require that the antennas used, when used for the emission of EM-waves, only emit such totally polarized waves or that the antennas when they are used for reception of reflections only are sensitive to waves having a certain polarization. Nor is it necessary that the objects to be detected only reflect waves having a certain polarization. It is sufficient for the application of the method that these conditions to some extent are met. 3.2. Other forms of polarization Circular and elliptisk polarization may be produced physically and may as a matter of fact be considered linear combinations of linear polarizations. For instance, circular polarization may be obtained by applying AC voltage to orthogonal, linearly polarized antennas with a mutual phase displacement of 90 . 4.1 Antenna configurations for linear polarization Linear rotating polarization is appied in an embodiment of the present invention which is demonstrated by the inventors - in the following some possible configurations of antennas for linear polarization will be described schematically. The antennas determine the polarizations to be used. The angle between the polarization of the transmitter and receiver antennas is important - the following is based on two basic configurations for linear polarization: TYPE 1 measurement: Co-polar: Same polarization of transmitter and receiver antenna TYPE 2 measurement: Cross-polar: The polarization of transmitter and receiver antennas are mutually perpendicular Figs. 3 and fig 4 illustrate the fundamental construction of some possible combinations of antennas in the form of outlines of combinations of dipole antennas of type 1 and type 2, respectively. Reference is made to S-parameters as they are well-defined. S 21 indicates a measurement of the type transmission measurement between two sets of terminals (even though reflections in the transmission medium are the important factors) and S u indicates a reflection measurement at a single connection. The use of S-parameters is symbolic, other definitions may be used. Table 9 is an outline of some possible antenna configurations. All the combinations in figs. 3 and 4 constructed from dipole pairs: one dipole for transmission, one for reception. Fig. 5 illustrates a measurement with one single antenna which means that a circuitry based measurement of a reflection which may be S as the emitted and received signal exist on the same terminals. The configuration in figs. 6a and 6b corresponds to the one used in [1] and [8] and in practice this configuration has turned out to be less useful for detection of objects in the ground, among other things because the direct electromagnetic coupling between transmitter and receiver antenna will have a large size compared to the EM-waves reflected from objects in the ground. The electrical centres of the antennas are coincident in figs. 6a and 6b. In spite of its practical limitations such a configuration is suitable for an approximate theoretical analysis of the relations regarding polarization-based detection of objects in the ground. If, as illustrated in fig. 7a, two crossed dipoles are positioned so that their mutual center is on the axis crossing perpendicularly between an elongated and thin object and the dipoles lie in a plane which is parallel to the linear object the following mathematically relations for the amplitude of the electrical AC voltage on the terminals of the receiver antenna apply. The angle between one of the dipoles and the object is θ. We assume that a high frequent AC voltage is applied to the transmitter antenna with a constant amplitude so that the applied voltage may be represented by the mathematical equation: v t χ(t) = A tχ cos(2πft) (1) where V^ is the applied, time dependent voltage, t is the time, A^ and fare the amplitude and the frequency of the applied signal, respectively. Given this electrical signal on the terminals of the transmitter antenna the following approximate equation for the voltage over the terminals of the receiver antenna applies: V rl (t,θ) = A 1 sin(2θ)A tχ cos(2πft +φ,) (2) Where A, is a constant amplitude factor determined by the physical conditions and φ is a starting phase. If two co-linear dipoles are positioned as in fig. 7b and the length of the dipoles and the distance between their centres are small enough in relation to the distance between the dipoles and the object, the following relation applies: V r2 (t,θ) = A 2 (l+cos(2θ))A tχ cos(2πft +φ 2 ) (3) Where A 2 and φ are constants. It should be noted that the voltage of the receiver antenna is dependent on both the time t and on the angle of rotation θ of the antenna in relation to the object and that the variation as a result of θ will normally happen much slower than the variation in time. Similar mathematical equations apply to types of antennas other than electrical dipoles, if these only have a linear polarization characteristic. The two mathematic cohesions (2) and (3) are based on a number of assumptions: - that there are no reflection from the receiver antenna to the transmitter antenna. - that the antennas as well as the objects are very thin in relation to the length of the EM- waves applied which is a condition for antennas as well as objects being considered linearly polarized. - that the thicknesses of antennas and objects are small in relation to the distance between antennas and object. - that all media surrounding antennas and object are homogenious in all directions which also may be expressed as the medium in which the electromagnetic fields and waves propagate is homogenious. The present invention enables safe detection of cables and pipes in the ground by means of polarization analysis without the fulfilment of the above ideal preconditions. 4.2. Equations for angular dependency at linear polarization In the following we will focus on the voltage transfer function between transmitter and receiver as it contains the important information rather than the voltage of the terminals of the receiver antenna. If we remove the time dependent parts from the equations (2) and (3) in order to emphasize the importance of the angle rotation θ we get the following equation for the angular dependencyr of the voltage transfer function: HJΘ) = A 1 sin(2θ) (4) for the angular dependencyr in a cross-plar antenna arrangement (type 2) and for the angular dependencyr in a cross-polar antenna arrangement (type 2) and H 2 (θ) = A 2 (l+cos(2θ)) (5) for the angular dependencyr in a co-polar arrangement (type 1). However, the above mathematical equation with the preconditions mentioned never applies precisely. In practice we will - when measuring the relation between the AC voltage applied on the transmitter antenna and the existing voltage on the receiver antenna - get a more complex context. 4.3. Equations for angular dependencyr at circular polarization Circularly polarized waves may be obtained by means of a linear combination of two linearly polarized waves. Antenna with circular polarization may be constructed by means of combination of linearly polarized antennas. For example the schematic configurations may be used - each of the combinations shown may be doubled so that one is included in the transmitter antenna and one in the receiver. If the transmitter antenna and the receiver antenna are both circularly polarized and if, as mentioned, we assume that an object is thin and elongated and thus show linear polarization sensitivity, the result is a voltage transfer function which does not vary in size. Under ideal circumstances corresponding to the circumstances mentioned above, we get a transfer function of the form: H c (θ) = A c exp(j2θ) (5al) or: H c (θ) = A c exp(-j2θ) (5a2) Under certain circumstances the response of two circularly polarized antennas on a linear object will be constant, i.e.: H c (θ) = A Here j is the imaginary operator in complex numbers, j = -1. A is an amplitude factor. H c (θ) is now complex and expresses (ideally) the rotation-angle dependent phase rotation in the voltage transfer function. As the polarization of the emitted wave at circular (or elliptical) polarization rotates continuously during the propagation, θ is not, similar to at linear polarization, equation for a polarization condition which is maintained as long as the antenna system is in a given consition or position. Instead θ is in (5al) and (5a2) equation for a starting rotation of the polarization of the wave. Such a starting rotation may vary with corresponding means like the above mentioned linear polarization. An angular dependencyr as in (5al) or (5a2) may be obtained by combinations of orthogonal antennas with 90 mutual phase rotation. It should be noted that it is not necessary for such phase rotation network to exist physically - or that electrical signals are expressed to the orthogonal antennas at the same time. Linear combinations of linear polarizations - including circular - may be formed by activating sets of for instance dipoles in arbitrary order, store the measured signals and thereafter combine them algebraicly. The phase rotation of signals is obtained by multiplication with suitable complex constants before summation. If circular or elliptical polarization is obtained by means of a combination of linearly polarized antennas the starting rotation of the resulting (approximate) circular polarization follow a mechanical or electrical (electronic) rotation of the applied linearly polarized elements. If emission of elliptical or circularly polarized waves is utilized then the measured signals may be used for detection of objects during application of the methods stated in the present patent for utilization of linear polarization. A practical utilization of circular or elliptical polarization may be based on splitting of the measured, complex angular dependencyr in a real part and an imaginary part, corresponding to what is often called quadrature splitting in an I and a Q part (In-phase Quadrature part, respectively). By way of example the equation in (5a2) may be written as: H c (θ) = A exp(-j2θ) = A cos(2θ) -jA sin(2θ), where it will be seen that the imaginary part corresponds to the equation for linear polarization (4). 5. Fourier analysis and rotation based measurements The above expression H j (θ) and H 2 (θ) for the angular dependencyr of the transfer function (at linear polarization) are both characterized by running through two periods when the antenna system is rotated one turn. If we place any combination of transmitter and receiver antennas above the ground and rotate it around a vertical axis there will often be a substantial variation in the transfer function during rotation, especially if the antenna is positioned close to the ground, due to inhomogeneities in the ground such as stones, varying types of soil and humitity, waste material etc. Also roughness in the surface of the ground often has a substantial influence. Besides variations in the magnitude of the transfer function variations of the phase in a much more complex manner than the shift of polarity sign implied in the above expression for H,(θ) and H 2 (θ) will apply. The phase difference between the AC voltage applied on the transmitter antenna and the voltage measured on the receiver antenna is the phase of the transfer function. If we rotate the antennas precisely one turn, i.e. 360 , we will measure exactly the same transfer funtion prior to and after the rotation , therefor it is obvious that a periodical angular dependencyr exits. But besides functions experiencing two periods per rotation dependencies of θ with higher periodicity are often examined, and a dependency corresponding to one period per rotation. As part of the present invention it has been discovered that the angular dependencyr of the voltage transfer function between two entirely or partly linear polarized antennas emitting and receiving electromagnetic fields or waves, respectively, propagating down into the ground and entirely or partly reflected from objects in or on the ground may with a good approximation be described by means of a Fourier series, and that this may be used for substantially improved detection of elongated objects compared to other known methods. Such a Fourier series may be expressed mathematically as follows: Nil H(θ) = ∑ C„ exp(;«ΩΘ) n=-NI2 (6) where: n= 0, ±l, ±2.., ±N/2 which is a Fourier series with N+l elements. C 0 represents a mean value which is constant during rotation. The Fourier constants C in the equation (6) are complex and may be calculated in the form of integrals by means of the following equation 1 π C " „ = — JH(θ)exp(-.//ιΩΘ)dθ lπ - « (7) where: n= 0, ±l, ±2.., ±N/2 θ is the rotation of the antenna system based on an arbitrary starting position Ωis a variable designated the angular harmonic variabel j = -1, j is the imaginary operator in complex numbers (6) describes the variation of the voltage transfer function during rotation of the antenna system as a function of the rotation angle θ. The variable Ω now introduced is analogous to the frequency variable ω, which is often used for representing (angle)frequency by Fourier transformation of time harmonic functions. Please note that in (6) a final number of elements exists - practice has revealed that only a smal number of harmonics are necessary for a useful representation of H(θ). H(θ) is complex and contains amplitude as well as phase information about the transfer function. The mathematical way of writing of complex numbers employed in this connection is in accordance with the way of writing employed by electrical engineers and others for representation of periodical alternating quantity and is described in many textbooks such as [3] og [4]. Comments concerning Fourier constants: C 0 in the above equation (6) describes a mean value which typically originates from reflections in the ground which are independent of the polarization rotation. C 2 and C_ 2 are two constants corresponding to two periods of a rotation of the antenna system. By linear polarized antennas C 2 and C 2 are under ideal conditions conjugated in a mutually complex manner, i.e.: * * C 2 = C_ 2 ( means complex conjugation) By circular polarized antennas either C 2 or C_ 2 is under ideal conditions zero. H(θ) is in its nature a continous function of the angle (θ) and has so far been regarded as such, but it will often be of great practical value to measure H(θ) only at a smaller number of finite values of θ, for instance 8 or 16 values during one rotation corresponding to a rotation of the antenna system of 45 or 22.5 , respectively, between each measurement. If H(θ) is measured as described at some discrete values of θ, exclusively, the angle may be written mathematically as: θ = ΠΔΘ, where n= 0..N-1 and ΔΘ is the smallest angle rotation, for instance 45 or 22.5 . Based on such measurements of H(θ) complex Fourier components may be calculated by means of the formula: N-\ C k = ∑ H(nΔΘ)exp(y(2π / N)nk) n=0 C k is periodical in k. C k constitutes a discrete function the independent variable of which may be considered a quantified copy of the above mentioned angular harmonic variable Ω, but for practical use by detection of objects it is useful to consider it a function in the index k. Therefore we define: VΛk) = ∑ H(nΔΘ) exp(;(2π / N)nk) , k = 0,1..N - \ «= (8) N may for instance be 8, 16, 32 or 64. The number of measurements in (8) is equal to the number of calculation points for the function V f (k). Thus the equation (8) may effectively be calculated by means of a Fast Fourier Transformation method, know as FFT, vide for instance [4]. V j (k) as defined in the equation (8) is in the present invention called an angular harmonic function as it appears in a Fourier transformation of the angle dependent transfer function and thus a solution of the angular dependencyr in harmonic components. V f is marked f, as Η in (8) is a frequency dependent variable. In a step-frequency radar, where Η(ΠΔΘ) is measured at M frequencies for each n, V f becomes a two-dimensional function with MxN points, i.e. V j (n,m), n= 0..N-1 and m=0..M-l. k is used as index for the angular harmonic variable in discrete form If the radar system measures signals as a function of time - as in an impulse radar which is the most common in commercial ground radar systems - the angle-Fourier-transformation of the data measured will result in a function which is dependent of the angular harmonic and time. The calculation is conducted according to (8), but often the measured result will not be complex, but real. Corresponding to (8) we can define: W-l V,(k) = ∑ Λ, («ΔΘ)exp(;(2π / N)nk) , k = 0,1.. N - 1 « -o (8a) where h t is a measured time function, most often an impulse response - again at different angles ΠΔΘ. If the measurements takes place at N angles and I t points in time, V t becomes a function with I t xN points, i.e. V t (n,i), n=0..N-l, i=T..I t It has turned out that such a solution on the basis of equation (8), (8a) or the like with subsequent selection of suitable harmonic components is extremely effective in emphasizing electromagnetic reflections from objects as cables and pipes in the ground when these appear together with other reflections from soil etc. The preferred embodiment of the present invention uses discrete rotation angles of the polarization (the antenna system), and the preferred values of N in (8) and (8a) is suitable for FFT calculation. Reference is made to table 10 indicating number of rotations of the antenna system at different N and at two generally existing values of ΔΘ. ΔΘ is the angle distance between each measurement. The discrete index k for the angular harmonic, as V Jc) or V t (k) is calculated according to (8), (8a) or equivalent is dependent of the applied angle increments ΔΘ and the number of measurements N, which is included in a calculation (and thus the number of physical rotations of the polarization/the antennas). There are no negative index values in (8) and (8a). The two k-values corresponding to the above mentioned C 2 and C_ 2 , corresponding to two periods per rotation, is for some typical values illustrated in table 11. Examples of k- indexes corresponding to two periods per rotation. K-values stated in pairs (k^k^), ΔΘ is the rotation angle between each measurement, N is the number of measurements. 6. Rotating and translational movement. The present invention takes advantage of the fact that electromagnetic waves are emitted into the ground during rotation of the polarization of the waves. If an area of the soil is to be investigated for e.g. cables and pipes it is necessary that the antenna system is moved forwardly above the ground. Prior art georadar methods requires the antenna system to be moved according to a predetermined pattern, for instance in straight, parallel paths. The present invention allows the antenna system to be brought forward in an arbitrary path above the ground and the method described here ensures an increased reliability for correct detection and locating of elongated objects in the ground due to the movement. If, as illustrated in figs. 8 and 9, we perform two rotations of the polarization plane of the antenna system, both around centers lying near - but not necessarily exactly above - a burried, elongated object and if we measure the voltage transfer function during rotation in the two cases we often see that certain similarities between the two sets of measurements exist, and that certain differences exist. The differences may be caused by variations in the composition of the upper parts of the soil and by an uneven surface. Variations in the composition of the soil, humidity, occurence of stones, garbage, metal parts and the like may exist - often resulting in considerable variations in a movement of just a few centimeters. The similarities are often results of reflections from the burried object. The minor movement of the antenna possibly alters a bit in these reflections and in their angular dependencyr, but the periodicity is mainly maintained. As a whole the periodic sequence of the angle dependent reflections from elongated objects will approximately be maintained during a minor movement whereas the corresponding sequence of inhomogenieties positioned above the object results in considerable changes. If a calculation of Fourier components according to the equation (8) is performed on the basis of repeated measurements during a combination of rotation and suitable movement, V(k) corresponding to these values of k will be emphasized in relation to others. Those which are emphasized will originate from elongated objects whereas those which are damped will originate from the above mentioned other reasons for reflections. This condition being favourable for detection of for instance cables and pipes arises from the fact that calculation of Fourier components in accordance with (8) basically consists of a summation of products which implies determination of mean of sizes measured. The mean determination is also important in connection with objects in the ground causing angle independent reflections. For instance horizontal soil layers will equally reflect the electromagnetic waves regardless of the horizontal polarization direction - such reflections will during calculation of (8) be summed up in the Fourier component V(0) , which is conceptually analogous to the direct- current component or the DC value or the mean value by Fourier solution of an AC current. It should be noted that variations in the measured signal caused by the near field of the antennas and which according to common language usage do not originate from real radar reflections may also be damped or emphasized, respectively, by means of rotation, conveying and Fourier solution. This is a result of the fact that the near fields of the antenna will often have a well-defined orientation. The method described here for emphasizing elongated objects by means of rotation of the polarization of electromagnetic waves may also be applied for improving location of for instance cables by means of inductive methods employing low frequency magnetic fields generated by coils and currents. Contrary to other methods for detection of cables and pipes in the ground as for instance described in [11] the present method does not require the antenna system to be moved crosswise in relation to these objects - a movement along such an object will lead to an increased emphasis of the reflections from this object. However, the method may in fact be used during movement along an arbitrary path - if only distance and angle in relation to the detection object is not altered too much between each measurement. In a possible embodiment of the present invention presented by the inventors, the polarization is rotated so fast that a full rotation of the antennas is achieved for every few centimetres of movement. For each fourth rotation - corresponding to N=32 and ΔΘ = 45 - the 32 Fourier components are calculated. Under these circumstances, undesired reflectors and roughnesses positioned between the antenna and the elongated object are smoothed out to such an extent that a good detection is obtained. 7. Measurement in the frequency domain, step-frekvens CW RADAR The present invention also relates to a method enabling the use of electromagnetic fields and waves which are sinusodial shaped and which do not per se contain information about transient wave propagations or transient reflections from objects in the ground. The method allows for application of the so-called step-frequency radar method in which sinusoidal- shaped (or almost sinusoidal-shaped) waves are generated and emitted, generating stationary waves which strength and phase are measured by a receiver antenna which may be the same as the one used for transmitting. The step-frequency radar method comprises transmission of a number of waves having different frequences, often with equally sized increments in the frequency between each transmission. The frequencies employed in a step-frequency radar may mathematically be expressed by: f(m) = Δfm + f o , m=0,l..M-l (9) where f(m) is the applied frequency, Δf is the frequency interval, i.e. the smallest difference in frequency, m is an integer, and f is the smallest frequency. For ordinary, practical purposes e.g. the following numeric values may be used: Δf = 5 MHz, M=201, f = 100 MHz, which means that 201 different frequencies in the interval 100 MHz to 1100 MHz, both inclusive, are used. The order in which the frequencies in (9) is emitted is of no importance. All the frequencies are applied to the transmitting antenna until the transient period coexisting with the sinusoidal-shaped variation in time of the electromagnetic fields may be considered as insignificant compared to the total, time dependent field strength. In practice, this may take 10 microseconds or less. Measurements with such sinusoidal-shaped fields or waves having transient variations damped result in a frequency dependent measuring of the voltage transfer function between transmitting and receiving antenna. Such a measurement in the frequency domain does not per se provide information about time delays of reflections. The ability to distinguish between different time delays is of crucial importance in a radar system for location of objects in the ground since this differentiation is a substantial means for sorting out for instance reflecting objects on or immediately below the surface of the ground. In case the radar system is designed as a step-frequency CW system it becomes necessary to provide a measure for the time delays of the radar signal based on the measured, sinusoidal- shaped oscillations. The traditional method for obtaining such measurements is Fourier transformation, often designed as a so-called Fast Fourier Transformation or FFT algorithm. By means hereof the measured elements of the frequency domain may be transformed into a calculated estimate of the corresponding time delays. However, the application of Fourier methods for frequency-time transformation is subject to a significant uncertainty fundamenally because all radar measurements only can be performed in a limited frequency interval according to physics. Radar waves in the ground are in practice frequency limited downwardly since the antennas for low frequencies will become too bulky in order to obtain sufficient sensitivity when receiving and sufficient emission when transmitting. Applicable frequencies of electromagnetic waves in soil are furthermore in practice limited upwardly since these waves are dampered during propagation. The dampering is often in practice increasing at a high rate with frequency at frequencies which according to a total estimation are practically applicable. Therefore, radar waves in soil may often be chosen by consideration of conflicting demands concerning limited size of antennas on the one hand and a failing penetrating power of emission on the other hand. Frequencies in the interval 100 MHz to 1.0 GHz are often used for practical reasons. The damping of propagation of radio waves between 100 MHz and 1.0 GHz is substantially increasing with the frequency. This is evident partly from measurements on which the present invention is based, and moreover from several sources, among others: [6, Hoesktra mil.], [5, Turner], [9, Freundhofer et al.]. In addition, the frequency dependency of the damping at practically applicable frequencies are approximately of exponential form. If the damping is illustrated in logarithmic scale in DB per meter and is illustrated as a function of the frequency in MHz then the result is often with a good approximation a linear function. The damping measured in dB/m is thus fairly linearly dependent on the frequency which means that the damping may be expressed mathematically as an exponential function of the frequency. This empirical relation is used in the present invention to obtain a resolusion which has not previously been realized at calculation of time delays in step frequency CW signals. 8. Mathematic model for electromagnetic reflections from objects in the ground and other suppressing materials. When the response of the receiver antenna during transmission of EM waves having sinusoidal-shaped variation in time is measured by means of electronic equipment a value for relative amplitude and phase of the received signal are obtained for each emitted frequency. For every frequency applied a sinusoidal-shaped response is measured which may mathematically be described as follows: where h m (t) is the sinusoidal-shaped voltage with the amplitude A m , the angle frequency ω m = 2πf m and the initial phase φ m ; t is time. Each measurement results in a complex number H m = A m eX P(Jφ m )- The receiver antenna is influenced by an incoming EM-wave which may with a good approximation be construed as a total of waves which are all a time delayed and dampened response to the emitted wave. In a step-frequency CW radar those responses have of course the same frequency as the AC voltage of the transmitter antenna. The time delayed parts originate from a number of reflectors. Consequently, mathematically the received response may be expressed as follows: L H m = A, expO ' φ = ∑a A,m expC/τ, ffl 2π/ (11) here the measured is H m with the amplitude A m and the phase φ m expressed as a total of L components each with the amplitude a k m and a phase which is proportional to the measurement frequency f m and a time delay τ k applying for the single reflector. Due to the exponential frequency dependency of the damping a k m may be expressed as follows: α* ,m = ^ exp(-r i 2π/ m ) (12) , and therefore we obtain: H m = A m exp φ » ) = ∑ c i exp{(-r t + jτ k )2πf k=\ (13) c k are complex factors representing the frequency independent damping as well as a phase rotation which may among others originate from the effective reflection coefficient for the single reflector. In (13) we have removed index m as in the mathematical model we suppose that c k and r k , τ k are independent of the frequency. If we measure at a number of frequencies which are equidistantly positioned in an interval as expressed in (9) it is advantageous to rewrite (13) into : H m = m exp(;φ = ∑cj exp{(r t + jτ k )2π(f 0 + ri } *-> (14) or: H m = A, e pO ' P m ) = ∑ c k exρ{fo + jτ k )2π ή (15) in (15) c k = c k exp[(r k +jτ k )2πf 0 ], and now we have obtained an equation in which the complex exponents are proportional with m since Δf is constant. Based on these equations and as a result of a frequency characteristic of the transfer function measured at a number of discrete frequencies as stated in (9) a set of equations of the following form are listed: or: Η m = C^P,)" 1 + C 2 (P 2 ) m + ... C L (P L ) m , m=l..M (16b) H, = C.P, + C 2 P 2 + ... C L P L H 2 = C^P,) 2 + C 2 (P 2 ) 2 + ... C L (P L ) 2 (16c) This set consists of M equations with 2L unknown complex components. Normally we will provide more measurements than unknown components, i.e. M > 2L, and thus the equation system becomes in excess solable . Such an in excess solvable equation system is to be solved by means of a method of least squares. The equation system in (16) based on M measurements may advantageously be solved by means of a modified so-called Prony- method employing either Singular Value Decomposition (S VD) and/or so-called QR- decomposition. Good results are obtained by means of a modified Prony method and by means of Shanks method in combination with QR eller SVD. The solution of the above mentioned equation system by a least squares method leads to 2L complex numbers: C k = B ex P Φ k ) °g P k =exp{(-r k +jτ. )Δf}, k=l..L (17) where: B, is the amplitude is the phase is the damping factor is time delay for the k' reflector. Δf is the applied sampling interval in the frequency domain. The mathematic model described here for the measured radar signals is formulated according to the fact that the damping of the soil shows (approximate) exponential frequency dependency. The model enables an improved solution of time delays compared to a Fourier method having identical physical conditions. To solve the equations comprised in the model practically different approximations and re- writings may be applied some of which are evident from the possible embodiments, including attached computer programs. A practical problem in solving the form of (17) is that the time delay of the reflectors will be different at different rotation angles which is a result of electrical noise and the above mentioned inevitable variations in the soil etc. This is a practical problem because we want to be able to perform angle Fourier anaysis at some time delays chosen by us. For this reason and for other calculation reasons an alternative mathematical formulation of the equations (15) to (17) may be used. P,..P L i (16) and (17) may be construed as the roots in a so-called characteristic polynomial originating from a homogenous difference equation describing the context between the values of H m for different m. Equation (16) may be formulated as a so-called rational polynomial model of the form: b 0 + b { z-'+..+b z- q B(z) H(z) = l + α,z - ] +..+a L z- A(z) (18) H(Z) is a rational function with the nominator polynomial B(z) and the denominator polynomial A(z) in the variable z representing a frequency shift operator with the frequency shift Δf. It should be noted that H m as expressed in (16) may be considered a series development above the roots in the polymonial A(z). The form in (18) is also called an ARMA function or Auto Regressiv-Moving Average function. The co-efficients in (18) and thus indirectly the coefficients in (16) may be approximated by means of a number of methods. A possible embodiment of the invention applies a so-called Prony method in modified form for determination of the denominator polynominal and Shanks method for determination of the nominator polynominal - these are realized in the attached computer programs and are used for calculation of curves enclosed in this description. The enclosed computer programmes illustrate possible embodiments of algorithms which have turned out to give good results and additionally are possible to perform by means of generally available electronic integrated circuits performing calculation functions - and even having such a small time consumption that it is possible to use the present invention in an apparatus which is moved in a fairly high speed across the ground. When H(z) described by (18) is determined in the form of the co-efficients b 0 ..b og a r .a L , and thus a functional equation for an approximation to the frequency dependent transfer funtion (one per angle at which the measuring is made) is obtained an associated time function may easily be calculated. The associated time function is calculated by substituting z in (18) by: Z = exp(j2πtΔf), 0 < t < l/(2Δi) (19) , and therefore: h(t) = H[exp02πtΔf)] ,0 < t < l/(2Δf) (20) It must be emphasized that the time function here is not identical to the time function in the equations (2) and (3). The time dependent function h(t), obtained from (19) and (20) is claimed not to exist physically, but it has turned out to be useful for detection of objects in the ground. h(t) is continuous (and periodical in t), but is often in practice calculated for a number of discrete values in the time t. The mathematical model presented here is based on a number of assumptions about the measured frequency data and thus about the physical realities concerning the surroundings, including: - that the damping of the electromagnetic waves during propagation has an exponential frequency dependency. - that time delays are frequency independent. - that the number of reflectors is final, here determined as L. In reality none of these preconditions are fully present. It is a substantial advantage of the present invention that it enables a safe determination of the strength and time delay of substantial reflectors even though the ideal circumstances mentioned are not present. Please notice: The discussed H m modelled here is constructed as the measured frequency response in a step frequency CW radar - and is therefore normally complex with both a phase and an amplitude value. Alternatively H m may be represented by a real and an imaginary part. Apart from noise and other inaccuracies the real part as well as the imaginary part of H m contain the same information, and both are sufficient to perform a calculation of the coefficients in (18) or in (16). The above mentioned model may very well be used to model of real sequences. (16a) may therefore be modified into: Re(H m ) = ∑ C t (P, r Im(H = ∑ C t ( )" -=ι or *=ι The P k 's in the above will - in order for the summation to be real - exist in complex conjugated pairs. The corresponding relations apply for the roots in A(z) in (18). There may be certain practical advantages by only using the real or imaginary part of H m . In an embodiment of the method presented by the inventors Re(H m ) is used. The advantage is mainly to be found in connection with measuring of H m , which in the embodiment presented takes place in a system using both analogous and digital technique. 9. Signal analysis in two dimensions When CW radar signals are used the above described Fourier solution of the dependency of the measured matter of the rotation angle of the antenna system based on an arbitrary angular position will often not per se be sufficient to obtain a reliable detection of elongated objects in the ground. In many cases the total measured signal will be dominated by reflections undesired in this connection and originating from the surface of the ground and from inhomogenieties in the ground. Therefore, the CW signal will often only to a small extent demonstrate an angular periodicity even though it contains the reflection from e.g. a cable in the ground. In order to obtain best possible emphasis of the angular dependencyr in the polarization conditioned reflections of objects it is useful to resolve the measured signal into both angle and time. If the signal is measured in time and is a result of an impulse or another transient electrical voltage applied to the transmitter antenna then it will be sufficient to perform the angle-Fourier solution for different parts of the signal corresponding to different time delays. But if the signal is a stepped frequency CW signal a combination of the above mentioned two described analysis methods may advantageously be used for angle Fourier resolution and time analysis based on exponential modelling, respectively. The function H(θ) introduced in chapter 3 and 4 representing the complex transfer function is measured at different angles of rotation θ and at different frequences and may therefore be considered a function of two variables: the angle θ and the frequency f , i.e.: H(θ,f). Since the measuring is performed at discrete angles and at discrete frequencies in practice and if we use: f(m) = Δf m + f o , m=0,l..M-l and θ = Δθn, n= 0,l ..N-l then we get H in the form: H(Δθn,Δf m) or just H(n,m), m=0,l..M-l, n= 0,1 ..N-l (21) The latter compact form in (21) is appli when ΔΘ and Δf have been determined. H(n,m) is a set of numbers with NxM complex elements. If a transformation of the frequency variable into time is performed, for instance during application of the method described in chapter 8, for each of the θ-values, i.e. for each n, we get N time dependent functions in total to be considered a discrete function in two dimensions: θ and the time t: h(θ,t). In practice also h(θ,t) will be calculated in discrete points and take the form: h(Δθn,Δti) orjust h(n,i), i=0,l..I f l, n= 0,1 ..N-l (22) V j (k) as defined in equation (8) in chapter 4 is the Fourier transformed of H and does consequently not give direct information about the time dependency of the measured matter. Therefore, it is in practice a great advantage to Fourier transform h(θ,t) or h(n,i) in the angle or in n, respectively, in order to emphasize the angular harmonic content of the signal at different time delays (and thus depths). Consequently, a very useful alternative to (8) is used in practice: N-] V t ' (k) = ∑/2(n,i)exp(y(2π / N)nk), k = 0..N - \ n=0 (23) where i is the constant during summation in (23) and represent a fixed value of the time delay. If (23) is calculated for a number of values of i then a two-dimensional set of numbers in k,i is obtained, where k corresponds to the angular harmonic and i corresponds to the time delay quantified , i.e.: V l (k,i) = ∑h(n,ϊ)exp(j(2π / N)nk), k = 0..N - \, i = i v .i 2 n=0 (24) The number of points in time: I t = i 2 -i j +1. The time index runs from \ { to i 2 , both included, corresponding to an appropriate time interval. V t (k,i) is produced by Fourier transform I t functions with each N points. Real two- dimensional functions are not involved, but rather combinations of functions (series of numbers) being in one dimension. In (24) a frequency to time transformation has been performed having h(n,i) as result before calculation of the angular harmonic. An alternative method for calculation of a function corresponding to V t (k,i) is: firstly Fourier transformation of the measured frequency data in the angle, thereafter frequency to time transformation. No functional equation for the Prony based method described in chapter 8 for frequency-time transformation is given. For the sake of convenience the following notation is used here: x(t) =Prony[X(f)] for the total procedure. Hereafter the alternative calculation of V t (k,i) may be written in a short form: V t (k,i) = Prony[V j (k,m)] where: N-l V s {k,m) = ∑ H(«,m)expC/(2π / N)nk), k = 0..N - \ m= 0,l..M-l (25) Please notice: m, n, k and i are indexes for frequency, angle, angular harmonic and time, respectively. 10. Detection curves The angular dependencyr in different depths in the ground corresponding to different time based distances will most often vary - similarly this applies to the surroundings of the antennas as a whole. For instance, an elongated reflecting object will demonstrate a periodicity approximately similar to the ones described in the equations (4) and (5) whereas the material above the object will often demonstrate another, possibly minor degree of periodicity. By calculating the strength of the angular harmonic corresponding to two periods per rotation at different time delays a useful detection curve is obtained which has a function of the time (depth) and which concentrates the result of the measurements and the associated calculations in a clear way. Detection curves are calculated by summing the relevant harmonic in V t (k,i): Examples of formulas for detection curves are: D 1 (i) = |V t (k 1 ,i)| + |V t (k 2 ,i)|, =1 ι - (26) where k, and 1^ correspond to a selected angular harmonic, for instance the one corresponding to two periods per rotation. A value of D j is calculated for each selected value of i corresponding to each time delay to be investigated. PLEASE NOTE: Two values of k are employed because the calculation of the Fourier coefficient in accordance with the formulas (24) or (25) results in calculation of what corresponds to a positive and a negative frequency for each of the harmonic which is a mathematically based consequence of the applied definition of the Fourier coefficients and the fundamental sizes. If the Fourier-resolved sequence fulfills certain requirements one of the two associated coefficients may be disregarded, but generally this is not the case. Under ideal conditions an angular dependency corresponding to the equations in (5al) or (5a2) will be obtained by use of a circular polarization. These angular dependencies only give rise to a certain value of k when resolving the angular harmonics by Fourier. Other examples of detection curves that may be used are: D 2 (i) = |V t (k,,i) + V t * (k 2 ,i)|, i =i, ..i 2 (27) where * means complex conjugation and: D 3 (i) = |V t (k,,i) - V t * (k 2 ,i)|, i =i, ..i 2 (28) Generally these detection curves are expressed by: D(i) = ∑ W k {V(k,i)} (29) where W k { } represents a suitable funtion of the selected harmonic. Examples are given in (26), (27) and (28). A is a set containing the selected harmonics. Example: We want to detect elongated objects that are supposed to have a relatively large content of harmonics corresponding to two periods per rotation of the antennas which are linearly polarized, i.e. of Type-1. The measuring is performed at angular separations 22.5 , and we consider 4 rotations at a time, i.e.: ΔΘ = 2π/16 (radian) and N=64. In this case the relevant k-values are: k,=8 and l -,— 56. With reference to the equations (24) and (25). Since local inhomogenieties near the antennas give rise to propagation of the energy of the signal over a larger number of angular harmonics it makes good sense to weigh the equation in (29) against the energy in the harmonics falling outside the set A which may be implemented as follows: D(i) = V(k,if Which is a measurement for the relative strength of the selected harmonics at a time delay given. Detection curves may generally be produced from functions of V(k,i) which is the polarization angular harmonic time response from objects. Variations of the time related location of an object in the measured signals may be countered by average determining detection curves over a minor time interval corresponding to more values of index i. Detection curves concentrate an (often) large number of measurements into one single curve expressing a measurement of whether objects having a given periodic or constant angular dependencyr exist in the angle scanned areas of (often) the ground. In the calculations of D(i) only two harmonics (2 k-values) are typically included which means that the necessary frequency to time transformation by use of the step frequency CW radar method need only to be performed for the two relevant harmonics if the Fourier resolution in angular harmonics is performed before the frequency-time transformation. This corresponds to use of the equation (25) symbolizing a procedure comprising a Prony- method. Prony methods are rather demanding with respect to calculation. Therefore, the method starting by Fourier resolving in angular harmonics followed by Prony calculation of typically two selected harmonics and finally calculation of a detection curve is the most effective method. Such a method is demonstrated by the inventors by way of the enclosed examples. In the above description elongated objects are emphasized, but similar detection curves may also be produced for other types of objects. Rotation symmetrical (with respect to the line of direction from the antennas) objects for example demonstrate a relatively large content of the mean value in the Fourier series corresponding to k=0 in the formulas (24) and (25). Therefore A in (29) might in this case be limited to: A={0}. 11. Determination of the direction of elongated objects The present invention enables determination of the direction of elongated objects without using reference measurements. The direction determination is performed in relation to the known, physical embodiment and orientation of the antennas. The determination of direction takes place by considering the set of curves representing the strength of the reflections measured at associated values of rotation angles and time delays, for example obtained by means of the methods described above in the present specification. The mathematical notation introduced above is employed, but coherent values of angle and time delays obtained by other methods than described here additionally may be employed as a starting point for the determination of the direction. The set of numbers symbolized by h t (n,i) in equation (24) or (25) when containing reflections from an elongated object will show an angular periodicity in a certain time interval where the object is positioned relative to the time - vide for example figure Eks.lA showing at about 31 ns a periodic sequence is seen along a perpendicular cross-section and similarly for figure Eks.3A at about 22.5 ns. Index i in h^nά) corresponds to the time, and if Ih^i)! is plotted as function of n along a fixed value of ι=ι' a close to the time related position of the object a partly periodic sequence is obtained in n, corresponding to the angle. The plotted function may be symbolized mathematically by: A v (n,i a ) = |h t (n,i a )|, i = i a , n = 0..N-1 (30a) Alternatively the following may be used: A v (n,i a ) = h t (n,i a ) h t *(n,i a ), i = i a , n = 0..N-1(* : compl. conjug.) (30b) During the radar measurements the antenna system has been rotated in relation to the elongated object in the ground starting with an unknown starting angle Θ Q . If the applied antenna system is copolar or parallel (type 1) local maxima A v (n,i a ) will exist for k-values corresponding to θ 0 +0 ,180 .. etc. If the antenna system is crosspolar (type 2) a maxima in the angles θ 0 +45 , 90 ,135 ..etc will exist. Please note that the frequency of A v (n,i a ) in the angle is doubled for the type-2 antenna compared to the corresponding type-1. The curves in fig. Eksl A..Eks IE correspond to a type-1 antenna system. In practice the angular dependencyr of h t (n,i a ) in (30) will not correspond to simple equations as in the equations (4) and (5). Consequently angular determination is not performed based on A v (n,i a ) directly, but based on the Fourier transformation of A v (n,i a ). The scanned maxima for A v (n,i a ) are coincident with maxima in the sinusodial-formed curve corresponding to a definite harmonic in the Fourier series of A v (n,i ). The relevant harmonic is the one corresponding to two maxima per rotation at type 1 antennas and 4 maxima per rotation at type 2 antenna. The term rotation is defined as rotation of the polarization, possibly by rotating the antenna system. The phase of the relevant complex Fourier component is directly proportional with the displacement of the maxima mentioned in relation to a position in which the first maximum falls in n=0. Therefore, the value of index n corresponding to the displacement is calculated from the phase for the relevant harmonic. Harmonic index k j corresponding to two maxima per rotation is obtained by: k j = NΔΘ/180(ΔΘ in degrees) (31a) and corresponding to 4 maxima per rotation: k 4 = 2NΔΘ/ 180 (ΔΘ in degrees) (3 lb) The relevant Fourier composant is calculated by: N-\ XΛU = ∑k(« )|expO " (2π / N)nk 2 ), (31c) when k=k 2 and correspondingly when k=k 4 X v (i a ) is a complex number from the phase of which the starting angle of the antenna in relation to the elongated object is easily determined by: Type-1 antennas: The displacement of the relevant maxima in relation to n=0 is obtained by: n 0 = φ /(2Δθ) (all angles in degrees) , φ = ZX v (i a ) = phase of 1^. harmonics. (32a) n 0 is not an integer. Consequently, the angle of the object in relation to the linear polarization of the type-1 antenna system type-1 is: θ 0 = φ Ii (all angles in degrees) , φ = ZX v (i a ) = the phase of k-,. harmonics. (32b) It should be noted that the starting angle of the antenna system in relation to the object calculated as θ 0 in (32) may be provided with a better resolution than corresponding to the angle increment ΔΘ between every measurement. The ability of the Fourier resolution to interpole is utilized and θ 0 may in principle be determined with arbitrary resolution, only limited by noise, inaccuracies of the measurement etc. The meaning of θ 0 is seen in relation to Fig. 7b. Type-2 antennas: Here the number of periods in X v (i a ) per rotation are doubled in relation to type -1 antennas. The meaning of θ 0 is seen in relation to Fig. 7a as it is to be noted that 45 must be added in relation to this figure. Other types of antennas Circularly or elliptically polarized antennas may be considered linear combinations of type- 2 antennas and the orientation of objects may be determined by a procedure corresponding to the one described here. 12. Possible methods for locating/detecting cables and pipes in soil. The above described mathematical methods for analysis of a signal in the angular/angular harmonic and frequency/time domains, respectively, may advantageously be combined in various ways. In the following some combinations which have been shown to be applicable in practice will be described: In the following two-dimensional sets of numbers are described with since most often discrete values are relevant. These sets of numbers may also be construed as elements in a matrix and each of the rows or columns in it may be construed series. Curves or functions and function values are synomymously described. The preferred embodiments presented by the inventors are based on discrete frequencies, angulars, angular harmonics and times which are motivated by the application of digital storing and calculating units - even though the demonstrated examples appear as continuous functions. The principles of the invention also applies for continuous frequences, angle rotation, angular harmonics and times. Procedure No. 1 Comprises the following steps: 1.1 An antenna arrangement of type 1 or 2 as described in chapter 3 and 4 is positioned on or above the ground with arbitrary, but approximate horizontal, orientation. 1.2 The voltage transfer function between the transmitter and receiver antenna is measured at a number of frequencies. The measured values are stored. 1.3 The antenna arrangement is rotated mechanically or electrically an integer multiple of an angle ΔΘ. Typical values of ΔΘ may be 22.5 or 45 corresponding to 1/16 or 1/8 rotation. Simultaneously to rotating the antenna may be moved a bit translatorily which will be the case if the antenna is moved during rotation above the ground. 1.4 The voltage transfer function between transmitter and receiver antennas is measured at a number of frequencies. The measured values are stored. 1.5 Step 1.3 and 1.4 are repeated until an appropriate number of measurements are performed at a corresponding amount of angular positions. The amount depends on the circumstances. Practical amounts of useful angles may for example be: 8, 16, 32 or 64. The result is a set of complex numbers representing measured values of the voltage transfer function for coherent values of angular rotation and frequency. The result may be reduced into a real set of numbers corresponding to the real part of the complex set of numbers just mentioned. 1.6 The measuring results from the latter item are transformed from frequency to time. For this purpose the exponential based mathematical method described in item 8 or the like is applied. The result is a number of estimated reflections, their strength, phase and time delay. Frequency-to-time transformation is performed one by one on the frequency dependent transfer functions (series) associated with each angle. Thus for each angle a time dependent, continuous-in-time and periodic function is obtained which is calculated at a suitable number of discrete times. The same calculation time is used for all the angles. The result so far is a set of complex numbers in two dimensions. The series corresponds to a mathematic function having a discretizied rotation angle and the time discretisized as independent variable. Comment: Examples of the result of the procedure 1.1 to 1.6 are illustrated in Figs, eks.la, eks.2a, eks.3a, eks.4a and eks.5a. In many cases angle periodic objects may be identified by inspection. Eks.la illustrates at the time delay of about 31 ns an object known as a 160 mm pipe made of a plastics material and containing water in a depth of 135 cm in soil. Procedure No. 2 Consists of No. 1 or followed by additional calculations 2.1 Step 1.1 to 1.6 as in procedure No.1 or correspondingly 2.2 For each of the points in time used in step 2.1 a Fourier transformation is performed with the angle as independent variable. The result so far is a set of complex numbers in two dimensions. The set of numbers corresponds to a mathematical function having the angular harmonic and the time as independent variables. 2.3 Based on the two-dimensional set of numbers which is the result af step 2.2 a one-dimensional function in time is calculated, called D(t) by means of one of the methods described above in chapter 10 or correspondingly. 2.4 The discrete time function produced in step 2.3 is scanned for local and globale maxima that demonstrate a significant strength compared to the mean value. Such maxima represent angle periodic reflections from elongated objects. The value of time corresponding to the individual maximum states the time delay of the reflections from the corresponding object. Scanning for maxima may be performed mechanically or by inspection of the curve. Comment: The time delays thus calculated may together with a knowledge of the speed of propagation of the radar waves in the ground be used for calculating the depth of objects. Examples of the result of procedure 2 step 2.1 to 2.2 are illustrated in figs. eks.lC, eks.2C, eks.3C, eks.4C and eks.5C. Examples of the result of procedure 2 step 2.1 to 2.3 are illustrated in figs. eks.lE, eks.2E, eks.3E, eks.4E and eks.5E, where the detection curve is calculated in accordance with (28). Procedure No. 3 Consists of procedure No. 1 or corresponding chapters followed by additional calculations. 3.1 Step 1.1 to 1.6 as procedure No. 1 or correspondingly 3.2 Based on the result of step 3.1 the angular position in relation to the antenna system is calculated by means of the method described above in item 11. The angular position is calculated for one or more angle periodic objects that may be detected or time determined by visual inspection of the result of step 1.1 to 1.6 under procedure 1 or by use of detection curves as described in procedure 2 above. Comment: If the antenna system comprises mechanical rotation the angular position in the starting position in relation to the elongated object(s) is hereby determined. If rotation is produced by shifting between the antenna elements with fixed angular position the angular position is determined by the polarization direction corresponding to the first measuring position - and thus the angular position of the total antenna arrangement in relation to the elongated object(s). Examples of result of this procedure are illustrated in Fig. Eks.3F. Procedure No. 4 comprises the following steps: 4.1 An antenna of the type 1 or 2 as described in chapter 3 and 4 is positioned on or above the ground with arbitrary, however approximately horizontal orientation. 4.2 The voltage transfer function between transmitter and receiver antenna is measured at a number of frequencies. The measured values are stored. 4.3 The antenna arrangement is mechanically or electrically rotated an integer multiple of an angle ΔΘ. Typical values of ΔΘ may be 22.5 or 45 , corresponding to 1/16 or 1/8 rotation. Simultaneously to rotating the antenna may be moved a bit translatorily which will be the case if the antenna is moved during rotation above the ground. 4.4 The voltage transfer function between transmitter and receiver antennas is measured at a number of frequencies. The measured values are stored. 4.5 Step 4.3 and 4.4 are repeated until an appropriate number of measurements are performed at a corresponding amount of angular positions. The amount depends on the circumstances. Practical amounts of useful angles may for example be: 8, 16, 32 or 64. The result is a set of complex numbers representing measured values of the voltage transfer function for coherent values of the angular rotation and frequency. The result may be reduced into a real set of numbers corresponding to the real part of the complex set of numbers just mentioned. 4.6 The measuring result from step 4.5 is subject to a Fourier transformation in the angle. For each of the frequencies used in step 4.5 a Fourier transformation is performed with the angle as independent variable. The result is a set of complex numbers in two dimensions. The set of numbers corresponds to a mathematical function having the angular harmonic and the measuring frequency as independent variable. Comment: The set of numbers thus obtained is in two dimensions which may also be construed as a number of frequency dependent curves, one for each angular harmonic or as a number of functions of the harmonic, one for each measuring frequency. Procedure No. 5 Comprises the steps in procedure No. 4 or corresponding steps and additional calculations. 5.1 The steps 4.1 to 4.6 in procedure No. 4 or corresponding steps. 5.2 The set of numbers obtained in step 5.1 are transformed from frequency to time. The series corresponding to each of the angular harmonics are transformed by means of the exponential based mathematic method or a corresponding method described in chapter 8. The result is a number of estimated reflections, their strength, phase and time delay. Thus for each angular harmonic a time dependent, continuous-in-time and periodical function is obtained which is calculated at a suitable number of discrete times. The identical calculation points in time are used for every angular harmonics. The result is a set of complex numbers in two dimensions. The set of numbers corresponds to a matematical function having the angular harmonic discretisized and the time discretisized as independent variable. Comment: Sets of figures in two dimensions are hereby obtained which may also be construed as a number of time dependent curves, one for each angular harmonic, or as s number of curves or functions of the harmonic, one for each point in time. This set of numbers may be illustrated and by inspection objects may be found by identifying global or local maxima for selected harmonics, typically the two harmonics corresponding to two periods per rotation of the polarization. Procedure No. 6 Comprises the steps in procedure No. 4 or corresponding steps and additional calculations. 6.1 The steps 4.1 to 4.6 in procedure No. 4 or corresponding steps. 6.2 Parts of the set of numbers obtained in step 6.1 are transformed from frequency to time. The series corresponding to selected angular harmonics are transformed by means of the exponential based mathematic method or a corresponding method described in chapter 8. The result is a number of estimated reflections, their strength, phase and time delay. Thus a time dependent, continuous-in-time and periodical function is obtained for each angular harmonic which is calculated at a suitable number of discrete times. The same calculation points in time are used for all angular harmonics. The result is a set of complex numbers in two dimensions. The set of numbers corresponds to a mathematic function having the angular harnomic discretisized and the time discretisized as independent variable, but only for selected angular harmonics. 6.3 Based on the two-dimensional set of numbers which is the result of step 6.2 a one-dimensional function in time is calculated, called D(t), by means of the methods described above in chapter 10. 6.4 The discrete time function produced in step 6.3 is scanned for local and global maxima that demonstrates a significant strength compared to the mean value. Such maxima represent angular periodic reflections from elongated objects. The value of time corresponding to the individual maximum states the time delay of the reflections from the corresponding object. Scanning for maxima may be performed mechanically or by inspection of the curve. Comment: As described in chapter 10, two of the angular harmonics are often selected corresponding to 2 periods per rotation. If the antenna is of the Type-1 described above the two harmonics are often used which correspond to the positive or negative, respectively, frequency corresponding to two periods per rotation. Since only time sequences need calculation for example of two harmonics - and thus only two Prony transformations are applied - then procedure is effective for calculation. The time delays calculated in this manner may together with a knowledge of the speed of propagation of the radar waves in the ground be used for calculating the depth of objects. Examples of the result of procedure 6 step 6.1 to 6.3 are seen in the figures eks.lD, eks.2D, eks.3D, eks.4D and eks.5D in which the detection curve is calculated in accordance with equation (28). Procedure No. 7 Comprises the following steps: 7.1 An antenna arrangement of type 1 or 2 as described in chapter 3 is positioned on or above the ground with arbitrary, however approximately horizontal, orientation. 7.2 A voltage pulse which should be a short-period pulse is applied to the transmitter antenna. The voltage of the transmitter antenna is then measured at a number of time delays. 7.3 The antenna arrangement is rotated mechanically or electrically an integer multiple of an angle ΔΘ. Typical values of ΔΘ may be 22.5 or 45 , corresponding to 1/16 or 1/8 rotation. Simultaneously to rotating the antenna may be moved a bit translatorily which will be the case if the antenna is moved during rotation above the ground. 7.4 A voltage pulse which should be a short-period pulse is applied to the transmitter antenna. The voltage of the receiver antenna is then measured at a number of time delays. 7.5 Chapter 7.3 and 7.4 are repeated until a suitable number of measurements have been performed at a corresponding amount of angular positions. The amount depends of the circumstances. Practical amount of usable angles may for example be: 8, 16, 32 or 64. The result is a set of numbers representing measured values of the voltage transfer function for coherent values of angle rotation and frequency. The set of numbers will often be real. If the antenna arrangement is arranged so as to measure two time functions physically which are mutually orthogonal - often called I(t) and Q(t) - the set of numbers is considered complex. If the measured set of numbers is real a complex corresponding set may be produced - in the form of a so-called Hubert transformation - either by means of electric filtering or by means of calculations performed on the measured, discrete values. Procedure No. 8 Consists of procedure No. 7 or corresponding procedure followed by additional calculations. 8.1 Step 7.1 to 7.5 as under procedure No.7 or corresponding chapters. 8.2 For each of the points in time used in item 8.1 (= time delays) a Fourier transformation with the angle as independent variable is performed. The result so far is a set of complex numbers in two dimensions. The set of numbers corresponds to a mathematic function having the angular harmonic and the time as independent variable. 8.3 Based on the two-dimensional set of numbers which is the result of step 8.2 a one-dimensional function in time is calculated, called D(t), by means of the methods described above in chapter 10 or corresponding methods. 8.4 The discrete time function produced in step 8.3 is scanned for local and global maxima that demonstrates a significant strength compared to the mean value. Such maxima represent angle periodical reflections from elongated objects. The value corresponding to the individual maximum states the time delay of the reflections from the corresponding object. Scanning for maxima may be performed mechanically or by inspection of the curve. Comment: The time delays thus calculated may together with a knowledge of the propagation speed of the radar waves in the ground be used for calculating the depth of objects. Procedure nr. 9 Consists of procedure No. 7 or corresponding procedure followed by additional calculations. 9.1 step 7.1 to 7.5 as under procedure No.7 or corresponding chapters.. 9.2 Based on the result of step 9.1 the angular position is calculated in relation to the antenna system by means of the method described above in chapter 1.1. The angular position is calculated for one or more angle periodic objects which may be detected and time determined by visual inspection of the result of step 9.1 or by use of detection curves as described under procedure 8 above. Comment: If the antenna system comprises mechanical rotation the angular position in the starting position is hereby determined in relation to the elongated object(s). If rotation takes place by shifting between antenna elements with fixed angular position the angular position is determined by the polarization direction corresponding to the first measuring position - and thus the angular position of the total antenna arrangement in relation to the elongated object(s). Procedure No. 10 Consists of procedure No. 7 or corresponding procedure followed by further calculations. . 10.1 Step 7.1 to 7.5 as under procedure No.7 or corresponding procedure. 10.2 For each of the points in time used in step 10.1 (=time delays) a Fourier transformation is performed with the angle as independent variable. The result so far is a set of complex numbers in two dimensions. The set of numbers corresponds to a mathematic function having the angular harmonic and the time as independent variable. Comment: The result of Fourier transformation of measured radar signals in the polarization angle may by means of visual inspection give valuable information about objects in the ground. Procedures for use of circular or elliptical polarization The present invention also comprises use of a circular or elliptical polarization. The procedures described here, i.e. procedures Nos. 1 and 4, use antennas with linear polarization rotated mechanically or electrically for example by electronic shifting between elements. If circular or elliptical polarization is applied the procedures are used in a corresponding manner. Circular or elliptical polarized waves and the associated signals of the antennas may be split into components corresponding to linear polarization. If the circular or elliptical polarization is obtained by means of linearly polarized antenna elements and their terminals are accessable the methods described here may be applied directly on the individual linear parts - with or without subsequent combination. This applies irrespective of linearly polarized parts being activated at the same time or individually and irrespective of EM-waves with circular or elliptical polarization existing physically during the measurement, or the corresponding signals are produced in the form of linear combinations of measuring results. The present invention also comprises the circular or elliptical polarization being obtained by means of one or more antennas per se radiating circular or elliptical polarized EM-waves - for instance spiral antennas - the electrical signals of the terminals of such antennas being divided into orthogonal parts and these parts being processed by means of the method described here. Orthogonal signal parts are often designated quadrature components or I and Q, where I and Q in total constitute a complex representation of a signal. Irrespective of the splitting of a signal in orthogonal parts being obtained by means of electrical networks or by means of algebraic manipulation in a (most often) digital computer the processing of the signals produced is comprised of the present invention by means of the methods described here. Use of Fourier methods for transformation from frequency to time. In the procedures Nos. 1, 5 and 6 described here the exponential based method for determination of time delays in the radar signal described in chapter 8 is included. The present invention also comprises procedures corresponding to the ones described where Fourier transformation is used for frequency to time transformation - including use of Fourier solution in the angle as described above in combination with Fourier transformation of the frequency dependent measuring data. In procedure No. 1, step 1.6, procedure No. 5, step 5.2 and in procedure No. 6, step 6.2 the exponential-based method here described may be replaced by a Fourier method including FFT or Fast Fourier Transform. Use of other signal forms than Step-frekvens CW radar The present invention also comprises use of the methods described in connection with other signal forms than Step-frekvens CW radar, which is the preferred one, and impulse radar which is comprised of the procedures 7 to 10. The methods described here in combination with rotating polarization with or without movement above the ground or the like may advantageously be applied irrespective of the signal form used. Some possible signal forms are: frequency-sweep or "chirp" or FM-CW, in which the frequency of the signal is altered continuously during an interval. correlation radar in which constructed or arbitrary time frequencies are employed and in which time delays of reflections are calculated by means of correlation. Detection of several objects Detection and determination of direction are described here for individual objects. If several objects exist in the same set of radar measurements the methods described here enable individual processing of them if their associated time delays are different. Objects in different depths, including crossing cables and pipes, may be determined individually by means of the methods described. The modified Prony-methods will often be a help for separation of closely positioned objects. Examples with performed calculations: The examples stated are all based on measurements made under ordinary circumstances in Denmark. Thus, the examples are thus fully realistic and correspond to ordinary existing conditions. However, they have not to be considered calculation examples which are arranged with the aim of emphasizing theoretical or principal aspects of the methods of the invention. Table 12 illustrates a scheme of objects illustrated in the examples 1 to 5. The figures 13a)-13b), 14a)-14b), 15a)-15b), 16a)-16b) and 17a)-17b) are the result of calculations of the type mentioned in chapter 9 and illustrate calculated signal strength as a function of the angle index n and the time in ns. Are the result of above described procedures No. 1 through step 1.6 13a)-17a) in the form of 3D-plot, 13b)-17b) same in contour plot. The figures 13c)-13d), 14c)-14d), 15c)-15d), 16c)-16d) and 17c)-17d) measured signal strength as function of the angle index n and the frequency in GHz. Are the result of the above described procedure No. 1 through step 1.5. 13c)-17c) in the form of 3D-plot, 13c)- 17c) same in contour plot. The figures 13e)-13f), 14e)-14f), 15e)-15f), 16e)-16f) and 17e)-17f) are the result of calculations of the type mentioned in chapter 9 and illustrate calculated signal strength as function of angular harnomic index k and the time in ns. Are the result of above described procedure No. 2 through chapter 2.2. 13e)-17e) in the form of 3D-plot, 13f)-17f) same in contour plot. The figures 13g)-13h), 14g)-14h), 15g)-15h), 16g)-16h) and 17g)-17h) are the result of calculations of the type mentioned in chapter 10 and illustrate detection curces. Are a result of the above described procedure No. 6 through step 6.3. The figures 13i)-13j), 14i)-14j), 15i)-15j), 16i)-16j) and 17i)-17j) are the result of calculations of the type mentioned in chapter 10 and illustrate detection curves. Are the result of above described procedure No. 2 through step 2.3. The figure 15k) through 15o) illustrate an example of determination of direction by means of calculations as mentioned in paragraph 11 and illustrate calculation result included in the above described procedure No. 3. Comments to the examples: Please notice: All the examples illustrated are measured by means of an antenna system in which the interior time delay and the time for direct coupling from transmitter to receiver in total constitute approx. 11 ns. This included delay is not deducted in the illustrated curves. Please notice: The illustrated curves in the examples are produced by connecting discrete values with straight lines and are, accordingly, not to be construed continuous functions or curves. Example No. 1 illustrates in the figures 13a) and 13b) a clear angular harmonic about 31 ns, appearing in the form of clear local maxima in the figures 13e) and 13f) — and gives in the detection curve in fig. 13h) a global maximum lying more than approx. 17 dB above the "noise floor". Consequently, clear detection of a pipe is seen which would by means of a ground radar without polarization rotation and analysis only have given a signal on the same level as many others, without characteristic features. In the figures 13e) and 13f) the example shows that substantial periodicity exists around 15-20 ns and that these are sorted out by the total procedure. The angular harnomic corresponding to the 0 th order - i.a. a mean value - has a distinctive maximum around approx. 12 ns - this is also filtered away. Example No. 2 is measured during normal, but advantageous circumstances. Here a safe detection is obtained by means of just a single rotation with 16 measurements. If the number of rotations is halved corresponding results are obtained. It is seen that the raw frequency measurements in the figs. 14c) and 14d) demonstrate a significant degree of periodicity. Example No. 3 illustrates a measurement with substantial "clutter" in a depth corresponding to approx. 14 ns. It is seen how this clutter in the final detection curve in fig. 15h) is dampened by 20 dB compared to the global maximum, positioned in approx. 22 ns. The figs. 15k) to 15o) demonstrate an example of determination of direction. 15m) is the amplitude of the function corresponding to the function h(k,t) in the figures 15 a) and 15b) for t=21,8 ns, which is the position of the global maximum of the detection curve figs. 15g) and 15h). The periodicity is clearly seen. Angle index n is used as horizontal unit. In the middle 15n) the absolute value of the FFT calculation is illustrated above the before mentioned curve with number of points N=64. The lower part of fig. 15o) illustrates the phase of the two angular harmonic corresponding to two periods per rotation (type-1 antenna), corresponding to k =8 and k =56 during rotation of the antennas. The figure -0.1844 is the calculated angular position calculated in number of angular steps in accordance with the above mentioned formula (32b). From the uppermost curve 15m) and when considering the figures 15a) and 15b) it is seen that the calculated position of the object as being almost coincident with the position of the first measurement (n=0) is correct. Example No. 5 illustrates how in spite of a very poor degree of periodicity in the frequency measurements (figs. 17c) and 17d)) and in spite of considerable clutter around approx. 12 ns (figs. 17a) and 17b)), a useful detection in the figs. 17g) and 17h) is obtained in which the global maximum in approx. 12 ns may be rejected if we do not accept an object immediately below the surface - likewise in the figures 17i) and 17j). 14. Possible applications The present invention will among other things be appliacable for: manually borne detector for locating of cables, pipes and optical fibres. Such a detector will be able to give the operator an inmediate indication of presence, position and orientation of such objects. The detector may be moved above the ground in an arbitrary pattern and enable a burried object to be followed. - corresponding detector mounted on vehicles. automatic detector mounted on excavators or other machinery for movement of soil with the aim of avoiding damage of objects. mapping of cables, pipes and other underground objects. The detector may be coupled together with positioning equipment and equipment for data collecting. Typically, by means of mapping a scanning in accordance with a predetermined pattern will be performed. Instrument for scanning of the structure and condition of materials including concrete. instrument for location of pipes and cables in building constructions: floors, walls e.g. of concrete and other materials. 15. Antenna constructions Stepwise rotation of the polarisation without mechanical means is made in the best manner by shifting between similarly designed antennas positioned in appropriate angles and with displaced centers as illustrated schematically in figs. 3, 4 and 9. In the figures 3 and 4 linear thin dipoles are outlined. In order to obtain sufficient frequency band width it is an advantage to make the arms of the dipole conical as outlined in fig. 9. In order to avoid or at least dampen reflections from the ends of the dipole arms (corresponding to standing waves along the axis of the dipole) a kind of damping is often used. Our preferred damping is a combination of damping material positioned close to the antennas above the antennas as illustrated in fig. 12 and use of serial, resistive coupling elements as illustrated in fig. 10 and 11. The resistive elements mentioned may consist of a resistor in the form of an ordinary resistor for surface mounting and having a varying value so that the highest values are used farthest away from the center of the dipole. Typical values are from 10 ohm to 100 ohm. The resistive elements may also consist of a series coupling of the above mentioned resistor and a switch diode for instance of the type PIN. By applying a DC voltage between the end points of the dipole and the center a possibility of bringing the PIN diodes in conducting or cutoff mode is obtained. One of the effects of such an arrangement is that the dipole in cutoff mode will have less electromagnetic coupling to closely positioned similar dipoles than without the diodes. In this way it becomes possible to reduce the size of the total construction without disturbing coupling between the active and passive dipoles. Undesired couplings between the dipoles may cause a deteriorated linearity of the polarisation and undesired ringing in the signal. Only those antennas which are desired to be active have a DC voltage applied - often two at a time - causing the PIN diodes to conduct. The switch arrangment outlined here having serial PIN diodes allows dipoles to overlap each other without significant mutual coupling. A dipole with four metal surfaces and three resistive coupling elements with or without PIN diodes of a total length of 24 cm are demonstrated by the inventores and are measured to have a frequency characteristic which is fairly flat in the area 100 MHz to 900 MHz. The rest of the construction was as outlined in figs. 11 and 12. The present invention comprises application of splitted antennas, coupled together with resistor links with or without switch diodes for use in ground radars. 16. References 1. US-Patent 4,728,897 Gunton et al. 2. US-Patent 4,812,850, Gunton et al. 3. Balanis C.A., Advanced Engineering Electromagnetics, John Wiley & Sons, 1989 4. Oppenheim AN. & Schafer R.W., Discrete-Time Signal Processing, Prentice Hall, 1989 5. Turner G. & Siggins A.F., Constant Q attennuation of subsurface radar pulses, Geophysics, vol 59, No 8, August 1990, p 1192-1200. 6. Hoekstra P. & Delaney A. , Dielectric Properties of Soils at UHF and Microwave Frequencies, Journal of Geophysical Research, vol.79, no.l 1, April 1974 pp 1699-1708 7. Therrien CW. , Discrete Random Signals and Statistical Signal Processing, Prentice Hall, 1992. 8. US-Patent: 4,062,010, Young et al. 9. Lizuka K., Freundorfer A.P. m.fl., Step-frequency radar, J. Appl. Phys. vol.56, No.9, November 1984 10. US-patent 4,967,199 Gunton et al. 11. Chignell R.J. & Dabis H.S., A Pipe Detection Radar with Automatic Three Dimensional Mapping, i Proceedings of the 6th International Conference on Ground Penetrating Radar GPR'96 Sendai Japan, 1996 17.Time filtering of frequency data. In order to emphasize radar signals originating from a given depth interval it is often an advantage to perform a filtering of the measured frequency signal before it is transformed to the time domain. The filtering takes place by means of a signal filter the function of which may, considered mathematically, be identical to an ordinary filter which is used for time dependent signals - however differing in the effect that what is normally construed in the frequency characteristic of the filter now becomes a time characteristic. If the basis is the frequency representation of a signal a filtering of this is performed so that parts of the signal corresponding to different time intervals are weakened or reinforced - for instance a high pass filtering of the frequency representation will suppress the early parts of the signal. Since measurements are made in the frequency domain by means of a Step Frequency CW radar it is advantageous to make a filtering before transformation of the time domain. The effect of the filtering in the frequency domain by means of an ordinary filter may the contrued mathematically so that time and frequency in the Fourier transformation are included in a product in a symmetrical manner. Furthermore, it may be construed by watching that the phase in the frequency representation is proportional with the time variable - late parts of the signal correspond to bigger phase variation per frequency unit than early parts. Ground radar signals are very often characterized by the early parts of the signal - often originating from undesired coupling from transmitter to receiver - contain much more energy that the weaker signals from objects in the ground. By filtering the frequency dependent signal by means of a high pass filter before transformation to the time domain the above mentioned early, undesired parts may be filtered away. High pass as well as band pass filters may advantageously be applied. Filtering as described here may in a possible embodiment be applied in connection with the procedures Nos. 5 or 6 described in paragraph 12. In this case the filtering will be inserted after chapter 5.1 or 6.1 (corresponding to procedure No. 4). Corresponding filtering may also advantageouly be applied if inverse Fourier transformation is used for transformation from frequency to time. In this case the filtering is applied before the Fourier transformation. A functioning prototype step-freqency ground radar has been produced allowing the user to choose between high pass filters designed as ordinary high pass filters allowing signals with time delays above a certain value to pass. The characteristic time constants which may be elected are in one embodiment: 10 ns, 15 ns, 20 ns and 25 ns. If for instance water pipes are searched for by means of the radar it will often be suitable to dampen all signals with time delays less than 20 ns. 18. Other antenna configurations Tests have shown that antenna arrangements as illustrated in figs. 45, 46 and 47 may be applied with a good result. Fig. 45 illustrates an arrangement containing 4 antenna pairs whereas figs. 46 and 47 illustrate two different arrangements, each of 5 pairs. The elements in these antennas are all of the type butterfly the construction of which correspond approximately to the one illustrated in fig. 11, and the total arrangement corresponds to the construction illustrated in fig. 12. The damping material designated c in fig. 12 is of the brand Emerson & Cuming, the types LS20 and LS24 in combination. The used butterfly elements are produced on ordinary fibre glass print plate, layout is included in the description of the prototype. The elements are supplied with a transformer for impedance adjustment in the feeding point and termination resistors in the ends. The dipole elements are always engaged in pairs so that two dipoles lying 180 mutually displaced around the center of the arrangement are engaged at the same time as transmitter and receiver, respectively. In figs. 45, 46 and 47 one pair is constituted by the elements la and lb, another pair of the elements 2a and 2b etc. All the elements are intended to be similar. A set of measurements following each other with all four or five pairs correspond for the configurations in figs. 45 and 46 to one period of the polarization variation (pipe or cable) of a linear object. - and for the configuration in fig. 47 to two periods. 19. Determination of the type of cables and pipes. Through measurements with antennas of the type mentioned here it is determined that the linear model for cables and pipes in the ground functions well in connection with the described methods demonstrated by the present prototype. Furthermore it has been discovered that certain types of objects - including pipes of plactic containing water or gas - will often during rotation of the polarization demonstrate a significant periodicity with half the period length. This phenomenon corresponds to the reflection of the object, besides demonstrating maximum at a polarization which is parallel with the longitudinal orientation of the object, also demonstrating a substantial local maximum at a polarization which is perpendicular to the object. Accordingly, by Fourier transformation in the rotation angle an additional component appears corresponding to half the period length in relation to the expected one. Thin objects, especially cables, will only to a very small extent demonstrate this phenomenon whereas thick pipes especially produced from a plastics material will demonstrate it to a significant extent. This phenomenon may be used for distinguishing between types of cables and pipes and will easily be authomatized by means of a small enlargement of the existing procedure and software. 20. Functioning phototype A prototype is produced which demonstrates a possible embodiment of the invention. The prototype has been applied for detection of cables and pipes under normal circumstances - i.e. outside laboratory environment. Fig. 21 demonstrates a system diagram for the hardware of the prototype. The system consists of three main parts: The antenna arrangement (antenna array), RTVA electronics , (RTVA = Real Time Vector Analyzer) and a PC supplied with a signal processing module. The prototype is mounted on a small vehicle corresponding to a sack truck and may be pushed across the ground simultaneously with the result of the current measurements with associated calculations being shown on a PC screen. 20.1. System and system block diagram Antenna array: Consists of an antenna arrangment of the type illustrated in figs. 45, 46 or 47 and a double electronic switch shifting transmitter as well as receiver between the antenna elements syncronically. RTVA electronics: Consists of two main parts: a high frequency part (RF part) and a DSP part with analogous-digital converter. High frequency part (RF part): Receiver, Transmitter and Frequency Synthesizer DSP1: Analog-digital converter and a fix-point DSP processor of the type ADSP2181 of the brand Analog Devices Inc. Constructed around a turn-key module of the same brand. Besides analog-to-digital converter a quadrature detection of the interfrequency signal from the receiver takes place. Furthermore control of antenna switch and control of frequency synthesizer. PC and signal processing module A standard type PC provided with a turn-key plug- in unit, a so-called demo-board of the type ADSP-21062 EZ-LAB Evaluation Board from Analog Devices Inc. comprising a floating point processor of the type ADSP21062 is applied. The signal processing almost entirely takes place in the ADSP21062 processor. The PC is entirely a cabinet comprising the ADSP-21062 EZ-LAB Evaluation Board module. Furthermore the display of the PC is used for real time presentation of detection curves. 20.2. Function and use The prototype realizes a procedure corresponding to procesure No. 6 described in paragraph 12 and the above described time filtering inserted between the procedure chapters 6.1 and 6.2 (pkt.6.1 corresponds to procedure No. 4). The phrase used in procedure step 4.1 : "an antenna arrangement of type 1 or 2 as described" means in practice that the antenna is part of the equipment and that the positioning above the ground takes place currently by the equipment in its entirety is moved across the ground. The types of antennas applied are outlined in figs. 13, 14 and 15. The total calculation procedure takes place currently so that the user sees the result of currently measured data and associated calculations. On the screen of the PCs the latest result of a set of calculations are displayed in the form of a detection curve of the type mentioned in chapter 10, equation (26) or detection curves of the form: D 4 (i)= |V t (k,,i)| N^DI, i =i, ..i 2 (35) Where the elements included are described in chapter 10. The equation (35) is in a product form and is the one most often applied in the prototype and is included in the attached printout of the software of the prototype. These detection curves are currently illustrated graphically, vide the below examples. 20.3 Technical specifications The basic specifications of the present prototype are: RADAR system: Frequency range: 50 to 1000 MHz Frequency step size: multiplum of 1.6 MHz, typically 6.4 MHz Amount of frequency steps in a sweep: typical 120 Time consumption per frequency step: 57 msec (equals aprx. 7 msec for 120 steps) Basic dynamic range: 70 dB Dynamic range with automatic gain control: HO dB Maximum radar signal lag: - with freq. step size=l .6 MHz: 312 nsec corresponding to aprx. depth 13 m - with freq. step size=6.4 MHz: 78 nsec corresponding to aprx. depth 3.5 m Number of Detection curves calculated pr. sec: - with 4 antenna pairs: 8.9 typically (aprx. 35.7 rotations /sec) - with 5 antenna pairs: 7.1 typically (aprx. 28.5 rotations /sec) Antenna size: Diameter: 85 cm (model a), 65 cm (model b) Height: 7 cm (model a), 7 cm (model b) 20.4. Some results obtained by means of the prototype The above described detection curves are concurrently displayed on the display of the prototype as they are calculated. Typically around 7-8 curves per second are calculated. This makes it possible for the operator to evaluate the calculation results simultaneously with the prototype being pushed across the ground. Figs. 19a) and 19b) illustrate two typical detection curves from the display of the prototype. In the graph illustrated in fig. 19a) a clear indication in a depth corresponding to the time delay approx. 31 ns is seen. In fig. 19b) a detection curve is illustrated which does not indicate any cable or pipe. The object which is indicated in figs. 19a) and 19b) is known and is a PVC pipe filled with water and having a diameter of 110 mm and being burried in a depth of approx. 140 cm. Fig. 18 illustrates a collection of detection curves each one being collected from the prototype and afterwards gathered in the figure - here it is seen how the detection curve alters when being conveyed above an object - here the same pipe as indicated in figs. 19a) and 19b). In fig. 18 time delay is recalculated into estimated depth on the supposition of an estimated average value of the propagation speed of the radio waves in the ground. Example of embodiment In the following a reproduction of the embodiment of the invention is presented by way of example. Oversigt over programmer: Program til PC go4.c. Downloader program og normaliseringsdata til ADSP-21062 Uploader resultater fra ADSP-21062, displayer disse pa sk∑erm Styrer ADSP-21062 boardet On-line kontrol af normaiisering, fiitervalg, metodevalg, mm I program til ADSP-2I062 Kan uploade data fra ADSP-21062 og gemme disse pa arddisk Program til ADS P-21062. a_svd4 c Hovedprogram til ADSP-21062 Modtager data seπeit fra ADSP-2181 Beregner Foretager normaiisering, filtrenng samt modeldannelse bsvd4 asm Assembler funktioner der bruges af a_svd4 c Program til ADS P-2 I 81 rot51.dsp Programmerer synteser Styrer antennevalg Maler radata Forbehandler radata, sender forbeliandlede data seπeit til ΛDSP-21062 Andet. def_4 h header-fil der bruges af go4 c, a_svd4 c og bsvd4 asm * include <asm_sprt.h> « include "def21060.h" I include "def_4.h" .segment /dm seg_dmda; . ar _source (RAWDATA] ; -var _rx_ιnterrupt; .global _source; -global _rκ_ιnterrupt; . endseg; . segment/pm seg_pmco; .global _tx_antenna; _tx_antenna: leaf_entry; r0=0x000f0000; dm(TDIVl)=rO; r0=0x000070fl; dm(STCTLl)=rO; /* internal TFS - /* TFS requxi-ed -/ /* Serial w rα le n gt /* Sport enaoie -' dm(TXl)=r1; leaf exit; /* float searchmax ( float *v, int n] */ /* return maximum value in vector v of length r. */ /* replaces C-routine findmax */ .global searchmax; searchmax: leaf_entry; £0—1.0e99; very small *' ι4-r4; /* pointer ;: vec fl2=dm(ι4,m6) . /* get vjOl -' lcntr=r8, do do_fιnd until Ice; /* Loopcount^: is n */ do find: fO=MAX(fO, fl2), fl2=dm(i4,m6) . /* fine new -= '. , get next v(k] */ leaf exit; /* float pytht loat a, float b) V .global _pyth; /* required: fll=2.0 input: fO-numerator, f12=denomιnator output: fO-result affected: n , fl2 */ _pyth: leaf_entry; flO-abs £4 ; /* abs(a) */ f9-abs fβ; /* abs(b) */ fl-O.S; /* used in sqrtf_pr */ f8=3.0; /* used m sqrtf_pr ~/ comp(fl0, f9) ; if It ]ump b_bιg (DB); /* if absaopsb */ £11-2.0; /* used in dιv_ph *' f15-1.0; /* used in general expression */ call dιv_ph (DB); fl2-rl0; /* den i'.in to is ϊosa */ f0=f9; /* numerator s acsc */ call sqrtf_ph (DB); £2-f0*f0; /* quotient squarec */ f0-f2+fl5; /* input to sqrtf_?h - 1 f0=f4*fl0; / « absa'sqr ( .. ) - leaf exit; b_bιg: fl2-pass f9; /* numerator is absa */ call dιv_ph (DB); /* r4 and r8 previously set */ if eq ]ump lszero; /* both arguments are zero */ fO-flO; /* denominator is absb */ call sqrtf_ph (DB); £2=f0*f0; /* quotient squared V f0-f2+fl5; /* input to sqrtf_ph ♦ / f0=f4*f9; /* absb'sqrt ( .. ) -/ leaf exit; f0-0.0; leaf exit; /* void sum_and_scale(ιnt m, int n, int 1, int 1, float mvh, float *-a) */ /* for (}=1; <n; ■ }++) /* { /* for (s-0.0, k-i; <=nι-l; k++) s+=a [ ) [ i) *a [ ] ( ] ; */ /* f-s*ιnvh; */ /* for (k=ι; k<=m-l; k++) a ( k! [] ] < ■ -fa | r) [ i J . */ /* } '/ /* inner loops earlier calculated usinα scalai ana SJ 3 • / .global _sum_and_scale; _sum_and_scale: leaf_entry; rO=reads(l) ; /* 1, aisσ ■ ) '/ rl=r8-r0; /* n-l -/ r2=r4-rl2, lcntr=rl; /* • m-i ioorjcounter _n ooth inner loops » / fl5=reads(2). /* invh */ ι4-reads(3) ; /* address of vec:;.- of pointers to a */ rl-r8*rl2 (ssi ) , rl0=dm( ι , m5) ; /* n*ι, point tc a ' I r3-rl+rl2, m4=r9; /* n*ι- | -ι, modify cε:rfeen rows is p */ r3-r3+rl0; / • pointer value :cr 3[k](ι] */ do for_] until Ice; /* do outer loop */ r5=rl+r0, ι4=r3; /* n*ι+ι, pointer : ι(k] [i] r5=r5+rl0, f7=dm( ι4,m4 ) ; /* pointer value .. ι|k) n\, get a[k) (i) f6=£12-fl2, ι3=r5; initialize sum, oointer to a(k)[;j] fl4-dm(ι3,m4); /* get a[k)(]] */ lcntr=r2, do innerl until Ice; fll-f7*fl4, f7-dm(H,πU); /* a [k] [ι| *a ( ; [ ■ ) ] , get a(k](ι] */ innerl: f6-f6+fll, fl4=dmU3,m4); /* update sun-, get a[k]l]l */ f6-£6*fl5,ι4=r3; /* f-s*ιnvh, pointer to a(k][ι] */ i3-r5; /* pointer to a(k)i l */ f7-dm(i4,m4); /* get A[k] (1) ♦ / lcntr-r2, do ιnner2 until Ice; fH-f6*f7, fl3=dm(ι3,m5); /* multiply by :', get A[k][;)] */ fll-fl4+fl3, f7=dm(ι4,m4); /* A[k]{]] + f-[k][ιl, get A(k][ι) */ ιnner2: dm(ι3,m4 )-fll; /* store in A[k)!:, -/ for_] : rO-rO+l; /* increase 3 leaf exit; /* void sum2_and_scale ( int m, int n, int 1, int 1, float . float 'a) */ /* for (3=1; ]<n; 3++) -I /* ( -I /* for (s-0.0, k=l; k<=m-l; k++) s+=a ( ] 11. 'a (k) [; ) . * 1 I* f-s*gιnvaιι; */ /* for <k-ι; k<-m-l; k++) a [k] [3 ] +-fa (k) UI ; */ /* ) /* inner loops earlier calculated using scalar and ≤vc 3 • / .global _sum2_and_scale; _sum2_and_scale: leaf_entry; rO-reads ( 1 ) ; /* 1, also 3 */ rl-r8-r0; /* n-l */ r2-r4-rl2, lcntr-rl; /* m-i loopcounter in second inner loops */ fl5-reads<2); /* invh */ ι4=reads(3); /* address of vector of pointers to a */ rl-r8*rl2(ssι) , rlO-dm( 1 ,m5) ; /* n*i, point to a •/ r3-rl+rl2, m4=r8; /* n*ι+ι, modify between rows is n ♦ / r3»r3+rl0; /* pointer value for a(k][ι) */ r8=r8*r0(ssι), /* n*l */ rl2=r8+rl2; /* n*l+ι ♦ / rl2-rl2+rl0; /* pointer to a(l](ι) */ do for_32 until Ice; /* do outer loop */ r5-r8+r0, ι4=rl2; /* n*ι+ 3 , pointer to a(k][ιl */ r5-r5+rl0, f7=dm( 14 ,m ) , /* pointer value for alk]( 3 ), get a[M(l] */ f6=£12-fl2, ι3=r5; /* initialize sum, pointer to a[k)( l */ r2=r2-l, f 14=dm( ι3, m4 ) ; /* loopcounter is ιr-l-m-ι-1, get a ( | ( 3 1 */ lcntr=r2, do ιnnerl2 until Ice; fll=£7*fl-, f7=σm(ι4,m4), /* a f kj [ 1 ) *a [ k 1 ( 3 ) , cjet alM'il */ ιnner!2. f6=£6+fll, f 14=dm( j.3, m4 ) , /* update sum, get ail] hi */ pointer to alkjlij t Ajkj ( 1 j » / a (k) [3 ] * / pointer to a|kj k ] [ 3 ) */ get A[k,!ιl */ ιnner22- for_32: rC-rO+1; increase 3 -I leaf e it; t m, int n, int 1, int 1, float *-v, float "a| /* for (s-0.0, k-1; k<=n-l; k++) s+=a (1] [k] *v[k) [3 ) ; /* for (k=l; k<-n-l; k++) v [kj ( ] +=s*v(k] [1] ; /* ) /* inner loops earlier calculated using svd_12 and svd 3 -global _sum3_and_scale; _sum3_and_scale: leaf_entry; r0=reads ( 1 ) ; /* 1, also 3 */ rl-rβ-rO; /* n-l */ ι4*»reads(3) ; /* address of vector of pointers to a */ ι3-reads(2); /* address of vector of pointers to v */ r2-r8*rl2(ssι ) , rlO=dm( ι4, m5) ; /* n*ι, point to a */ r2-r2+r0, m4=xβ; /* n*ι+l, modify between rows is n */ r2»r2+rl0, rll-cm(ι3,m5) ; * pointer value for a(ι)(l], point to \ r8=r8*r0(ssι) ; /* n*l */ rl2=r β -τl2; /* n*l+ι */ rl2=rl2+rll; /* pointer to v[l](ι) */ ι2=rl2; point to it */ lcntr=rl ,do for 3 until Ice; /* lcopcounter is n -1, do outer loop r5=r8+r0. ι4=r2; /* n*ι +3, pointer to all] 11] */ r5=r5+rll. f =dm( ι4 , m.6) , /* pointer value for v[ ][ ] , get a [1! [1] f6=f!2-fl2, ι3=r5; /* initialize sum, pointer to v[l) J *"/ fl4=dm(ι3,m4); /* get v(lj[j] • / lcntr-rl, do ιnnerl3 until Ice; f9-f7*fl4, £7=dmd4,m6); /* a( 1] I k] ♦ v(k) !;. ] , get a[ι][k] */ mnerl3: f6-£6+f9, fl4-dm(ι3,m4) ; /* update sum, get v(k]l3l */ f7«dm(i2,ra4); /* pointer to v(l]t]l */ ι3-r5; /* point to v(l][ι] */ lcntr-rl, do mner23 until Ice; fl4-f6*f7, fl3=dmd3,mS); /* multiply by sum, get v[k]f 3 ] */ fl4-fl4+fl3, f7-dm 2,m4); /* v[k][j) + sum*v(k)[ι], get v[k](ι] */ mner23: dπι(ι3,m4 )=»fl4; /* store in v(k][j] */ for_}3: r0=r0+l,ι2=rl2; /* increase ] ♦ / leaf_exιt; /* void sum4_and_scalednt m, int n, int 1, float *rvl, :..at **a) */ / ♦ for (]-l; ι<m;]++) */ /* { ♦ / /* for (s=0.0, k=l; k<-n-l; k++) s+=a ( ] ] ( k] -a [ i ] | ,. . «■ / /* for (k=l; k<=n-l; k++) a d ) ( k] +-s*rvl ( k] ; «■ / /* I */ /* inner loops earlier calculated using svd_8 and svd_9 */ .global _sum4_and_scale; _sum4_and_scale: leaf_eπtry; r0=rl2+l; /* 1 = l+l r2=r4-rO; /* m-1, loopccurit .- outer loop */ rl=r8-r0, lcntr=r2, /* n-l is loopco -- in inner loops, set outer loopcount. -/ ι4=reads(2), /* address of vec::; of pointers to a */ r4=reads(l); /* address of ivl -/ r4=r4+rO; /* address of rvi _ ♦ / r2=r8T12(ssι ) , rlO=dm( ι , m5) , /* n*ι, point tc */ r2=r2+r0; /* n*ι+l */ r2=r2+rl0; /* pointer a ^ us :.: a|ι]|l] - ' /* n'1+1 = n*ι+l-- .3 address of a[l][l] */ do for_}4 until Ice; /* do outer looo - ι4=r2; /* pointer to a { 1 . '/ f7=dm(ι4,m6) ; /* get a(ι]|l) ♦ / f6=fl2-fl2, ι3=r5; /* initialize sun, -winter to ai]]|l] */ fl4=dmd3,m6); /* get a{])[ll */ lcntr=rl, do ιnnerl4 until Ice; f9-f7*fl4, f7=dm(ι4,m6); /* a|]][kl'a|. ,), get a[ι][k| */ ιnnerl4: f6=f6+f9, fl4=dm(ι3,m6) ; /* update sum, at a(j][k] */ ι2-r4; /* pointer to rvl._ ♦ / ι3-r5; /* point to a(]][l -/ f7-dm(ι2,m6); /* get rvl(l] */ lcntr-rl, do ιnner24 until Ice; fl4-f6*f7, fl3-dm(ι3,m5); /* multiply b\ sum, get a(]](k] */ fl4-fl4+fl3, f7-dm(ι2, 6); /* a[]][k] + s_—'rvl(k], get rvl(k] */ ιnner24: dm(ι3,m6)-fl4; /* store in a(]][t. -/ for_ 3 4: r5»r5+r8; /* increase ] is t-.a same as increasing address of a[]][l] with n */ leaf_exιt; /* void get_dιv(ιnt indx, int *source, float pm *uu_r, f.r-t pm *uu_ι, int ιn_uu), */ /* fetch complex integer data from source. Perform corrple division of measured signal with reference and store in vectors uu_r a a u-_. -/ -global _get_dιv; _get_dιv: leaf_entry; r4=r4+r8, rlO-reads (2 ) ; /* source [ inc ] , .-;5 into uu */ rl2»rl2+rl0, ι4-r4; /* uu_r | in e/.1 , pci- to source */ r2=dm(ι4,m6); /* m_r */ f2=float r2; rl-dm(ι ,m6); /* m_ι */ fl-float rl; r3=»dm< ι4 ,m6) ; /* r r */ f3»float r3, r6-dm( i4 , m5 ) ; /* r_ι */ f6-float r6, ιll=rl2; /* point to address of uu_r[ιπdex] r4-reads ( 1 ) ; /* address of uu_ι */ r4-r4+rl0; /* indx */ f5-£3* f3, ιl2«r4 ; /* r_r*r r, point to uu_ι(ιndx] */ fl3-£6* f6; /* r_ι*r~ι ♦ / fl2-fS+fl3; /* complex denominator */ rl3-0x2edbe6ff; /* le-10 */ comp ( fl2, fl3 ) ; if It j ump less; /* if smaller than le-10 don't divide */ call dιv_ph ( DB ) ; fll-2.0; f 0-1 .0; /* numerator */ r4-0x3f800000; rθ-0x40000000; */ ump done_dιv; less : r0-0x501S02f 9; /* set inv_den=lel0 if den was small ♦ / done_dιv: f4=f2*f3 /* m_r*r_r */ f8«fl- f6 /* m_ι*r_ι */ f4-f4 + f8 /* add ♦ / f4 = f4* f0 /* times ιnv_den » / f4 = fl- f 3 pm(ιll,ml3)=f4; /* m_ι*r_r, store real part of prev result */ f8=f2* f 6 /* m_r*r_ι */ f 4=f 4 -f8 /* subtract */ f4 = f 4 * fO /* times irv den -/ pm l 2 , ml 3 ) = f 4 /* stoie imaα part * / leaf_exιt; /* void norm_αιv(ιnt indx, int 3D, float *n_r, float *n_ι, float pm *uu_r, float pm "JU_L) * I /* Normalize complex data and store in vectors uu_r and uu_ι */ .global norm_cιv; _norm_αιv: leaf_entry; rl2=rl2+r8; /* n_r[jj) ι4-rl2; /* • point to it */ rl2=reads(l) ; /- address of n_ι -/ ,m5) , I - n_ι(]3) , get r_r ♦ / ι4-rl2; /* point to it */ rl2=reads(2); /* aααress of uu_ι */ rl2=rl2+r4, f6=dm( 14 ,m5 ) , /* uu_r(ιndx], get r_ι */ ιll-rl2; /* point to it */ ~ rl2=reads(3) ; /* adαress of uu_ι ♦ / rl2-rl2+r4; /* uu_ι[ιndx] */ ιl2-rl2; /* point to it */ f5-£3*f3, f2=pm(ιll,ml3) ; /* r_r*r_r, get m_r */ fll-f6*f6, fl=pm(ιl2,ml3), /* r_ι*r_ι, get m_ */ fl2=f5+fll; /* complex denominator */ rl3=0x2edbe6ff; /* le-10 */ comp(fl2,fl3); if It jump less_n; /* if smaller than le-10 don't divide */ call αιv_ph (DB); f11=2.0; f0-1.0; /* r4-0x3f800000; r8»0x40000000;V jump done norm; less_n: r0=0x501502f9; /* set ιnv_den=lelO if den was small */ done_norm: f4=f2*f3; /* m_r*r_r */ fβ-fl-£6; /* m_ι-r l V f4=f4-f8; /* add V f4=f4-fO, I " times mv_den */ f4-fl-f3, pm(ιll,ml3) = f4. /* m_ι*r_r, store real part of prev result */ f8=f2-:6; /* m_ι— r~ι */ f4=f<:-:S; / ■ * suσtract */ f4=f0-f , /* times inv den */ pm(ιl2,r.l3) =f4; /* store imag part * / leaf ex t; /* void mk Xadr.t ra, int 1, int indx, int row, float fxoat **Xa) */ /* implementation of "for (col-0; coKl; col++) Xa (indx) (col) =x(row-col-l] " */ .global mk_Xa; mk Xa: leaf_entry; r2-r4*rl2(ssi), /* startindex is m'indx, loop 1 times */ i4=reads(3) ; /* address of vector of pointers to Xa */ rO-dm(i4,m5) ; /* point to the real address of Xa */ r0-r0+r2; address of first element i4-r0; point to it */ r4-reads(2); /* address of x */ rθ-reads(l) ; /* row ♦ / rO-rO-1; /* start in row-l r / r0=r4 +r0; i3-r0; /* point to it - I do do xa until Ice; f4-dm(i3,m7); /* get x(row-col-i; */ do xa: dm( ι , m6) =f ; /* update Xa ( indx] (col) ♦ / leaf exit; /* void impulsdnt il, int 1, float *ha, float *a) -/ /* implementation of "for (j]=l; jj<=l; 3]++) ha(ιι)- '-'-,a I 11-3] ]" '/ . global _impuls; impuls: leaf_entry; rO=r4τl2, lcntr=r£ /* address of h≤J.. ' , loop 1 times * / i4=r0; /* point to it -/ r0= reads ( 1 ) ; / ■ * address of a • r0= rO+1, f2=dmι; 4 , m7 ) ; /* start in 33=1, r ha(ιι] and point to ha[ιι-l] ι3= rO; /* point to it • / rιa(ii-j]] */ do_imp: et a(]]] */ r0-r4+rl2; /* address of ha(_i: */ i4-r0; /* point to it • / dm(i4,m5)=f2; /* really update */ leaf exit; /* void mk_Ha(int m, int 1, int row, float *ha, float « *Ha) */ /* implementation of "for (col=0; coKl; col++) Ha [ row] (col) =ha ( ow-col] " */ .global _mk_Ha; mk Ha: leaf_entry; r2«r4*rl2(ssi), lcntr-r8; /* startindex is m*row, loop 1 times */ i4-reads(2); /* address of vector of pointers to Ha */ r0-dm(i4,mS) ; /* point to the real address of Ha */ r0-r0+r2; /* address of first element */ r4=reads(l) ; /* address of ha * rO-r4+rl2, i4=r0; /* start in ha (row], point to Ha (row) i3-r0; /* point to it */ do do_na until Ice; f4=dm(i3,m7); /* get x[ ow-cell • ' do ha: dm( i4 , m6) =f ; /* update Xa( indx] ic;l] leaf exit; /* float f_abs( float >:) */ /* implementation of "y=fabs(x)" */ .global _£_abs; f abs leaf_entry; fO-ABS f4; leaf_exit; /* float svd_l(int m, int k, dm float **A, int 1) */ /* implementation of "for(i-j ; ι<l; ι++) scale+-fabs(A(i] (k) ) " */ -global _svd_l; I. _svd_l : leaf_entry; rl=»r4*r8(ssι) , ι4=-rl2; /* m*j, get address of vector of pointers to A */ r2=>r8+rl, rO=dm( ι4,m5) ; /* startindβΛ is 3*m+k, point to the real address of A */ rl=r0+r2, m4=r4; /* address of first element, modify f0=fl2-fl2, 14-rl; /* initialize scale, point to A */ r4-reads (1 ) ; rl2=reads(2); r0=r4-rl2, f4=dm(ι4,m4 ) ; /"loop counter: 1-], get A|ιj(k) */ Icntr-rO, do calc until Ice; f8-ABS f4; /* fabs */ calc: f0=f0+f8, f4=dm(ι4,m4); /* update scale, cet A(ι][k| -/ leaf exit; /* void svd_2( float invscale, int k, int m, float pm *su.-., float "A, int 1 ) */ /* implementation of "for d=k;ι<l;ι++) 1 A( 11 ( k] *=in scale; sum+=A(ι] (k]*A(ι] |k] ) */ . lob≤i _svd_2. _svd_2. leaf_entry; ι4=reads (2) ; /* address of vector of pointers to A */ r2=reads(3) ; /* 1 m5) . /* I-'-., point to the real accress of A */ /* m+1, loopcounter is i- * / r2=r8-rl (ssi ) ; startindey is '-. » (m+1 ' */ rl=r0+r2, m4=rl2; /* aαcress of first element, modify is ι4=rl; /* point to it */ ι3-rl; /* once again, looses line m loop •/ ιl2=reads(l); /* initialize sum -/ f3=dm(ι3,m4 ) , f12=>pm( ιl2,ml3) ;/* get A(ι](k] anc sum */ f2=f3*f4, f3=dm(ι3,m4); /* All ] [k] "invscale, get next A ♦ / do do_sp until lce; f8=f2*f2, dm(ι4,m4) =f2; /* A(ι] (k] *A(ι] [k] , store prev in A[ι][k] */ do_sp: f2=f3*f4, fl2=f8+fl2, f3=dm( ι3,m ) ; /* A(ι ] (kl "invscale, update sum, get next A */ pm(ιl2,ml3)=»fl2; /* store sum */ leaf exit; /* svd_3(ιnt m, int 1, int } , int 1, float f, dm float **A, int st) */ /* implementation of "for < k=st; k<l; k++) A[k)(]) +=■ f*A(k](ι]" */ .global svd 3; _svd_3: leaf_entry; r2=>reads ( 1 ) ; /* 1 */ rl=reads( ) ; /* st */ r2=r2-rl; /* 1-st */ rO=r4*rl (ssi) , lcntr=r2; /* m*st, loopcounter is 1-st */ ι4=reads(3) ; /* address of vector of pointers to A -/ r2=r0+r8, rl0=dm( 1 , m5) ; /* startindex is a'stii, point to the real address of A */ r3=r0+rl2; /* m*st+] */ rl=rl0+r2, m4=r4; /* address of A(kl[-1, modify is m */ r2=rl0+r3, ι4=rl; /* address of A(k][ι], ceint to A(k)(ιj */ ι3=r2; /* point to A(k] (] ) */ f0-reads(2) ; /♦ f ♦/ f4=dm(ι4,m4 ) ; /* get A(k] [1] do do 3 until Ice; f8=fO*f4, fl2=dm(ι3,mS); /* multiply by £, get A „| [1] */ f2=fl2+f8, £4-dm(ι4,m4); /* A(k](j] + f*A(k)[ι], get A[k][ι) */ do_3: dm(i3,m4)-f2; /* store in A(k]( ) ♦ / leaf_exιt; /* svd_4(ιnt m, int i, int 1, float scale, dm float "*A) */ /" implementation of "for(k=ι; k<l; k++) A(k](ι] *= scale" */ .global _svd_4; _svd_4 : leaf_entry; r2=rl2-r8; /* l-i */ ι4-reads(2); /* address of vector of pointers to A "/ rl=r4+l, r0=dm( ι ,m5) ; /* m+1, point to the Leal address of A */ r2=r8*rl (ssi) , lcntr=r2; /* startinde-' is ι*(m+l), loopcounter is l-i */ rl->r0+r2, m4»r4; /* address of element, modify between rows = m -/ ι4=rl; /* point to it */ ι3=rl; /* again, loose line in loop */ f0=reads(l); /" scale */ f4=dm(ι3,m4) ; /* get A(k](ι] ♦ / do do_4 until Ice; f8=f0*f4, f4=dm( l3,m4 ) , /* multiply by C, get n»v L A "/ do_4. dm(ι4,m4)=»f8; /* store in A(k]U) */ leaf_eκιt, /* svd_5(ιnt , int k, int 3, dm float "*A) */ /* implementation of " for ( 1= ; ι<l, 1++ ) scale+=fabs ιA[ K] | 1 ] ) " */ -global _svd_5, _svd_5 leaf_entry; rl=r4*r8(ssι), /* m" » / r2=rl2+ rl; /* startinαe is ι:"m T n */ ι4=reads(l), /* address ot vectoi of pointers to A */ r0=dm(ι4,m5) ; /* point to the real address of A */ rl=r0+r2; /" address of first element */ f0=fl2-fl2, ι4=rl; /* initialize scale, point to A */ r2=r4-rl2, f4=dm( ι4, m6) ; /* loop counter = 1-3, get A(k](ι] * / lcntr=r2, do do_5 until Ice; f8=>ABS f4; /* fabs */ do_5: f0=f0+f8, f4=dm(ι4,m6); /* update scale, get A(k](ι] */ leaf_exιt; /* void svd_6(float invscale, int 1, int m, float pm "sum, float *"A, int ] ) */ /* implementation of "for (k=j ; <l;k++) {A(i] (k) "-invscale; sum+-A[ι] (k)*A(ι) [k) ) "/ -global _svd_6; _svd_6: leaf_entry; ι4=«reads(2) ; /* address of vector of pointers to A */ rl=reads(3); /* } */ r0-rl2-rl; /" 1-j ♦ / r2=rl2*r8(ssι) , lcntr=r0; /* m*ι, set loop counter */ r2=r2+rl, r0=dm( ι4 , m5) ; /* startindex is ι"m+3, point to the real address of A */ rl=r0+r2; /* address of first element "/ ι4=rl; /* point to it "/ ι3=rl; /* again, loose line in loop */ ιl2-reads(l) ; /* initialize sum */ f3-dm(ι3,m6), fl2»pm( ιl2,ml3) ; / ♦ get A(ι][k), get sum */ f2=f3*f4, f3»dm(ι3,m6); /" A(ι] (k) "invscale, get next A */ do do_6 until Ice; f8~f2*f2, dmd4,m6) =f2; /- A| 1 ] [k] " 1 ] [k] , store A(ι][k) */ do_6: f2=f3*f4, fl2-f8+fl2, 3»dm( ι3,mδ) ; /* A( 1] [k] "invscale, update sum, get A|ι]| | -< pm( ιl2, ml3) -fl2; leaf exit; /* void svd 7 (int m, int i, float invh, float "rvl, float **A, int ]) */ /•*. implementation of "for (k=3 ; k<l; k++) rvl (k)=ιnvh*A(ι) [k] " "/ .global _svd_7; _svd_7: leaf_entry; rl=reads(3) ; /* 1 */ r0=r4-rl; /" 1-3 */ r2=r4*r8(ssι| , lcntr=rO; /* m*ι, set loopcount ♦ / ι4=reads(2); /" address of vector of pointers to A */ r2=r2+rl, r0=dm( ι4 ,m5) ; /* startindex is rtrι+ 3, point to the real address of A '/ r0=r0+r2; /* address of first element */ ι4-r0; /" point to it */ r4»reads(l) ; /* address of b */ r0=r4+rl, f4=dm( ι4 , mδ) ; /* address+3, get A(ιl(}] */ ι3=r0; /* point to b(}] */ do co_upd until Ice; :8=fl2*f4 , f4=dmd4,m6) . /" A(ι] (3 ] * mvh, ϊ- A[).] [3] */ do upd: cm(ι3,m6)~f8; /* update b(ι) "/ leaf_exιt; /" float svd_8dnt m, int 3, int 1, float ""A, int st) */ /* implementation of "for (sum=0.0, tc=st; k<l ; k++ ) sum+=A[ 3 ] 11.1 -=.( 1 ] [ 1 | •• -/ .global _svd_8; svd 8: lea:_entry; rl»reads ( 2 ) , /* st "/ r0=r--rl; /* 1-st "/ rO=r4-r3(ssι ) , lcntr=r0; /* m*3, set loop counter */ ι4=reaαs (1 ) ; /* adαress of vector ;f pointers to A • / rO-ri-rO, r2=dm( ι4,m5) ; /* m"3+st, point to c.-,e real aαdress of A */ r0«r0-τ2; /* address of first element */ r0=r8-rl2, ι4=r0; /* 3-1, point to A */ rO=r0τ4 (ssi) ; /* (3-1) " m ♦ / rl-rO+1; r0=rl2-r8, m4=rl; /* (1-3), modify between A( ] [k] and A(ι](k] "/ r0=»r0*r4 (ssi) ; /* d-3) * m */ m0=r0; /* modify between A(ι](k] and A(3)(k) ♦ / f0=f!2-fl2, f4=dm(ι4,mO); /* initialize sum, get A[ 3 ](k] */ f8«dm(ι4,m4 ) ; /* get A( ] [k] "/ do αo_6 until Ice; f2»f4*f8, f4=dm(ι4,m0) ; /* A(3) lk]"A(ι] (kl, get A(ι)(k] "/ do 8: f0-f0+f2, f8=dm(l4,m4) ; /" update sum, get A(ϊj[kj */ leaf exit; /* void svd_9(mt m, int 3, float s, float "rvl, float **A, nt st) */ /* implementation of "for ( k=st; k<l; k++) A(3][k] += s"rvl[k)" */ -global svd 9; svd 9: r2=r *r3(ssι) , lcntr=r0; /* m*3, set loop counter */ ι4-reaαs(2) ; /* address of vector o: pointers to A */ r2»rC-rl, r0=dm( ι4,m5) ; /* startindex is *ι+s:, point to the real address of A */ r0-r0+r2; /* address of first element in A */ r2-reads ( 1 ) ; /* address of rvl */ r0-r2+rl, ι4»r0; /* address + st, point to A */ 13-rO; /* point to b(st) "/ f4-dm(ι3,m6) ; /* get rvl(k] */ do do_9 until Ice; f8-fl2"f4, f0-dm(ι4,mS); /* rvl(k]"s, get A(3](k] */ f8-f8+f0, f4-dm(ι3,m6) ; /* do sum, get rvl(k] */ do 9: dm(ι4,m6)-f8; /* update A(3)(k) */ leaf ex t; /* svd_10(ιnt m, int l, float scale, dm float **A, int st) "/ /" implementation of "for (k=st; k<l; ++) A(ι](k] *= scale" ♦ / -global _svd_10; _svd_10: leaf_entry; rl»reads(2) ; /" st "/ r0=r4-rl; /* 1-st */ rO=r4*r8 (ssi) , lcntr=»r0; /" m"ι, set loop counter */ ι4=»reads (1 ) ; /* address of vector of pointers to A */ r2=r0+rl, r0=dm( ι4 ,m5) ; /" startindex is nritst, point to the real aαdre≤s of A */ rl=r0+r2; /" address of element */ ι4=rl; /* point to it */ ι3=rl; /* again, loose line in loop */ f4=dm ( 13, mδ ) ; /* get Ad] lk| */ do do_10 until Ice; f8=fl2*f4, f4=dm(ι3,mδ); multiply by scale, get next A(ι](k] co 10: dm( ι4,mδ)=f8; store in A[ι ] [kl */ leaf exit; I - svd_ll(ιnt m, int l, float s, dm float "\ , dm float "-., int st) "/ /- implementation of "for(3=st; 3<1; 3++) v( I j [ I ] =a ( I] ( ] -3" */ . ional svd 11; svd 11: leaf_entry; rl=reads(3) ; st */ r0=-r4-rl; 1-st "/ r0»r4"r8 (ss ) , lcntr=rO; /" m*ι, set loopcounter */ ι4=reads(2) ; /* address of vector of pointers to A */ r2=r0+rl, r0=dm(ι4,m5); /* startindex s m*iτst in a, point to the real adαress of A r0=r0+r2; /* address of element "/ r0»r4*rl(ssι), ι4=r0; /* m*st, point to element "/ ι3-reads(l) ; /* aαdress of vector of pointers to v */ r2»r0+r8, r0=dm(ι3,m5) ; /* startindex is m"st+-ι in v, point to the real address of r0=r0+r2, m4> r4; /* adαress of element, modify between rows in v is m */ ι3-r0; /* point to it */ f4=dm( 14 ,mδ) ; /* get A(ι] (3] */ do do_ll until Ice; f8=fl2*f4, f4=dm(ι4,m6); / ♦ A(ιj(3]*s, get next A(ι](3] */ do 11: dm(ι3,m4)=f8; /* store in v(3)(ι) */ leaf exit; /* float svd_12(ιnt m, int 1, int 3, float **A, float **V, mt st) */ /* implementation of "for (sum=0.0, k=st; k<l; k++) sum+-A(ι ] (k| *V[k] ( ] " */ -glcb3l _svd_12; _svα_12: leaf_entry; rl-reads ( 3 ) ; st V r0-r4-rl; 1-st */ r0-r4*r8 ( ssι ) , lcntr-rO; /* m*ι, set loop counter */ ι4-reads ( l ) ; /* address of vector of pointers to A */ rO-rl+rO, r2=dm( ι , m5 ) ; /* start in a is m*ι+st, point to the real address of A */ r0-r0+r2; /* address of first element */ r0-r4 * rl ( ssi ) , ι4»r0; /* m*st, point to A , modify is 1 */ ι3=reads ( 2 ) ; /* address of vector of pointers to V */ r0=rl2+r0, 2=dm ( ι3, m5 ) , /* start in v is ra*st+3, point to the real address of v */ r0»r0+r2, m4»r4 ; /* aαdress of first element, modify between rows is m */ f0=fl2-f l2, ι3=r0; /* point to v, initialize sum */ f 4 =dm ( l 4 , mδ ) ; /* get All] (k) •/ f8=dm( ι3, m4 ) ; /* get V[k] ( 1 do do_12 until Ice; f2=f4-f8, f =dm(ι4, δ); /* A ] tk]"V(k] (;j, get All) [kl " I do 12 : f0=f0+f2, f8=dm(ι3,m4) , /* update sum, get V ( k ) 1 ) */ leaf exit. /* svd_13dnt m, int 1, am float **v, int st) */ /* implementation of " for ( k=st; k<l; ++ ) v(ι](H v(k] ti] - 0 0" ' / .global _svd_13; svd_13: leaf_entry; rl=reads(l); /* st */ r0=r4-rl, ι4-rl2. /* 1-st, address M vector of pointers to v -/ rO=r4*r8 (ssi) , lcntr=r0; /* m*ι, set loop rjunter */ r2=r0+rl, rlO=dm( ι , m5) ; /* startindex is n-i+st in v[ι][kl, point to the leal of v */ adαress r0=rl0+r2; /* aoαress of ele-.ent '/ r0=r4*rl(ssι), ι4=r0; /* m*st, point tc J* 1 r2=r0+r8; /* startindex is π-st+i in v[k)[ι)*/ rl=rl0+r2, m4=r4; /* aαdress of element, moαify between rows is m */ fl2=fl2-fl2, ι3=rl; /* point to v */ do do_13 until Ice; dmd4,mδ)«fl2; /* vli] [k)=0.0 */ do 13: dm(ι3,m4)=fl2; /* v(k] (ι]=0.0 */ leaf exit; /* svd_14(ιnt m, int 1, int n, mt 1, float c, float s, cn float **a) */ /* implementation of " for (3=0; 3<=1; 3++) 1 y-a(3)(n]; r-a(j] [il; a( ] (nm)=y*c+z*s; a (3] (ι)=z*c-y*s; ) */ -global _svd_1 ; _svd_14: leaf_entry; ι4=reads ( ) ; /* address of vector of pointers to a(3][n] */ rO=dm( ι , mS ) , /* point to the real address of v */ rO=rO+rl2, lcntr=r8; /* adαress of ele^e- a[0)(n], loop 1 times *7 ι4=r0; /* point to it */ rO=reads (1 , ; ι3=reads ( ) ; /* address of vectcr of pointers to a! l[i] */ r2=dm(ι3,m5) ; /* point to the re . address of v */ rO=rO+r2, rrι4 = r4 ; / * address of eleme- t a ( 0 | l ι modi fy between rows is m ι3-r0; /* point to it */ 12-rO; /* again, loose line in loop */ f3»reads(2); c */ f0-reads<3); s */ f2=dm(ι4,m5); /* y-a(:][n] */ fl0=f2*f3, f4=dm(ι2,m4); /* y*c, z-a(]][ι] do do_14 until Ice; fl5-f0*f4; /* z*s */ fl2=»f3*f4, flO-flO+fiS, f4=dm(ι2,m4); /• z*c, y*c+z*s, get next z */ fl=f2*f0, dm(ι4,m4)-flO; / ♦ y*s, store y*c+:*s in a(3)(n) fl2=fl2-fl, f2-dm(ι4,mS); /- z*c-y*s, get y */ o 14: fl0»f2*f3, dm(ι3,m4)-fl2; /* y*c, store ;*c-y*s in a [3 Id] leaf exit; /* float svd_15(int , int 3, int st, float *b, float **A, int 1) */ /♦ implementation of "for (sum=0.0, ι=st; ι<l; 1++) sum+=A[ 1) ( ] -b! 1 ) " */ .global _svd_15; svd 15. lea _entry; r0=reads (3) ; 1 */ r0=r0-rl2; 1-st r0=r4*rl2 (ssi) , lcntr=rO; / ■ " m*st, set loop counter */ ι4=reads(2), acdress of vector of pointers to A */ r2=r0+r8, r0=dm(ι4,m5); startindex is m*sL+3, point to the real address of A r0=r0+r2, m4=r4; /* aαdress of first ele-nent, modify for A[ι)(3) = m */ r4=reads ( 1 ) ; /* acαress o£ b *' r0=-r4 +rl2, ι4=r0; /* b(st], point to A * 1 f0=fl2-fl2, ι3=r0; /" initialize sum, p?ιπ- cc * ' f4=dm(ι4 , m4 ) ; /* get A(ι] [3) ♦ / f3=>dm(ι3,m6); /* get b(ι) ♦ / do do_15 until Ice; f2=f4*f8, £4=dm(ι4,m4 I ; /* A(ι] l3)*b(ι], ge Aj.i ] do 15: £0=f0+f2, fS=dmd3,m6) ; /* upαate sum, get b(ι] * leaf exit; /* float svd_16(ιnt m, int 3, float *b, float **A) */ / ♦ implementation of "for <3j=0; 33<1; 3D ++ ) s+=A( ] (3 ] *b(3 ] " */ -global _svd_16; _svd_16: leaf_entry; ι4-reads(l); /* address of vector of pointers to A */ r8-r4*r8(ssι) , rO-dm(14 , m5 ) ; /* (m*j), point to the real address of A */ r2-r0+r8, ι3-r!2; /* address of first element, address of b(0) f0-fl2-fl2, l4-r2; /* initialize sum, point to b */ fl2=dm(ι4,m6) ; get A(i) (3] f8=dm(ι3,mδ); get b(3) */ lcntr=»r4, do αo 16 until Ice;/* loop 1 times f2=fl2*f8, fl2=dm(ι4,m6); b<3)*A[ι] [3I, get A(. do 16: f0-f0+£2, f8=dm(ι3,m6); uocate sum, get b(3) * leaf exit; /* float scalardnt n, int m, int k, int 3, float **A, ipt 1) - /* implementation of "for (sum=0.0, ι=l; x<n; 1 — ) sum+=A( 1 ] I ] * \ .1 [3 ] .glooal _scalar; _scalar: leaf_entry; r0-reads(3); /* 1 */ r4-r4-rO; /* n-l •/ rl=-r8*r0(ssι) , lcntr=r4; /* m* -( set loop counter = n */ ι4-reads(2) ; /* address o£ vector of pointers to A */ r2=rl+rl2, r0=dm(i4,m5) ; /* m*l+k, point to the real address of A rl=r0+r2; /* address of first element */ r4-reads(l); * " *" /* j V r4-r4-rl2, ι4=rl; /* ]-k, point to A */ r0~r8-r4, m4»r4; /* m-(3-k), modify between A[ι] (k] and A(ι) [3] is 3-k */ f0=fl2-fl2, m0=r0; /* initialize sura, modify between A(ι][l) and A(ιl(k] */ f4-dm(ι4,m4 ) ; /* qet All] [k] */ f8-dm(ι4,m0); /* get All] 1]] */ do do s until Ice; f2=f4*f8, f4«dm(ι4,m4); /* All] l-A I |l. , get A(ι] Ik) « / do s: f0=f0+f2, f8=dm(ι4,m0); /* update sum, get Alillj] */ leaf exit; /* void evalhxdnt 11, int np, float *a, complex float p- *s, complex float * ha ) */ /* implementation of "for (j }=0; 30<np; 33 ++ ) ha I}} ] =ha I3 ; -31] 3 ] +a ( 11 J " */ .global _evalhx; evalhx: leaf entry; r0=rΪ2+r4; /* address of a | 1. ι3=r0; l2=reads(l ) ; /* • address o£ ι4=reads(2! ; /* adαress 01 fl5=αmU3,mb). /- afiil -/ lcntr=r8, do upd_ha until Ice; f0=dm< I4,m6) , f 2=pm( ιl2,ml4 ) , /- --_L, point to ha_ , s_r, point to s_ι -/ fθ=f0*f2, f l=dm( ι4,m7 ) , f 4=pm( ιl2, ml 4 ) , /- -;_r*s_r, ha_ι, point to ha_tr; s_ι, pointo next s r •/ fl2=fl*f4, f8 = f8+flS; / • ha_ι*s_ι, ha_r-3_r + a|n] */ f8-f0*f4, f3=f8-fl2, /* ha_r-s_ι, h a_r" :_r-ha_ι*s_ι */ fl2=fl*f2, dm( ι4 ,m6) = f3. /" ha_ι*s_r, urdai reallhal]]] I point to lrnaq */ f8=f8+fl2; /* ha_r*s~ι+ha_ι--_r */ upd_ha : dm(ι4,m6)=f8; /* update ι.naς( a --]) point to neM real */ leaf exit; /* float cal_dft(ιnt , int k_u, int N_s, float u, l az 'uu real, float oin *uu_ιιr.ag, comple v float *twιd_px) */ /* implementation of "for (n=0;n<ku; n+τ ) u[ k | +=UU| ] [n ] - .αjpxln] .global cai dft; cal_dft: leaf_entry; f9-fl2-fl2; /* u(k] */ rl»reads ( 1 ) ; /* address of uu_real(0] */ r2-r4+rl, ml2-rl2; /* plus k, modify to next column in uu */ rl»reads(2) ; /* address of uu_ιrr.=g(01 */ r2-r4+rl,ιl2=r2; /* plus k, point tc uu_real(k) */ i!4-r2; /* point to uu_ιmac'k] */ ι4-reads(3); /* point to twιd_px'0] */ fl0-fl2-fl2, fl=dm(ι4,ra6), f5=pm(ιl2,ml2) ; /* l.-.ϊ flO, twid r, UU_r-7 fl2-fl2-fl2, f4-dm(ι4,m6), f2=>pm(ιl4,ml2) ; /* ir.lt fl2, twιd~ι, UU_ι */ lcntr*r8, do do_dft until Ice; fl0-fl*f5, fl5=fl0-fl2, fl=dm(ι4,m6), f5=praι .:2,ml2) ; /* UU_r*twιd_r, calc diff, get twιd_r, UU_r */ do_dft: fl2=f2*f4, f9=f9+fl5, f 4=αm( 14 , n>6) , f2=pm( 1.,, -.12) ; /* UU_ι*twιd 1, update u(k],get twid 1, UU 1 */ f8=fl0-fl2; /- calculate last Ξ.iference */ f0=f8+f9; /* • return upcateα - -.) */ leaf exit; /* float dm_dft(ιnt k_u, float dm *uu_real, float dm *uu_.rag, complex float *twιd_px) */ /* implementation of "for (n=0;n<ku;n++ ) u| k) +=UU|k) [r, 3_px[n]" */ .global _dικ_dft; _dm_dft: leaf_entry; lcntr»r ; f9-fl2-fl2; /* u(kJ-0 */ ι3-c8; /* point to uu_real(0] */ ι4-rl2; /* point to uu_ιmag(0) */ ι2=ceads(l) ; /* point to twιd_px(0] */ fl0»fl2-fl2, fl=dm(i2,m6), /* init flO, twιc_r */ fS=dm(ι3,m6) ; /* UU_r */ fl2-fl2-fl2, f4=dm(ι2,m6) , /* init fl2, twιd_ι */ f2-dm(l4,m6); /* UU i */ do do_dmdft until Ice; fl0=£l*f5, fl5-fl0-fl2, fl=dm(ι2,m6); /* UL"_r*twιd L, calc diff, get fwιd_r * / f5-dm(ι3,m6) ; /* U _r */ fl2=f2*f4, f9-f9+fl5, f4=dm( ι2, mδ) . /* Ul'_ι*twιd_ι, update u( |, get twιd_ι */ o d dft: f2=dm(ι4,m6) ; / ♦ U i */ f8=fl0-fl2; /* calculate last difference */ f0-fβ+f9; /* return updatec [ ] */ leaf_exιt; /* void fr_resp(ιnt 1, complex float *H, complex float --a, complex float *hb, float p * ) '/ /* implementation of "for (11=0; iKl; ιι++) H|ιι]=win --o( ll] /ha I ii ] ; " */ -global _fr_resp; _fr_resp: leaf_entry; ι4=r8; /* pointer to H */ ι3=rl2; /* pointer to ha */ ι2=reads(l) ; /* pointer to hb */ l2=reads(2) , /* pointer to */ f11=2.0; f2=dm(ι3,m6), /* ha r • */ fl=dm(ι3,m6); /* ha~ */ f3=dm(ι2,m<5); /* hb_r */ f6=dm(ι2,m6), fl4=pm(ιl2,ml4) ; / « hb lcntr=r4, do αo fr until Ice; /* loopcounteL fl0=f2*f3; /* ha_r*hb_r ♦ / fl3=fl*fδ; /* ha_ι*ho*ι */ f9=f2*f6, fl0=-fl0+fl3; /* ha_r*hb_ι, nuπ._:?al » / fl3=fl*f3; /* ha_ι*hb_r -/ f9=»f9-fl3, f3=dm(ι2,m6); / ' num_ιmag, get "=_r */ £5-f2*f2, f2=dm(ι3,m6); /* ha_r squared, ςet ha_r */ fδ=fl*fl, fl=dm(ι3,m6); I* ha_ι squared, get ha l */ call dιv_ph (DB) ; fl2=f5+ 6, fδ=dm(i2,m6); /* denominator, hb i */ f0=1.0; /* numerator is 1.0 */ fl0-f0*fl0; /* num_real * ιnv__;en */ fl0-fl0*fl4; /* times w ♦ / f9-f0*f9; /* num_ιmaς * ιnv_cen */ f9-f9*fl4, dm(ι4,mδ)» flO, fl4=pm(il2,ml4) ; /- times w, store real part, get w */ do fr: dm(ι4,m6)-f9; /* store imaς part */ leaf exit; /* void cal_vdet(ιnt 1, float *vdet, complex float *h0, crrole.< float *hl) */ /* implementation of "for (ιι=0; iKl; n++) vdet ( nl=0. CC .-cabsf (hOl n] *hi ( n ] .global _cal_vdet; _cal_vdet: leaf_entry; I4=r8; /* point to vdet • ι2=rl2; /* point to nO */ ι3»reads(l) ; /* point to hi */ fl=0.5; /* used n sqrtf_r f8-3.0; /* used in sqrtf pr f10=0.001; /* scaling factor - f2=dm(ι2,m6); /* hO r */ f5=dm(ι2,m6); /* hO i */ f3=dm(ι3,π>6) ; /* hl~r */ fδ=dm(ι3,m6) ; /* hi i */ lcntr»r4, do do_vd until Ice; / ♦ loopcounter is 1 *7 f9-f2*f3; /* h0_r*hl_r */ fl3-f5*f6; /* hO_ι*hl_i ♦ / fll-f2*f6, f9=f9-fl3; /* real part, h0_r*hl_ι */ fl3-f3*f5, f2-dm 2,m6); /* hl_r*hO_ι, get hO_r */ fl3-fll+fl3, f5-dm(ι2,m6); /* imag part, get hO_ι */ f9-f9*f9, f3-dm(i3,m6); /* real squared, get hl_r */ call sqrtf_ph (DB); fl3=fl3*fl3, f6=dmU3,m6). / ■ * i ag squared, get hl_ι */ f0-f9+fl3; /* input to sqrt_pn */ f0-f4 « fl0; /* scale sqrt */ do vd: dm(l4,m6)-f0; /* store in vdet * ' leaf exit; /* max_abs(ιnt n, int m, int k, dm float **A) */ /* implementation of "for ( ι«k; Kn; ι++) seale=FMAX( scale, :aos (Al I] | k ] ) ) " */ .global max_abs; max abs: leaf_entry; m4»r8; /* modify = in *7 ι4=reads ( 1) ; /* address of ve::;: cl pointers to A r0=dm( ι4,m5) . /* point to the - . address of A ' / rl-r8+l; /* m+1 */ r2=rl2*rl (ssi) , /* startince/ rl=r0+r2; /* address ot fir.- ι4=rl; /* point to it -/ f2=fl2-fl2; /* initialize SCΪ r0=r4-rl2; /* calculate lcc: lcntr=r0, do calc_qr until Ice; f4=dm(ι4,.τ.4), /* A[ι)[k] ♦ / f8=AES f4; /* tabs */ ;alc_qr: f2=MAX(f2, fδ) , /* update scale - f0=f2; /* return value leaf exit; /* float scale_ρow2 (int n, int m, int k, float invscale, suτi, float • A) /* implementation of "for (sum=0.0, ι=k; Kn; ι++) 1- ι] (k]*=ιnvscale; sum+« POW2(A ] Ik] ) } */ .global _scale_pow2; scale_po 2: leaf_entry; r0-r4-rl2; /* n-k V lcntr=r0; ι4=reads(3) ; /* address of vec— of pointers to A r0=«dm(ι ,m5) ; /* point to the re_,_ address of A */ r2=rl2*rl(ssι); /* startinαex is -- —i> */ rl«r0+r2; /* address of firs; .lament */ ι4-rl; /* point to it */ m4»r8; /* m « / fl=reads ( 1 ) ; /* invscale */ ιl2=reads(2); /* initialize s . fl2-pm(ιl2,ml3) ; do do_sp_qr until Ice; f4=dm(ι4,mS); /* get A[ι] [k| -/ f2=f4*fl; /* times invscale ' dm(ι4,m4 )=f2; /* store in A[ l ] i • f8=f2-f2; /* A(ι] [k]*A[ι] li. do_sp qr: fl2=fl2+f8; /* update sum */ pm(ιl2,ml3)=fl2; leaf_exιt; /* tau A(ιnt n, int m, int k, int ], float pm tau, dm flc --^l /* implementation of "for <i=k; i<n;ι++) A(i][j] tau*A(i) (k]' -global _tau_A; tau A: leaf_entry; r0«r4-rl2; /* n-k */ lcntr=rO; i4»reads<3) ; /* address of vector of pointers to A rO-dm( 1 ,m5) ; /* point to the real address of A */ rl=r8+l; /* m+1 */ r2»rl2*rl(ssι). /* startindex is k*(m+l) */ rl=r0+r2; /* address of first element */ ι4-rl; /* point to t */ r4=reads(l) ; / ♦ j r4=r4-rl2; /* }-k */ m4-r4; /* modify between A(ι][k] and A(ι)[τ) ♦ / r0=r8-r4; /* m-(j-k) */ m0=r0; /* modify between A ) |τ| and A(ι| (k) */ f0=reads(2) ; /* tau */ do do_t until Ice; f 4=dm( ι4 , m4 ) ; I' get A[ι) [i] */ f8=fO*f4; /* multiply cy tau f4=dm( ι4,m5) ; / • get A[ι] i j] 'I f2 = f4-f8; / • A[ι] []] - tau'Ali] [i.l -' do L: dm(ι4,mO)=f2; / • store in Al 1111 ] -/ leaf exit; /- float qr_scalar ( int n, int m, int k, int ~. , Clc=L "A) */ /* implementation of "for (sum=0.0, ι=k; Kn; ι+^ ) ju.'i+-A( ι J ( ) * A| l ] 131 " */ .global _qr_scalar; _qr_scalar: leaf_entry; rO=r4-rl2; / • n-k ♦ / lcntr=rO; ι4=reads(2) ; /* address o: vector 1 pointers to A r0=dm( ι4 ,mS) ; / • point to ; ι real 3cress of , nde:-: is k*ιm+l) */ rl=r0+r2; /* address of first element ι4=rl; /* point to it */ r4»reads(l) ; /* ■ } r4-r4-rl2; /* ]-k */ m4»r4; /* modify between A(ι](k] and A(ι]l]] */ rO=-r8-r4; /* m-{}-k) */ mO-rO; /* modify between A[ι) []J and A(ι] [k] */ f0=fl2-fl2; /* initialize sum */ do do_s_qr until Ice; f4«dm(i4 ,m4 ) ; /* get Ali] (k] */ f8-dm(i4,m0) ; /* get A(i) [j] ♦ / f2-f4*f8; /* A(i](j]*A(ιl fk) */ do_s qr: f0-f0+f2; /* update sum -/ leaf exit; /* float sumaibdnt n, int , int j, float * o, float **A) */ /* implementation of "for (sum^O.0, ι=j ; Kn; . — ) sum+=A(ι] ]*b(ι|" V .global sumaib; sumaib: leaf_entry; rO-r4-rl2; /* n-] ♦ / lcntr-rO; 14-reads<2); address of vector ot pointers to A */ r0»dm(i4,m5) ; point to the real address of A */ rl=r8+l; /* m+1 */ r2=rl2*rl(ssι); /' startinde;: .5 ]* (m+1 ) */ rl=r0+r2; /* address of first element */ i4-rl; /* point to it */ m4«r8; /* modify for A[ι] l l ) = m •/ r4«reads(l) ; /* address of b */ r0«r4+rl2; ι3»r0; f0=fl2-fl2; /* initialize sum */ do do_sum until Ice; f4=dm(ι4,m4); f get All] (j] */ f8-dm(ι3,m6); I* get b(ι] */ f2=f4*f8; I* A(ι] [:]*b(ι] do sum: f0=f0+f2; I* update sum */ leaf exit; /* void btauA nt n, mt m, int ] , float tau, float *b, float **A) */ /* implementation of "for <ι=];Kn;ι ++) b[ι) —tau*A(ιJ [I 1 " */ .global _btauA; _btauA: leaf_entry; r0=r4-rl2; /* n-] ♦ / lcntr=r0; ι4=reads ( 3 ) ; / • " address of vector ol pointers to A */ r0=dm( ι4,m5) ; /* point to the real adcress of A */ rl=r8+l; /* m+1 */ r2=rl2-rl(ssι). /* startindex 3* (m+1) */ rl=r0+r2; /* adαress of first element •/ i4=rl; /* point to it */ m4=r8; /* moαify for All]]]] = m */ r4=reads(2), /* adαress of b */ ι3=r0; 2=reads ( 1 ) . /* tau -/ do ]] •/ do_upd_q r */ leaf_exιt; /* float sumaibdnt m, int 1, float » b, float **A) */ /* implementation of "for (sum=0.0, 3 =1+1; ]<m;]++) sum+=A(ι] [] ] *b(;j ] ' .global _sumajb; sumaib: leaf_entry; rl-r8+l; /* i+1 */ r0»r4-rl; /* m-ι-1 */ lcntr»r0; ι4-reads(l) ; /* address of vector of pointers to A */ r0=dm(ι4,mS) ; /* point to the real address of A */ r8=r4*rS(ssι); / (m*ι) */ r8=rl+r8; / i+l+(m*i) */ r2=r0+r8; / address of first element */ ι4»r2; / point to it */ r0=rl+rl2; /* address of b[ι+l] */ ι3=r0; /* point to it */ f0 */ do do_a 3 b: leaf exit; /* void rx_contιnue(voιd) sets up serial port receive, DMA. */ .global _rx_contιnue; rx continue: leaf entry; r0»0; dm(SRCT l)=r0; /* set DMA rx index to start at source */ rO-l; /* set DMA modify to 1 */ dm(IMl)=r0; r0=θ_source; /* set DMA count to length of source * dmldl-rO; r0=0x000420f3; r0=0x000464f3; dm(SRCT l)»r0; /* Rx DMA enable */ /* external RFS */ /• RFS required */ /* Serial word length 16 '• /* • Sport enable */ /* sign extend into unusec ''SB's leaf exit; /* void set_ιnts ( oid) */ /* Sends interrupt to 2181, enables SPORT1 R> interruct -' .global set ints; _set_ιnts: lea _entry; bit set imask SPR1I, /* enable sport _ i . int. bit set model IRPTEN; /* global interrupt enat. bit set mode2 F G20; /* set flag2 to output * ' bit set astat FLG2; /* set flag2 =1 */ bit clr astat FLG2; /* • send interrupt */ /* r0=0x000f0005; dm(RDIVl)=r0;*/ leaf_exιt; /* serial rx service routine */ .global rx svc; leaf_entry; rO=l; dm(_rx_ιnterrupt ) »r0; leaf exit; /* S U B R O U T I N E S */ /* floating point division, page B-39 in SHARC user's manual */ /* required: £11-2.0 input: fO-numerator, fl2-denomιnator output: fO-result affected: fO, f7, fl2 */ div ph: fO=recιps fl2, f7=f0; fl2=f0*fl2; f7=f0*f7, f0=fll-fl2; fl2=f0*fl2; f7=f0*f7, f0=fll-fl2; fl2=f0*fl2; rts (DB); f7»fO*f7, f0=fll-fl2; f0=f0*f7; /* inverse of float required: r4=0x3f800000 , r8=0x40000000 inpu : f5 output: f2 affected: 4, fl2 */ inv_ph: f2»recιps fS; ' « " fl2-f2*f5; f4-f2* , f2=f8-fl2; fl2=f2* l2; f4-f2*f4, f2=f8-fl2; fl2=f2*fl2; f4-f2*f4, f2»f8-fl2; £4=f2* 4; f2=f2-fl2; rts (DB); f2=f2*f4; f2=f2+f4; /* inverse of denominator */ /* sqrtf_ph is taken from page B-40 in the SHARC user's manual required: fl=0.S , f8=3.0 input: fO output: f4 affected: fl2 */ sqrtf ph: f4=RSQRTS fO; fl2=f4*f4; fl2=fl2*f0; £4-fl*f4, fl2=f8-fl2; f4«f4*fl2; fl2=f4*f4; fl2=fl2*f0; f4=fl*f4, fl2=f8-fl2; f4=f4*fl2; fl2=f4*f4; fl2=fl2*f0; f4=fl*f4, f!2=f8-fl2; rts(DB); f4=f4*fl2; f4=fO*f4; . endseg; /* a_svd4.c This program includes routines which can be used in the analysis of data obtained from a Ground Penetrating Radar system with a rotating antenna. The measured data is read into the program from a serial port. ' r The calculations involve a rotational analysis based on the Discrete Fourier Transform with respect to angle via the function "dft", and the development of an ARMA model in the "time" range using Shank's extension to the basic Prony method via the functions "shank" and "prony". The sets of n linear equations which are parts of Shank's method are solved by QR-decomposition and back substitution via the functions "qr" and "qrsolv". The discrete frequenzy response of the ARMA model is obtained by the function "freqz". A detection on two frequency responses is carried out by the function "cetect" . Functions for allocating and deallocating memory for vec rs dud matrices of floats and complex floats are included. The program runs on a SHARC ADSP-21062 processor, and is compiled by the Gnu g21k compiler. Written by : Peter Hazell, Ekko Dane Production A/S Last modified : 240698 by : PH mod from a mean . c : svd solver implemented. uses bsvd4.asm include <stαιo.h> include <math.h> include <dsoc. > include <co olex. > include <stcdef h> include <stαlιb.h> include <sιgnal . h> include "def_4.h" incluαe <21060.h> : (maxarg2| ) : (maxargl))- define IMIN(a,b) (mιnargl=(a ) ,mιnarg2=(b) , (minar.l ) -inarα.-! ? narg2) (minargl ) ! define SQR(a) (pow2arg=(a ) , pow2arg*pow2arg ) define TIMEOUT lelO /* constants and globals */ static float pm uu_real [Nr*ku] ; static float pm uu_ιmag[Nr*ku] ; /* vectors for data matrix download */ static float dm norm_real [Nr » NO_ANTENNAS] ; static float dm norm_imag(Nr*NO_ANTENNAS] ; extern int source (RAWDATA] ; extern int rx_mterrupt; / ♦ float vdet(np) , ldet(np);*/ /* output */ static float dm vdet(np); /* output */ /* done flag to interface program /* prototypes for functions managing memory */ float *vector_cal (int n); complex float *c_vector_cal (int n); float *vector(ιnt n); complex float -c vector (int n); float **matrix_cal(int row, int col); float "matrix ( int row, int col ) ; complex float **c_matrix(int row, int col); void free_vector ( float *v); void free_c_vector (complex float *v); void free_matrix( float **m); void free_c_matrιx(complex float **m); I /* prototypes for calculation functions */ void make_ιndex(ιnt *index); void mdatadnt "source, float pm *uu_real, float pm *u-,_ιmag, int *ιndex, ιnt*serιal_checι- ) , void normalize (float *norm_r, float *norm_ι); void twiddle (complex float twιd_px(ku] , int p>: I ; void dftlfloat *u, float pm *uu_real, float pir, -uu_iniag, complex float twιd_p.< I ku] ) ; void filter) float pm *b, float pm *a, float * , int N, _nt 1); void filtfiltl float *x, float pm *b, float pm -a, float *zι, int 1); float pytha l float a, float b); void svdcmpl float **a, int m, int n, float *w, float "--. • ); void svdsmoothe ( float *w, int n); float findmaxl float *v, int n); void svdsolvet float **u, float *w, float **v, int , in- n, float *b, float *x), void prony(float *x, t Q, int P, float *3); void prony_pade( float *x, int Q, int P, float -o, float -a); void shank(float *x, int Q, int P, float -b, float -a). void mk_s_and_w( complex float pm s(np], float pr w(npl), void freqz nt na, float *a, float *b, comple. iloat • "-, complex float pri s|nol, float om w|r ^ void detect (complex float -HO, complex float 't-i, Lloat .-detlnp], float lαet[ιiLl,, void qrdnt n, int , float **A, float *c, float -d I , void qrsolvdnt n, int m, float **A, float *c, float » c, float *b); void prony_qr( loat *x, int Q, int P, float -a), void prony_pade_qr ( float *x, int Q, nt P, flcat -b, fi.:at "a ) , void shank_qr( float *x, int Q, int P, flo3t *b, float -aj; float determιne_angle ( float pm *uu_real, int position, cc-.olex float pm s(nD|, float oτι (nu|, complex float *twιd_px); /' prototypes for assembly functions */ float searchmax ( float *v, int n); float pyth( float a, float b); void sum_and_scale( int , int n, int 1, int 1, fioa float "'a); void sum2_and_scalednt m, int n, int l, t 1, float ι- -, float **a); void sum3_and_scale (int , int n, int l, int 1, .oat *-», float *"a); void sum4_and_scale(ιnt , int n, nt i, float -rvl, float **a); void get_dιv(ιnt indx, int 'source, float pm -UL_L, float pm *uu_ι, int ιn_uu), void norm_dιv(ιnt indx, int 33, float *n_r, fl a " n _ι, float pm *uu_r, float pm -uu_ι), void mk_Xa(mt m, int 1, int indx, int row, float - :, f.oat **Xa); void mk_Ha nt m, int 1, int row, float *ha, float **Ha); void i pulsdnt 11, int 1, float *ha, float *a), float f_abs( float x); float svd_l(ιnt m, int k, float **A, int 1); void svd_2 ( float invscale, int k, int m, float pm "su pow, float **A, int 1); void svd_3(ιnt , int 1, nt 3, mt 1, float f, float *-A, int st); void svd_4(ιnt , int i, int 1, float scale, dm float *-A); float svd_5(ιnt m, int k, int 3, float **A); void svd_6(float invscale, int 1, int m, float pm *sum, float **A, int 3); void svd_7(int m, int i, float invh, float *rvl, float •-A, int 3); float svd_8dnt m, int 3, int 1, float **A, int st); void svd_9(ιnt m, int j, float s, float Tvl, fioat **A, int st); void svd_10(int m, int 1, float scale, dm float **A, int st); void svd_ll(int m, int 1, float s, dm float **V, dm float **A, int st); float svd_12(int m, int i, t 3, float **A, float **V, t st); void svd_13(int m, int 1, dm float **v, int st); void svd_14 (int m, int 1, int n, int 1, float c, float s, dm float **a); float svd_15dnt m, int 3, int st, float *b, float **A, mt 1); float svd_16(ιnt m, t 3, float *b, float *'A); float scalar (int n, int m, int k, int 3, flo3t -*A, t 1'; void evalhxdnt 11, int n, float *a, complex float pm *s, complex float *ha); / ♦ float cal_dftdnt k, int k_u, int N_s, float u, float n *uu_real, float pm *uu_ιmag, conrale^ float *twιd_px) ; */ float cal_dft ( mt k, nt k_u, int N_s , float pi.i - o real , f loat pm *uu_ιmag, co l x f loat ♦ twιd_px ) ; ~ float dm_dft dnt k_u, float *uu_real , float • uu_;-.ac, c?τ lex float *twιd_ρκ ) ; void rx_contιnue ( void ) ; void rx_svc ( voi ) ; void set_ιnts (void ) ; void tx_antenna ( int pos ) ; float max_abs ( ιnt n, int m, int k, f loat ♦ ♦ A' ; void scale_pow2 ( int n, int m, int k, float ι n 4ι-j 4 β, f l it pm *suιnpow, f loat "A) ; void tau_A(int n, int , int k, int j, float tau, float ♦♦ A) ; float qr_scalar (int n, int m, int k, int 3, float •♦ A); float sumaibdnt n, int m, int 3, float *b, float ♦♦ A); void btauAϋnt n, int m, int 3, float tau, float *b, float ♦♦ A); float suma3b(int m, int i, float *b, float ♦♦ A) ; void fr_resp(int 1, complex float ♦ H, complex float *ha, complex float ♦ hb, float pm *w); void cal_vdet(ιnt 1, float ♦ vdet, complex float *h0, complex float ♦ hi); mam ( ) { int counter=O; int ii, 33; /* counters -/ static int mαex(Ns), serαal_check ll] = ( 1) ; complex float ♦ HO, *H1, tw d_p2lku), twιd_p31 ku] ; float 'a, *b, 'utO, ♦ utl; / ♦ static float pm b_hpl[4)=(0.8175824, -2. -5527472, 2.4527472, -0.8175824); static float pm a_hpl ( ]=11.0, -2.5985328, 2.2736861, -0.6684403); ♦ / /-Sns*/ static float pm b_hpl(4]=(0.6670312, -2.0010937, 2.0010937, -0.6670312]; static float pm a_hpl I ) = ( 1.0, -2.2006360, 1.6907151, -0.4448988); / ♦ 10ns * / static float p b_hp2[4]=(0.5417665, -1.6253000, 1.6253000, -0.5417665); static float pm a_hp2 I ] ={ 1.0, -1.8085834, 1.2223036, -0.2932450); / < 15ns'/ static float pm b_hp3[ ]=! 0.436202, -1.30tό0ό, 1.30860G, -0 436202); static float pm a_hp3 ( 4 ] =11.0, -i.420727, 0 879754, -> 189134); / » 20:.s*' static float pm b_fl (3) =( 0.7520041, -1.5040082, 0.7S"041); static float pm a_f1 ! 3] =( 1.0, -1.4415303, 0.5664360), float zι_l[2]='0.1230402, 0.1855131); static float pm b_f2 [ 3] =( 0.6507412, -1.3014824, 0.6SC"412); static float pm a_f2 t 31 -| 1.0, -1.1755349, 0.4274298], float zι_2[2)={0.0973640, 0.2233114); static float pn o_f3 [3] = 10.5610593, -1.12211S , 0.561^=93], static float pm a_f3 [ 3] =( 1.0, -0.9191507, 0.3250Sfa5|, float zι_3(2)=!0.0330048, 0.2359728); static complex float pm s|np|; static float pm w(np]; voiα *svc_ptr; /* pointer co IRQ service routine ♦ / I N I T I A R O U T I N E S svc_ptr=(int* ) rx_svc; interrupts (SIG_ΞPR1I, svc_ptr) ; /* set up service routine for SPORTl Rx interrupt ♦ / / ♦ interrupts (SΪG TMZ, svc j ptr);*/ / ♦ set up timer interrupt ♦ / for dι=0; 1KIO; 11++) asmC'nop;"); tx_antenna ( u ) ; for di=0; ιι<np; ιi++) ( vdet [11] =0.0; / ♦ ldet[iι]=0.0;-/ ) for (ii=0; ιι<RAWDATA; 11++) source [ il] =1; / ♦ timer_set(0, IMEOUT);*/ / ♦ calculate twiddle factors for tracks p2 and p8 ♦ / twiddle (twιd_p2, p2 ) ; twiddle (twιd_p8, p8 ) ; /* calculate time vectors for freqz */ mk_s_and_ ( s , ) ; /* make vector of inαices into received data ' / make_ιnde ( lnαe ) ; /* send 'ready' interrupt to 2131, setup SPORTl for Rx of first 4 words ♦ / set_ιnts( ) ; rx_ιnterrupt=0; rx continue) ) ; asm("bιt clr astat 0x00200000;"); / ♦ send interrupt to IRQLO ♦ / for (ιι=0;ιι<10;ιι++) asm("nop; " ) ; asm("bιt set astat 0x00200000;"); /- reset interrupt to IRQLO ♦ / tx_antenna(ku) ; /♦ A I C A L C U L A T I O N P R O G R A M "I while(l) / ♦ forever */ ( while (got_here=-l ) ; / ♦ wait for interface to set got_here=0 */ time... '/ / ♦ read measured data into uu_real and uu_ιmag ♦ / mαata (source, uu_real, uu_ mag, index, serιal_che - lf (norm==l) normalize ( norm_real, norm_ιmag); done_normalιzιng=l; angle_determined=0; if (angle_Dos'=0.0) f phase=deterrune_angle ( uu_real , angle_pos, s, v., -.. angle_determιned=l; angle_pos=0.0; counter=0; / ♦ calculate DFT-coef ficients of tracks or anc o; utl=vecto (Nr) ; /* DFT vectors -/ dftlutO, uu_real, uu_ιmag, twιd_p2); dftlutl, uu_real, uu_ιιr.ag, twιd_p8); if (do_fιlter==l) \ flltfιlt(utO,b_fl,a_fl,zι_l,Nr); fιltfιlt(utl,b fl,a fl,zι l,Nr); if (do fιlter==2) I fιltfιlt(utO,b_f2,a_ 2,zι_2,Nr); flltfιlt(utl,b_f2,a_f2,zι_2,Nr); ) if (do filter—3) ( filtfιlt(utO,b_ 3,a_f3,z _3,Nr); fιltfιlt(utl,b_f3,a_f3,zι_3,Nr); } / ♦ estimate poles ana zeros from DFT-coeffs. */ a=vector(ma+l) ; /* estimated denr~ :. coeffs ♦ / b=vector_cal (mb+1 ) ; / ♦ estimated nuiei ceffε ♦ / if (counter==l) I if (αo_shank==0) prony_pade (utO, iπb, ma, b, a), else shank(ut0, mb, ma, b, a ) ; i else { if (do_shank==»0) prony_pade_q (utO, mb, ma, b, a else shank_qr (utO, mb, ma, b, a); 1 free_vector (utO) ; /* calculate frequency response of estimated filter HO-c_vector(np) ; / ♦ frequency response of estimated filter ♦ / freqz(ma+l, a, b, HO, s, w); /* estimate poles and zeros from DFT-coeffs. ♦ / if (counter=-l) ! if (do_shank==0) prony_pade (utl, mb, ma, b, a); else shanklutl, mb, a, b, a); 1 else ( if (do_shank==0) prony_pade_qr (utl, mb, ma, b, a); else shank_qr (utl, mb, ma, b, a); I free_vector(utl) ; /♦ calculate frequency response of estimated filter -/ Hl=c_vector(np) ; / ♦ frequency respcnse of estimated lilter ♦ / freqz(ma+l, a, b, HI, s, w); / ♦ carry out detection •/ done_detectmg=0; / * detect ( HO, HI , vdet, ldet ) ; - *' cal_vdet ( np, det , HO, HI ) ; done_detectιng=l; free_vector ( a ) ; / * clean up mess • / f ree_vector (b) ; free_c_vector ( HO ) ; free_c_vector ( HI ) ; i f (no_converge==l ) ( senal_check ( 0 ] =123; no_converge=0; ] counter=l; / ♦ looping done, -^li rarn is running properly '/ done = serιal_check(0] ; / ♦ return flag to interface program */ 1 return (0) ; /* make_ιndex Make vector of indices corresponding to the measurement series in the 2181. The index of index (!) is the measurement number. The value at that point is the frequency placement of the measurement, e.g index [1] =60 means the second measurement is the 61st frequency. void make index (int ♦ index) { int ii; /* indata Indata reaαs measured data from files predata.re and recΞZϊ.im containing real and imaginary parts of data from one rotation. Data • .= storeα in complex form in matrix UU. Each column of UU contains da-.; :.orn one frequency sweep tor one antenna position. The file handling functions require the DSP host program 3.-21 .exe This function can be interchanged with an interrupt service routine, which reads data from a serial port. void mdata dnt ♦ source, float pm ♦ uu_real , float pm ♦ uu_ιmag, int # index, int ♦serιal_check ) { int ii, j; / ♦ counters ♦ / int indx, ιndx_ιi; / ♦ temp index variable */ float den, inv_den, m_r, m_ι, r_r, r_ι; while (rx_ nterrupt==0) ; rx_contιnue ( ) ; asmC'bit clr astat 0x00200000; " ) , for ( iι=0; ιι<10; ιι++ ) asm( "nop; " ) ; asm( "bιt set astat 0x00200000; " ) , r>:_interrupt=0; for (ιι=0; ιι<ku; n++) f ιndx_u=4*Ns*n, for Ϊ33=0; 33<Ns; 33++) I ) ) + i'ιde [33 ] -STARTi-'OIN D . / * αei into source -/ den=r_r- r_r+ r_ι* r_ι ; if (de->=l Oe-10) ιnv_den=l 0/αen, else mv_den=l . OelO; ] -STARTPOINT, uu_real ( indx] = (m_r*r_r+m_ι*r_ι ) * ιn _den, uu_ιmag [ indx] = (m_ι*r_r-m_r^r ι)*ιnv_den; */ I ) I / ♦ check serial transmission and MAC overflow in 2181 ♦/ if ( source [RAWDATA-1] ==0x1234 ) senal_check (0) =1, / » transfer OK, no overflow ♦/ if ( source [RAWDATA-1] ==0x4321) se ial^check [0] =2, / ♦ MAC overflow ♦/ if (source(RAWDATA-ll==0x9876) serιal_check [01—3; /* ADC OTR ♦/ if ( ( source [RAWDATA-1] '=0x9876) 44 (source I RAWDATA-1 ] ' =0x4321 ) (source (RAWDATA-1 ) '=0x1234) ) serιal_chec [ 0] =4 ; 1 / ♦ normalize Normalize complex data with normalization vectors. void normalize (float ♦ norm r, float ♦ norm_ι) ( int ii, 33, indx, ιndx_ιι; float den, ιnv_den, num_r, num_ι , den_r, den_ι; for (11=0; ιι<NO_ROT; 11++) I ndx_n = n *Nr*NO_ANTENNAS; for Ϊ33=0; 33 <Nr*NO_ANTENNAS; 3 3 ++ ) I norm_dιv ( ιndx_ιι +33,33, norm_r, norm_ι , uu_real , uu imag) , den=den r^den r+den l^den 1, if <den>-le-10) ιnv_den»l.0/den; else ιnv_den-1.0el0; / ♦ 1 over denominator of complex division ♦ / /* uu_real(indx)=(num_r^den_r+num_i*den_i)*inv_den;*/ / ♦ real part of result */ /* - uu_ιmaglindx) = (num ι den_r-num_r^den_ι ) ♦ ιnv_den; ♦ / / ♦ imaginary part of result ♦ / ) ] i I /* twiddle Function twiddle calculates the twiddle factors for DFT calculation. The factors are calculated for column no. px and returned in the vector twιd_px. . void twiddle (complex float twιd_px[ku], int px) I nt ii; for ( 11=0; lKku; ιι++ ) twιd_px [ il ] =ce.xpf ( -1 .0;, -2*pι*pκ* n/ku ) ; /* dft Function dft calculates the DFT-coe flcient specified by k on each row in data-matrix UU. The function overwrites vector udft with the DFT-coeffs corresponding to <. The size of the DFT's is specif.βd oy KU. . void dft (float -L, float pm *uu_real, float pm *u _ιιiιac, jrompie.-. float twid PΛ I ku] ( int k; /* mαires * ι for (k=0; -:<Nr; ):++) { /* cai eft ! ,:, ku, Nr, u, uu real, uu_ιmag, tk:: a. ' ; - / /* u [k) =cal_dft (k,ku,Nr,u|k), uu_real, uu_ raag, τ..-ιd_p ) ; */ u(k)=caι_cft ( k, ku, Nr, uu_real , uu_ιmag, tv d_ρ.-: ; i /* filter Filter the data in ut with the filter specified in pre filt void filter! float om ♦ b, float pm *a, float ♦ x, int N, m 1) { int n,k,n; float *y; float 4 xx; y-vector_cal ( 1+N) ; xx=vector_cal (1+N) ; for (ii=N; ιi<l+N; iι++) xx [n 1 =x [ n-N) ; for (n=N; r.<N+l; n++) { for (k=0; k<=N; k++) y (n) +=b(k] *xx (n- i ; for (k=l; k<=N; k++) yln) —a (k) ♦ y(n-k) ; ) for (ιι=0; IKl; n++) x ( i ) =y [ n+N) ; free_vectcr x-x); f ee vector y) ; /* filtfilt Filter the data n ut with the filter specified in r-re filt void filtfilt ( float -s, float pm *b, Cloat pm 'a, float -;ι, int 1) int ii, indx; float ♦ y, *xx; y-vector(l+12) ; '• rxx=tfector(l+12) ; for (iι=6; iι>0; ii— ) y(-ιι+6]=2*x (0) -x [ii ] ; for dι=6; ιι<l+6; ιι++) y [ ii] =x( n-6] ; / ♦ filter in the forward direction ♦ / xx(0)=(zι[0]+b[0] )*y(01; xxlli=zι(ll*ylO)+b{0]*y[l]+b[l]*y(0]-a(l]*xx(0]; for (iι=2; ιKl+6; ιi++) xx [il] =b[0] *y( n ] +b( 1 ] *y [n-1 ; +b(2) *y I n-2] -a 111 -x.x 11 i-i I -a I 2] ♦ :■:>: I li-2 ) ; for dι=l+6, ιndx=l+4; ιι<l+12; ιι++) xx( ll] =2*xx ( 1+5] -,-:x (indx— ]; / ♦ filter in the backward direction ♦ / y(l+ll]=(zι(0]+b(0] )*xx[l+ll]; y [ l+10]=zι [ 1] *xxl 1+11] +b (0) *xx ( 1+10] +b [l] « xx( 1 +111 -a [l]*y 11+11] ; for (11=1+9; n>=0; il— ) y[ιι]=b(0)*xx(ιι]+b[l]*xx[ιι+l]+b(2]*xx[ιi+2]-a(l)*y(ιι+il-a[2]*y(n+2], / ♦ loose the ends.. ♦ / for (ιι=0; ικl; ιι++) x ( ll ] =y I n+6) ; free_vector (y) ; free_vector (>:x! ; ) void svdcmplfloat **a, int , int n, float *w, float » *v) / ♦ a: m x n U read out in a V not transposed -/ ( int flag, I, its, ], ] j , k, 1, nm; float anorm, c, f , g, h, s , scale, x, y, z, ♦ rvl ; static float pm s2 ( l ] ; float invscale, invh, invginvail , mvz, ginva n ; rvl=vector_cal ( n ) ; g=scale=anorm=0.0; for ( 1=0; K=n-1; ι++ ) ( 1=1+1; rvl [ ι ) =scale^g; g=s=scale=0.0; if (Km) I sea le-s vd_l ( n , i , a , m ) ; if (scale ) I ιnvscale=l - 0/scale; /^reduce divisions 4 / s2 [0] =s; svd_2 (invscale, ι,n,s2, a, m) ; s=s2[0); f=a ( i ] [ i ] ; g=-SIGN(sσrt(s), f) ; =f*g-s; ιnvh=l .0/h; a(ι] [ι]=f-g; lf (n>l) sum_and_scale (m, n, l, 1, invh, a) ; svd 4 (n, i, m, scale, a) ; ) ) w[ l ) =scale*g; g=s=scale=0.0; lf (Km SS ι!=n-l) ( scale=svd_5(n, i, l,a) ; if (scale) 1 ιnvscale=l .0/scale; / ♦ reduce divisions 4 / s2(0]-s; svd_6( invscale, i,n,s2, a, 1) ; s-s2[0); f=a[i] [1]; g— SIGNIsqr ls^fl.- h-f^g-s; ιnvh»1.0/h; / ♦ educe divisions / a[i)(l]=f-g; svd_7 (n, i, invh, rvl, a, 1 ) ; if (m>l) sum4_an.d_scale(m,n, I, rvl, a) ; svd 10(n, i, scale, a, 1) ; anorm=FMAX(anorm, ( f_abs(w) I ] ) + f _abs ( vl ( i ] ) ) ) ; I for (ι-n-1; ι>=0; l — ) I if (Kn-1) { if (g) I nvgιnvaιl=l .0/ (g^a ( l ] 11 ] ) ; /^reduce divisions*/ svd_ll (n, i, invginvail, , a, 1 ) ; if (n>l) sum3_and_scale (m, n, l , 1, , a ) ; g=w(ι] ; for (1=1; l<n; }++| a[ι](]l=0.0; ιf (g) I g-l.O/g; gιnvaιι=g/a( l] 111 ; if (n>l) sum2_and__scale(m, n, i, l.ginvan, a . ; svd_4 (n, ι,m,g,a) ; 1 else for (;j=ι; ]<m; }++) a ( } ) [ l] =0.0; ++a(i][ιl; 1 for (k=n-l; k>=0; — ) I for (its=0; its<30; its++) ( flag-1; for (l=k; 1>=0; 1 — ) { nm«l-l; if (( float) ( f_abs( rvl [1) ) +anorm) ~ anorm) [ flag-0; break; 1 if ( (float) ( f_abs(w(nm] )+anorm) == anoral bre_>'; 1 if (flag) { c=0.0; s=1.0; for (ι = l; K=k; ι++) I f=s'rvl[i]; rvl[ι]=c*rvl[ι] ; if ( (float) (f_abs( f) +anorm) == anormi brea ; g=w[i]; h=pyth( f ,g) ; w(i)=h; h=1.0/h; c-g 4 h; s— £* ; svd_14 (n,m, nm, ι,c,s,a) ; ) 1 z-w[k); if (1—k) { if (z<0.0) { w(k]=-z; for (3=0; ]<=n-l; ]++) v[] ] [k] *=-l.0; / ♦ reduce pointer op 4 / ) break; 1 if (ιts==29) no_converge=l; x= ( 1 ] ; nm=k-l; y=w(nm] ; g=rvl [nm] ; h=rvl(k); f=( (y-z) 4 (y+z)+(g-h) 4 (g+h) )/ (2.0*h*y); g=pyth( f , 1.0) ; f=( (x-z) 4 (x+z)+h 4 ( (y/(f+SIGN(g,f) ) )-n) )/x, c=s=l .0; for (] = 1; ]<=nm; ]++) I 1=0+1; g=rvl| l] ; y=w ( l ] ; h=s 4 g; g=c*g; z=pyth( f , h) ; rvll 3 ]=z; ιnvz=l .0/z; c=f 4 ιnvz; s=h ιnvz; f=x 4 c+g 4 s; g=g 4 c-x 4 s; h=y 4 s; y»=c; s vd_l 4(n,n,],ι,c,s,v); z=pyth(f,h); w(] ]=z; if (z) { z-l.O/z; c=f^z; s= *z: ) f=c^g+s 4 y; χ= c *y- s* ς ; svd_14 (n,m,],ι,c,s,a); ) rvl [1] =0.0; rvl[k]=f; w[k]-x; I } f ree_vector ( rvl ) ; } float pythagtfloat a, float b) i float absa, absb; / ♦ absa=fabs(a) ; ♦ / /* absb=fabs(b) ;*/ absa=f_abs (a) ; absb=f_abs (b) ; if (absa>absb) return absa 4 sqrt ( 1.0+SQR(ac≤c" absa) ) ; else return (absb==0.0 ? 0.0 : absb^sqrt ( 1.0+SQR(absa/aosb) ) ) ; void svdsmoothef float 4 w, int n) int ii; float w max; for (ii=0; lKn; ii++) if (wdi]<le-10) wliι)=lelO; / ♦ w_max=findmax (w, n ) ; '/ / ♦ find largest singular value ♦ / w_max=searchmax (w, n ) ; w max # ="0.075; / ♦ scale with appropriate factor ♦ / for dl=0; ιι<n; ιι++) w| ii) 4=w_max; / ♦ add smoothing constant to SV* s ♦ / float findmaxl float ♦ v, int n) { int ii; float fmax=-le99; / ♦ very small ♦ / for (ιι=0; lKn; ιι++) fmax=FMAX ( fmax, v ( ii ] ) ; return fmax; void svdsolve ( loat 4 -u, float *", float "v, int , int n, float *b, float *x) { int 33, 3, l, hlp=0; float s, 'tmp; tmp=vector ( n ) ; for (3=0; ]<=n-l; }++) I s=0.0; lf (w(]| ) I / for (1=0; K=m-1; ι-+) s+=u ( l ) (3 } -bl l ] ; ♦ / s=svd_15 (n,3,hlp,b,u,m); s/=w l; t pl}] I for (3=0; ]<=n-l; ]++) I s=0.0; / ♦ for (33=0; 33<=n-l; 3D++) s+=v (3 ] (33 ] *tmp[3j ) ; ♦ / / ♦ s=svd_l6(n,],n,tmp,v); 4 / s=svd_16(n,3 , tmp, v) ; x(j)-s; ) free vector (tmp); /* prony Function prony estimates the denominator A(z) of the system underlying the data given in the vector x, 3nd returns the polynomial coefficients in vector a. The order of A(z) is P, and the order of the numerator is Q. Therrien pp 550-553 void prony(float 4 x, int Q, int float 4 a) ! int row, col, ax; / 4 indices 4 / float 44 Xa, "al, 4 w, 44 v "so1; Xa-matrιx(Nr-Q-l, P) ; / ♦ matrix and vector for normal equations ♦ / al=vector (Nr-Q-1 ) ; v»matπx(P, P) ; / ♦ storage vectors for QR-solver *"/ w»vector(P) ; sol=vector(P) ; I* form Xa matrix, and al vector ♦ / for ( row-Q+1, ιndx-0; row<Nr; ιndx++, row++ ) / P; col++ ) Xa ( ιndx) (col ] =x ( row-col-1 ) ; ♦ / mk_Xa ( P, P, indx, row, x, Xa ) ; I / ♦ solve (Xa^a - al ) by QR-decomposition ♦ / / ♦ qr (Nr-Q-l, P, Xa, c, d) ; V / ♦ perform QR-decomposition on Ha ♦ / / ♦ qrsolv (Nr-Q-l , P, Xa, c, d, al ) ; / ♦ solve ♦ / svdcmp(Xa, Nr-Q-1, P, w, v) ; if (do_smoothe-"»l ) svdsmoothe (w, P) ,- svdsolve(Xa, w, v, Nr-Q-1, P, al, sol); / ♦ extract polynomial coefficients from al ♦ / a(0)=1.0; / ♦ by definition ♦ / for (row=l; row<=P; rσw++ ) a [ row) =sol [row-1 ) ; free_matrιx (Xa ) ; free_vector ( a1 ) ; free_vector (sol 1 ; free_vector (w) ; ree matrix (v) ; /* prony_pade The function prony_pade establishes and solves a least scuares problem, in s se to esimate an ARMA model of the system by which the data vector .x was obtained The system is characterized by the numerator polynomial -jβffici nts given .- vector b, and the denominator polynomial coefficients given in vector a. Th orders of these polynomials are given by Q and P resp. Prony oade uses tne function prony to estimate denomin- void orony_oade( float 4 x, int Q, int P, float 4 b, float 4 a) int row, col, strt=0, indx; / 4 indices ♦ / float 44 Xb; /" estimate denominator using Prony' s method '/ prony(x, Q, P, a) ; Xb=matπx_cal (Q+l, P+l) ; I * X-matπ::, ail zeros ♦ / / ♦ form matrix Xb, make multiplication of dot product •/ for (col=0; col<=P; col++) ( ιndx»0; for (row=strt++; row<=Q; row++) Xb[row] (col ] =x[ιndx++ ) *a [col] ; ) for (row=0; rowOQ; row++) { for (col=0; col<=P; col++) b(row) +=Xb( row] [col] ; I / ♦ alternativ formuleπng ♦ / / ♦ for (col=0; col<=P; col++) ( mαx=0; for (row=strt++; row<=Q; row++) b( row) +=x [ ιnd.x++) 4 a [col ] , I free_matrιx(Xb) ; ι" shank The function shank establishes and solves a least squares problem, in order to esimate an ARMA model of the system by which the data in vector x was obtained. The system is characterized by the numerator polynomial coefficients given in vector p, and the denominator polynomial coefficients give-* in vector a. The orders of these polynomials are given by Q and P resp. Shank uses the function prony to estimate denominator coeffs., and the functions qr and qrsolv to solve a set of normal equations by QR-decomposition. TherrieTi pp 558-559 ./ void shan (float 4 x, int Q, int P, float 4 b, float a) ( int row, col; / ♦ indices ♦ / int ii, 33; / ♦ counters ♦ / float 44 Ha, *ha, *w, ♦♦ v; / ♦ estimate denominator using Prony 's method -/ prony (x, Q, P, a); ha=vector_cal (Nr ) ; / ♦ calculate ha, the impulse response of 1/AC) , NL j.onc -/ /* [33 j • "-„ [ 11-j 3 • ; • / Ha=matrιx_cal (Nr,Q+l ) , /* ma rix f . -..ual » udtιona */ /" form matrix Ha */ for ( row=0; row<Nr; row++) /- , coi-ι-+) if (row>=col) Ha I row] (col ) =ha [ row-col ] , else Ha [rowj [col)=0.0; / ♦ for (col=0; col<=Q; col++) Ha ( row) [col] =hs row-cn.,-' mk Ha(Q+l,IMIN!Q, row)+l, ow, ha, Ha) ; 1 free_vector ( ha ) ; v=matrιx (Nr,Q+l ) ; w»vector (Q+l) ; / • al=vector(Q+l) ; -' / ♦ solve (Ha 4 b = x! by QR-decomposition ♦ / / ♦ qr(Nr, Q+l, Ha, c, d); 4 / I* perfotm QR-αecotr osition on Ha * / I* qrsolv(Nr, Q+l, Ka, c, d, x); 4 / / ♦ solve */ svdcmp(Ha, Nr, Q+l, w, v); / ♦ svdsolve(Ha, w, v, Nr, Q+l, x, al);V if (do_smoothe~l) svdsmoothe(w,Q+l ) ; svdsolve(Ha, w, v, Nr, Q+l, x, b); free_matrιx(Ha) ; free_matrιx(v) ; free_vector (w) ; / ♦ extract polynomial coefficients from al ♦ / / ♦ for (n=0; n<=Q; 11++) b(ιι)=al [ 11) ; ♦ / / ♦ free vector(al); ♦ / /* mk_s_and_w Make s and w vectors for the function freqz. void mk_s_and_w( complex float pm s[npl, float pm w[np) /♦ generate "time" vector s at n points equally spaced around the upper half of the unit circie. ♦/ for (ιι=0; iKnp; ii-*) w( ii ] = ( tl+il 4 (t2-tl ) / ( np-l ) ) ; creal (s [ ιι ] ) =cosf (pι001 4 w[ iι] ) ; cιmag (s ( ιι ] ) =smf (pι001 4 w( n ) ) ; ) I /♦ freqz Function freqz calculates the n-point comple.x frequency response vector H of the filter B/A: -1 -nb w B(z) b(l) + b(2)z + + b(nb+l)z H(e) = = -1 -na A(z) 1 + a(2)z + + a(na+l!z given numerator and denominator coefficients in vectors b ana a. The orders of A(z) and B(z) is assumed to be na . The frequency response is evaluated at n points equally spaced around the upper half of the unit circle. void freqzdnt na, float 4 a, float 4 b, complex float ♦ «, como ex float pm s(np], float pm w(np]) I int ii, ], kk; / • cojnters */ complex float 'ha, 'hb, ha=c_vector_cal (np) , /* --poir frequency respon e of a anc b '/ hb=c_vector_cal (np) ; / evaluate polynomials at values sDecified by ^«:t ι s, usmς Hornet's method */ for (ιι=0; lKna; n ++) { evaih.x (ii, np, a, s, ha ) , evalhx ( ii, np, b, s, b) ; I / * calculate frequenzy response and weight ~ιt time-/ / * for (ιι=0; lKnp; ιι++) H( ll 1 =w( n ) « hb| ii] /ha ( ii ) , * / fr_resp(np, H, a, hb,w) ; free_c_vector ( ha ) ; free_c_vector (hb) , ) /* detect This function performs detection on the two freq. responses HO and HI. The result is vdet=abs (H0-con3 (HI ) ) and ldet which is vdet exσressed in dB. The calculation of complex absolute value is written out due to a bug in the g21k compiler (new compiler works now, ph 1S0897). void detec (complex float ♦ HO, complex float "HI , float vcet f np] , float Idet l np] ) 1 int n; / ♦ counter ♦ / float ldet_max=-1000000.0; / 4 very small 4 / / 4 for(li=0; lKnp; n++) vdet ( ll] =0. OOl'cabsf (HO [ ii j 'HI [n] ) ; 4 / cal_vdet(np, vdet, HO, HI) ; I * for(ιι=0; ιι<no; ιι++) vdet [ll ) =0.001; ♦ / vdet[n]=cabsf (HOlii) ) +cabsf (HI [ n ] ); vdetln]=0.001 4 cabsf (HO(ιι) ) 4 cabsf (HI [ n ] ) ; ldet[n]=10*logl0f (vdet[ιι] ) ; ldet_ma.x=FMAX(ldet_max, lcet 1 ll] ) ; ' / /'csiculatec ?C tor speed ♦ / /* I for(ιι=0; ιι<np; ii—■•) ldet [ ii ] -=ldet_ma^ , - ' / " ::=it ■ • / 1 / ♦ 4 vector_cal This function allocates memory for a vector oi float-, of size n. float 4 vector_cal (int n) .. float ♦ v; v- ( float 4 ) calloc ( (size_t) n, (sιze_t) sizeofl float )) ; return v; 1 / * c_vector_cal This function allocates memory for a vector of complex floats, of size n. complex float 4 c vector_cal (int n) ( complex float "v; v=(complex float- ) calloc ( (sιze_t ) n, (sιze_t) siteof (c nplex float) ); return v; 1 /* 'vecLor This function allocates memory Cor a vector of floats, o: zize n. . / float -vector (int n) ( float *v; v=( float- Imallcc s.;e_t) n); return v; ) /• *c_vector This function allocates -lemory for a vector of comple.x llzιz.3, of size n. * complex float *c vector (int n, ( complex float *v; v=(complex float- , .ϊlloc ( (sιze_t ) n 4 2); return v; /* 44 matrιx_cal This function allocates memory for a matrix of floats, of size row x col. float ♦♦ matrix_cal(int row, mt col) { int i; float ♦♦ m; m=(float ♦♦ ) calloc 'sιze_t) row, (sιze_t) (sizec ' float ; / ♦ pointers to rows 4 / m(0] = (float *! ca.l-. , !sιze_ ) (row'col), (sιze_ ..sire : , float ))) ; ford=l; κ»row-i; .-- ml I ] =m( i- ] +col; return m; / ♦ ♦♦ matrix This function allocates memory for a matrix of floats, of s ;e row x col. t float ♦♦ matri dnt row, int col) { int 1; float ♦♦ m; t m-(float ♦♦ ) malloc ((sιze_t) row); / ♦ pointers to rows 1 / m[0)=(float ♦ ) malloc( (sιze_t) (row^col)); for(ι=l; K-row-l; ι++ ) m[ι ]»m[ι-l] +col; return m; /♦ ♦♦ c natπ.-. This function allocates memory for a matrix of complex floats, of size row x co1. */ complex float 44 c_matnx(ιnt row, int col) ( int I; complex float 44 m; m=(compiex float -') malloc ((sιze_t) row-2), / 4 poιnt=rr Lo r m[0] =(comDle Λ tloat -) malloc! (sιze_t ) ( row-col ) -2 ) ; for(ι = l; K=row-l; ι++) m( l ] =m( i-i ] +col; return m; /* free_vector — Frees memory allocated for vector of floats v. void free vector (float 4 v) I free ( (char 4 ) v) ; / ♦ free_c_vector Frees memory allocated for vector of complex floats c. void free_c_vector (comolex float 4 v) I freeflchar^l v); 1 / ♦ free_matrix — Frees memory allocated for matrix of floats m. void free_matrι.x( float 44 m) { free! (char 4 ) mlO] ); free ( (char ) m) ; / ♦ free_c_matπ.x Frees memory allocated for matrix of complex floats void free_c matri (complex float ♦♦ m) free((char 4 ) m(0)); free ((char 4 ) m); .J •,/♦ -_- qr This function performs QR-decomposition of the matrix A of size n x m, so that A»Q # R where Q is orthogonal and R is upper triangular. R is stored in the upper triangle of A except the diagonal elements of R which are stored in d. Q is represented as a product of householder matrices Q(0i ...Q(n-2) where Q(j)"l - u(j) x u(3) /c(3), where the nonzero components of u(3) are returned in A. -/ qrdnt n, int m, float ' ♦ A, float 4 c, float 4 d) I int i, j, k; float sum; static float p scale, tau, sigma, invscale, s-mpow(: for (k=0; k<m; k++) I scale=max_abs (n, m, , A) ; if (scale<le-10) ιnvscale=lelO; else ιnvscale=l/scale; sumpow(O) =0.0; scale_pow2 (n,m, k, invscale, su pow. A) ; sigma = SIGN (sqrt (sumr>ow( 0] ) , A[kJ(k]); A[k) [k] += sigma; c[k) = l/(sigma'A(k) [k] ); d[k] = -1/ (scale'sigma) ; for (3=k+l; 3<m; 3++) I sum=qr_scalar (n,m, ). , , A) ; tau = sum'c[k) ; tau A(n, m, , , au. A) ; /* qrsolv qrsolv solves the set of linear equations Ax=b where A 1: :; site n :■; m, x of length m, and b of length n. The matrix A is output zι:τ„ the function qi (see above) . The solution vector x overwrites the first - r.sments of b. .. / void qrsolvdnt n, int m, float 44 A, float 4 c, float 4 c, float -= { mt 1, j; float sum; static float pm tau; / ♦ form Q' 4 b ♦ / for (j-0;j<m;3++) { sum=sumaιb(n, m, ,b, A) ; tau»sum 4 c[ ] ; btauA(n,m, 3 , tau,b,A) ; ] / ♦ solve by back substitution ♦ / b[m-l] ♦ = d[m-l]; / ♦ b(m-l) /= d(m-l) oprmdeliς- - for (ι=m-2; ι>=0; 1 — ) ( sum=suma3b(m, ι,b. A) ; b[i] = (b(ι)-sum) 4 d[i]; / ♦ b(ι] = (b[ i] -sum) /z . prindeligt ♦ / / 4 prony_qr Function prony estimates the denominator A(z) of the syst.:- -r.αerlying the data given in the vector x, and returns the polynomial cce cients in vector a. The order of A(z) is P, and the order of the numerator is - Therrien pp 550-553 void prony qr( float 4 x, int Q, int P, float ♦ a) { int row, col, indx; / ♦ indices ♦ / float ♦♦ Xa, *al, ♦ c, ♦ d; Xa»matπx(Nr-Q-l, P) ; / 4 matrix and vector for normal equations * I al-vector(Nr-Q-l) ; c-vector(P); I* storage vectors for QR-solver 4 / d=vector( P) ; / ♦ form Xa matrix, and al vector ♦ / for (row=Q+l, ιndx=0; row<Nr; ιndx++, row++) I al(indx]= -x(row); for (col=0; coKP; col++) Xa (indxl (col ] «x ( rou-col-11 ; ) / ♦ solve (Xa 4 a = al) by QR-decomposition '/ qr(Nr-Q-l, P, Xa, c, d); / 4 perform QR-decotroosi tion on Ha -/ qrsolv(Nr-Q-l, P, Xa, c, d, al); /- solve -/ I * extract polynomial coefficients from al */ a(01=1.0; /' by der.niLion '/ for (row=l; row<=P; row++) a ( ow] =al [ row-11 ; free_matrιx (Xa ) ; free_vector (al) ; free_vector (c) ; free vector (d ) ; /* prony_pade_qr The function prony_pade establishes and solves a ±east squares problem, in order to esimate an ARMA model of the system by which the data in vector x was obtained. Tne system is characterized by the numerator polynomial coefficients given vector b, and the denominator polynomial coefficients given vector a. The orders of these polynomials are given by Q ≤rd P resp. Prony_pade uses the function prony to estimate denominator coeffs. 4 / void prony_pade_qr( float x, int Q, int P, float -b, float 4 a) ( int row, col, strt=0, indx; /* indices 4 / float ♦♦ Xb; / ♦ estimate denominator using Prony' s method ♦ / prony_qr(x, Q, P, a); Xb=matrix_cal(Q+l,P+l); / ♦ X-matπx, all zeros ♦/ / ♦ form matrix Xb, make multiplication of dot product ♦/ for (col-0; col<=P; col++) ( ιndx-0; for (row=strt++; row<=Q; row++) Xb( row) (col ] =x( ιndx++l 4 a (col) ; } for (row=0; row<=Q; row++) { for (col=0; col<=P; col++) b( row] +=Xb( ow] lcol 1 ; 1 / " alternativ formulering ♦ / / ♦ for (col=0; col<=P; col++) { ιndx=0; for ( row-strt++; row<=Q; row++ ) b [ row) -=χ [ mc.x+ + ] 4 a [ col ) ; ) */ ree_matrιx (Xb) ; 1 /« shank_qr The function shank establishes and solves a least squares problem, m order to esima-te an ARMA model of the system by which the data in vector x was obtained. The system is characterized by the numerator polynomial coefficients given in vector b, and the denominator polynomial coefficients given in vector a. The orders of these polynomials are given by Q and P resp. Shank uses the function prony to estimate denominator coeffs., and the functions qr and qrsolv to solve a set of normal equations by QR-decomposition. Therrien pp 558-559 * / void shank_qr( float 4 x, int Q, mt P, float 4 b, float 4 a) ( int row, col; / ♦ indices -/ int ii, 33; / 4 counters */ float ♦♦ Ha, *ha, ♦ c, ♦ d; / ♦ estimate denominator using Prony' s method */ prony_qr(x, Q, P, a); ha=vector_cal (Nr) ; / ♦ calculate ha, the impulse resσonse of 1/A(z) , Nr icng */ ha[0|=a[0]; for (ιι=l; lKNr; ιι++) for (33=1; 33<=n , 11 ++ ) 1 if (33<=P) ha(ιι]-=a[33 ]-ha(ιι-33 ] for norrral eαuations *l /* form matrix Ha ♦ / for (row=0; row<Nr; row++) ( for (col=0; col<»Q; col++) 1 if (row>=»col) Ha ( row] [col ] =ha [ row-col ] ; else Ha(row) [col]=0.0; ] ) free_vector t ha ) ; c=vector(Q+l) ; / * storage vectors for QR-solver 4 / d=vector (Q+l) ; / ♦ solve (Ha 4 b = x) by QR-decomposition ♦ / qr(Nr, Q+l, Ha, c, d); / ♦ perform QR-decomposition on Ha ♦ / qrsolv(Nr, Q+l, Ha, c, d, x); / ♦ solve ♦ / free_matrιx(Ha) ; free_vector (c) ; free_vector(d) ; / ♦ extract polynomial coefficients from x ♦ / for dι=0; ιK=Q; ιι++) b(n!=x[ιι 1 ; } float determιne_angle( float pm 4 uu_real, int position, complex f.oat pm s(np], float pm w[np], complex float 4 twιd px) I int ii, 33; float 4 a, 4 b, 4 tmp, u_real, u_ιmag, ph; complex float 4 H; complex float "valval; float Hr_pos; float 4 Hr_neg; float *Hi; tmp-vector (Nr) ; H«c_vector (np) ; valval=c vector cal(ku); for (ιi-0; lKku; 11++) { for (jj=0; jj<Nr; 33++) tmp[ 3 3 ) =uu_real (33+n 4 Nr) : a-vector ( ma+1 ) ; b-vector_cal ( mb+1 ) ; shank_qr (tmp, mb, a, b, a); freqz(ma+l, a, b, H, s, w); free_vector(a) ; free_vector (b) ; valval 111 ]=H (position) 4 con3 (H [position) ) ; I free_c_vector (H) ; free_vector ( tmp ) ; Hr_pos=vector (ku) ; Hr_neg=vector ( ku ) ; Hι=vector (ku) ; for (ιι=0; lKku; 11++) ( Hr_pos (11 ] =creal ( valval [ 11 )) ; Hr_neg [ιι]=-creal ( valval [ 11 ] ) , Hi ( ιι]=cιmag ( valval ( 11 ] ) ; 1 free_c_vector (valval ) ; u_real=dm_df t ( u, Hr_pos, Hi, twιd_px ) ; u_ιmag=dm_dft ( ku, Hi, Hr_neg, twιd_px) ; if (u_real !=0.0) ph=atan (u_ιmag/u_real ) 180/pι; else ph=90.0; free_vector (Hr_pos) ; free_vector ( Hr_neg ) ; free_vecto (Hi) ; return (ph) ; / ♦ go4.c runs a_svd4.21k on the ADSP 21062 and displays the results. ♦ / /* Written by Peter Hazell, modified 240698 by PH ♦ / / ♦ .changes from go_a_dat: mean values subtracted from measured is a new option 4 / / ♦ black on white option ♦ / I include <dos.h> d include <math.h> I include <conιo.h> t include <stdιo.h> f include <stdlib.h> I include <graphιcs.h> ϋ include <strιng.h> il include "dsp21k.h" » include "\dsp21k\dh21k\def_ . " static float argl, arg2; * define FMAX(a,b) (argl=(a) ,arg2= (b), (argl) (arg2) ^ ■ 3U (arg2) ) t define FMIN(a,b) (argl=(a) ,arg2= (b), (argl) (arg2) -rgl! (arg2) ) * define N 128 8 define N_REM 1 I define LOGIC int « define BOARD_NUM 0 / ♦ assume board number 0 -' β define ERR 10 S define FILENAME_REAL 'd:\\data. re" * define FILENAME_IMAG 'd: Wdata . lm" i define FILENAME DUMMY "d. Wdummy" int GraphDriver; /* The Graphics device drive. nt GraphMode; /" The Graphics mode value int ErrorCode; / 4 Reports any graphics err:: float norm real [NO_ANTENNAS 4 Nr] , norm_ιmag 1 NO_ANTENNAS-|s . /"float sub real [NO ANTENNAS 4 Nr] , sub_ιmag[NO_ANTENNAS*';. int been_here_h=0; / 4 HP- 4 / int been_here_l=-l; / 4 log screen */ mt been_here_m=-l; / ♦ subtract mean int been_here_n=l; / ♦ normalize 4 / int been_here_s=-l; / 4 shank/prony ♦ / int been_here_v=-l; / 4 svd smoothing * mt l_draw=15; int 1 eras=l; / 4 prototypes 4 / void Initialize (void) ; void ιn_norra( float 4 norm_real, float 4 norm_ιmag), voiα ιn_sub(float 4 sub_real, float ♦ sub_ιmag); void get_settιngs (char 4 txtbuf,char 4 vmιn,char ♦ vmax,c | -.-r 4 vgrιd,char 4 lmιn,char 4 l-max,char 4 lfιt,char 4 lgrιd, char ♦ forget_ιt); void draw_framednt x_l, int x_r, int y_u, int y_d); void αraw_grιd(ιnt x_l, int x_r, int y_u, mt y_d, int cr.d_<, float grιd_y); void draw_graph ( float ♦ ydata, int x_l, int y_u, float y_-m, float y_max, LOGIC fit, float gridy, int cursor, float xpos); void erase_graph( float ♦ ydata, int x_l, int y_u, float ^-.ln, float y_max, LOGIC fit); void erase_cursor(ιnt x_l, nt y_u, int cursor, float κp s); void erase_scalednt x_l, int y_u, float y_mιn, float y -ax, float gridy); int posmaxl float ♦ v, int n); ~ float findmaxl float ♦ v, int n); float fιndmιn( float *v, int n); float ♦ vector (int n); void free_vector( float *v) ; void textxy_float (int x, int y, float a); void show_help(voιd) ; void showtime! void) ; void collect_data(DSP21 ♦ board); void collect_means(DSP21K 4 board); void collect_dummy(DSP21K 4 board); void save_data ( float "data); void save_means (DSP21K 4 board); void make_sound(mt counter); void make_3_tones (int del); void got_an_error (int s); int count_down(ιnt cnt); void update_screendnt l_draw, int l_eras); void change_fliter (int new, DSP21K "board); void change_subtract dnt new, DSP21K 4 board); void cnange_normal (int new, DSP21K "board); void change_methoddnt new, DSP21K "board); void change_smoothe (int new, DSP21K ♦ board); mai^ ) 'i char txtbuf [300], input; char vmιn(lθ) , vmax(10], vfιt(10], vgrιd(lθ); char lmιn(10], lmax[10], lfιt[10], lgrid(lθ), forget_ι (10) ; float fvmin, fvmax, flmin, flmax, forget; int do_upper-l, got_data—16, got_means»0; float fvgrid, flgrid; LOGIC fvfit, flfit; int del=50; int ii, 33 ; int indx, found; int xcrsr=254 , xcrsr_old; int seπal_check»0; int been_here_z=l; / ♦ cursor reading -/ int been_here_f=-l; / fast cursor */ int been_here_c=»-l; / 4 collect raw data / int been_here_r=-l; / ♦ record results ♦ / int been_here_S=-l; I * calculate mean values •/ int been_here_h_old; int been_here_n_old; int been_here_s_old; int been_here_m_cld; int been_here_v_old; int xιnc=l; float 4 ldet, "vαet, ldet_old, 4 vdet_old, 4 ιra_r, -fm_., float xpos, xpos_old, κpos_f rom=0.0, FILE *ιnd; 0SP21K " boarα; mt counter=-15, int err_count=0; float l_max; float angle; mt posιtιon=64; int fιg2poly(8]=(0,240,0,450,640, 450,640,240), xpos= (tl+(t2-tl ) 4 xcrsr/508.0) /ns_to_m-xpos_frorr; vdet=vector ( N ) ; ldet-vector(N) ; vdet_old««vector (N) ; ldet_old=vector (N) ; Initialize! ) ; setbkcolo ( l_eras ) ; setcolor(l_draw) ; outtextxy(220,1, "Press <q> to quit, <F1> for list of hctKeys"); outtextxy(265,225,"x-pos:"); outtextxy( 1, 455, "Method: Shank" ) ; outtextxyd, 470, "normalization: on" ) ; outtextxy(200, 470, "subtraction: off" ) ; outtextxy( 400, 470, "HP-filter: off"); textxy_f loa ( 80, 225, tl/ns_to_m) ; settext3 ustιfy ( 2, 2 ) ; textxy_f loat ( 80+508, 225, 2/ns_to_m) ; settext3 ustιfy( 0, 2 ) ; ςet_settmgs ( txtbuf , vmin, vmax , vf it, vgrid, imir, Iraax, I f it , Ig rid , forget it ) , fvmax=atof ( max ) ; flmm=ato ( lmin i ; : lmax-atof ( lma ) ; fvgrιd»a to f (vgrid ) ; f lgrid-atof ( lgri ) ; fvfιt«atoι (vfιt ) ; flfit-atoι ( l fit ) ; orget-atof ( orget_ι ) ; board=dsp21k_open ( BOARD_NUM) ; / * open tne 00a e ♦ / redo: been_here_h_old—1; been_here_n_old-0; been_here_s_old-0; been_here_m_old«0; been_here_v_old-0; dsp21k_reset_proc (board ) ; / 4 reset bord / dsp21k_dl exelboard, "Wdsp21k\\dh21k\\a_svd4.21k" ) ; / 4 download and start the dsp program 4 / dsp21k_start (board) ; ιn_norm(norm_real, norm_ιmag); / ♦ get and create normalization vectors */ / 4 ιn_sub(sub_real, sub_ιmag); 4 / / 4 get and create mean vectors " / while (dsp21k_ul_ιnt (board, dsp21k_get_addr (board, "_done_ιnιtιalιzatιon" ) )==0) ; dsp21k_dl_fIts (board, dsp21k_get_addr (board, "_norm_real" ) , NO_ANTENNAS 4 Nr, norm_real); dsp21k_dl_fIts (board, dsp21k_get_addr (board, "_norm_ιmag" ) , NO_ANTENNAS Nr, norm_ιmag); /* dsp21k_dl_fIts (board, dsp21k_get_addr (board, "_sub_real" ) , NO_ANTENNAS- r, ≤ub_real), dsp21k_dl_fIts (board, αsp21k_get_addr (board, "_sub_ιmag" ) , NO_ANTENNAS'NL , sub_ιmag) ; */ /" dsp21k_dl_ιnt (board, dsp21k_get_add (board, "_done_αownloadιng" ) , 1);*/ dsp21k_dl_ιnt (board, αsp21k_get_addr (board, "_got_here" ) , 0); whιle(l) ( /" wait for done variable to be set true */ 11=0; while (ιι<le3) 1 seπal_check=dsp21k_ul_ιnt (board, αsp21k_get_addr (boaid, "_done" ) ) , if (serιal_check' =0) goto ςo_on; ιι++; ~ goto redo; go_on: dsp21 _αl_ιnt (boarc, dsp21 _get_addr (board, "_got_here" ) , 0), settext3ustιfy(0, 2) ; setcolor ( l_draw) ; if (serιal_check!=l ) { got_an_error (≤eπal_check) ; err_count=ERR; goto cont; > if (err_count>0) err_count=count_down(err_count ) ; if ((ιnput=»*a') I ! dnput=='A')) ( setcolor (l_eras) ; textxy_float (450, 455, angle) ; setcolor ( l_draw) ; if dnput=='A') posιtιon=dnt) (xcrsr/4); else posιtιon=posmax( vdet,np) ; dsp21k_dl_flt (board, dsp21k_get_aαd (boarc, "_angιe_pos" ) , position); while (αsp21k_ul_ιnt (board, dsp21k_get_addr (board, " angle_determιned" ) )==0) ; angle=dsp21k_ul_f It (board, dsp21k_get_addr (beard, "_phase") ) ; outtext.xy(400, 455, "Angle: ") ; ~ textxy_float (450, 455, angle) ; I if (ιnput=='c') been_here_c 4 ~-l; if ( (been_here_c~l ) 44 (got_data<100) ) 1 if (got_data>«0) collect_data (board) ; if (got~data<0) collect_dummy( board) ; got_data++; make_sound (got_data ) ; ) if (got_data~100) ( . make_3_tones (del ) ; been_here_c»-l; got_data++; ) if (input—'S'l been_here_S 4 =-l; if ((been here_S==l) (got_means<100) ) { if (got_means==0) I dsp21k_dl_ιnt (board, dsp21k_get_addr (board, "_subtract" ) , 0); / 4 initialize sub_vectors ♦ / for (11=0; ιKNr 4 NO_ANTENNAS; n + +) { sub_real(n]=0.0; sub_ιmag( ii) =0.0; l 4 / ) if (got_means>=0) collect_meaπs (board) ; got_means++; make_sound (got_means ) ; 1 if (got_means==100) [ if (been_here_m==l ) dsp21k_dl_ιnt (board, dsp21k_ er__audr (board, "_subtract" ) , save_means (board) ; make_3_tones (del ) ; been_here_S=-l; got_means=0; I / 4 uploaα the results ♦ / while (dsp21k_ul_ιnt (board, αsp21k_get_addr (boarc, "_-:r.e_dstectιnc" ,' ) ==0) ; dsp21k_ul_flts (board, dsp21k_get_aodr (board, "_voet" , N, vdet); / ♦ dsp21k_ul_flts (ooard, dsp21k_get_aααι (ooard, "_lcet"), N, lαet);-' I* calculate logαata here, quicker 4 / for (33=0;33<np;33++) I if (vdet(33)>0) ldet [33 ] =10 4 logl0( vαet (33 ] ) ,- else ldet ( ]— 60.0; } l_max=fιndmax(ldet,np) ; for ( 3"0;3D<n ; : ++ ) ldet( 3)-=l_max; if (been_here_r==l) save_data (vdet) ; if dnput=-'f ) been_here_f 4 =-l; / 4 if (input—'h'l been_here_h 4 =-l; ♦ / if (input=-'h'l { if (been_here_h=»3) been_here h=0; else been_here h++; — - 1 if dnput=='m') been_here_m 4 —1 if dnput=='n') been~here_n 4 —1 if dnput=='s') been here_s 4 =-l if dnput=='r') been~here_r ÷ =-l if dnput=='V) been_here_v 4 =-l if (been_here_f==l) xιnc=10; else xιnc=l; if ( been_here_h!=been_here_h_old) change_fιlter (been_-.ere h, board); been_here_h_old=been_here_h; - if ( been_here_m!=been_here_m_old) change_subtract (been here m, board ); been_here_m_old-been_here_m; ~ ~ if ( been_here_n!=been_here_n_old) change_normal (beer._.-.ere n, board); been here n old=been here n; - if (been_here_s!»been_here_s_old) change_method(been here_s, board); been_here_s_old=been_here_s; ~ if (been_here_v!-been_here_v_old) change_smoothe (been_here v, board); been_here_v_old=been_here_v; xcrsr_old=xcrsr; xpos_old=xpos; if dnput=» 'z' ) ( if (been_here_z==-l) 1 xpos_from=0.0; been_here_z=l; ) else 1 xpos_from=xpos; been here_z=-l; 1 xpos=(tl+ (t2-tl ) *xcrsr/S08.0)/ns_to_m-.xpos_from; erase cursor ( 80, 20, xcrsr_old, pos_old ) ; 1 if dnput==' \M' ) /' arrow right */ ( if ( (xιnc==l ) 44 (xcrsr!=508) ) xcrsr+=xmc; /- move cursor right, slow -/ if ( (xιnc==10) 44 (xcrsr<499) ) xcrsr+=xmc; /- move cursor right, fast "/ xpos=(tl+ ( t2-tl) "xcrsr/508.0) /ns_to_m-.xpos_fro ; erase_cursor (80, 20, xcrsr_old, pos_olc ) ; if (been_here_l==-l ) erase_cursor ( 80, 240, .xcrsr_old, xpos old); ] if dnput==' \K' ) / arrow left ♦ / I if ( (xmc==l) 44 (xcrsr! =0) ) xcrsr-=xmc; /- move cursor left, siow */ if ( (xιnc==10) 4 (xcrsr>9) ) xcrsr-=xιnc; /- move cursor left, fast */ xpos=(tl+(t2-tl ) 4 .xcrsr/50S.0) /ns_to_m-xpos_from; erase_cursor (80, 20, xcrsr_old,xpos_olc! ; if (been_here_l==-l ) erase_cursor ( 80, 240, .xcrsr_olc, xpos old); I for (ιι=0; lKN; ιι++) ( vdet [ιι] = ( vdet [ ii ] +vdet_old (ii ) "forget ) / (1+forget) ; ldet[ιι]=(ldet[iι]+ldet_old[ιι] "forσε )/ (1+ forget) ; ) if (been_here_l==-l) erase_graph ( ldet_olα, 80, 240, flmin, flmax, flfit); erase_graph(vdet_old, 80, 20, fvmin, fvmax, fvfit); if ( input— • 1 ' ) t been_here_l 4 =-l; setcolo (l_eras) ; fillpoly(4, fig2poly) ; setcolo (l_draw) ; 1 if ( input==»' u ' ) do_upper=l; if (ιnput--'l') do_upper=0; if dnput=='\H' ) / ♦ arrow up "/ ( if (been_here_l==-l) erase_scale ( 80, 240, flmin, flma , flgrid); erase_scale( 80, 20, fv in, fvmax, fvgrid); if (do_upper==l ) I if (fvmax<16384) I fvmax 4 =2.0; fvgrιd 4 =2.0; 1 ) else flmin—10.0; ) if dnput=='\P' ) /* arrow down -/ if (been_here_l—-1) erase_scale(80,240, flmm, flmax, flgrid); erase_scale(80,20,fvmιn, fvmax, fvgrid); if (do_upper==l ) - { fvmax/-2.0; fvgrιd/=2.0; ) else if (flmin<flmax-10) flmιn+=10.0; ) if (been_here_l—1) draw_graph(ldet, 80, 240, flmm, flmax, flfit, flgrid, xcrsr, xpos); draw_graph(vdet, 80, 20, fvmin, fvmax, fvfit, fvgπα, xcrsr, xpos); counter++; if (counter==0) showtime!); if (counter==1000) showtιme( ) ; ♦ / showtime i ) ; for (ιι=0; n<N; ιι++) vdet_old[ιι] =vdet [ii] ; ldet~oid[ιι]=ldet[n] ; } ιnρut=' ' ; /* r°set input */ while (konitO) ιnput=getch ( ) ; if ( np t=='q' ) I I ( ιnput=='Q' ) ) goto out; upcate_screen ( l_αraw, l_eras); else 1 craw=15; l~eras=l; uocate_screen(l_draw, l_eras); I been_nere_h_old=-l; been_nere m_old=0; been_here_n_old=0; been_here_s_old=0; been nere v old*»0; if (input=='\; ' ) show_help(); /* Fl ♦ / serial check=0; /* reset serial check */ out: closegraph ( ) ; / ♦ close the poard ♦ / dsp21k_reset_ρroc (board) ; dsp21k_closeι ooard) ; free_vector ( lcet ) ; free_vector ( cet ) ; free_vector ( idet_old) ; free_vector (vcet_old) ; return (0) ; void Initialize! oic int ii; for dι-0; ιι<Nr 4 NO_ANTENNAS; ιi++) { sub_real [ ii ] =0.0; sub_ιmag ( ii ] =0.0; GraphDriver = ■ DETECT; /* Request auto-detection / ιnιtgraph( 4GraphDrιver, 4GraphMode, "" ); ErrorCode = graphresult ( ) ; /* Read result of initialization 4 / ιf( ErrorCode '= grOk ) / 4 Error occurec during init 4 / I pnntf!" Graphics System Error: %s\n", grapherror-33 ( ErrorCode ) ); exιt( 1 ); ) setfillstyled, 1 eras); / 4 black -• void ιn_norm( float 4 norm_real, float 'norm imag) f FILE 4 ιnd; float a_r(Ns], a_ι[NsJ; int n, ιnd=fopen ( "\\dsp21 \\bcclιb\\a_r dat", "rb"); fread(a_r, sizeof ( float ) , Ns, md); fclosednd) , ιnd=fopen ("Wdsp21kWbcclibWa_i.dat", "rb" ) ; fread(a_ι, sizeo ( float ) , Ns, ind); fclose ( ind ) ; for (li=STARTPOINT, iKNr+STARTPOINT; 11 + +) ( norm_real [ 1 l-STARTPOINT] =a_r [ 11 ] ; norm_ιmag [ 11-STARTPOINT] =a_ι [11] , md=fopen("\\dsp21k\\bcclιb\\b_r.dat", "rb"), fread(a_r, sizeof ( float ) , Ns, ind); fclose(ιnd) ; c ose (ind) ; for (ιι=STARTPOINT; iKNr+STARTPOINT; 11++) I norm_real [ n-STARTPOINT+Nr)=a_r [11] ; norm_ιmag[ 11-STARTPOINT+Nr] =a_ι [11] ; ) ιnd=fopen ( "Wdsp21kWbcclibWc_r.dat", "rb" ) ; fread(a_r, sizeof ( float ) , Ns, ind); fclose(ιnd) ; ind=fopen( "Wdsp21kWbcclibWc_i.dat", "rb"); fread(a_ι, sizeof (float) , Ns, ind); fclosednd) ; for (li=STARTPOINT; iKNr+STARTPOINT; 11++) { norm_real [ ιι-STARTP0INT+Nr 2]=a_ (11] ; norm imag [ n-STARTP0INT+Nr 4 2] =a 1(11]; ιnd=fopen("\\dsp21k\\bcclιb\\d_r.dat", "rb") ; fread(a_r, sizeof ( float ) , Ns, ind); fclosednd) ; ιnd=fopen( "\\dsp21kWbcclibWd_i.dat", "rb" ) ; fread(a_ι, sizeof ( float ) , Ns, ind); close! ind) ; for (li=START POINT; n<Nr+STARTPOINT; iι++) < norm_real(ιι-STARTPOINT+Nr 4 3]=a_r(ιι]; norm_ιmag(ιι-STARTPOINT J r 4 3]=a ι(ιι) ; I void m_sub( float 4 sub_real, float 4 sub_ιmag) (7 FILE 4 ind; /* ιnd»fopen(SUBMEANS_RE, "rb"); 4 / ind»fopen("c:\\dsp21k\\bcclιb\\sub_mean. re", "rb" ) ; fread(sub_real, sizeof ( float ) , Nr"NO_ANTENNAS, lnα); fclosednd) ; /* ind=fopen(SUBMEANS_IM, "rb"); 4 / ind=fopen("c:\\dsp21k\\bcclιb\\sut_mean. lm", "rb" ) ; fread(sub_ιmag, sizeof ( float ) , Nr-NO_ANTENNAS, ind); fclosednd) ; void draw framednt x_l, int x_r, int y_u, nt y_d) ( int ii; setlinestyle (0, 0, 1 ) ; /" solid -/ setcolor(l_draw) ; / * white -/ moveto(x_l, y_u) ; lineto (x_l, y_d) ; lιneto(x_r, y_d) ; lineto (x_r, y_u) ; lιneto(x_l,y_u) ; void draw_grιd(ιnt x_l , int κ_r, int y_u, :-.t / _d, mt gπc_.., float grιd_y! ( int ii; setlinestyle ( 1, 0, 1) ; /" dottec *- for dι=l; n<grιd_x; ιι++) line ι>._:-:: 4 (.x_r-.-._l ) /gnα_.., y_u, x_l+n" (>:_r- -:_1 ) /grιd_.-:, y_α); for (ιi=l; ιι<grιd_y; ιι++) lιne(x_l, ( int ) ( y_d-ιι* ( y_α-y_u) /grιd_y) , x_r, (int) (y_d-ιι 4 (y_d-y_u ) /grιc_y) ) ; draw_graph( float 4 ydata, int x_l, int y_u, float y_mιn, float y_max, LOGIC fit, float gridy, int cursor, float xpos) < mt ii; float y; char txt[10J; if (fit—1) ( y_min«findmιn( ydata, np) ; y_max-f dmax ( ydata, np) ; 1 y=y_max-y_mm; / ♦ y-raπge ♦ / if (y—0.0) y»1.0; / will overflow if y=0 4 / if ( ydata (0]>y_max) moveto(x_l, y_u) ; /- move to top left hand corner "/ else if ( ydata (0)<y_mιn) moveto (x_l, y__ι+200) ; / ♦ move to bottom left hand corner -/ else moveto(x_l,y_u+(mt) ( (y_max-ydata (0] ) 4 200.0/y) ) ; / ♦ move to first point 4 / setlinestyle (0, 0, 1) ; /* solid "/ setcolor (l_draw) ; /* white -/ , , , , , % /* line to frame top*/ for dι=l; lKnp; n++) ,. nfi t<j frame bQttom ., i .f. (,yd.a ^ ta (, i.i ,]> ^ y_max ,) l,ine_to (,x_l,+n- (, 5,r,12/,np), , y u) /" line to next ooint * / else if (ydata (ii) <y_rain) lιneto(.x_l+ιi 4 ( 512/np) , y_u+200) ; else linetolx 1+n 4 (512/np) , y_u- ( int ) ( (y max-ydata ! n ] ) 4 200.0/y) ) ; I moveto (x_l+cursor, y_u+200) ; lιneto(x_l+cursor,y_u) ; / ♦ vertical line at cursor 4 / settext3ustify(2,2) ; textxy_float (x_l-5, y_u, y_max); textxy_float ( 380, 225, xpos) ; settext * 3ustify(2,0) ; textxy_float (x_l-5, y_u+200, y_mιn); draw_grιd (x_l , x_l+508, y_u, y_u+200, 6, y/gridy ) ; draw~frame (x_l, x_l+508, y_u, y_u+200) ; erase graph(float 4 ydata, int x_l, int y_u, float y_mιn, float y_ma.x, LOGIC fit) I int ii; float y; char txttlO] ; if (fit—1) ( y_mιn=flnd in (ydata, np) ; v_max=fιndmax (ydata, np) ; ) y=y tιax-y_mιn; if (y—0.0) y=1.0; /" will overflow i: y=0 */ setlinestyle(0,0, 1 ) ; /* solid ♦ / setcolor ( l_eras) ; / 4 black ♦ / if (ydata 10) >y_max ) moveto (x_l, y_u) ; else if (yαata I 0] <y_mιn) moveto (x_l, y_u+200) ; else moveto (x_l, y_u+(ιnt ) ( (y_max-ydata 10] ) 4 200.0/y) ) ; for (ιι=l; IKΠD; ι++) ( f (ydata I ii] >y_max) lineto (x_l+ ιi 4 (512/np) , y_u) ; else if (ycata [ ii ] <y_mιn) lineto (:<_l+ιι 4 ( 512/np) , ,-2t'ύ) ; else lineto (x_l+ιι 4 (512/np) , y_u+ (int) ( (y_ma:-yσati , . _ " , -200.0/y) ) ; I i int posmaκl float 'v, int n) { mt ii, pos; float largest; I* very small ♦ / largest=v[0] ; pos=0; for (ιι=l; ιi<n; ιi++) I if (v [ iι ] >largest ) ( largest=v ( ϋ ] ; pos=ιι; return oos; float findma l loat 'v, int n) float fm≤.x=-le99; I * very small - ■ for m=0; ιι<n; iι++) fmax=FMAX( fmax, v(ιι] ) ; return fπax; float findmιn( loat *v, int n) I J.nt-ιi; float fmιn=le99; / ♦ very oig ♦ / for dl=0; ιι<n; ιι++) fmm=FMIN( fmin, v( ii) ) ; return fmin; / ♦ 'vector This function allocates memory for a vector of floats , of size n. float 4 vector(ιnt n) ( float 4 v; v=(float 4 )calloc( (sιze_t ) n, (sιze_t) sizeof ( float )) ; return v; 1 /' free_vector Frees memory allocated for vector of floats void free vector (float 4 v) I free! (char- ) v) ; ) vo d textxy float (int x, int y, float a) ( char whole(5] , dec(5], tκt[20]="' int ii; ltoal (int) (a) , hole, 10) ; itoal (int) (abs( (a- (int) (a) ) 4 1000) ),dec,10); lf ( (a<0.0)44(a>-1.0) ) strcat (txt, "-") ; strcat (txt, hole) ; strca (txt, " . ") ; if ( ( (int) (abs! (a- (int) (a) ) 4 1000) )<100)44( (int) (abs( (a-dnt) (a) 1*1000) )>=10) ) strcat ( txt, "0" ) . if ( ( (int) (abs( (a-dnt) (a) ) 4 1000) )<10)44( (int) (abs( U-dnt) (a) ) 4 1000) )>=1) ) strcat (txt, "00" ) ; strca (txt,dec) ; outtextxy(x, y, txt) ; ] void get_settmgs(char "txtbuf, char ♦ vmin, char 4 vmax,cnar 4 vfιt,char 4 vgrιd,char ♦ 1mm, char ♦ lmax,char ♦ lfit,char ♦ lgrιd,char ♦ forget it) ( FILE ♦ ind; int flag— 1, indx, found, cnt=0; ind-f open ( "\\dsp21kWbcclibWdat_a . txt" , " rt" ) ; fread ( txtbuf , 4 , 300, ind ) ; fclose dnd ) ; found=0; indx— 1 ; while ( found<2 ) ( if (flag==l) vmιn(++ιndx]=txtbuf lent) ; if (txtbuf lent) — *S' ) flag 4 =-l, found++; cnt++; 1 found=0; indx—1; while (found<2) ( if (flag—1) vmax [++ιndx] -txtbuf(cnt) ; if (txtbuf [cntl — *S' ) flag 4 —l,found++; " cnt++; I found-0; while (found<2) { if (flag—1) vfit[++indx]=txtbuf (cnt); if (txtbuf lent) — • $') flag 4 —l,found++; cnt++; ) found=0; indx—1; while (found<2) 1 if (flag==l) vgrid (++ιndx]=txtbuf lent) ; if (txtbuf [cnt] — 'S ' ) flag 4 —1, found++; cnt++; I wnile ( ound<2 ) ( if (flag—1) lmin [++ιndx] =txtbuf [cnt ] ; if (txtbuf (cnt ]=='$' ) flag 4 =-l, found++; cnt++; 1 found=0; ; while (found<2) ( if (flag==l) lfιt[+-ι-ιndx]=txtbuf [cnt] ; if (txtbuf (cnt) — 'S' ) flag 4 =-l, found++; cnt++; ] found=0; ιndx=-l; while (found<2) I if (flag—1) lgrιd(++ιndx)=txtbuf (cnt) ; if (txtbuf [cnt] — '$' ) flag 4 =-l, found++; cnt++; ) found=0; ιnαx=-l; while (found<2) ( if (flag—1) forget_ιt(++ιndx)=txtbuf (cnt) ; if (txtbuf (cnt) — *$' ) flag*—1, found++; cnt++; ] I void show_help ( void ! ( int lιne=l, l_spc=10; cleardevicef ) ; settext ustιfy(0,2) ; lιne++; lιne++;outtextxy(50, line # l_spc, " Your hotkeys are:"); lιne++;lιne++;lιne++;lιne++;outtextxy(50,lιne*l_spc," a : Determine angle at maximum"), l e++;outtextxy(50, lιne*l_spc, " A : Determine angle at cursor"); lιne++;outtextxy(50,line 4 l_spc, " b : Black on white or white on black"); lιne++;outtextxy(50, line 4 l_spc, " c : Collect raw data"); lιne++; outtextxy(50, lιne*l_spc, " f : Fast cursor movement σn/off"); lιne++,-outte.xtxy(50,lιne , l_spc, " h : High Pass filtering of /10ns/15ns/20r ι s" ) ; lιne++; outtextxy! 50,lιne 4 l_ spc. 1 : Change y-range of lower graph" ) ; lιne++; outtextxy! 50,lme*l " spc, " m : Mean value subtraction on/off"); line++; outtextxy! 50,line*l " spc," n : Normalization on/off"); line++; outtextxy!50,line 4 l " spc," q : Quit" ) ; lιne++; outtextxy( 50,lιne 4 l " spc," r : Record results"); line++; outtextxyf 50,lιne 4 l " spc," s : Solution method: Shank/ Prony" ) ; lιne++; outtextxy! 50,lιne 4 l " spc, " S Collect mean values for subtraction"); line++; outtextxy( 50,lιne 4 l " spc," u Change y-range of upper graph"); lιne++; outtextxy! 50,lιne 4 l^ spc, " V SVD smoothing on/off"); lιne++; outtextxy! 50, lιne l " spc, " Z : Set x-position to zero or restore"); lme++; outtextxy! 50,lιne 4 l~ spc, " 1 : Toggle lower graph on/off"); lιne++; lιne++;outtextxy(50^ lιne < l_ spc, " arrows: " ) ; lιne++; line++;out;textxy(50, line a l " spc, " left : Move cursor left"); lιne++; outtextxy) 50,lιne 4 l spc," right: Move cursor .ignt"); lιne++; outtextxy! 50,lιne 4 l " spc, " up Increase y-rar.ge of selected graph (1 or u)"). lιne++; outtextxyt 50,lιne-l " spc, " down • Decrease y-range of selected graph (1 or u)"); lιne++; lιne++;outte.xtxy (50^ line a l spc, " function keys"); lιne++; lιne++;outtextxy(50, line a l " spc, " Fl : Retur- to program"). while (getchl ) cleardevιce( ) ; setbkcolord eras), settext3ustιfy (0, 2) if !been_here_h==ι ! outtextxy (400, 70, "HP-filter 10 rr" , if (been_here_h==2 ) outtextxy(400, 470, "HP-filter 15 ';"', if (been_here_h==3 ) outtextxy(400, 470, "HP-filter. 20 '=' , if (been_here_h<l ) outtextxy (400, 470, "HP-filter: off"), if (been_here_m==l ) outtextxy(200, 470, "suotraction: or" , else outtextxy(200, 470, "subtraction: off"), if (been_here_n==l , outtextxy ( 1, 70, "normalization: o' " . else outtextxy ( 1, 70, "normalization: off"); if (been_here_s==l ) outtextxy! 1, 55, "Method. Prony" ) , else outtextxy ( 1, 55, "Method: Shank"); if (been_here_v==l ) outtextxy (200, 455, "Smoothing: on" , eise outtextxy(200, 455, "Smoothing: off"); outtextxy(220, 1, "Pr ess <q> to quit, <F1> for list of -:t e v s"). outtextxy (265, 225, " x-oos : " ) ; /- te.xtxy_float (80, 445, tl/ns_to_m) , -/ textxy_float (80, 225 , -/ns_to_m) ; settext3ustιfy(2, 2) / ♦ textxy_f loat (80+5 12,445, t2/ns_to_m) ;»/ text.xy_f loat ( 80+512 ,225,t2/ns to m); settext3ustιfy(0,2) void showtime (void) 1 struct dostιme_t t; char hour(2], mιnute(4], second(4], txt(20)="' int poly[8) = (550,4S5,550,470,640,470,640,455); _dos_gettιme ( 4t ) ; itoalt. hour, hour, 10) ; ιtoa(t.minute, minute, 10) ; ltoa (t.second, second, 10) ; strcat (txt, hour) ; strcat (txt,":") ; if (t.mιnute<10) strcat (txt, "0" ) ; strcat (txt, minute) ; strcat (txt, ":") ; if (t.second<10) strcat ( txt, "0" ) ; strcat (txt, second) ; setcolor (l_eras) ; fιll?oly(4,poly) ; setcolor (l_draw) ; outtextxy(630, 470, t-. > ; void collect means (DSP21K 4 b ard) float -uu real, *uu_.raς; int ii, 33; uu_real-vector (Nr*ku) ; uu_imag-vector (Nr 4 ku) ; while! !dsp21k_ul_int (board, dsp21k_ et_addr (board, "_done_normalizιng") ) ) ; dsp21k_ul_f Its (board, dsp21k_get_addr (board, "_uu_real"), Nr 4 ku, uu_real); dsp21k_ul_f Its (board, dsp21k_get_addr (board, "~uu_ιmag"), Nr 4 ku, uu_ιmag); for (iι=0; ιKNO_ROT; iι++) ( /* for (J3=0; <Nr 4 NO_ANTENNAS; J3++) I sub_real[33 ] += (0.0025 4 uu_real (33 + n 4 Nr*NO_ANTENNAS| ) ; sub ιmag(33 ] += (0.0025 4 uu_ιmag( 33+ιι"N 4 N0 _ ANTENNAS) ) ; 1*/ ) ree_vecto ( uu_real ) ; ree_vector (uu imag); I void collect_data (DSP21K "board) FILE -ind; float *uu_real, "uu_ιmag; uu_real=vector (Nr ku) ; uu_ιmag= vector (Nr ku) ; while! !dsp21k_ul_ιnt (board, dsp21k_get_aαdr (bo rc, "_cone_n realizing" ) ) ) ; dsp21k_ul_f Its (boarα, σsp21k_get_addr (bθ3rd, " u>. rea!"', Nr-ku, uu real); dsp21k_ul_flts (board, αsp21k_get_addr (boiic, " -_ ιιω " , , Nr-l-.u, uu _ ιmag); ιnd=fopen ( FILENAME_REAL, "a+D" ) ; fwrιte(uu_real, sizeof ( float ) , Nr 4 ku, ind); f close ( ind) ; ιnd=fopen ( FILENAME_I! ' 1AG, "a+b" ) ; fwrιte(uu_ιmag, sizeof ( floa ) , Nr 4 ku, ind); fclosednd) ; f ree_vector (uu_real ) ; f ee_vector (uu_ιmag) ; 1 void collect_dummy(DSP21 "boarc) { FILE "ind; float *uu_real, "uu_ιmag; uu_real=vector (Nr 4 ku) ; uu_ιmag=vector (Nr 4 ku) ; while! !dsp21k_ul_int (board, dsp21k_get_addr (boarc, "_done_normalιzιng" ) ) ); dsp21k_ul_flts( board, dsp21k_get_addr (board, "_uu_real"ι, Nr*ku, uu real); dsp21k_ul_flts( board, csp21 _get_adαr (board, "_uu_ιmac"), Nr*ku, uu~ιmag); ιnd=fopen(FILENAME_DUMMY, "wb" ) ; fwπte(uu_real, sizeof ( float ) , Nr"ku, md); f close ( ind) ; ιnd=fopen ( FILENAME_DUM1-'Y , "wb" ) ; fwrιte(uu_ιmaς, sizeof ( float ) , Nr"ku, ind); f close! ind! ; f ree_vector (uu_real ) ; free vector ( uu_ιma ) ; ) void save data (float "data) i FILE 4 ιnd; md-fopen("d:\\vdet.dat", "a+b") ; fwrιte(data, sizeof ( float) , np, ind); fclosednd) ; ) save_means(DSP21K "board) ( FILE "ind; /* ιnd=fopen(SUBMEANS_RE, "wb");*/ /" ιnd=fopen("c:\\dsp21k\\bcclιb\\sub_mean. re", "wb" ) ; fwrιte(sub_real, sizeof ( float ) , Nr 4 NO_ANTENNAS, md); fclose (ind) ; ♦ I I* ιnd=fopen(SUBMEANS_IM, "wb"); 4 / I* md=fopen("c: \\dsp21k\\bcclιb\\sub_mean. lm", "wb"); fwrιte(sub_ιmag, sizeo ( float ) , Nr 4 NO_ANTENNAS, ind), fclosednd); 4 / / 4 download new subtraction vectors '/ / ♦ dsp21k_dl_flts(board, dsp21k_get_addr (board, "_sub_re < =l" ) , NO_ANTENNAS-Nr, oub_rpal). dsp21k_αl_f Its (board, dsp21k_get_addr (ooarc, "_sub_ιmac" I , NO ANTENNAS'Nr, sufc ιwαl.'/ ] void make_sounα ( int counter) ( int fl=500, f2=1000, f3=2000; double res, / ♦ αelay(MEAS_DELAY) , 4 / I* countdown */ if (counter—10) sound(f3); if (counter—8) nosound ( ) if (counter==-5) sound(f3) if (counter==-3) nosound () /* measuring */ if (counter>=0) f res=fmo ( (double) (counter) ,10.0); if (res—0.0) sound(fl); if (res==1.0) nosound () ; if (res—5.0) sound (f2), if (res—6.0) nosoundU; ) void make_3 tones (int del) ( sound ( 500 ) ; delay(del), • sound ( 00) ; delay(del ) ; sound (900) , delay(del) , sound (1100) , delay(del) ; nosound ( ) , void got_an error (int s) I if (s—2) outtextxyd, 1, "MAC overflow" ) ; if (s—3) outtextxyd, 1, "ADC out of range"); if (s—4) outtextxyd, 1, "Serial transmission error"); if (s—123) outtextxy ( 1, 1, "SVD did not converge"); int count_down ( int cnt) {- int poly(8] =< 1,1, 1,10, 200, 10, 200,1); cnt—; if (cnt—0) 1 setcolor ( l_eras ) ; fιllpoly(4,poly) ; setcolor (1 draw); I return (cnt); void update_screen (int l_draw, int l_eras) ( setbkcolor ( l_eras ) ; setcolor! l_draw) ; setfillstylel 1, l_eras) ; cleardevice ( ) ; settext ustιfy(0, 2) ; outtextxy (220, 1, "Press <q> to quit, <F1> for list of o'.l. ?" I . outtextxy (265, 225, "x-pos: " ) ; /* text.xy_float (80, 445, tl/ns_to_m) ; ♦ / textxy_£loat (80, 225, tl/ns_to_m) ; settextjustifyf∑, 2) ; / textxy_float (80^512, 445, 2/ns_to_m) ; "/ textxy_f!oat (80+512, 225, t2/ns_to_m) ; settext3ustιfy(0,2) ; ~ void change_fliter dnt new, DSP21K "board) 1 if (new==l) ( dsp21k_dl_mt ( ooard, dsp21k_get_addr ( boarc , "_do f i l ter" ) , 1 ) ; setcolor ( l_eras ) ; outtextxy ( 400, 470, "HP- filte : of f" ) ; setcolor d_draw ) ; outtextxy(400, 470, "HP-filter: 10 ns"); ) if (new==2) ( dsp21k_dl_ιnt (board, dsp21k_get_addr (board, "_do filter"), 2); setcolor ( l_eras ) ; ~ ~ outtextxy(400, 70, "HP-filter: 10 ns"); setcolor (l_draw) ; outtextxy(400, 470, "HP-filter: 15 ns"); ) if (new—3) ( dsp21k_dl_ιnt ( board, αsp21k_get_addr (boarc, "_do filter" i , J ) ; setcolor (l_eras) ; ~ outtextxy(400, 470, "HP-filter: IS ns"); setcolor! l_draw) ; outtextxy(400, 470, "HP-filter: 20 ns"); 1 if (new<l) ( dsp21k_dl_ιnt (board, dsp21k_get_addr (boarc, "_dc_fliter" ) , 0). setcolor ( l_eras ) ; outtextxy! 400, 470, "HP-filter: 20 ns" I ; setcolor! l_draw) ; outte.xtxy(7θ0, 470, "HP-filter: off" ) ; ) ) void change_subtrac (int new, DSP21K "board) [ if (new— 1) i dsp21k_dl_ιnt (board, dsp21k_get_addr (board, "_subtract" ) , 1); setcolor ( l_eras ) ; outtextxy (200, 70, "subtraction: off"); setcolor (l_draw) ; outtextxy(200, 70, "subtraction: on") ; ) else ( dsp21k_dl_ιnt( board, dsp21k_get_addr (board, "_subtract" ) , 0); setcolor ( l_eras ) ; outtextxy(200, 470, "subtraction: on") ; setcolor! l_draw) ; outtextxy (200, 470, "subtraction: of f") ; void change_normal ( int new, DSP21K "board) [ if (new—1) ( dsp21k_dl_ιnt (boarc, dsp21 _get_addr (boa d, "_norn."), 1), setcolor ( l_eras ) ; outtextxy ( 1, 70, "normaliza ion . of f" ) , setcolor! l_αraw) ; outtextxy! 1,470, "normalization : on" ) ; dsp21k_ci_mt (boarc, dsp21k_get_addr (board, "_norm"', 0), setcolor ( l_eras ) ; outtextxy ( i, 70, "normalization : on" ) ; setcolor ( l_draw) ; outtextxy! 1,470, "normalization: of " ) ; void change_method( mt new, DSP21K "boarα) [ i f ( new— l ) ( dsp21k_dl_mt (boarα, αsp21k_get_addr (board, "_do_snank" ) , 0); setcolor ( l_eras ) ; outtextxyd, 455, "Method: Shank" ) ; setcolor (l_draw) ; outtextxyd, 455, "Method: Prony" ) ; ) else ( dsp21k_dl_ιnt (board, dsp21k_get_addr (boa d, "_do_shank") , 1); setcolor (l_eras) ; ~ outtextxyd, 455, "Method: Prony" ) ; setcolor ( l_draw) ; outtextxyd, 455, "Method: Shank") ; 1 change smoothednt new, DSP21K "board) I ~ if (new==l) I dsp21k_dl_mt (coard, dsρ21k_get_addr (boarα, "_ o_srrι::the" ) , 1); setcolor ( l_eras ) ; outtextxy (200, 55, "Smoothing: off") ; setcolor ( l_ raw) ; outtextxy(200, 455, "Smoothing: on" ) ; ) else ( dsp21k_dl_mt (boarα, dsp21k_get_addr (boarα, " do_smccthe" ) , 0); ,_ O 99/01 133 setcolor ( l_eras ) ; outtextx (200, 55, "Smoothing: on" ) ; setcolor (l_draw) ; outtextxy (200, 55, "Smoothing; off"); void erase_cursor (int x_l, int y_u, int cursor, float xpos) { setlinestyle ( 0, 0, 1); /* solid "/ setcolor (l_eras) ; /* black "/ settext3ustify(2, 2) ; textxy_float( 380, 225, xpos) ; moveto(x_l+cursor, y_u+200) ; lmeto(x_l+cursor, y_u) ; void erase_scale(ιnt x_l, int y_u, float y_min, float y_max, float gridy) ( float y; v setlinestyle(0,0,l) ; / 4 solid */ setcolor ( l_eras ) ; / 4 black 4 / settext3ustιfy (2, 2) ; textxy_float (κ_l-5, y_u, y_max); settext3usti yT2, 0) ; ~ ~ textxy_float (x_l-5, y_u+200, y_mιn); draw_grια(x_l, x_l+508, y_u, y_u+200, 6, y/ ridy) ; I* total routine for 2181, rotation of antenna. ■ * one waitstate. count on adcrx. no tx interrupts, unsigned data, synth setup. 4 Written by Peter Hazell, last modified 310398 by PH 4 / I* mod from rotll: 5 antennas, 20 measurements in a rotation */ .module/RAM/ABS=0 rotS; A ASSSSEEMMfBLE TIME CONSTANTS —- -const waιt_read = 1 . const IDMA= 0x3fe0 .const BDMA_BIAD= 0x3fel .const BDMA_SEAD= 0x3fe2 .const BDMA~BDMA Ctrl= 0x3fe3 . const BDMA~BWCOUNT= 0x3fe4 . const PFDATA= 0x3fe5 .const PFTYPE= 0x3fe6 .const SPORTl Autobuf= 0x3fef .const SPORTl RFSDIV= 0x3ff0 .const SP0RT1_SCLKDIV= 0x3ffl .const SPORTl Control Reg= 0x3ff2 .const SPORTO Autobuf= 0x3ff3 . const SPORT0 RFSDIV= 0x3ff4 .const SPORT0_ΞCLKDIV= 0x3ff5 .cons SPORT0 Control Reg= 0x3ff6, -const SPORT0 TX ChannelsO 0x3ff7 .const SPORT0 TX Channelsl 0x3ff8 .const SPORT0 RX ChannelsO 0x3ff9 -const SPORT0 RX Channelsl 0x3ffa .const TSCALE= 0x3ffb . const TC0UNT= 0x3ffc .const TPERI0D= 0x3ffd .const DM Wait Reg= 0x3ffe .const Syster._Control_Reg= 0x3fff . const MEAS=0xce; /* IO address of measured signal, ml:0xce, ιn2:0xae "/ .const REF=0x6e; /' IO aαdress of ref-signal '/ -const DATA19=0xdb; I * IO address of 19 bit data, clock, and strobe */ .const SYNTH=0xd7; I * IO address of synthesis switch 4 / .const ANT=0χ7b; I " IO address of antenna switch * I .const ATT IN=0x7d; .const ATT OUT=0χ77; -const GET_ANT=Ox0020; /* unmask SPORT0 Rx */ .const WAIT_SHARC=0x0080; /* unmask IRQLO */ . const READ=0x0200; I " unmask IRQ2 '/ /* DATA BUFFER DECLARATIONS "/ . var/pm/ram/circ Dcos ( 120) ; I* declare cosine buffer */ .var/pm/ram/circ Dsin [120 ) ; / ♦ declare sine buffer ♦ / - var/pm/ram/circ antenna [5] ; / ♦ array of antenna positions ♦ / . va r/ pm/ r am/ ci c words (240) ; / ♦ 19 bit words for low freqs, MSW and LSW ♦ / / ♦ and for high freqs, MSW and LSW ♦ / . va r/dm/ ram/ci e rx_buf_low( 80 ) ; / ♦ Rx buffer for low oscillator ♦ / . var/dm/ ram/circ rx_buf_hιgh [ 80] ; / ♦ Rx buffer for high oscillator ♦ / . var/dm/ ram/ ci c int_result ( 3) ; / ♦ results for interpolation ♦ / . var/dm/ ram control; / ♦ control word, overflow status ♦ / . var/dm/ am rx_done; / 4 set to one when 40 words have been read 4 . var/dm/ ram word_inιt_hι lo [ 2 ] . var/dm/ ram word_ιnι t_txrx [ 2 ] . var/dm/ ram word_ιnιt_tx ( 2 ] ; . var/dm/ ram word_mιt_rx ( 2 ] ; . var/dm/ ram ku; . var/dm/ ram got_new_ant; . var/αm/ ram dummy; ....... DATA BUFFER INITIALIZATIONS — .init Dcos: <dcos90. txt> , <dcos! 10. txt>, <dcosl00. txt>: .init Dsin: <dsm90. txt>, <dsml l0. txt>, <dsinl00. txt>; -init words: <words . txt>; .init antenna: 0x000100, 0x000200, 0x000300, 0x000400, 0x000500; .init control: 0x1234; .init word_ιnιt_hιlo: 0x1006, 0x6000; -init word_ιnιt_txrx: 0x1064, 0x2000; . init wόrd_ιnιt_tx: 0x3a86, 0x0000; .init word_ιnιt_rx: 0x3a86, 0x4000; -init ku: 20; INTERRUPT VECTOR TABLE Each interrupt vector has 4 PM memory locations. Wnen an interrupt occurs the DSP will ump to the location of the interrupt vect r providing the interrupt is unmasked. "/ ump start; / 4 address = O.xOO: reset interrupt vector */ rti; rti; rti; ump adcrx; / " address = 0x04: IRQ2 interrupt vector */ rti; rti; rti; rti; /* address = 0x08: IRQL1 interrupt vector *7 3ump letsgo; / 4 address = 0x0c: IRQLO interrupt vector '/ rti; rti; rti; rti; rti; rti; rti; /- address = 0x10. SPORTO tx interrupt vector "/ / ♦ adαress = 0x14. SPORTO rκ interrupt vector */ rti; rti; rti; rti; rti; rti; rti; / ♦ address = 0x18: IRQE interrupt vector. Interrupt vector used by the interrupt switch on the board -/ rti; rti; rti; rti; / 4 address = Oxlc: BDMA interrupt vector ♦ / rti; rti; rti; rti, / ♦ adαress = 0x20: SPORTl tx or IRQ1 interrupt vect, -/ rti; rti; rti; rti; / ♦ address = 0 24 : SPORTl rx or IRQO interrupt vect. rti; rti; rti; rti; / ♦ aαdress = 0x28: timer interrupt vector "/ rti; rti; rti; rti; /" acdress = 0κ2c: power down interrupt vector ♦ / Data Address Generator Initialization start: ιmask=0; /"DM 4 / lO = "rx_buf_low; I* set lO = start adddress of r^._buf"/ 10 = %rx_buf_low; /* set 10 = length of rx_buf */ il = "word init hilo; 11 = 0; ι2 = "rx_buf_low; /* set ι2 = start adddress of rx_buf "/ 12 = %rx_buf_low; / • set 12 = length of rx buf */ ι3 = "int result; 13 - %ιnt result; mO - 0 ml - 1 / ♦ modify registers for dm ♦ / m2 = 2 / ♦ PM 4 / 14 = "Dcos; / ♦ set 14 = start address of Dcos ♦ / 14 = %Dcos; / ♦ set 14 = length of Dcos ♦ / ι5 = "Dsin; / ♦ set ι5 = start address of Dsin ♦ / 15 = ΪDsin; / ♦ set 15 = length of Dsin ♦ / i6 = "words; / ♦ set ι6 = address of words ♦ / 16 » twords; / ♦ set 16 = length of words ♦ / ι7 = "antenna; / ♦ set ι7 = address of antenna ♦ / 17 = %antenna; / ♦ set 17 = length of antenna ♦ / m4 = 0; / ♦ modify registers for pm ♦ / m5 - 1; S E R I A L P O T S T U F F axO = 0χ7b03; / ♦ set PF0, ?F1 to output "/ dm( PFTYPE)=ax0; /* PF0, PF1 for codec disable */ ax0»0x0002; dm( PFDATA) =ax0; / ♦ disable Z0DEC, enable normal SPORTO "/ axO =0x0006; /* ≤CL = OUT / ( 2 (SCLKDIV + 1 ) "/ dm (SPORTO_SCLKDIV) - axO; / ♦ using internal serial clock ( SCLK-input ) ♦ / axO - OxβaOf; / ♦ 0110 1010 0000 1111 ♦ / dm (SPORTO_Control_Reg ) = axO; / ♦ SLEN- 16 bits, right 3ustιfy, zero-fill unused MSBs, INVRFS-0, INVTFS=0, IRFS-0, ITFS-1, ISCLK-1, MCE=0 ♦ / / ♦ S Y S T E M A N D M E M O R Y S T U F F -*/ i c Oxff ; / ♦ clear pending interrupt, all ♦ / nop; mstat = 0x40; / ♦ enable 30 mode ♦ / axO - 0x0001 ; dm ( DM_Waιt_Reg ) = axO; / 4 one wait state for IO *7 axO = 0x1000; /* PWAIT = 0, enable SPORTO */ dm (System_Control_Reg) axO; ιcntl=b«00100; /* disable nestinα, IRQ2 edge sensitive ιmask=0, se=0x01, /* shift re = +1 */ myl=0xc000; /" -0 5 - : ' :r calculation of mean -/ axO=0; /* send out all zeics -/ IO(DATA19)=axO; ιl="worα_ιnιt_hιlo; ar=32; call ιl9bιt; ar=setbιt 2 of axO; call waιt2; IO(DATA19)=ar; ar-0; call waιt2; IO(DATA19l=ar; ιl="word_ιnιt_hιlo; ar=16; call ιl9bιt; ar=»setbιt 2 of axO; call waιt2; IO(DATA19)=ar; ar=0; call waιt2; IO(DATA19)=ar; ιl="word_mιt_txrx; ar»8; call ilθbit; ar-setbit 2 of axO; call waιt2; IO(DATA19)=ar; ar»0; call waιt2; IO(DATA19)=ar; ιl="word_ιnιt_txrx; ar-64; call ιl9bιt; ar=setbιt 2 of axO; call waιt2; IO(DATA19)=ar; ar-O; call waιt2; IO(DATA19)=ar; ιl-"worα_ιnιt_tx; ar»8; call ιl9bit; ar»setbιt 2 of axO; call waιt2; IO(DATA19)=ar; ar-0; call waιt2; IO(DATA19)-ar; ιl-"word_ιnιt_rx; ar-64; call l9bιt; ar-setbit 2 of axO; call waιt2; IO(DATA19)=ar; ar=0; call waιt2; IO(DATA19)=ar; ax 0=700; call waitmicro; — M A I N P R O G R A M DO ιt_all UNTIL forever; axl=0xl234; dmlcontrol )=axl; /* reset control word */ ιmask=WAIT_SHARC; ldle; /- IRQLυ interrupt */ ιmask=GET ANT; ar=32; CALL sl9bιt; ar=setbιt 2 of axO; call waιt2; IO(DATA19)=ar; ar=0; call waιt2; IO(DATA19)=ar; axO-1; IO(SYNTH )=ax0; /* sui ten to LO */ cntr=1513; DO mitl UNTIL ce; /* '.>2it aporo:. 46 microsecs */ mitl: nop; ar»16; CALL sl9bιt; ar=setbιt 2 of axO; call waιt2; IO(DATA19)-ar; ar»0; call waιt2; IO(DATA19)-ar; cntr-183; DO inιt2 UNTIL ce; / ♦ wait approx 6 microsecs ♦ / mιt2: nop; /" cntr-dm(ku) ; ♦ / cntr-20; DO loopku UNTIL ce; ax0-pm(ι7,m5) ; IO(ANT)-axO; axO=l;V ax0=10; call waitmicro; ax0-0; dm( x_done) =ax0; /" reset rx done */ ifc-OxOOff; /- clear all pending interrupts */ axl—39; /" set R.x count */ ι2="rx buf low; imask-READ; /* unmask IRQ2 */ readini: idle; /* wait for next read "/ ayl=dm(rx done); ar=pass ayl; . if gt ump inidone; / ♦ are we done reading jump readini; inidooe: imask-O; cntr»60; DO loop60 UNTIL ce; axO-O; IO(SYNTH )=axO; / ♦ switch to HI */ ar-32; CALL sl9bιt; ar=setbιt 2 of axO; call waιt2; IO(DATA19)=ar; ar-0; call waιt2; IO(DATA19)-ar; /* perform detection on meas LO -/ iO="rx_buf_low; /" point to meas, LO CALL calc_cos; CALL calc cos; axC=0; dm( r.x_done) =ax0; /* reset r:-._αone */ ιfc=0x00ff; /* clear ill pending interrupts */ aκi=-39; / • set Rx count "/ i2=~rx_buf_hιgh; /" read i-.to HI buffer -/ ιmas =READ; /" unmas>: :RQ */ /- continue detection on meas LO */ CAL1 calc_cos; CALL tneas_real_lo 4 / CALL calc_sιn; CALL c≤lc_sm; CALL ca . ' c_- :r.; / ♦ continue detection • / CALL mean; /* calc ar z ?:■: ιneas_ιnιag_lo *l readhign: icle; /" wait for next read "/ ayl=cm( rx_done ) ; ar=pass ayl; if t 3ump highdone; / " are we cone reading ? "/ 3ump readhigh; highdone: imask-O; axO-i ; IO( SYNTH ) =axO; /* switch to LO "/ ar-lc; CALL sl9bit; ar-setbit 2 of axO; call wait2; IO ( DATA19 ) =ar; ar-0; call aιt2; IO ( CATA19 ) =ar; / " pe rform detection on meas HI •/ ιO=" r:-:_buf_hιgh; /" point t: -eas , HI " / CALL -alc_cos ; CALL talc cos; aκC= " ; dm( r:-:_done)=axO; /* reset rx_done ♦ / ifc=Cκ00ff; /* clear all pending interrupts */ aκi— 9; /* set Rx count */ i2='r>: buf low; imask-READ; I* unmask IRQ2 */ /* continue detection on meas HI */ CALL calc_cos; CALL mean; /* calc and Tx meas_real_hι */ CALL calc_sin; CALL calc_sin; CALL calc_sιn; CALL mean; I* calc and Tx meas imag hi */ / ■ * perform detection on ref HI / ιO»"rx_buf_hιgh+l; I* point to ref, HI 4 / CALL calc_cos; CALL calc_cos; CALL calc__cos; / 4 perform detection 4 / CALL mean; /* calc and Tx ref_real_hi 4 / CALL calc sin; CALL calc sin; CALL calc sin; CALL mean; I* calc and Tx ref_ιmag_hι / readlow: idle; I* wait for next read * I ayl-dm( rx_done ) ; ar=pass ayl; if gt 3ump lowdone; I ' " are we done reading ? *V 3ump readlow; lowdone : ιmask=0; loopβO: nop; loop u: nop. cntr=100, do waιt_tx until ce; I * wait for last Tx to finish * / wait tx: ΠOD; ax0=dm( control ) , tx0=ax0; I * send control word -/ cntr=100, do waιt_tx2 until ce; I * wait for last Tv to fim≤n " / wait tx2- nop; ιmask=0; / 4 Don't bother with last reads '/ ι6="words; ιt_all: ι2="rx_buf_low; I " reset pointers to original oosition */ / 4 disable CODEC, enable normal SFORT0 */ S U B R O U T I N E S /* subroutine sl9bιt shifts out 19 bits to lower oscillator */ sl9bιt: call waιt22; IO(DATA19)-ar; sι-pm(ι6,m5) ; / 4 load with first 16 bits * sr-lshift si (LO); /* do first shift */ sι-pm(ι6,m5) ; /* load with last 3 bits 4 / cntr-16; DO sl6_out UNTIL ce; af-pass srl; / goto 0 or 1 ace to next bit 4 / if ne 3ump sonelδ; ar=clrbιt 0 of ar; nop; IO(DATA19)=ar; I* output bit, clk=0 * / ar=setbιt 1 of ar; call waιt22; IO(DATA19)=ar; I * output same bit, clk=l * I 3ump finslβ; sonelβ: ar=setbιt 0 of ar; nop; I0(DATA19)=ar; / * output bit, ci =0 / ar=setbιt 1 of ar; call waιt22; IO(DATA19)=ar; I* output same bit, clk-1 ♦ / finslβ: sr=lshift srO (LO); sl6 out: ar=clrbιt 1 of ar; / 4 shift to next bit V sr-lshift si (LO); / 4 do first shift on last 3 */ cntr-3; 00 s3_out UNTIL ce; af-pass srl; / ■ " goto 0 or 1 ace to next bit */ if ne jump sone3; ar-clrbit 0 of ar; nop; IO(DATA19)=ar; / 4 output Pit, clk=0 4 / ar-setbit 1 of ar; call waιt22; IO(DATA19)=ar; / 4 output same bit, clk=l " I 3ump fιns3; sone3: ar=setbιt 0 of ar; nop; I0(DATA19)=ar; I* output cl)-=ύ ar-setbit 1 of ar; call waιt22; I0(DATA19)=ar; /* output sane on, clk=l fιns3: sr=lshιft srO (LO); s3_out: ar=clrbιt 1 of ar; I* shift to next bit */ nop; I0(DATA19)=ar, ax0=ar; /* subroutine ιl9bιt shifts out 19 bits to higher oscillat;: -/ ιl9bιt: call waιt22; IO(DATA19)=ar; sι=dm(ιl,ml ) ; /* load wi-- fust 16 bits -/ sr=lshιft si (LO); /- co first shirt * I sι=dm( ιl,ml ) ; I " loaα «:-- >as 3 bits - I cntr=16; DO il6_o.it UNTIL ce; af=pass srl; i c:t: rr 1 ace _o next bit • / if ne ump ιonel6, ar=clrbιt 0 of ar; nop; IO(DATA19)=ar; I " DUtOUt c-."., cι l- =0 * i ar=setbιt 1 of ar; call waιt22; IO(DATA19)=ar; / * output c=-e cit, clk=l - / }ump finilβ; lonelδ: ar-setbit 0 of ar; nop; IO(DATA19)-ar; / * output c.t, clk=0 4 / ar-setbit 1 of ar; call waιt22; IO(DATA19)-ar; I* output SΞT3 bit, clk-1 */ finilδ: sr-lshift srO (LO); ilδ out: ar-clrbit 1 of ar; I * shift to next bit *7 sr-lshift si (LO); / ♦ do first sii ft on last 3 *l cntr-3; DO ι3_out UNTIL ce; af=pass srl; / 4 get: or 1 ace to next bit */ if ne 3ump ιone3; ar=cirbιt 0 of ar; nop; IO(DATA19)=ar; I * output t- , cik=0 */ ar=setbιt 1 of ar; call waιt22; I0(DATA19)=ar; OJt Ut S3 clk-1 •/ 3ump fmι3; lone3: ar=setbιt 0 of ar; nop; IO(3ATA19)-ar; output -0 ♦ / ar=setbιt 1 of ar; call waιt22; I0(DATA19)-ar; / * output sr; o.t, clk=l */ fini3: sr-lshift srO (LO); ι3_out: ar-clrbit 1 of ar; I* shift to next bit */ nop; IO(DATA19)-ar; axO-ar; rts; / subroutine calc. Detection on 40 elements of rx_buf_xxxx */ calc_cos:CNTR-39; I* loop counter 4 / mr-0; /* initialize mult/acc V mx0-dm(ι0,m2) , my0=pm( I4 , mS ) ; / 4 get 1st multiply-pair 4 / DO c_cos UNTIL CE; c_cos: mr-mr+mx0*my0 (US), mx0-dm( i0,m2) , my0=pm( 1 ,m5) ; mr-mr+mx0 4 my0 (US); sr-lshift mrl by -2 (LO); sr-sr or lshift mr2 by 14 (LO); dm(i3,ml)=sr0; / 4 fill result */ af=tstbιt 2 of mr2; if ne 3ump cos_one; af=tstbιt 1 of mr2; if ne jump o_flow; rts; cos_one:af=tstbιt 1 of mr2; if eq ump o_flow; rts; calc_sιn:CNTR=39; mr-0; mxO=dm(ιO,m2) , my0-pm( ι5,m5) ; / • initialize mult/3cc, point to dsm */ DO c_sιn UNTIL CE; c_sιn: mr-mr+mx0 4 myO (US), mx0=dm( lO, m2) , myύ<-pm( ιs,m5) ; mr=mr+mx0 4 myO (US); sr»lshιft mrl by -2 (LO); sr-sr or lshift mr2 by 14 (LO); dm(i3,ml)=sr0; I * fill lesult ♦/ af=tstbιt 2 of mrC; lf ne jump sιn_one; af-tstbit 1 of~mr2; if ne 3ump o_flow; rts; sιn_one:af=tstbιt 1 of mr2; if eq 3ump o_flow; rts; mean: mr-0; mx0-dm(ι3,ml) ; mr-mx0 myl (SS), mx0=dm( ι3,ml ) ; / 4 -0.5 4 det3 */ mr-mr+mx0 myl (SS), mxO-dm( I3, ml ) ; /* -0.5 4 det3-0.5 4 det5 4 / rar-mr-mxO*my1 (SS) ; /* -0.5(det3+det5) + 0.5 4 det4 */ rar-mr-mxO*myl {SS ) ; /* -0.5(det3+det5) + det4 */ txO-mrl; rts; o_ low: ax0=0x4321; dm(control ) =ax0; rts; waιt2: nop; rts; waιt22: nop; nop; nop; nop; nop; nop; nop; rts; waitmicro: cntr-axO; do waitm until ce; cntr-33; do wait m until wai mm: nop; a tm: nop; rts; /*- I N T E R R U P T S E R V I C E R O U T I N E S letsgo: rti; adcrx: ar-IO(MEAS); / 4 read meas */ ar-clrbit 14 of ar; I* bit 14 is D.C. 4 / dra(i2,ml)-ar; / 4 store in rx_buf */ ar-tstbit IS of ar; / ■ * test for ADC out of range * I if gt u p adc_of; I* if ADC is out of range modify control word '/ ar-IO(REF); I- read ref * I ar-clrbit 14 of ar; /* b t 14 is D.C. 4 / dm(ι2,ml)=ar; / 4 store in rx_buf */ ar=tstbιt 15 of ar; I* test for ADC out of range "4 / if gt ump adc_of; / if ADC is out of range modify control word * I ar=axl+l; I" increase Rx counter *l if gt 3ump rxdone; /" 40 measurements completed * / axl=ar; rti; adc_of: ayl=0x9876; I- ADC was out of range "/ dm(control )=ayl ; ar=axl+l; I" increase Rx counter * ι if gt 3ump rxdone; I* 40 measurements completed * / axl-ar; rti; rxdone: ayl»l; dm( rx_done ) -ayl; notify main program that Rx is complete * ■ / rti; sp0_rx: axl-rxO; I* get word dm(ku)=axl; . endmod; Def 4.h # define pi 3.141592653589793115997963468544185161590576171875 # define DF 6400000 # define piOOl pi*DF*2*le-9 # define NO_A TENNAS 5 # define NO_ROT 4 # define ma 12 /* model order of denominator */ # define mb 12 /* model order of numerator */ # define np 128 /* number of points in frequency response *7 # define tl 1 0 /* time start in ns "I # define t2 45 0 /* time stop in ns *7 # define ku 20 # define Ns 120 /* number of frequencies per antenna position " 7 # define RAWDATA 4*Ns*ku+l /* complex siganl and reference, one control word */ # define p2 NO_ROT # define p8 ku-NO_ROT # define ns_to_m 1 0 # define Nr 120 /* Nr = nf2-nfl + 1 "7 # define STARTPOINT 0 # define SUBMEANS_RE "c:\\dsp21k\\bcclib\\sub_mean re" # define SUBMEANS_IM "c Wdsp21 k\\bcclib\\sub_mean im" # define MEAS DELAY 0 Table 1. Receiver circuit. Description: The receiver circuit is divided into 5 separate printed circuit boards: * Board a: LO frequency mixing. * Board b: LO signal distribution. * Board c: Receiver reference channel down conversion. * Board d Receiver test channel down conversion. note: 2 pcs, one for each test channel 10 The input signals are (See receiver block diagram in figure 23): * B 1 , B2: Receiver inputs (test channels). * C: Receiver reference input. * E: 1600-2500 MHz signal from synthesizer. 15 * G: 1510.1 MHz signal from synthesizer. The output signals are: * H: 100 kHz IF-signal, reference channel. * II, 12: 100 kHz IF-signal, test channels. 20. The 5 boards are mounted in a metal box with 5 separate rooms. High frequency signals are routed between boards by use of coaxial cables with SMA connectors. Power supplies and low-frequency control signals are decoupled at the walls between the rooms. Power supplies are stabilized by use of ordinary voltage stabilizers. 25 Circuit diagrams. Circuit diagrams for the 4 different boards are shown in figures 24, 25, 26 and 27 respectively. Part list, board a: 30 RA5 ERA-2 (Mini Circuits) RM4 RMS-25MH (Mini Circuits) RF7 Microstrip band-stop filter, 1510 MHz with 2 (edge coupled) resonators (Board material: Rogers RO4003). RF8 1000 MHz "low-pass" filter, implemented as a 5-resonator microstrip band-stop filter (Board material: Rogers RO4003). L a. 33 nH L a2 Permax 51 C al =C a2 =C a3, 33 pF C a4 InF R a, 110 ohm R a,2 75 ohm a3 330 ohm R a.4 16 ohm R a5< 330 ohm Part list, board b: RA6 = RA7 = RA8 ERA-1 (Mini Circuits) RA9 = RA10 INA-10386 (Hewlett-Packard) RD1 LRPS-2-4 (Mini Circuits) L bl = L b3 = L b5 = L b7 = L b8 470 nH L. b ,2 - L. b4. = L, b6 , = L, b9 _ = L, b ,lO. Permax 51 C bl = C b2 = C b3 = C b4 = C b 5 = C b6 =C b7 =C b8 =C b9 =C M bl n O 150 p r F R bi =R ™ 100 ohm R b2 = R b9 33 ohm ^δ^lO ^ll 130 ohm ^ " ^S 150 ohm R M 36 ohm R bi4 = R bi5 = R bi 6 5 1 ohm Part list, board c: RM3 TUF-2LHSM (Mini Circuits) RF5 1000 MHz "low-pass" filter, implemented as a 5-resonator microstrip band-stop filter (Board material: Rogers RO4003). L c,l 22 nH L 330 nH C cl, 8.2 p r F C c2 = C c3 470 pF R cl = R c ,2 47 ohm Part list, board d (each of 2 boards): RA1 MGA-82563 (Hewlett-Packard) RA3 IN A- 10386 (Hewlett-Packard) RM1 TUF-2LHSM (Mini Circuits) RSI - RS3 SW-339 (M/A-COM) RF1 1000 MHz "low-pass" filter, implemented as a 5-resonator microstrip band-stop filter (Board material: Rogers RO4003). L„ d,l = L d .3, 470 nH L d2 = L d4 Permax 51 L α „5 22 nH L H d ή o 330 nH C dl = C d2 = d3 = C d4 = C d 5 = C d7 15 ° F C d6 = C d8 l nF C d]7 8.2 P F C (118 =C <119 470 pF R dl = R d2 = R d5 = R d6 100 ohm R d3 100 ohm R d4 33 ohm R d7 = R d8 47 ohm Table 2. Transmitter The transmitter circuit diagram is in figure 28. Input signals: F (see RTVA block diagram): 1500 MHz signal from Synthesizer/reference D (see RTVA block diagram): 1600 -2500 MHz from Synthesizer Output signals: A (see RTVA block diagram): Transmitter output to antenna swich C /REF (see RTVA block diagram): Ateenuated output to REF channel in receiver unit. Parts list: U4A: Microstrip band-stop filter, 1510 MHz with 2 (edge coupled) resonators (Board material: Rogers RO4003). U9A 1000 MHz "low-pass" filter, implemented as a 5-resonator microstrip band-stop filter (Board material: Rogers RO4003). U5A ERA-2 (Mini Circuits) U8A, U11A ERA-5 (Mini Circuits) U3 RMS-25H mixer (Mini Circuits) U20 Step Attenuator Digital controlled (MA-COM AT230) C2,C3,C4,C6,C8,C9,C10, C11,C13,C14,C15,C16,C17,C18: 150 pF SMD capacitor 603 footprint C22 not mounted C12: 180 pF SMD capacitor 805 footprint Rl 91 ohm R2 27 ohm R3 100 ohm R4 27 ohm R5 36 ohm R6 560 ohm R8 150 ohm R9 51 ohm R10 56 ohm Rl l 51 ohm R12 56 ohm R13 2.2 ohm R14 R15 680 ohm R16 330 ohm R17 56 ohm R18,R19 not mounted R23-R28 680 ohm R81 8.2 ohm R61 8.2 ohm R20 4.7 Kohm x 8 resistor network SMD L2, L6,L5 470 nF inductor SMD 805 footprint LCF1, LCF2, LCF3: L/C Pi-section trough coupler (TUSONIX 4101- 008) Table 3. Synthesizer Parts list on the following two pages Circuit diagram in figures 29 to 34. Table 4. Detector DSP-1 The detector consists of 3 boards. One ADDS-21XX-EZLITE Evaluation Board from Analog Devices Inc. This board incorporates the fixed-point DSP Processor ADSP2181 as well as clock generator and other support circuits. For description and circuit diagrams refer to the published material from Analog Devices Inc. regarding the ADDS-21XX-EZLITE Evaluation Board. Two boards comprising of Analog-to-Digital converters and digital logic input/output lines for controlling the synthesizer and the antenna switches plus some auxiliary circuits. The digital control lines for the Antenna Switch Decoder/Level Shifter and the synthesizer are all standard TTL level. Circuit diagram for these two boards are the same and shown in figures 35a), 35b) and 36. NOTE: The lines designated AQO ...AQ13, which are the output signals from the Analog to Digital converter should be reversed in order in figures 35a) and 35b). List of components on the following pages The analog input signals are the IF-outputs from the receiver unit. Refer to RTVA block diagram in figure 22. The IF signals of 100 KHz are the REF channel and one test channel. Software listings for the ADSP2181 DSP processor is included. The processor performs a quadrature detection, and the resulting stream of digital data is fed to the ADSP-2106x EZ-LAB Evaluation Board via a serial interface. Table 5. Antenna switch. Circuit diagram in figure 37. 2 pcs of this board are used, one for the transmitting antennas and one for the receiving. The board is constructed using a microstrip technique on a board material material: Rogers RO4003. Control inputs: swaO/swbO ... swa6/swb6 are +/- 5V signals generated by the Antenna Switch Controller/Level Shifter. RF signal ports ANT-1 .. ANT-6 are connected to antenna elements RF signal port Rx or TX is connected to the transmitter output or the receiver input. RF connectors are all SMA female chassis mounted. Parts list: R1, R2, R3, R4, R11, R12 51 W R5, R6, R7, R8, R9, RIO 10 KW C1, C2, C3 lO nF LCFEED 4101-008 (Tusonix). Pi-section, capacitance 5,5 nF SW1, SW2, SW3, SW4, SW5, SW6, SW7, SW8, SW9, SW10, SW11, SW12 SW-338 (Macom) Table 6. Antenna Switch Decoder/Level shifter Circuit Diagram: figure 38 2 pcs of this unit is used. Input signals:Terminals no 1,2,3 and 4 on connector JP3, only 1,2 an3 are used. These TTL level control signals are generated by the Detector/DSP- 1 unit. Output signals : Only the +/- 5V signals SWAO/SWBO ... SWA6/SWB6 are used. These lines are connected to the Antenna Switch units. This board converts standard TTL logic signals to +/- 5V signals. Encoding of the signals is performed by the logic pattern stored in the EPROM U5. The pattern is trivial in the sense that for the fist six of the 16 possible logic state combinations of the inputs AX0..AX3, the SWAO/SWBO ... SWA6/SWB6 are put at a voltage level, that in effect selects one out of the six RF ports on the antenna switch controlled by this unit. The logic pattern stored in the EPROM U5 is thus deductable from the included diagrams. Table 7. Serial Interface The serial interface is constructed in accordance with the guidelines given in the ADSP- 2100 family Users Manual under Hardware Examples, published by Analog Devices Inc. Standard differential RS-485 signaling is used. Circuit diagrams in figures 42, 43 and 44 Parts lists: EZLITE, (Fig. 44) R1, R2, R3 1 kohm C1, C2, C5 100 nF C3, C4 100 mF Dl 1N4001 Ul DS96174 U2 DS96175 U3 LM78L05 Table 8. Dipole Antenna Element Circuit diagram in figure 39 8 or 10 pcs of this unit is used, corresponding to 4 or 5 antenna pairs. Printed circuit layout is shown in figures 40 and 41. Parts list: R1,R2,R3,R4 22 ohm R5,R6,R7,R8,R9,R10 33 ohm R11,R12,R13,R14, R15,R16,R17,R18 47 ohm R19,R20,R21, R22,R23,R24 220 ohm TR1 ETC4-1T-7 (Macom) P 1 SMA j ack for pcb mounting. Table 9. View of some possible antenna configurations. /pe comment S-param, Fig: 3a 3b 1 co-linear S 21 Fig: 3c 3d 1 parallel S 21 Fig: 4a 4b 2 symmetrical S 21 Fig: 4c 4d 2 symmetrical S 21 Fig: 5a 5b 1 coincident Si i 1 Table 10. Examples of number of rotations of the antenna system. ΔΘ is angle of rotation between each measurement, N is number of measurements. N^ 8 16 32 64 128 ΔΘ = 22,5° I l / 2 1 2 4 8 Δθ = 45° I 1 2 4 8 16 Table 11. Examples of k-indexes corresponding to 2 periods per rotation, k-values stated in pairs (k^Jt.^), ΔΘ is the angle of rotation between each measurement, N is number of measurements. N = 16 32 64 128 Δθ = 22,5° I (2,14) (4,28) (8,56) (16,112) (k2> k -2) ΔΘ = 45° I (4,129 (8,249 (16,48) (32,96) (k 2 ) Table 12. view of objects seen in the examples 1 to 5.

Claims: PATENT CLAIMS 1. Plant for generation of information indicative of the depth and the orientation of an object positioned below the surface of the ground which plant is adapted to use elec- tromagnetic radiation emitted from and received by an antenna system associated with the plant and having a transmitter and a receiver for generation of the electromagnetic radiation in cooperation with the antenna system and for reception of an electromagnetic radiation reflected from the object in cooperation with the antenna system, respectively, characterized in that the antenna system comprises a plurality of individual antenna elements having sub- stantially linear polarization, especially dipole antennas, which are positioned in relation to the geometrical center of the antenna system with each of the centers of the antenna elements displaced in relation to the geometrical center of the antenna system and that the plant has means for rotation, either mechanically or electrically, of the antenna system and thus polarization of the electromagnetic field around or in relation to the geometric center of the antenna system. 2. Plant according to claim 1 , characterized in that the individual antenna elements of the antenna system, especially dipole antennas, are positioned radially relative to the geometric center of the antenna system. 3. Plant according to claim 1 or 2, characterized in that the individual antenna elements of the antenna system form polygonal structures symmetrically or alternatively asymmetrically around the geometric center of the antenna system. 4. Plant according to any of the claims 1 -3, characterized in that the individual antenna elements, especially dipole antennas, form orthogonally oriented, alternatively in parallel oriented, sets of transmitter and receiver antennas. 5. Plant according to any of the claims 1-4, characterized in that the transmitter and receiver antennas of the antenna system are co-polar or alternatively cross-polar. 6. Plant according to any of the claims 1-5, characterized in that the means for providing rotation of the antenna system are arranged to provide the rotation of the antenna system mechanically or electrically and thus provide polarization of the electromagnetic field around the geometric center in angular increments, typically in the order of 22.5°, 30°, 36° or divisions of or multiples of such angles. 7. Plant according to any of the claims 1-6, characterized in that the transmitter and the receiver of the plant are arranged to perform generation and reception, respectively, of electromagnetic radiation at several individual frequencies, typically within the range 100MHz to 1GHz in steps of 5MHz. 8. Plant according to any of the claims 1-7, characterized in that the plant comprises signal processing means for measuring a transfer function, for example a voltage transfer function, a current transfer function or combinations thereof or a power transfer function between signals between the emitted and the received radiation. 9. Plant according to any of the claims 1-8, characterized in that the signal processing means are arranged for measuring the transfer function for associated values of angular rotation and frequency. 10. Plant according to claim 9, characterized in that the signal processing means are arranged to perform a transformation from frequency to time by Fourier transformation or by using a mathematical exponential model with corresponding rational transfer function on the transfer function associated with that angle, for generation of a time dependent function continuous in time for each angle, calculated at a predetermined number of discrete times using identical calculation times for all the angles. 11. Plant according to claim 10, characterized in that the signal processing means are adapted to perform a signal analysis by Fourier transformation for each of the times in the time dependent function continuous in time associated with each angle, with the time as a constant and the angle as independent variable, for generation of a representation in the angle domain. 12. Plant according to claim 9, characterized in that the signal processing means are adapted to perform a signal analysis by Fourier transformation for each frequency ha- ving the frequency as a constant and the angle as an independent variable, for generation of a set of numbers having the angle harmonic and the measuring frequency as independent variables. 13. Plant according to claim 12, characterized in that the signal processing means furthermore are adapted to perform a transformation from frequency to time by Fourier transformation or by applying a mathematical exponential model with corresponding rational transfer function deriving for each angle harmonic a time dependent, in time continuous function at a predetermined number of discrete times, using identical calculation times for every angle harmonic, generating a set of numbers corresponding to a mathematical function having the angle harmonic in discrete form and the time in discrete form as independent variables. 14. Plant according to any of the claims 11-13, characterized in that the signal processing means furthermore are adapted to perform a scanning for local and global maxima indicating angle periodical reflections from objects, in the representation in the angle domain, and where the peak value indicates the time delays of associated reflections from an object. 15. Plant according to any of the claims 10-14, characterized in that the signal processing means furthermore are adapted to perform a calculation of angle position relative to the antenna system for the angle periodical reflections. 16. Plant according to any of the claims 10-15, characterized in that the plant comprises signal processing means for utilizing, during horizontal movement above the ground, collocated measurements for the suppression of clutter. 17. Method for generation of information indicative of the depth and the orientation of an object positioned below the surface of the ground which method comprises the use of electromagnetic radiation emitted from and received by an antenna system by means of a transmitter and a receiver for the generation of the electromagnetic radiation in cooperation with the antenna system and for reception of an electromagnetic radiation reflected from the object in cooperation with the antenna system, respectively, characterized in that for trans- mission and reception of the electromagnetic radiation a plurality of individual antenna elements is used having substantially linear polarization, especially dipole antennas, which are positioned in relation to the geometrical center of the antenna system with each of the centers of the antenna elements displaced in relation to the geometrical center of the antenna system and that the antenna system is rotated, either mechanically or electrically, around or in relation to the geometric center of the antenna system. 18. Method according to claim 17, characterized in that for transmission and reception of the electromagnetic radiation said antenna system is used having the individual antenna elements, especially the dipole antenna, positioned radially from the geometric center of the antenna system. 19. Method according to claim 17 or 18, characterized in that for transmission and reception of the electromagnetic radiation said antenna system is used having the individual antenna elements, especially the dipole antenna, forming polygonal structures positioned symmetrically or alternatively asymmetrically around the geometric center of the antenna system. 20. Method according to any of the claims 17-19, characterized in that for trans- mission and reception of the electromagnetic radiation the individual antenna elements of said antenna system mentioned are used, especially the dipole antennas, forming orthogonally oriented, alternatively in parallel oriented sets of transmitter and receiver. 21. Method according to any of the claims 17-20, characterized in that for trans- mission and reception of the electromagnetic radiation transmitter and receiver antennas are used, which are co-polar or alternatively cross-polar. 22. Method according to any of the claims 17-21, characterized in that the rotation of the antenna system is produced by rotating, mechanically or electrically, the antenna sy- stem and thus achieving polarization of the electromagnetic field around the geometric center in angular increments, typically in the order of 22.5°, 30°, 36° or divisions of or multiples of such angles. 23. Method according to any of the claims 17-22, characterized in that the generation and the reception of electromagnetic radiation are performed at several individual frequencies, typically within the range 100MHz to 1GHz in steps of 5MHz. 24. Method according to any of the claims 17-23, characterized in that, in said method, signal processing is performed for measurement of a transfer function, for example a voltage transfer function, a current transfer function or combinations thereof or a power transfer function between signals between the emitted and the received radiation. 25. Method according to any of the claims 17-24, characterized in that, in said signal processing, a measurement of the transfer function for associated values of angular change and frequency is performed. 26. Method according to claim 25, characterized in that, in said signal processing, a transformation from frequency to time is performed by Fourier transformation or by the use of a mathematical exponential model with corresponding rational transfer function of said transfer function associated with that angle, for generation of a time dependent function, continuous in time for each angle, calculated at a predetermined number of discrete times using identical calculation times for all the angles. 27. Method according to claim 26, characterized in that, in said signal processing, a signal analysis by Fourier transformation for each of said times is performed on said time dependent function, continuous in time and associated with each angle, with the time as a constant and the angle as independent variable, for the generation of a representation in the angle domain. 28. Method according to claim 25, characterized in that, in said signal processing, a signal analysis by Fourier transformation for each of the frequencies is performed with the frequency as a constant and the angle as independent variable, for generation of a set of numbers having the angle harmonic and the measuring frequency as independent variables. 29. Method according to claim 28, characterized in that, in said signal processing, a transformation from frequency to time is furthermore performed by Fourier transformation or by the use of a mathematical exponential model with corresponding rational transfer function deriving for each angle harmonic a time dependent, in time continuous function at a predetermined number of discrete times, using identical calculation times for every angle harmonic, generating a set of numbers corresponding to a mathematical function having the angle harmonic in discrete form and the time in discrete form as independent variables. 30. Method according to claims 27-29, characterized in that, in said signal processing, a scanning for local and global maxima is performed indicating angle periodical reflections from objects, in representation in the angle domain, and where the peak value indi- cates the time delays of associated reflections from an object. 31. Method according to any of the claims 26-30, characterized in that, in said signal processing, a calculation of the angular position relative to the antenna system for the angle periodical reflections is furthermore performed. 32. Method according to any of the claims 26-31 , characterized in that the signal processing utilizes, during horizontal movement above the ground, collocated measurements for the suppression of clutter.

Inventors: GREGERSEN OLE, JENSEN OLE KIEL, GREGERSEN, OLE, JENSEN, OLE, KIEL
Applicants: EKKO DANE PRODUCTION A S, GREGERSEN OLE, JENSEN OLE KIEL, EKKO DANE PRODUCTION A/S, GREGERSEN, OLE, JENSEN, OLE, KIEL
Application year: 1998
Main classification: G01S13
IPC codes: G01S7, G01S13, G01V3, H01Q3, H01Q21