Distance measurement method and device, terminal, and storage medium
By using a sound wave receiving device to calculate the distance to be detected based on a reference signal and an initial distance, the cost and interference problems of existing wireless ranging methods are solved, and efficient and accurate distance measurement is achieved.
Patent Information
- Application Number
- CN202110711462.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-25
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2041-06-25
AI Technical Summary
Existing wireless ranging methods have shortcomings in terms of cost and anti-interference. In particular, acoustic ranging is easily affected by multipath effects and is expensive, while infrared ranging is difficult to detect objects with strong light absorption, and electromagnetic ranging is expensive and susceptible to electromagnetic interference.
The sound wave signal transmitted by the sound wave transmitting device is detected by the sound wave receiving device. The distance to be detected is calculated using a predetermined reference signal and an initial distance. By combining motion information and phase difference, the distance measurement is realized, avoiding the need for real-time communication synchronization.
It reduces ranging costs, improves detection efficiency and accuracy, simplifies operation procedures, and expands the scope of application.
Smart Images

Figure CN115524708B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of electronic technology, and in particular, to a ranging method and device, a terminal, and a storage medium. BACKGROUND
[0002] Wireless ranging is widely used in the field of electronic devices. In short-range ranging, commonly used methods include infrared ranging, electromagnetic wave ranging, and acoustic wave ranging. The infrared ranging method has good consistency, low cost, and fast response speed, but the minimum distance detected by this method is large, and it is difficult to detect the distance of objects with strong light absorption. Electromagnetic wave ranging has a high cost and is susceptible to electromagnetic interference. Acoustic wave ranging is a simple and low-cost solution. However, if an echo ranging method is used, it is susceptible to multipath effects. If separate acoustic wave transmitting and receiving devices are used, communication between the two devices and precise time synchronization are required, which is costly. SUMMARY
[0003] The present disclosure provides a ranging method and device, a terminal, and a storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a ranging method is provided, applied to an acoustic wave receiving device, comprising:
[0005] detecting a detection acoustic wave signal sent by an acoustic wave transmitting device;
[0006] determining a to-be-detected distance between the acoustic wave transmitting device and the acoustic wave receiving device according to a phase difference between the detection acoustic wave signal and a predetermined reference signal and a predetermined initial distance.
[0007] In some embodiments, the method further comprises:
[0008] determining the predetermined initial distance according to an initial position of the acoustic wave receiving device.
[0009] In some embodiments, the initial position comprises a first position and a second position after the acoustic wave receiving device moves from the first position.
[0010] The determining the predetermined initial distance according to the initial position of the acoustic wave receiving device comprises:
[0011] receiving a first acoustic wave signal at the first position;
[0012] receiving a second acoustic wave signal at the second position;
[0013] obtaining motion information of the acoustic wave receiving device moving from the first position to the second position;
[0014] determine the initial distance according to a phase difference between the first acoustic wave signal and the second acoustic wave signal, and the motion information.
[0015] In some embodiments, the method further comprises:
[0016] determine a first reference phase difference according to a cross-correlation function of the first acoustic wave signal and the reference signal;
[0017] determine a second reference phase difference according to a cross-correlation function of the second acoustic wave signal and the reference signal;
[0018] determine the phase difference between the first acoustic wave signal and the second acoustic wave signal according to the first reference phase difference and the second reference phase difference.
[0019] In some embodiments, the motion information comprises distance change information and angle change information.
[0020] The obtaining the motion information of the acoustic wave receiving device moving from the first position to the second position comprises:
[0021] determining the distance change information according to acceleration information of the acoustic wave receiving device in each direction of a predetermined coordinate system;
[0022] determining the angle change information corresponding to the movement of the acoustic wave receiving device from the first position to the second position.
[0023] In some embodiments, the determining the distance change information according to the acceleration information of the acoustic wave receiving device in each direction of a predetermined coordinate system comprises:
[0024] performing a second integration processing on the acceleration information of the acoustic wave receiving device in each direction of a predetermined coordinate system to obtain displacement information in the each direction;
[0025] determining the distance change information according to the displacement information in the each direction.
[0026] In some embodiments, the acoustic wave receiving device comprises a first detection channel and a second detection channel different from the first detection channel in position.
[0027] The determining the angle change information corresponding to the movement of the acoustic wave receiving device from the first position to the second position comprises:
[0028] determining a first reference distance according to a first signal received by the first detection channel and a second signal received by the second detection channel when the acoustic wave receiving device is located at the first position;
[0029] According to the sound wave receiving device being located at the second position, the third signal received by the first detection channel and the fourth signal received by the second detection channel, a second reference distance is determined.
[0030] According to the first reference distance, the second reference distance, and a distance between the first detection channel and the second detection channel, the angle change information is determined.
[0031] According to a second aspect of the embodiments of the present disclosure, a ranging device is provided, applied to a sound wave receiving device, comprising:
[0032] A detection module is configured to detect a detection sound wave signal sent by a sound wave transmitting device.
[0033] A first determination module is configured to determine a to-be-detected distance between the sound wave transmitting device and the sound wave receiving device according to a phase difference between the detection sound wave signal and a predetermined reference signal and a predetermined initial distance.
[0034] In some embodiments, the device further comprises:
[0035] A second determination module is configured to determine the predetermined initial distance according to an initial position of the sound wave receiving device.
[0036] In some embodiments, the initial position comprises a first position and a second position after the sound wave receiving device moves.
[0037] The second determination module comprises:
[0038] A first receiving sub-module is configured to receive a first sound wave signal at the first position.
[0039] A second receiving sub-module is configured to receive a second sound wave signal at the second position.
[0040] An acquisition sub-module is configured to acquire motion information of the sound wave receiving device moving from the first position to the second position.
[0041] A first determination sub-module is configured to determine the initial distance according to a phase difference between the first sound wave signal and the second sound wave signal and the motion information.
[0042] In some embodiments, the device further comprises:
[0043] A third determination module is configured to determine a first reference phase difference according to a cross-correlation function of the first sound wave signal and the reference signal.
[0044] A fourth determination module is configured to determine a second reference phase difference according to a cross-correlation function of the second sound wave signal and the reference signal.
[0045] a fifth determining module, configured to determine the phase difference between the first sound wave signal and the second sound wave signal according to the first reference phase difference and the second reference phase difference.
[0046] In some embodiments, the motion information includes distance change information and angle change information.
[0047] The acquisition sub-module includes:
[0048] A second determining sub-module, configured to determine the distance change information according to acceleration information of the sound wave receiving device in each direction of a predetermined coordinate system.
[0049] A third determining sub-module, configured to determine the angle change information corresponding to movement of the sound wave receiving device from the first position to a second position.
[0050] In some embodiments, the second determining sub-module is specifically configured to:
[0051] performing second-order integration processing on the acceleration information of the sound wave receiving device in each direction of a predetermined coordinate system to obtain displacement information in each direction;
[0052] determine the distance change information according to the displacement information in each direction.
[0053] In some embodiments, the sound wave receiving device includes a first detection channel and a second detection channel different from the first detection channel in position.
[0054] The third determining sub-module is specifically configured to:
[0055] determine a first reference distance according to a first signal received by the first detection channel and a second signal received by the second detection channel when the sound wave receiving device is located at the first position;
[0056] determine a second reference distance according to a third signal received by the first detection channel and a fourth signal received by the second detection channel when the sound wave receiving device is located at the second position;
[0057] determine the angle change information according to the first reference distance, the second reference distance, and a distance between the first detection channel and the second detection channel.
[0058] According to a third aspect of the embodiments of the present disclosure, a terminal is provided, which at least includes a processor and a memory for storing executable instructions capable of running on the processor, wherein:
[0059] The processor is configured to execute the executable instructions, and the executable instructions perform the steps of any of the ranging methods.
[0060] According to a fourth aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, and the computer-readable storage medium stores computer executable instructions. The computer executable instructions are executed by a processor to implement the steps of any of the ranging methods.
[0061] The technical solutions provided by the embodiments of the present disclosure can have the following beneficial effects: by the above solutions of the embodiments of the present disclosure, the sound wave receiving device detects the sound wave signal emitted by the sound wave emitting device, and the actual distance is determined by using the predetermined reference signal and the initial distance, without the sound wave receiving device and the sound wave emitting device keeping real-time communication for time synchronization, so that the cost is reduced, and the detection efficiency and the detection accuracy are improved.
[0062] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0063] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0064] Figure 1 is a flowchart of a ranging method according to an exemplary embodiment Figure 1 ;
[0065] Figure 2 is a flowchart of a ranging method according to an exemplary embodiment Figure 2 ;
[0066] Figure 3 is a hardware schematic diagram of a ranging method according to an exemplary embodiment
[0067] Figure 4 is a schematic diagram of a ranging method according to an exemplary embodiment Figure 1 ;
[0068] Figure 5 is a schematic diagram of a ranging method according to an exemplary embodiment Figure 1 ;
[0069] Figure 6 is a structural block diagram of a ranging device according to an exemplary embodiment
[0070] Figure 7 is a physical structural block diagram of a terminal according to an exemplary embodiment. DETAILED DESCRIPTION
[0071] The exemplary embodiments will be described in detail below with reference to the drawings. The following description is only examples of the exemplary embodiments and is not intended to be limiting. Other embodiments, as those skilled in the art will recognize, are equally possible within the scope of the application as defined by the appended claims.
[0072] Figure 1 is a flow chart of a ranging method according to an exemplary embodiment, as shown in Figure 1 The method is applied to a sound wave receiving device, and includes:
[0073] Step S101, detecting a detection sound wave signal sent by a sound wave transmitting device;
[0074] Step S102, determining a distance to be detected between the sound wave transmitting device and the sound wave receiving device according to a phase difference between the detection sound wave signal and a predetermined reference signal and a predetermined initial distance.
[0075] In the embodiments of the present disclosure, the sound wave transmitting device has the function of sending a detection sound wave signal with a predetermined wavelength or volume, and can send the detection sound wave signal by using the sound wave transmitting device when distance detection is needed. In actual applications, the sound wave transmitting device can be any electronic device with audio output related hardware, including a sound box, a mobile phone, a television set, a computer device, and the like. In order to facilitate distance measurement at any position, the sound wave transmitting device can be a small device that is easy to move, such as a small sound box device, and the like.
[0076] The sound wave receiving device is a device with audio receiving function, i.e., an electronic device with audio signal receiving related hardware (such as a microphone or a microphone array, and the like). It can include a mobile phone, a microphone, a smart watch, and other sound pickup devices, and the like. In actual applications, the sound wave receiving device can also be an electronic device that is easy to move, and in the embodiments of the present disclosure, a mobile phone can be taken as an example. It should be noted that in the embodiments of the present disclosure, the mobile phone can have one audio receiving channel, or can have multiple audio receiving channels located at different sides or the same side of the mobile phone.
[0077] In the embodiments of the present disclosure, the predetermined reference signal can be a sound wave signal with a fixed period of a predetermined amplitude and frequency, or an arbitrary sound wave signal with a known waveform. Since the predetermined reference signal can be pre-stored in the sound wave receiving device, it does not need to be embodied in the form of a played sound wave, but is stored in the sound wave receiving device in a digital signal. The reference signal carries predetermined phase information, so that the sound wave receiving device can determine the phase difference between the detection sound wave signal and the reference signal based on the phase information of the detection sound wave signal and the phase information of the reference signal when receiving the detection sound wave signal. Since the phase difference represents the relative time delay between the detection sound wave signal and the reference signal, the initial distance needs to be superimposed on the basis to obtain the actual detection distance. The initial distance can be a distance obtained by initialization before ranging, which represents the initial distance between the sound wave receiving device and the sound wave transmitting device.
[0078] By using the initial distance and the reference signal, the sound wave receiving device can calculate the distance between the sound wave transmitting device and the sound wave receiving device by receiving the sound wave signal transmitted by the sound wave transmitting device only once. In this way, without additional hardware devices, the existing electronic devices with sound wave transmitting function and the existing electronic devices with sound wave receiving function can be used to realize accurate distance measurement. In addition, by using the above method, the sound wave transmitting device and the sound wave receiving device do not need to communicate with each other, and only the transmission and reception of sound waves can be realized, so that the information matching between electronic devices is not needed. Therefore, the technical solution of the embodiments of the present disclosure does not need additional hardware cost, is easy to operate and has wide application range.
[0079] In some embodiments, as shown in Figure 2 the method further includes:
[0080] In step S201, the predetermined initial distance is determined according to the initial position of the sound wave receiving device.
[0081] In the embodiments of the present disclosure, the initial distance can be determined by using the initial position of the sound wave receiving device before ranging. Here, the initial position can be a plurality of positions with known position coordinates. By using a plurality of positions, the distance between the sound wave transmitting device and the sound wave receiving device at the fixed position can be changed, so as to determine the initial distance between the initial position and the sound wave transmitting device.
[0082] When ranging, the relative position change of the sound wave receiving device can be determined by using the received detection sound wave signal and the reference signal, so as to determine the actual distance between the sound wave receiving device and the sound wave transmitting device based on the relative position change and the initial distance.
[0083] Thus, after the initial distance is obtained through initialization, multiple position or distance measurements can be performed based on the initial distance, which is convenient, fast and low in cost. If the position of the sound wave emitting device changes, the initialization can be performed again to facilitate the detection.
[0084] It should be noted that initialization is not required every time distance measurement is performed, and distance measurement is not required immediately after initialization. Therefore, the initialization process in the above Figure 2 may be performed independently.
[0085] In some embodiments, the initial position includes a first position and a second position after the sound wave receiving device moves.
[0086] The initial distance is determined according to the initial position of the sound wave receiving device.
[0087] The first sound wave signal is received at the first position.
[0088] The second sound wave signal is received at the second position.
[0089] The motion information of the sound wave receiving device moving from the first position to the second position is obtained.
[0090] The initial distance is determined according to the phase difference between the first sound wave signal and the second sound wave signal and the motion information.
[0091] The initial position can include two different positions, i.e., a first position and a second position. The sound wave receiving device receives the sound wave signals emitted by the sound wave emitting device at the first position and the second position, respectively. Thus, the distance difference between the two positions can be obtained according to the phase difference between the two sets of sound wave signals.
[0092] In addition, in the embodiments of the present disclosure, the sound wave receiving device can also have the function of detecting motion information, for example, detecting the direction, distance, speed, angle and other parameters of the motion through a sensor to obtain the motion information and further determine the relative position relationship between the first position and the second position.
[0093] Since the phase difference determined by the sound wave signals received at the first position and the second position is not the actual distance between the first position and the second position, but the relative distance difference between the sound wave emitting device, the initial distance needs to be determined in combination with the motion information detected by the sound wave receiving device.
[0094] Here, the initial distance can be the distance between the first position and the sound wave emitting device, or the distance between the second position and the sound wave emitting device.
[0095] In some embodiments, the method further includes:
[0096] determine a first reference phase difference according to a cross-correlation function between the first acoustic wave signal and the reference signal;
[0097] determine a second reference phase difference according to a cross-correlation function between the second acoustic wave signal and the reference signal;
[0098] determine the phase difference between the first acoustic wave signal and the second acoustic wave signal according to the first reference phase difference and the second reference phase difference.
[0099] In the embodiments of the present disclosure, the phase difference can be determined by the reference phase difference (i.e., the first reference phase difference and the second reference phase difference) between the first acoustic wave signal, the second acoustic wave signal and the reference signal. The correlation between the acoustic wave signal and the reference signal can be determined by the cross-correlation function between the detected acoustic wave signal and the reference signal. This process can be understood as sequentially multiplying the acoustic wave signal by the reference signal by moving the acoustic wave signal (i.e., phase shift). When the cross-correlation function takes the maximum value, the acoustic wave signal and the reference signal coincide (the phase is the same) at the corresponding phase shift. At this time, the corresponding phase shift is the phase difference between the acoustic wave signal and the reference signal. Therefore, the first reference phase difference can be determined by the cross-correlation function between the first acoustic wave signal and the reference signal, and the second reference phase difference can be determined by the cross-correlation function between the second acoustic wave signal and the reference signal.
[0100] In this way, based on the signals obtained by twice acoustic wave detection, the phase difference parameters can be obtained by performing operation processing on the known reference signal, which is convenient for subsequent use.
[0101] In some embodiments, the motion information includes distance change information and angle change information.
[0102] The motion information of the acoustic wave receiving device moving from the first position to the second position includes:
[0103] The distance change information is determined according to the acceleration information of the acoustic wave receiving device in each direction of the predetermined coordinate system.
[0104] The angle change information corresponding to the movement of the acoustic wave receiving device from the first position to the second position is determined.
[0105] The motion information of the acoustic wave receiving device moving from the first position to the second position can include distance change information, i.e., the straight-line distance from the first position to the second position. Exemplarily, the distance change information can be detected by the acceleration sensor, displacement sensor and positioning device built in the acoustic wave receiving device.
[0106] Further, for a sound wave receiving device with directivity or a sound wave receiving device with multiple audio receiving channels at different positions, the angle change information can be detected. For example, the above-mentioned angle change information is detected by using a sensor device such as a gyroscope, a gravity sensor, and a magnetic field sensor.
[0107] Here, the sound wave receiving device can determine the acceleration information in each direction by using a predetermined coordinate system, and further determine the distance change information, so as to obtain the vector of displacement. The predetermined coordinate system can be the coordinate system of the sound wave receiving device, that is, the coordinate axis direction of the coordinate system is fixed relative to the direction of the sound wave receiving device; or can be a predetermined geographical coordinate system, for example, a coordinate system corresponding to the south-north, east-west, and gravity directions.
[0108] In this way, by using the above-mentioned distance change information and angle change information, the position change of the sound wave receiving device in the initialization process can be located, and further the geometric relationship between the first position, the second position, and the sound wave transmitting device can be determined. In combination with the above-mentioned phase difference of the sound wave signal, the initial distance required can be obtained, which facilitates the detection of the actual distance subsequently.
[0109] In some embodiments, the distance change information is determined according to the acceleration information of the sound wave receiving device in each direction of a predetermined coordinate system, and includes:
[0110] The acceleration information of the sound wave receiving device in each direction of a predetermined coordinate system is subjected to a second integral processing to obtain displacement information in each direction;
[0111] The distance change information is determined according to the displacement information in each direction.
[0112] In the embodiments of the present disclosure, the data obtained by subjecting the acceleration information of the sound wave receiving device in each direction of a predetermined coordinate system to a second integral processing is distance, so that the above-mentioned acceleration information can be subjected to a second integral processing to obtain displacement information in each direction.
[0113] Based on the above-mentioned displacement information in each direction, the vector displacement in the coordinate system can be determined, and further the above-mentioned distance change information can be obtained. Moreover, the distance change information carries the change of direction.
[0114] In some embodiments, the sound wave receiving device includes a first detection channel and a second detection channel different from the first detection channel in position;
[0115] The angle change information corresponding to the movement of the sound wave receiving device from the first position to the second position is determined, and includes:
[0116] According to the first signal received by the first detection channel and the second signal received by the second detection channel when the sound wave receiving device is located at the first position, a first reference distance is determined;
[0117] According to the third signal received by the first detection channel and the fourth signal received by the second detection channel when the sound wave receiving device is located at the second position, a second reference distance is determined;
[0118] According to the first reference distance, the second reference distance and the distance between the first detection channel and the second detection channel, the angle change information is determined.
[0119] In the embodiments of the present disclosure, the sound wave receiving device has at least two sound wave detection channels in different positions, i.e., the first detection channel and the second detection channel. By using at least two channels of the sound wave receiving device, the angle change information can be determined.
[0120] The first detection channel and the second detection channel can respectively receive sound wave signals, and therefore, the phase difference between the two can be determined based on the sound wave signals detected by the two respectively and the reference signal. In the first position of the sound wave receiving device, the first distance difference between the first detection channel and the sound wave emitting device and the second distance difference between the second detection channel and the sound wave emitting device can be determined based on the phase difference detected between the two channels and the reference signal, i.e., the first reference distance. Correspondingly, in the second position of the sound wave receiving device, the second distance difference between the first detection channel and the sound wave emitting device and the second distance difference between the second detection channel and the sound wave emitting device can be determined, i.e., the second reference distance.
[0121] Based on the first reference distance, the angle change relationship of the sound wave receiving device after moving from the first position to the second position can be determined, including the angle between the sound wave emitting device and the line connecting the two detection channels of the sound wave receiving device in the first position, and the angle between the sound wave emitting device and the line connecting the two detection channels of the sound wave receiving device in the second position.
[0122] Thus, the angle change information can be obtained. By using the angle change information, the distance change information and the detected phase difference of the sound wave, the geometric position relationship between the first position, the second position and the sound wave emitting device can be determined, and the accurate initial distance can be determined, which is convenient for subsequent actual detection.
[0123] The embodiments of the present disclosure also provide the following examples:
[0124] The embodiments of the present disclosure use one sound wave emitting device to emit periodic sound wave signals, and use two sound wave receiving devices in different positions to receive and calculate, without the need for communication between the sound wave emitting device and the sound wave receiving device, which is simple to operate and does not require additional hardware costs.
[0125] As Figure 3 shown, the principle is to use the device to measure the distance, the sound wave generating device generates sound wave signal and transmits to different positions of the sound wave receiving device (or sound wave detection channel, or the same sound wave receiving device receives at different positions, etc.), and then uses the time delay calculation unit to process to obtain the time delay, and then calculates the angle and distance information. Then use the inertial information calculation unit to calculate the other required distance and angle information, and use the geometric relationship to solve the distance between the sound wave signal receiver and the sound wave signal transmitter.
[0126] In the embodiments of the present disclosure, the ranging system can be initialized before ranging, and the initial distance is used to detect the relative distance, and then the final actual distance detection result is obtained.
[0127] As Figure 4 shown, taking the mobile phone as the above-mentioned sound wave receiving device, O point is the position of the sound wave transmitting device, A point is the position of the sound wave receiving device, B point is the position of the sound wave receiving device after moving, and mn and m’n’ respectively represent the connecting lines of the audio detection channels at the top and bottom of the mobile phone before and after moving. Here, the distance OB between the B position and the O position obtained in the initialization process can be taken as the initial distance.
[0128] The sound wave transmitting device at the O position continuously transmits a specific sound wave signal, and the sound wave receiving device is initially at position A, m represents the audio detection channel at the top of the mobile phone, and n represents the audio detection channel at the bottom of the mobile phone. In the embodiments of the present disclosure, the audio signal detected by the audio detection channel m at the top of the mobile phone can be taken as the first sound wave signal, and the time delay between the first sound wave signal and the reference signal is calculated. Move the mobile phone to the B position, and take the audio signal detected by the audio detection channel at the top of the mobile phone at m’ as the second sound wave signal, and calculate the time delay between the second sound wave signal and the reference signal.
[0129] In addition, the motion information of the mobile phone moving from the A position to the B position can be calculated by using the related data detected by the inertial sensor, including distance motion information and angle motion information. In combination with the sound wave signal settlement, the angle and time delay information can be obtained, and the geometric relationship can be used to solve the actual distance from the B position to the O position.
[0130] As Figure 4 shown, OA = OC in the figure, and according to the cosine theorem:
[0131]
[0132] Among them, the value that needs to be initialized finally is the distance OB, so the values of AB, BC and ∠AOB in the above formula need to be calculated. Including the following steps:
[0133] (1) Calculate BC
[0134] BC is the difference between the distance between the signal receiver and the signal transmitter before and after moving, that is, OB-OA. OB and OA can be calculated by time delay, assuming that the time delay between the received signal and the reference signal when the signal receiving device is at A is△t1, here two schemes are given from the perspective of time domain and frequency domain calculation.
[0135] Scheme one: time domain processing
[0136] The received signal s is the digital signal collected by the sound wave receiver, and the reference signal s r is a periodic transmitted sound wave signal (its digital signal can be pre-stored in memory) The sound volume can be calculated from the received sound wave digital signal using methods such as average value method and root mean square value method. The signal is processed in frames, and the frame length is N. The cross-correlation function (convolution calculation) of the received signal (the first sound wave signal) and the reference signal is calculated, and the calculation formula is as follows:
[0137]
[0138] Where k is the delay point number, K is the maximum delay point number, m is the time domain sampling point of the signal, s(m) is the received sound wave signal, s r (m+k).
[0139] The time delay between the received signal and the reference signal is obtained according to the cross-correlation function, and the calculation formula is as follows:
[0140] △t1=p max / f s
[0141] Where p max is the value of k when the maximum value of the cross-correlation function is obtained, and f s is the sampling frequency.
[0142] Scheme two: frequency domain processing
[0143] The received signal and the reference signal are respectively processed by framing and windowing, framing is to ensure the short-term nature of the processed data, and windowing is to reduce the leakage of spectral energy. The window functions that can be used include "Blackman-Harris window", "triangle window" and "Hamming window", etc. as shown in the following formula:
[0144] s w (t)=s(t)·w(t),t=1,2,3,…,N
[0145] s rw (t)=s r (t)·w(t),t=1,2,3,…,N
[0146] where s(t) is the detected acoustic signal, s r (t) is the reference signal, and w(t) is a window function.
[0147] Then the frequency domain transformation is performed to obtain the spectrum, and the fast Fourier transformation is taken as an example here. According to the amplitude spectrum of the received signal, the spectrum of the received signal and the reference signal is obtained:
[0148] F = FFT(s w (t)), t = 1, 2, 3, …, n
[0149] F r = FFT(s rw (t)), t = 1, 2, 3, …, n
[0150] where FFT represents the fast Fourier transformation, and n is the number of FFT points.
[0151] The cross-correlation function is obtained by performing the cross-correlation calculation on the spectrum of the received acoustic signal and the reference signal:
[0152] R 12 = IFFT(F*F r * )
[0153] where F r * is the conjugate of F r .
[0154] The time delay between the received signal and the reference signal is obtained according to the cross-correlation function. The calculation formula is as follows:
[0155] △t1= p max / f s
[0156] where p max is the corresponding frequency shift when the maximum value of the cross-correlation function is obtained, and f s is the sampling frequency.
[0157] The distance OA between the signal receiver at point A and the signal transmitter is:
[0158] OA = d0+△t1*u
[0159] where d0 is the corrected distance, which is not required to be determined at present and will be eliminated later. u is the speed of sound in air, which is 340 m / s (meter per second) at normal temperature.
[0160] Similarly, the time delay Δt2 of the received signal (second sound wave signal) at B can be calculated, and the distance OB between B and O where the sound wave emitting device is located can be obtained:
[0161] OB = d0 + Δt2 * u
[0162] At this time, BC can be calculated, and in this process, the above-mentioned corrected distance d0 is eliminated to obtain the accurate BC:
[0163] BC = OB - OC = OB - OA = (Δt1 - Δt2) * u
[0164] At this time, the distance BC in the middle is obtained by using the sound wave receiving device to receive the sound wave signals at the positions A and B respectively, and performing operation processing based on the reference signal and the received signals. Figure 4 Next, the operation of the second step can be entered to obtain the distance AB.
[0165] (2) Calculate AB
[0166] As shown in Figure 4 , the displacement of the sound wave receiving device before and after movement can be calculated by linear acceleration twice integration. The linear acceleration is the acceleration of the sound wave receiving device in its carrier coordinate system, which can be obtained in two ways: one is that the general intelligent mobile phone device can directly obtain the linear acceleration information from the system; the other is to obtain the linear acceleration information in the carrier coordinate system by inertial navigation solution based on the proportional information measured by the accelerometer and the angular velocity information measured by the gyroscope. Assuming that the linear acceleration obtained is [a x a y a z ]; wherein x, y, and z represent three directions of the coordinate system. Twice integration in time can obtain:
[0167]
[0168]
[0169]
[0170] The D x , D y , and D z obtained by the above-mentioned twice integration are the distances of the sound wave receiving device moving in three directions of the coordinate system.
[0171] Thus, the moving distance of the sound wave receiving device from the position A to the position B is obtained:
[0172]
[0173] (3) Calculate ∠AOB
[0174] As shown in Figure 5 , draw parallel line LL' of mn as auxiliary line, then the angles in the figure: ∠α (the angle between OA and mn), ∠γ (the angle between OB and m'n') and ∠β (the angle between m'n' and auxiliary line LL') can be calculated by the following formula:
[0175]
[0176] In the formula, d1 is the difference between the distance from m to O and the distance from n to O, sgn() is the sign function, mn is the distance between the two audio detection channels on the sound wave receiving device, and d1 can be calculated by the method of calculating BC in step (1) above.
[0177]
[0178] In the formula, d2 is the difference between the distance from m' to O and the distance from n' to O, sgn() is the sign function, m'n' is the distance between the two audio detection channels on the sound wave receiving device, and d2 can be calculated by the method of calculating BC in step (1) above.
[0179] ∠β is the angle of rotation of the sound wave receiving device around the z-axis, which can be calculated by the following formula:
[0180]
[0181] In the formula, ω z (t) is the rotation angle of the z-axis measured by the gyroscope.
[0182] ∠AOB = π - ∠α - (π - ∠γ - ∠β) = ∠γ + ∠β - ∠α
[0183] Thus, the calculation of ∠AOB is completed.
[0184] At this time, BC, AB and ∠AOB have been calculated based on the sound wave signals detected at positions A and B, the reference signal and the motion information of the sound wave receiving device. At this time, the distance OB can be obtained by solving the equation by the following formula:
[0185]
[0186] Thus, the initialization process is completed, and the initial distance OB, i.e. d0 = -OB, is obtained. Subsequently, the time delay △t between the top audio detection channel of the mobile phone and the sound wave transmitting device can be calculated using the method in (2), and the actual distance to be measured can be calculated by the following formula:
[0187] d = d0 + △t * u
[0188] Thus, by the method in the embodiments of the present disclosure, one sound wave transmitting device and one or two sound wave receiving devices are used to calculate by an initialization method and obtain accurate distance combined with motion information. No communication is needed between the sound wave receiving device and the sound wave transmitting device, and only the sound wave receiving device needs to be calculated, so the application range is wide, no additional hardware cost is needed, and the operation is simple and the detection precision is high.
[0189] Figure 6 is a structural block diagram of a ranging device according to an exemplary embodiment, as shown in Figure 6 The device is applied to a sound wave receiving device, and the device 600 includes:
[0190] The detection module 601 is configured to detect a detection sound wave signal sent by a sound wave transmitting device.
[0191] The first determination module 602 is configured to determine a to-be-detected distance between the sound wave transmitting device and the sound wave receiving device according to a phase difference between the detection sound wave signal and a predetermined reference signal and a predetermined initial distance.
[0192] In some embodiments, the device further includes:
[0193] The second determination module is configured to determine the predetermined initial distance according to an initial position of the sound wave receiving device.
[0194] In some embodiments, the initial position includes a first position and a second position after the sound wave receiving device moves.
[0195] The second determination module includes:
[0196] The first receiving sub-module is configured to receive a first sound wave signal at the first position.
[0197] The second receiving sub-module is configured to receive a second sound wave signal at the second position.
[0198] The acquisition sub-module is configured to acquire motion information of the sound wave receiving device moving from the first position to the second position.
[0199] The first determination sub-module is configured to determine the initial distance according to a phase difference between the first sound wave signal and the second sound wave signal and the motion information.
[0200] In some embodiments, the device further includes:
[0201] The third determination module is configured to determine a first reference phase difference according to a cross-correlation function of the first sound wave signal and the reference signal.
[0202] a fourth determining module, configured to determine a second reference phase difference according to a cross-correlation function of the second sound wave signal and the reference signal;
[0203] a fifth determining module, configured to determine the phase difference between the first sound wave signal and the second sound wave signal according to the first reference phase difference and the second reference phase difference.
[0204] In some embodiments, the motion information includes distance change information and angle change information.
[0205] The acquisition sub-module includes:
[0206] a second determining sub-module, configured to determine the distance change information according to acceleration information of the sound wave receiving device in each direction of a predetermined coordinate system;
[0207] a third determining sub-module, configured to determine the angle change information corresponding to movement of the sound wave receiving device from the first position to a second position.
[0208] In some embodiments, the second determining sub-module is specifically configured to:
[0209] perform twice integral processing on the acceleration information of the sound wave receiving device in each direction of a predetermined coordinate system to obtain displacement information in the each direction;
[0210] determine the distance change information according to the displacement information in the each direction.
[0211] In some embodiments, the sound wave receiving device includes a first detection channel and a second detection channel different from the first detection channel in position;
[0212] The third determining sub-module is specifically configured to:
[0213] determine a first reference distance according to a first signal received by the first detection channel and a second signal received by the second detection channel when the sound wave receiving device is located at the first position;
[0214] determine a second reference distance according to a third signal received by the first detection channel and a fourth signal received by the second detection channel when the sound wave receiving device is located at the second position;
[0215] determine the angle change information according to the first reference distance, the second reference distance, and a distance between the first detection channel and the second detection channel.
[0216] With regard to the apparatus in the above-described embodiments, a specific manner in which each module performs an operation has been described in detail in the embodiments related to the method, and thus detailed explanation will not be given here.
[0217] Figure 7 is a block diagram of a terminal 800 according to an exemplary embodiment. The terminal 700 can be a mobile phone, a computer, a digital broadcast terminal, a messaging equipment, a game console, a tablet equipment, a medical equipment, a fitness equipment, a personal digital assistant, and the like, for example.
[0218] Referring to Figure 7 , the terminal 700 can include one or more of the following components: a processing component 701, a memory 702, a power supply component 703, a multimedia component 704, an audio component 705, an input / output (I / O) interface 706, a sensor component 707, and a communication component 708.
[0219] The processing component 701 generally controls the overall operations of the terminal 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 701 can include one or more processors 710 to execute instructions to complete all or part of steps of the above-described methods. In addition, the processing component 701 can further include one or more modules to facilitate interaction between the processing component 701 and other components. For example, the processing component 701 can include a multimedia module to facilitate the interaction between the multimedia component 704 and the processing component 701.
[0220] The memory 710 is configured to store various types of data to support the operations of the terminal 700. Examples of these data include instructions for any application or methods operating on the terminal 700, contact data, phonebook data, messages, pictures, videos, and the like. The memory 702 can be implemented by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disc or optical disc.
[0221] The power supply component 703 supplies electric power for the various components of the terminal 700. The power supply component 703 can include a power supply management system, one or more power supplies, and other components associated with generating, managing and distributing electric power for the terminal 700.
[0222] The multimedia component 704 includes a screen to provide an output interface between the terminal 700 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense a touch, a slide and a gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or a sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 704 includes a front camera and / or a rear camera. The front camera and / or the rear camera can receive external multimedia data when the terminal 700 is in an operation mode, such as a shooting mode or a video mode. Each of the front and rear camera can be a fixed optical lens system or have a focal length and optical zooming capability.
[0223] The audio component 705 is configured to output and / or input audio signals. For example, the audio component 705 includes a microphone (MIC) to receive an external audio signal when the terminal 700 is in an operation mode, such as a call mode, a recording mode and a voice recognition mode. The received audio signal can be further stored in the memory 710 or transmitted via the communication component 708. In some embodiments, the audio component 705 further includes a speaker to output audio signals.
[0224] The I / O interface 706 provides an interface for the processing component 701 and peripheral interface modules, such as a keypad, a click wheel, buttons and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button and a lock button.
[0225] The sensor component 707 includes one or more sensors to provide various state assessments for the terminal 700. For example, the sensor component 707 can detect an open / closed state of the terminal 700, relative positioning of components, such as a display and a keypad of the terminal 700, a change in position of the terminal 700 or a component of the terminal 700, presence or absence of user contact with the terminal 700, an orientation or acceleration / deceleration of the terminal 700, and a temperature change of the terminal 700. The sensor component 707 can include a proximity sensor to detect presence of an object within a proximity range of the terminal 700 without any physical touch. The sensor component 707 can further include a light sensor, such as a CMOS or CCD image sensor, for use in an imaging application. In some embodiments, the sensor component 707 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0226] The communication component 708 is configured to facilitate wired or wireless communication between the terminal 700 and other devices. The terminal 700 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 708 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 708 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, or other technology.
[0227] In an exemplary embodiment, the terminal 700 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements, for performing the above-described methods.
[0228] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 702 including instructions, is also provided, which can be executed by the processor 710 of the terminal 700 to complete the above-described methods. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.
[0229] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of a mobile terminal, the mobile terminal is enabled to perform the method provided by any of the above-described embodiments.
[0230] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
[0231] It is to be understood that the application is not limited to the precise construction described and as shown in the attached figures, and that various modifications and changes can be effected therein by those skilled in the art without departing from the scope of the application. The scope of the application is to be limited only by the appended claims.
Claims
1. A distance measurement method, characterized in that, The method includes: The sound wave receiving device detects the detection sound wave signal sent by the sound wave transmitting device; The detection distance between the sound wave transmitting device and the sound wave receiving device is determined based on the phase difference between the detected sound wave signal and the predetermined reference signal and the predetermined initial distance. The initial position of the sound wave receiving device includes: a first position and a second position after the sound wave receiving device has moved; Receive the first acoustic signal at the first position; Receive the second acoustic signal at the second position; Obtain motion information of the sound wave receiving device as it moves from the first position to the second position; The initial distance is determined based on the phase difference between the first and second acoustic signals and the motion information.
2. The method according to claim 1, characterized in that, The method further includes: The first reference phase difference is determined based on the cross-correlation function of the first acoustic signal and the reference signal; The second reference phase difference is determined based on the cross-correlation function of the second acoustic signal and the reference signal; The phase difference between the first acoustic signal and the second acoustic signal is determined based on the first reference phase difference and the second reference phase difference.
3. The method according to claim 1, characterized in that, The motion information includes: distance change information and angle change information; The step of obtaining motion information of the acoustic receiving device from the first position to the second position includes: The distance change information is determined based on the acceleration information of the sound wave receiving device in each direction of the predetermined coordinate system. Determine the angle change information corresponding to the movement of the sound wave receiving device from the first position to the second position.
4. The method according to claim 3, characterized in that, Determining the distance change information based on the acceleration information of the sound wave receiving device in each direction of the predetermined coordinate system includes: The acceleration information of the sound wave receiving device in each direction of the predetermined coordinate system is processed by a second integration to obtain the displacement information in each direction. The distance change information is determined based on the displacement information in each direction.
5. The method according to claim 3, characterized in that, The acoustic wave receiving device includes: a first detection channel and a second detection channel located at a different position from the first detection channel; The step of determining the angle change information corresponding to the movement of the sound wave receiving device from the first position to the second position includes: Based on the acoustic wave receiving device being located at the first position, the first signal received by the first detection channel and the second signal received by the second detection channel are used to determine the first reference distance; Based on the location of the acoustic receiving device at the second position, the third signal received by the first detection channel and the fourth signal received by the second detection channel are used to determine the second reference distance; The angle change information is determined based on the first reference distance, the second reference distance, and the distance between the first detection channel and the second detection channel.
6. A ranging device, characterized in that, The device includes: The detection module is used to detect the detection acoustic wave signal sent by the acoustic wave transmitting device; The first determining module is used to determine the detection distance between the sound wave transmitting device and the sound wave receiving device based on the phase difference between the detected sound wave signal and the predetermined reference signal and the predetermined initial distance. The initial position of the sound wave receiving device includes: a first position and a second position after the sound wave receiving device has moved; The first receiving submodule is used to receive the first acoustic signal at the first position; The second receiving submodule is used to receive the second acoustic signal at the second position; The acquisition submodule is used to acquire motion information of the acoustic wave receiving device as it moves from the first position to the second position. The first determining submodule is used to determine the initial distance based on the phase difference between the first acoustic signal and the second acoustic signal, and the motion information.
7. The apparatus according to claim 6, characterized in that, The device further includes: The third determining module is used to determine the first reference phase difference based on the cross-correlation function of the first acoustic signal and the reference signal; The fourth determining module is used to determine the second reference phase difference based on the cross-correlation function of the second acoustic signal and the reference signal; The fifth determining module is used to determine the phase difference between the first acoustic signal and the second acoustic signal based on the first reference phase difference and the second reference phase difference.
8. The apparatus according to claim 6, characterized in that, The motion information includes: distance change information and angle change information; The acquisition submodule includes: The second determining submodule is used to determine the distance change information based on the acceleration information of the sound wave receiving device in each direction of the predetermined coordinate system; The third determining submodule is used to determine the angle change information corresponding to the movement of the sound wave receiving device from the first position to the second position.
9. The apparatus according to claim 8, characterized in that, The second determining submodule is specifically used for: The acceleration information of the sound wave receiving device in each direction of the predetermined coordinate system is processed by a second integration to obtain the displacement information in each direction. The distance change information is determined based on the displacement information in each direction.
10. The apparatus according to claim 8, characterized in that, The acoustic wave receiving device includes: a first detection channel and a second detection channel located at a different position from the first detection channel; The third determining submodule is specifically used for: Based on the acoustic wave receiving device being located at the first position, the first signal received by the first detection channel and the second signal received by the second detection channel are used to determine the first reference distance; Based on the location of the acoustic receiving device at the second position, the third signal received by the first detection channel and the fourth signal received by the second detection channel are used to determine the second reference distance; The angle change information is determined based on the first reference distance, the second reference distance, and the distance between the first detection channel and the second detection channel.
11. A terminal, characterized in that, The terminal includes at least: a processor and a memory for storing executable instructions capable of running on the processor, wherein: When the processor is used to run the executable instructions, the executable instructions perform the steps in the ranging method provided by any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed by a processor, implement the steps of the ranging method provided in any one of claims 1 to 5.
Citation Information
Patent Citations
High-precision real-time supersonic wave positioning tracking method and system
CN106970357A
Ultrasonic measuring method and ultrasonic workpiece diameter measuring device
JP2012037294A