Time domain beam forming acceleration method and device based on sparse matrix
Technical Field
The invention belongs to the technical field of underwater acoustic array signal processing, and particularly relates to a sparse matrix-based time domain beam forming acceleration method and device.
Background
Because the attenuation of light waves and electromagnetic waves in water is serious, the application range of imaging equipment and technical means which are commonly used on land and in air is limited under water, and sound waves can not only propagate in water for a long distance and have smaller attenuation, but also have good directivity and penetrability, so that the sound waves become a signal carrier which is most commonly used for underwater detection at present. The three-dimensional sonar imaging system can overcome the problem that the visual distance of the optical imaging system is short, and can obtain more visual three-dimensional space-target image information compared with the traditional two-dimensional imaging sonar, so that the three-dimensional sonar imaging system is more and more widely focused and applied.
Three-dimensional imaging sonar can be classified into acoustic lens imaging, beam forming acoustic imaging, and holographic acoustic imaging according to the imaging mode. With the development of digital signal processing technology, beam forming acoustic imaging sonar is becoming more and more widely used. When the beam forming acoustic imaging sonar works, a transmitting transducer is used for actively transmitting sound waves with specific frequency, a receiving transducer is used for receiving scattering signals in a specific view field, a signal processor for realizing a beam forming algorithm is used for processing the sonar signals in real time, and finally, the spatial distribution condition of sound pressure amplitude values in the view field range is obtained through inversion. This process not only requires a high degree of real-time and accuracy of the algorithm, but also requires stringent requirements on the computational power of the signal processor.
In beam forming acoustic imaging sonar, the signal processing based on beam forming is used as a key part with long time consumption in the imaging calculation process, and the calculation complexity and efficiency directly influence the real-time performance and accuracy of the whole imaging system. At present, common beam forming imaging algorithms comprise time domain beam forming, deconvolution imaging, compression beam forming and the like, wherein the time domain beam forming algorithm is the earliest, is the most mature to develop, has the advantages of good robustness, small calculation amount and the like, and becomes a technical scheme commonly adopted by various current sonar devices.
However, time domain beamforming algorithms still face many challenges in practical applications. Firstly, the time delay of beam forming needs to be calculated for each spatial pixel point location in the time domain beam forming algorithm, and if a dense matrix storage mode is adopted, the storage amount is increased sharply, so that the hardware cost and the operation burden of the system are increased. Secondly, in conventional time domain beamforming calculation, frequent indexing operations of time delay parameters become main bottlenecks for restricting the performance improvement of the algorithm, and the indexing operations not only increase the calculation complexity, but also reduce the real-time performance of the algorithm. The three-dimensional sonar imaging system is used as an important technical means in the field of underwater detection, and performance improvement of the three-dimensional sonar imaging system is not separated from continuous optimization and innovation of a beam forming algorithm so as to realize more efficient three-dimensional underwater imaging.
Disclosure of Invention
In view of the above, the present invention aims to provide a time domain beam forming acceleration method and apparatus based on a sparse matrix, which stores signal interpolation coefficients and corresponding delays by using the sparse matrix, and replaces indexing operation with time domain multichannel signals by multiplication operation in time domain beam forming calculation, so that beam forming efficiency can be greatly improved, storage space required by time delay parameters is reduced, and the method and apparatus are suitable for receiving beam forming algorithm based on plane wave imaging by using a two-dimensional area array in three-dimensional imaging sonar, and have the advantages of small storage space, high operation efficiency, easy parallelization transformation, etc.
In order to achieve the above purpose, the technical scheme provided by the invention is as follows:
the time domain beam forming acceleration method based on the sparse matrix provided by the embodiment of the invention comprises the following steps:
Spreading the spatial distribution of the three-dimensional pixel points in the set three-dimensional imaging space to one dimension, and then carrying out average blocking on the pixel points to obtain a plurality of groups of pixel points;
Calculating to obtain a delay vector according to the distance vector from each group of pixel points to the two-dimensional plane receiving array and the two-dimensional plane transmitting array respectively; calculating according to the sampling rate and the delay vector of the two-dimensional plane receiving array to obtain a sampling index, and calculating according to the sampling index to obtain an interpolation coefficient vector; calculating a block sparse matrix corresponding to each group of pixel points according to the interpolation coefficient vector and the delay vector;
combining the partitioned sparse matrixes corresponding to all groups of pixel points into an overall sparse matrix;
the method comprises the steps of obtaining time domain multichannel signals transmitted by a two-dimensional plane transmitting array, expanding the time domain multichannel signals to one-dimensional arrangement, calculating according to an integral sparse matrix and the time domain multichannel signals of the one-dimensional arrangement to obtain a one-dimensional matrix, carrying out dimension transformation on the one-dimensional matrix, and reconstructing the one-dimensional matrix to a three-dimensional space to complete beam forming calculation of the time domain multichannel signals.
Preferably, the expanding the spatial distribution of the three-dimensional pixel points in the set three-dimensional imaging space to one dimension and then performing average blocking on the pixel points to obtain a plurality of groups of pixel points includes:
Respectively setting three-dimensional imaging space in 、AndResolution and imaging range of the direction, respectively, are thereby obtained、AndThe imaging points in three directions are respectively、AndThe total number of pixel points is;
Flattening three-dimensional space points to one-dimensional arrangement according to the row direction, andThe pixel points are divided intoGroups, i.e. average each groupEach group of pixel points corresponds toA shaft(s),Shaft and method for producing the sameThe axis coordinates form coordinate vectors respectively、And。
Preferably, the calculating the delay vector according to the distance vector from each group of pixel points to the two-dimensional plane receiving array and the two-dimensional plane transmitting array respectively includes:
Respectively calculating each group of pixel points to a two-dimensional plane receiving array 、AndDistance in direction、AndWherein,,,、AndRespectively the first two-dimensional plane receiving arraysCoordinate vectors corresponding to array elements in three coordinate axis directions are based on、AndCalculating to obtain the distance vector of each group of pixel points from the two-dimensional plane receiving array according to the following formula:
;
Respectively calculating each group of pixel points to a two-dimensional plane emission array、AndDistance in direction、AndWherein,,,、AndRespectively the first two-dimensional plane transmitting arraysCoordinate vectors corresponding to array elements in three coordinate axis directions are based on、AndCalculating to obtain the distance vector of each group of pixel points from the two-dimensional plane emission array according to the following formula:
;
According toAndCalculating delay vectors required for beamforming of signalsWhereinIs the sound velocity in water.
Preferably, the calculating according to the sampling rate and the delay vector of the two-dimensional plane receiving array to obtain a sampling index, and calculating according to the sampling index to obtain an interpolation coefficient vector includes:
sampling rate according to two-dimensional planar receiving array And delay vectorSampling index corresponding to calculation time delay;
For a pair ofRounding to obtain an arrayCalculation ofAnd (3) withIs the difference of (2)Then the interpolation coefficient vector isSuperscriptIs transposed.
Preferably, the method further comprises: after calculating the sampling index, judging the number of sampling points of a single channel of the two-dimensional plane receiving array if the size of the sampling index is greater than zero and less than or equal to the two-dimensional plane receiving arrayIf the threshold range is not satisfied, excluding the corresponding delay vector to update the delay vector。
Preferably, the calculating the block sparse matrix corresponding to each group of pixel points according to the interpolation coefficient vector and the delay vector includes:
Constructing a block sparse matrix to store signal interpolation coefficients and corresponding time delays, and calculating non-zero element values in the block sparse matrix as WhereinFor the purpose of interpolating the coefficient vector,Is a delay vector, superscriptThe pixel points are transposed to obtain the number of pixel points with the number of lines and the number of columns of the partitioning sparse matrix corresponding to each group of pixel pointsWhereinThe number of channels for a two-dimensional planar receive array,The number of sampling points for a single channel of a two-dimensional planar receive array.
Preferably, the combining the partitioned sparse matrices corresponding to all the groups of pixel points into an overall sparse matrix includes:
Stacking and combining the partitioned sparse matrixes corresponding to all groups of pixel points according to the row direction to obtain an overall sparse matrix ,Is of the dimension ofWhereinThe number of the pixel points is the total number of the pixel points,Column number of sparse matrix for each block.
Preferably, the acquiring the time domain multichannel signal transmitted by the two-dimensional plane transmitting array and expanding the time domain multichannel signal to a one-dimensional arrangement, and calculating according to the overall sparse matrix and the time domain multichannel signal of the one-dimensional arrangement to obtain a one-dimensional matrix, includes:
Acquiring a time domain multichannel signal transmitted by a two-dimensional plane transmitting array, expanding the two-dimensional time domain multichannel signal to one dimension in a line-first mode, and calculating a wave beam domain signal WhereinFor the one-dimensional matrix to be calculated,As a whole sparse matrix,To obtain time domain multichannel signals.
Preferably, the reconstructing the one-dimensional matrix after the dimension transformation to the three-dimensional space to complete the beam forming calculation of the time domain multichannel signal includes:
Reconstructing a one-dimensional matrix into a three-dimensional matrix through dimension transformation, wherein the dimension of the three-dimensional matrix is Wherein、AndRespectively, the three-dimensional imaging space is set、AndImaging points in three directions.
In order to achieve the above object, an embodiment of the present invention further provides a time domain beam forming acceleration device based on a sparse matrix, including: the system comprises a three-dimensional imaging space blocking module, a blocking sparse matrix construction module, an overall sparse matrix construction module and a time domain beam forming calculation module;
the three-dimensional imaging space blocking module is used for expanding the spatial distribution of the three-dimensional pixel points in the set three-dimensional imaging space to one dimension and then carrying out average blocking on the pixel points to obtain a plurality of groups of pixel points;
The block sparse matrix construction module is used for calculating a delay vector according to the distance vector from each group of pixel points to the two-dimensional plane receiving array and the two-dimensional plane transmitting array respectively; calculating according to the sampling rate and the delay vector of the two-dimensional plane receiving array to obtain a sampling index, and calculating according to the sampling index to obtain an interpolation coefficient vector; calculating a block sparse matrix corresponding to each group of pixel points according to the interpolation coefficient vector and the delay vector;
The overall sparse matrix construction module is used for combining the partitioned sparse matrixes corresponding to all groups of pixel points into an overall sparse matrix;
The time domain beam forming calculation module is used for acquiring time domain multi-channel signals transmitted by the two-dimensional plane transmitting array, expanding the time domain multi-channel signals to one-dimensional arrangement, calculating according to the whole sparse matrix and the time domain multi-channel signals of the one-dimensional arrangement to obtain a one-dimensional matrix, carrying out dimension transformation on the one-dimensional matrix, and reconstructing the one-dimensional matrix to a three-dimensional space to finish beam forming calculation of the time domain multi-channel signals.
Compared with the prior art, the invention has the beneficial effects that at least the following steps are included:
The invention uses the advantages of the sparse matrix in storage and index to convert the conventional time domain beam forming insertion delay and superposition calculation into the dot multiplication operation of the sparse matrix and the input signal vector, wherein the sparse matrix comprises the space pixel time delay corresponding to the parameters of imaging space size, imaging resolution, sampling frequency and the like and the interpolation coefficient based on a set interpolation method, thereby improving the beam forming efficiency, and the sparse matrix can be imaged for multiple times after being stored and read, so that the single imaging time is greatly reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a sparse matrix-based time domain beamforming acceleration method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a sparse matrix construction method according to an embodiment of the present invention;
Fig. 3 is a schematic diagram of performing time domain beamforming calculation on a received signal based on a sparse matrix according to an embodiment of the present invention;
Fig. 4 is an imaging time contrast schematic diagram of a conventional time domain beamforming method and a sparse matrix-based time domain beamforming method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a sparse matrix-based time domain beamforming accelerator according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the detailed description is presented by way of example only and is not intended to limit the scope of the invention.
The invention is characterized in that: aiming at the problem of poor real-time imaging speed caused by low calculation efficiency of a conventional time domain beam forming algorithm in the prior art, the embodiment of the invention provides a time domain beam forming accelerating method and device based on a sparse matrix, an integral sparse matrix is constructed through three-dimensional imaging space blocking, delay calculation and signal interpolation coefficient calculation, a time domain beam forming technology used by three-dimensional sonar is subjected to program optimization, and the advantages of the integral sparse matrix in storage and indexing are utilized to carry out dot multiplication operation on the integral sparse matrix and an input time domain multichannel signal vector, so that the efficiency of time domain beam forming is improved, the integral sparse matrix can be used for imaging for multiple times after being stored and read, and the single imaging time is greatly reduced.
Fig. 1 is a flow chart of a sparse matrix-based time domain beamforming acceleration method according to an embodiment of the present invention. As shown in fig. 1, an embodiment provides a sparse matrix-based time domain beamforming acceleration method, which includes the following steps:
Step 1, as shown in (a) of FIG. 2, setting three-dimensional imaging spaces in each of 、AndResolution and imaging range of the direction, respectively, are thereby obtained、AndThe imaging points in three directions are respectively、AndThe total number of pixel points is。
Step 2, as shown in (b) of FIG. 2, the three-dimensional space points are flattened to a one-dimensional arrangement according to the row direction, andThe pixel points are divided intoGroups, i.e. average each groupEach group of pixel points corresponds toA shaft(s),Shaft and method for producing the sameThe axis coordinates form coordinate vectors respectively、And。
Step 3, respectively calculating each group of pixel points to a two-dimensional plane receiving array (namely signal receiving equipment)、AndDistance in direction、AndWherein,,,、AndRespectively the first two-dimensional plane receiving arraysCoordinate vectors corresponding to array elements in three coordinate axis directions are based on、AndCalculating to obtain the distance vector of each group of pixel points from the two-dimensional plane receiving array according to the following formula:
。
Step 4, respectively calculating each group of pixel points to a two-dimensional plane emission array (namely signal emission equipment)、AndDistance in direction、AndWherein,,,、AndRespectively the first two-dimensional plane transmitting arraysCoordinate vectors corresponding to array elements in three coordinate axis directions are based on、AndCalculating to obtain the distance vector of each group of pixel points from the two-dimensional plane emission array according to the following formula:
。
Step 5, according toAndCalculating delay vectors required for beamforming of signalsWhereinIs the sound velocity in water.
Step 6, according to the sampling rate of the two-dimensional plane receiving arraySampling index corresponding to calculation time delayWhereinIs a delay vector. After calculating the sampling index, judging the number of sampling points of a single channel of the two-dimensional plane receiving array if the size of the sampling index is greater than zero and less than or equal to the two-dimensional plane receiving arrayIf the threshold range is not satisfied, excluding the corresponding delay vector to update the delay vector。
And 7, calculating coefficients required for linear interpolation of the signals. For a pair ofRounding to obtain an arrayCalculation ofWith adjacent smaller integersIs the difference of (2)The required interpolation coefficient vector isSuperscriptIs transposed.
Step 8, constructing a block sparse matrix according to the coo format to store the signal interpolation coefficients and the corresponding time delays, as shown in (c) of fig. 2, the number of rows of the block sparse matrix corresponding to each group of pixel pointsNumber of pixels per groupThe column number isWhereinThe number of channels for a two-dimensional planar receive array,Sampling point number of single channel for two-dimensional plane receiving array due to interpolation coefficient vectorThere are only two per row, thus resulting in two non-zero element values per row in the partitioned sparse matrix. Non-zero element values within a partitioned sparse matrix areWhereinFor the purpose of interpolating the coefficient vector,Is a delay vector, superscriptThe column and row indexes corresponding to the non-zero element values are respectively provided withThe rank index corresponding to the effective value.
And 9, repeating the steps 3 to 8 until the construction of the block sparse matrix of all the groups in the step 2 is completed. Stacking and combining the partitioned sparse matrixes corresponding to all groups of pixel points according to the row direction to obtain an overall sparse matrix shown in (a) of fig. 3,Is of the dimension ofWhereinThe number of the pixel points is the total number of the pixel points,Column number of sparse matrix for each block.
And step 10, for single imaging operation, directly adopting the whole sparse matrix obtained on the basis of the step 9 to perform the next operation. For the operation of multiple imaging, the whole sparse matrix generated in the step 9 is obtainedAnd the time delay and the storage space of interpolation coefficient information are reduced by storing in the csr format, and the time delay and the storage space of interpolation coefficient information are read when imaging calculation is needed.
Step 11, as shown in fig. 3 (a), fig. 3 (b) and fig. 3 (c), performs time domain beam forming signal calculation. Acquiring time domain multichannel signals transmitted by two-dimensional plane transmitting arraysExpanding the two-dimensional time domain multichannel signal to one dimension in a line priority mode, and calculating a beam domain signalWhereinFor the calculated one-dimensional matrix. Because the sparse matrix is adopted, the index format can accelerate the dot multiplication operation process.
Step 12, as shown in (d) of FIG. 3, a one-dimensional matrix is formedReconstructing into a three-dimensional matrix by dimension transformation, wherein the dimension of the three-dimensional matrix isSo that the subsequent image display processing can be performed.
In an embodiment, as shown in fig. 4, when the two-dimensional planar receiving array is a 16 x 16 array element,、AndWhen the axis imaging range is between (-1 m,1 m), (-1 m,1 m) and (4.5 m,5.5 m), the time domain beam forming acceleration method based on the sparse matrix provided by the embodiment of the invention is adopted to perform beam forming calculation (the computer parameters are a dual-core Intel (R) Xeon (R) Silver 4210 CPU processor, a main frequency is 2.19 GHz and a memory size is 64G), and compared with the conventional time domain beam forming calculation, the method has obvious speed advantage.
In summary, the time domain beam forming accelerating method based on the sparse matrix provided by the embodiment of the invention utilizes the advantages of the sparse matrix in storage and index, and converts conventional time domain beam forming insertion delay and superposition calculation into dot multiplication operation of the sparse matrix and an input signal vector, wherein the sparse matrix comprises space pixel point delay corresponding to parameters such as imaging space size, imaging resolution, sampling frequency and the like and interpolation coefficients based on a given interpolation method, so that the beam forming efficiency is improved, multiple imaging can be performed after storage and reading, the single imaging time is greatly reduced, and more powerful technical support is provided for the fields such as marine science research, underwater resource development, underwater safety monitoring and the like.
Based on the same inventive concept, as shown in fig. 5, an embodiment of the present invention further provides a sparse matrix-based time domain beamforming acceleration apparatus 500, including: a three-dimensional imaging spatial blocking module 510, a blocking sparse matrix construction module 520, an overall sparse matrix construction module 530, and a time domain beamforming calculation module 540.
The three-dimensional imaging space blocking module 510 is configured to spread the spatial distribution of the three-dimensional pixel points in the set three-dimensional imaging space to one dimension, and then perform average blocking on the pixel points to obtain a plurality of groups of pixel points.
The block sparse matrix construction module 520 is configured to calculate a delay vector according to a distance vector from each group of pixel points to the two-dimensional planar receiving array and the two-dimensional planar transmitting array; calculating according to the sampling rate and the delay vector of the two-dimensional plane receiving array to obtain a sampling index, and calculating according to the sampling index to obtain an interpolation coefficient vector; and calculating a block sparse matrix corresponding to each group of pixel points according to the interpolation coefficient vector and the delay vector.
The overall sparse matrix construction module 530 is configured to combine the partitioned sparse matrices corresponding to all the groups of pixel points into an overall sparse matrix.
The time domain beam forming calculation module 540 is configured to obtain a time domain multi-channel signal transmitted by the two-dimensional planar transmitting array, spread the time domain multi-channel signal to a one-dimensional arrangement, read the whole sparse matrix and the one-dimensional arrangement time domain multi-channel signal to calculate to obtain a one-dimensional matrix, perform dimension transformation on the one-dimensional matrix, reconstruct the one-dimensional matrix to a three-dimensional space, and complete beam forming calculation of the time domain multi-channel signal.
It should be noted that, the time domain beam forming accelerating device based on the sparse matrix provided in the foregoing embodiment and the time domain beam forming accelerating method based on the sparse matrix belong to the same inventive concept, and detailed implementation processes of the time domain beam forming accelerating device based on the sparse matrix are shown in the embodiment of the time domain beam forming accelerating method based on the sparse matrix, which is not repeated here.
The foregoing detailed description of the preferred embodiments and advantages of the invention will be appreciated that the foregoing description is merely illustrative of the presently preferred embodiments of the invention, and that no changes, additions, substitutions and equivalents of those embodiments are intended to be included within the scope of the invention.