DISTANCE DETECTION DEVICE AND DISTANCE DETECTION METHOD THEREOF
20190033438 ยท 2019-01-31
Assignee
Inventors
- Po-Jen Tu (New Taipei City, TW)
- Jia-Ren CHANG (New Taipei City, TW)
- Kai-Meng Tzeng (New Taipei City, TW)
Cpc classification
G01S5/30
PHYSICS
International classification
G01S11/16
PHYSICS
G01S5/30
PHYSICS
Abstract
A distance detection device and a distance detection method thereof are provided. A second time at which a packet amplitude peak of a preset sound signal is received by a sound receiver is estimated according to a time difference between the preset sound signal and a low pass filter signal thereof. A distance between a speaker and the sound receiver is calculated according to the second time.
Claims
1. A distance detection device, comprising: a speaker, outputting a preset sound signal, the preset sound signal having an amplitude and a frequency that vary over time, a time difference existing between the preset sound signal and a first low pass filter signal obtained after performing a low pass filtering on the preset sound signal, a packet amplitude peak of the preset sound signal being outputted by the speaker at a first time; a sound receiver; and a processor, performing the low pass filtering on a sound signal received by the sound receiver to generate a second low pass filter signal, the processor estimating a second time corresponding to when the packet amplitude peak of the preset sound signal is received by the sound receiver according to the time difference and the second low pass filter signal, the processor calculating a distance between the speaker and the sound receiver according to the second time.
2. The distance detection device according to claim 1, wherein the processor further determines whether a relative velocity between the speaker and the sound receiver is zero, when the relative velocity between the speaker and the sound receiver is zero and a difference between a frequency value of the sound signal received by the sound receiver corresponding to the second time and a frequency value of the preset sound signal outputted by the speaker corresponding to the first time does not exceed a preset range, the processor performs a cross-correlation operation on the preset sound signal outputted by the speaker within a first time length based on the first time and the sound signal received by the sound receiver within a second time length based on the second time so as to generate a cross-correlation signal, and calculates the distance between the speaker and the sound receiver according to a time corresponding to a packet amplitude peak of the cross-correlation signal and the first time, wherein the second time length is greater than the first time length.
3. The distance detection device according to claim 2, wherein the processor performs a Fourier transform operation on the sound signal received by the sound receiver within the first time length based on the second time and determines whether a difference between a frequency value of the sound signal received by the sound receiver having a maximum amplitude in a frequency domain within the first time length based on the second time and the frequency value of the preset sound signal outputted by the speaker corresponding to the first time exceeds the preset range, and when the preset range is not exceeded, the processor performs the cross-correlation operation on the preset sound signal outputted by the speaker within the first time length based on the first time and the sound signal received by the sound receiver within the second time length based on the second time.
4. The distance detection device according to claim 2, wherein the time difference is a difference between the first time and a third time corresponding to a packet amplitude peak of the first low pass filter signal.
5. The distance detection device according to claim 2, wherein the speaker and the sound receiver are disposed in a space, and the second time length is less than a time length required to transmit the preset sound signal for a farthest relative distance possibly disposed between the speaker and the sound receiver within the space, wherein the preset sound signal has a third time length, and the second time length is greater than or equal to the third time length.
6. The distance detection device according to claim 1, wherein the speaker outputs the preset sound signal in an m.sup.th time period where m is an integer greater than 1, the preset sound signal has a first frequency at the first time, the processor further determines whether a relative velocity between the speaker and the sound receiver is zero, when the relative velocity between the speaker and the sound receiver is not zero, the processor corrects a frequency value of the preset sound signal by using a Doppler effect according to the relative velocity between the speaker and the sound receiver previously calculated, performs a cross-correlation operation on the corrected preset sound signal and the sound signal received by the sound receiver so as to generate a cross-correlation signal, and calculates the distance between the speaker and the sound receiver according to a time corresponding to a packet amplitude peak of the cross-correlations signal and the first time so as to obtain a corrected relative distance, wherein a sound signal received by the sound receiver at the second time corresponds to a second frequency.
7. The distance detection device according to claim 6, wherein the processor calculates the relative velocity between the speaker and the sound receiver corresponding to the m.sup.th time period according to the corrected relative distance between the speaker and the sound receiver corresponding to the m.sup.th time period and the corrected relative distance between the speaker and the sound receiver corresponding to an (m-1).sup.th time period, and determines whether the relative velocity between the speaker and the sound receiver corresponding to the m.sup.th time period is converged to fall within a preset range according to the relative velocity between the speaker and the sound receiver corresponding to the m.sup.th time period and the relative velocity between the speaker and the sound receiver corresponding to the (m-1).sup.th time period.
8. The distance detection device according to claim 7, wherein the relative distance between the speaker and the sound receiver corresponding to the m.sup.th time period is used as a final confirmed relative distance when a difference between the relative velocity between the speaker and the sound receiver corresponding to the m.sup.th time period and the relative velocity between the speaker and the sound receiver corresponding to the (m-1).sup.th time period divided by the relative velocity between the speaker and the sound receiver corresponding to the m.sup.th time period does not exceed the preset range.
9. The distance detection device according to claim 6, wherein the processor calculates an initial relative velocity between the speaker and the sound receiver by using the Doppler effect according to the first frequency and the second frequency.
10. The distance detection device according to claim 6, wherein the processor performs a Fourier transform operation on the sound signal received by the sound receiver within a time length centered on the second time so as to obtain the second frequency, wherein the processor further performs an interpolation operation on a plurality of frequency domain signals obtained after the Fourier transform operation is performed so as to obtain the second frequency.
11. The distance detection device according to claim 6, wherein the time difference is a difference between the first time and a third time corresponding to a packet amplitude peak of the first low pass filter signal.
12. A distance detection method of a distance detection device, the distance detection device comprising a speaker and a sound receiver, the speaker outputting a preset sound signal, the preset sound signal having an amplitude and a frequency that vary over time, a time difference existing between the preset sound signal and a first low pass filter signal obtained after performing a low pass filtering on the preset sound signal, a packet amplitude peak of the preset sound signal being outputted by the speaker at a first time, the distance detection method of the distance detection device comprising: performing the low pass filtering on a sound signal received by the sound receiver to generate a second low pass filter signal; estimating a second time corresponding to when the packet amplitude peak of the preset sound signal is received by the sound receiver according to the time difference and the second low pass filter signal; calculating a distance between the speaker and the sound receiver according to the second time.
13. The distance detection method of the distance detection device according to claim 12, comprising: determining whether a relative velocity between the speaker and the sound receiver is zero; when the relative velocity between the speaker and the sound receiver is zero, determining whether a difference between a frequency value of the sound signal received by the sound receiver corresponding to the second time and a frequency value of the preset sound signal outputted by the speaker corresponding to the first time exceeds a preset range; if the difference between the frequency value of the sound signal received by the sound receiver corresponding to the second time and the frequency value of the preset sound signal outputted by the speaker corresponding to the first time does not exceed the preset range, performing a cross-correlation operation on the preset sound signal outputted by the speaker within a first time length based on the first time and the sound signal received by the sound receiver within a second time length based on the second time so as to generate a cross-correlation signal, wherein the second time length is greater than the first time length; and calculating the distance between the speaker and the sound receiver according to a time corresponding to a paket amplitude peak of the cross-correlation signal and the first time.
14. The distance detection method of the distance detection device according to claim 13, comprising: performing a Fourier transform operation on the sound signal received by the sound receiver within the first time length based on the second time; determining whether a difference between a frequency value of the sound signal received by the sound receiver having a maximum amplitude in a frequency domain within the first time length based on the second time and the frequency value of the preset sound signal outputted by the speaker corresponding to the first time exceeds the preset range; and if the preset range is not exceeded, performing the cross-correlation operation on the preset sound signal outputted by the speaker within the first time length based on the first time and the sound signal received by the sound receiver within the second time length based on the second time.
15. The distance detection method of the distance detection device according to claim 13, wherein the first time length is a time length during which a packet amplitude of the preset sound signal is less than a preset value.
16. The distance detection method of the distance detection device according to claim 12, wherein the speaker outputs the preset sound signal in an m.sup.th time period where m is an integer greater than 1, the preset sound signal outputted by the speaker has a first frequency at the first time, and the distance detection method of the distance detection device comprises: determining whether a relative velocity between the speaker and the sound receiver is zero; when the relative velocity between the speaker and the sound receiver is not zero, estimating the second time corresponding to when the packet amplitude peak of the preset sound signal is received by the sound receiver according to the time difference and the second low pass filter signal, wherein the sound signal received by the sound receiver at the second time corresponds to a second frequency; correcting a frequency value of the preset sound signal by using a Doppler effect according to the relative velocity between the speaker and the sound receiver previously calculated; performing a cross-correlation operation on the corrected preset sound signal and the sound signal received by the sound receiver so as to generate a cross-correlation signal; and calculating the distance between the speaker and the sound receiver according to a time corresponding to a packet amplitude peak of the cross-correlations signal and the first time so as to obtain a corrected relative distance.
17. The distance detection method of the distance detection device according to claim 16, comprising: calculating the relative velocity between the speaker and the sound receiver corresponding to the m.sup.th time period according to the corrected relative distance between the speaker and the sound receiver corresponding to the m.sup.th time period and the corrected relative distance between the speaker and the sound receiver corresponding to an (m-1).sup.th time period; and determining whether the relative velocity between the speaker and the sound receiver corresponding to the m.sup.th time period is converged to fall within a preset range according to the relative velocity between the speaker and the sound receiver corresponding to the m.sup.th time period and the relative velocity between the speaker and the sound receiver corresponding to the (m-1).sup.th time period.
18. The distance detection method of the distance detection device according to claim 17, wherein using the relative distance between the speaker and the sound receiver corresponding to the m.sup.th time period as a final confirmed relative distance when a difference between the relative velocity between the speaker and the sound receiver corresponding to the m.sup.th time period and the relative velocity between the speaker and the sound receiver corresponding to the (m-1).sup.th time period divided by the relative velocity between the speaker and the sound receiver corresponding to the m.sup.th time period does not exceed the preset range.
19. The distance detection method of the distance detection device according to claim 16, wherein the time difference is a difference between the first time and a third time corresponding to a packet amplitude peak of the first low pass filter signal, wherein the speaker and the sound receiver are disposed within a space, and a time length of each time period for outputting the preset sound signal is equal to a time length required to transmit the preset sound signal for a farthest relative distance possibly disposed between the speaker and the sound receiver within the space, wherein the low pass filtering is an infinite impulse response filtering, wherein the cross-correlation operation is a fast cross-correlation operation.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
DESCRIPTION OF THE EMBODIMENTS
[0052] Reference will now be made in detail to the present preferred embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts.
[0053] With reference to
[0054] Furthermore, the processor 106 can conduct the signal transmission with the speaker 102 by, for example, a network transmission, so as to obtain a time point at which the preset sound signal is outputted by the speaker 102. A time difference exists between the preset sound signal and a first low pass filter signal obtained by performing a low pass filtering on the preset sound signal (e.g., performing an infinite impulse response filtering on the preset sound signal, but not limited thereto). For instance,
[0055]
[0056] Furthermore, the processor 106 can determine whether a difference between a frequency value of the sound signal y(t) received by the sound receiver 104 corresponding to the time t_Max and a frequency value of the preset sound signal s(t) outputted by the speaker 102 corresponding to the time t_Tx exceeds a preset range. Specifically, the processor 106 can perform a Fourier transform operation on the sound signal y(t) received by the sound receiver 104 within a time length T_C based on the time t_Max (e.g., centered on the time t_Max, but not limited thereto), and determine whether a difference between a frequency value of a frequency domain signal having a maximum amplitude in a frequency domain of the sound signal y(t) received by the sound receiver 104 within the time length T_C based on the time t_Tx (e.g., centered on the time t_Tx, but not limited thereto) and the frequency value of the preset sound signal s(t) outputted by the speaker 102 corresponding to the time t_Tx exceeds the preset range. When the difference between the frequency value of the sound signal y(t) received by the sound receiver 104 corresponding to the time t_Max and the frequency value of the preset sound signal s(t) outputted by the speaker 102 corresponding to the time t_Tx does not exceed the preset range, it means that the preset sound signal s(t) is received by the sound receiver 104. The time length T_C may be, for example, set as a time length during which a packet amplitude of the preset sound signal s(t) is less than a preset value. In other words, only a portion of the preset sound signal s(t) with the packet amplitude being larger is used for comparing the frequency values so an accuracy of the comparison result may be improved. Moreover, an amount of operations may also be reduced for the processor 106.
[0057] When the difference between the frequency value of the sound signal y(t) received by the sound receiver 104 corresponding to the time t_Max and the frequency value of the preset sound signal s(t) outputted by the speaker 102 corresponding to the time t_Tx does not exceed the preset range, the processor 106 can perform a cross-correlation operation on the preset sound signal s(t) outputted by the speaker 102 within the time length T_C based on the time t_Tx and the sound signal received by the sound receiver 104 within a time length T_N based on the time t_Max so as to generate a cross-correlation signal, The cross-correlation operation may be, for example, a fast cross-correlation operation, but not limited thereto. In addition, the time length T_N is greater than the time length T_C. The time length T_N may be, for example, set to be greater than or equal to a time length TA of the preset sound signal s(t) but less than a time required to transmit the preset sound signal s(t) for a farthest relative distance possibly disposed between the speaker 102 and the sound receiver 104 within a space. The processor 106 can calculate the distance R1 between the speaker 102 and the sound receiver 104 according to a time t_Rx corresponding to a packet amplitude peak of the cross-correlation signal (i.e., an accurate time when the packet amplitude peak of the preset sound signal s(t) is received by the sound receiver 104) and the time t_Tx. For instance, the distance R1 between the speaker 102 and the sound receiver 104 may be equal to (t_Rx-t_Tx)c where c is an acoustical velocity.
[0058] It should be noted that, in some embodiments, the time length T_N may also be set to be less than the time length TA. For example, the time length T_N may be set as a time length during which the packet amplitude of the preset sound signal s(t) is less than another preset value. By setting the time length T_N to be less than the time required to transmit the preset sound signal s(t) for the farthest relative distance possibly disposed between the speaker 102 and the sound receiver 104 within the space, the processor 106 does not need to perform the cross-correlation operation on the preset sound signal s(t) and the sound signal y(t) received by the sound receiver 104 over a long period of time (at least the time length TA plus the time required to transmit the preset sound signal s(t) for the farthest relative distance possibly disposed between the speaker 102 and the sound receiver 104 within the space) as required in the prior art.
[0059] In this way, the time required for the processor 106 to perform the cross-correlation operation on the preset sound signal s(t) and the sound signal y(t) may be significantly reduced. Also, it is given that the processor 106 already determines that the difference between the frequency value of the frequency domain signal having the maximum amplitude in the frequency domain of the sound signal y(t) received by the sound receiver 104 within the time length T_C based on the time t_Tx and the frequency value of the preset sound signal s(t) outputted by the speaker 102 corresponding to the time t_Tx does not exceed the preset range. Therefore, since it can be ensured that the preset sound signal s(t) is indeed received by the sound receiver 104, the time t_Rx when the packet amplitude peak of the preset sound signal s(t) is received by the sound receiver 104 may be obtained accurately, such that the distance R1 between the speaker 102 and the sound receiver 104 may then be calculated accordingly.
[0060] With reference to
[0061] It should be noted that, according to the distance detection method of the above embodiment, in the case where the distance R1 between the speaker 102 and the sound receiver 104 is fixed, the relative distance R1 between the speaker 102 and the sound receiver 104 may be accurately detected while significantly and effectively saving computational resources. However, in the case where the distance R1 of the speaker 102 and the sound receiver 104 is not fixed, i.e., if the relative velocity between the speaker 102 and the sound receiver 104 is not zero, an accuracy of the detected distance R1 will be reduced. The processor 106 can receive data from the speaker 102 and the sound receiver 104 (e.g., sensed data from a velocity sensor, an acceleration sensor, a gyroscope sensor, a height sensor, a direction on the speaker 102 and the sound receiver 104) through networks or other methods in wired or wireless manner, so as to learn whether or not the relative velocity between the speaker 102 and the sound receiver 104 is zero. When the relative velocity between the speaker 102 and the sound receiver 104 is zero, the processor can detect the distance R1 between the speaker 102 and the sound receiver 104 according to the method described in the foregoing embodiments. When the relative velocity between the speaker 102 and the sound receiver 104 is not zero, the processor can detect the distance R1 between the speaker 102 and the sound receiver 104 by the following method.
[0062] The speaker 102 can, for example, output one preset sound signal per one time period, and the preset sound signal s(t) may be expressed by the following equation:
s(t)=A(t).Math.cos [2.Math.f(t).Math.t] (1)
[0063] In this equation, t is the time, A(t) is the amplitude of the preset sound signal s(t), and f(t) is the frequency of the preset sound signal s(t). A time length of each time period may be, for example, set as a time length of the preset sound signal s(t) plus the time required to transmit the preset sound signal s(t) for the farthest relative distance possibly disposed between the speaker 102 and the sound receiver 104 within the space.
[0064] By doing so, it can be ensured that the sound receiver 104 is able to receive the preset sound signal s(t) sent by the speaker 102 in each time period.
[0065] It is assumed that the speaker 121 outputs the preset sound signal s(t) in an m.sup.th time period where m is an integer greater than 1, and the packet amplitude peak of the preset sound signal s(t) corresponds to the time t_Tx and a frequency f_TMax. In addition, the sound signal y(t) received by the sound receiver 104 corresponds to the frequency f_RMax at the time t_Max. A frequency f_RMax may be obtained by, for example, performing the Fourier transform operation on the sound signal y(t) received by the sound receiver 104 within the time length T_C based one the time t_Max (e.g., centered on the time t_Max, but not limited thereto) by the processor 106. The frequency f_RMax may be, for example, the frequency value of the frequency domain signal having the maximum amplitude in the frequency domain of the sound signal y(t), but not limited thereto. In some embodiment, the processor 106 can further perform an interpolation operation (e.g., a polynomial interpolation operation, but not limited thereto) on a plurality of frequency domain signals obtained after the Fourier transform operation is performed so as to obtain the frequency f_RMax more accurately. The time length T_C may be, for example, set as a time length during which a packet amplitude of the preset sound signal s(t) is less than a preset value. In other words, only a portion of the preset sound signal s(t) with larger amplitude is used to conduct comparison between the frequency values so an accuracy for calculating the frequency may be improved. Moreover, an amount of operations may also be reduced for the processor 106.
[0066] The processor 106 can correct the frequency value of the preset sound signal s(t) by using a Doppler effect according to the relative velocity between the speaker 102 and the sound receiver 104 previously calculated. For instance, the processor 106 can correct the frequency f(t) of the preset sound signal s(t) by using the following equation:
[0067] In this equation, f(t) is a corrected frequency, v.sub.m.sup.k-1 is an initial relative velocity between the speaker 102 and the sound receiver 104 at a (k-1).sup.th stage in the m.sup.th time period, c is an acoustical velocity, and k is a positive integer. The corrected preset sound signal x(t) may be expressed by the following equation:
[0068] The initial relative velocity between the speaker 102 and the sound receiver 104 (the relative velocity when k is equal to 1) may be calculated by the processor 106 according to the frequency f_RMax and the frequency f_TMax by, for example, using the following equation:
[0069] In this equation, v.sub.m.sup.0 is the initial relative velocity between the speaker 102 and the sound receiver 104 in the m.sup.th time period. The processor 106 can perform a cross-correlation operation on the corrected preset sound signal x(t) and the sound signal y(t) received by the sound receiver 104 so as to generate a cross-correlation signal. The cross-correlation operation may be, for example, a fast cross-correlation operation, but not limited thereto. The processor 106 can calculate the distance R1 between the speaker 102 and the sound receiver 104 according to a time corresponding to a packet amplitude peak of the cross-correlation signal and the time t_Tx corresponding to the packet amplitude peak of the preset sound signal s(t).
[0070] For instance, a corrected relative distance R.sub.m.sup.k may be expressed by the following equation:
R.sub.m.sup.k=(t_Rxt_Tx).Math.c (5)
[0071] The processor 106 can calculate the relative velocity between the speaker 102 and the sound receiver 104 corresponding to the m.sup.th time period according to the corrected relative distance between the speaker 102 and the sound receiver 104 corresponding to the m.sup.th time period and the corrected relative distance between the speaker 102 and the sound receiver 104 corresponding to an (m-1).sup.th time period. For instance, the relative velocity v.sub.m.sup.k at a k.sup.th stage in the m.sup.th time period may be expressed by the following equation:
v.sub.m.sup.k=(R.sub.m.sup.kR.sub.m-1)/Td (6)
[0072] In this equation, Td is a time length of each time period, and R.sub.m-1 is the relative distance calculated for the (m-1).sup.th time period. After obtaining the initial relative velocity v.sub.m.sup.0 the processor 106 can start to recursively calculate the relative velocity between the speaker 102 and the sound receiver 104 according to the above equations (2), (3), (5) and (6) until the relative velocity is converged to a specific value. For instance, the processor 106 can determine whether the relative velocity between the speaker 102 and the sound receiver 104 corresponding to the m.sup.th time period is converged to fall within a preset range according to the relative velocity between the speaker 102 and the sound receiver 104 corresponding to the m.sup.th time period and the relative velocity between the speaker 102 and the sound receiver 104 corresponding to the (m-1).sup.th time period. For example, the processor 106 can determine whether the relative velocity is converged according to the following equation:
[0073] In this equation, THV is a preset threshold. When an absolute value of (v.sub.m.sup.kv.sub.m.sup.k-1)/v.sub.m.sup.k is converged to fall within the preset range from THV to THV, it means that the accuracy of the corrected relative distance R.sub.m.sup.k at the k.sup.th stage in the m.sup.th time period calculated by the processor 106 meets the requirement, and such corrected relative distance may then be used a final confirmed relative distance for the m.sup.th time period. Similarly, the relative velocity v.sub.m.sup.k at the k.sup.th stage in the m.sup.th time period may also be used as a final confirmed relative velocity for the m.sup.th time period. In addition, a final continued relative acceleration a.sub.m between the speaker 102 and the sound receiver 104 may be expressed by the following equation:
a.sub.m=(v.sub.mv.sub.m-1)/Td (8)
[0074] With reference to
[0075] Next, the low pass filtering is performed on a sound signal received by the sound receiver to generate a second low pass filter signal (step S504). Then, a second time corresponding to when the packet amplitude peak of the preset sound signal is received by the sound receiver is estimated according to the time difference and the second low pass filter signal (step S506). The sound signal received by the sound receiver at the second time corresponds to a second frequency. The second frequency may be obtained by, for example, performing a Fourier transform operation on the sound signal received by the sound receiver within a time length centered on the second time. In some embodiment, an interpolation operation may be further performed on a plurality of frequency domain signals obtained after the Fourier transform operation is performed so as to obtain the second frequency. In addition, the time difference may be, for example, a difference between the first time and a third time corresponding to a packet amplitude peak of the first low pass filter signal. Subsequently, a frequency value of the preset sound signal is corrected by using a Doppler effect according to the relative velocity between the speaker and the sound receiver previously calculated (step S508). Then, a cross-correlation operation is performed on the corrected preset sound signal and the sound signal received by the sound receiver so as to generate a cross-correlation signal (step S510). The cross-correlation operation may be, for example, a fast cross-correlation operation, but not limited thereto. Next, the distance between the speaker and the sound receiver is calculated according to a time corresponding to a packet amplitude peak of the cross-correlations signal so as to obtain a corrected relative distance (step S512).
[0076] For instance, in step S512, the relative velocity between the speaker and the sound receiver corresponding to the m.sup.th time period may first be corrected according to the corrected relative distance between the speaker and the sound receiver corresponding to the m.sup.th time period and the corrected relative distance between the speaker and the sound receiver corresponding to an (m-1).sup.th time period (step S512A). The initial relative velocity between the speaker and the sound receiver may be calculated by using the Doppler effect according to the first frequency and the second frequency. Then, whether the relative velocity between the speaker and the sound receiver corresponding to the m.sup.th time period is converged to fall within a preset range is determined according to the relative velocity between the speaker and the sound receiver corresponding to the m.sup.th time period and the relative velocity between the speaker and the sound receiver corresponding to the (m-1).sup.th time period (step S512B). If the relative velocity is converged to fall within the preset range, the relative velocity between speaker and the sound receiver corresponding to the m.sup.th time period is used as a final relative distance (step S512C). Conversely, if the relative velocity is not converged to fall within the preset range, the process may go back to step S508, in which the frequency value of the preset sound signal is adjusted again according to the newly calculated relative velocity, and then proceed to the subsequent steps for calculating the relative distance until a result that can be used as the final confirmed relative distance is obtained.
[0077] In summary, based on the embodiments of the invention, the second time when the packet amplitude peak of the preset sound signal is received by the sound receiver is estimated according to the time difference between the preset sound signal and the low pass filter signal thereof and the low pass filter signal of the sound signal received by the sound receiver. When the frequency value of the sound signal received by the sound receiver at the second time is approximate to the frequency of the packet amplitude peak of the preset sound signal outputted at the first time, the cross-correlation operation is performed on the preset sound signal outputted by the speaker within the first time length based on the first time and the sound signal received by the sound receiver within the second time length based on the second time so as to generate the cross-correlation signal, and the distance between the speaker and the sound receiver is calculated according to the time corresponding to the packet amplitude peak of the cross-correlation signal and the first time. The second time length is greater than the first time length. As a result, simply by performing the cross-correlation operation on the preset sound signal outputted by the speaker within the first time length based on the first time and the sound signal received by the sound receiver within the second time length based on the second time, the relative distance between the speaker and the sound receiver may be accurately calculated while significantly and effectively saving computational resources.
[0078] It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.