Method and apparatus for detecting relative position between devices
By acquiring audio signals emitted by the speaker of device A through the microphone of device B, determining the audio segment and arrival time, and constructing a hyperbolic function, the problem of accurately locating the relative position between devices in the prior art is solved, and high-precision device position detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2021-02-10
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies struggle to determine the relative positions of devices with high precision without adding extra hardware, especially since the relative positions of devices cannot be accurately determined by reflected signals.
The audio signal emitted by the speaker of device A is collected by the microphone of device B, the first and second audio segments are determined, and the relative position between device A and device B is calculated based on the arrival time of the audio segments. A hyperbolic function is constructed using the arrival time of the audio signal to avoid multipath interference of the audio signal during spatial transmission.
It enables high-precision determination of the relative positions between devices without adding hardware, improving the accuracy of device position detection and user experience.
Smart Images

Figure CN114910867B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of positioning, and more particularly to a method and apparatus for detecting the relative position between devices. Background Technology
[0002] Spatial interaction refers to human-computer interaction technologies and methods based on spatial location awareness (including relative positions and angles, absolute positions and angles, etc. between people and devices, and between devices). In order to achieve a better user experience, spatial awareness needs to be achieved between multiple devices of the user. For example, Apple uses ultra-wideband (UWB) technology to realize the AirDrop directional sharing function; and devices use WIFI and Bluetooth for proximity detection.
[0003] In one approach, multiple ultrasonic positioning modules transmit ultrasonic signals. These signals are reflected upon contact with the user's hand. The reflected signals are then filtered by a control and processing module and output to a computer, generating information such as the user's hand posture and position. However, relying solely on reflection is insufficient to determine the relative positions between devices. Summary of the Invention
[0004] This application provides a method and apparatus for detecting the relative position between devices. Using this application, the relative position between devices can be determined with low cost and high accuracy without adding extra hardware.
[0005] In a first aspect, embodiments of this application provide a method for detecting the relative position between devices, including:
[0006] A first target audio signal is acquired through the first microphone of device B. The first target audio signal is acquired based on the first audio signal emitted by the first speaker and the second audio signal emitted by the second speaker of device A. A first audio segment and a second audio segment are determined based on the first target time and the first target audio signal. The first target time is the time in the first target audio signal determined according to the target amplitude. The first audio segment is the segment in the first target audio signal related to the first audio signal. The second audio segment is the segment in the first target audio signal related to the second audio signal. The first audio segment and the second audio segment are searched respectively to obtain the first arrival time and the second arrival time. The first arrival time is the time corresponding to the first target peak, and the second arrival time is the time corresponding to the second target peak. The first target peak is the peak with the earliest reception time among the peaks in the first audio segment whose signal amplitude is greater than the first preset amplitude. The second target peak is the peak with the earliest reception time among the peaks in the second audio segment whose signal amplitude is greater than the second preset amplitude. The relative position between device A and device B is determined based on the first arrival time and the second arrival time.
[0007] In the first target audio signal, the time interval corresponding to the first audio segment does not overlap with the time interval corresponding to the second audio segment.
[0008] Optionally, the timing of the first speaker of device A emitting the first audio signal may or may not overlap with the timing of the second speaker of device A emitting the second audio signal. The aforementioned first preset amplitude and second preset amplitude may be the same or different.
[0009] Optionally, the first target time is a time determined based on the target amplitude in the first target audio signal. Specifically, the first target time is the time corresponding to the highest signal amplitude in the first target audio signal, or, in the first target audio signal, there are multiple peaks with signal amplitudes exceeding the target amplitude, and the first target time is the time corresponding to the peak with the earliest reception time among these peaks. Optionally, the target peak may also be the average, maximum, or other value of multiple peaks in the first audio signal.
[0010] The relative position between devices A and B is determined by collecting audio signals emitted by the first and second speakers of device A through the first microphone of device B. This achieves the determination of the relative position between devices without adding additional hardware. By searching for the audio signals generated by the first and second speakers of device A, the first arrival time and the second arrival time are obtained. The relative position between devices A and B is determined based on the first arrival time and the second arrival time, avoiding multipath interference in the spatial transmission of audio signals, thereby improving the accuracy of the relative position between devices.
[0011] In one feasible embodiment, determining a first audio segment and a second audio segment based on a first target time and a first target audio signal includes:
[0012] A first audio segment is determined from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B; a second audio segment is determined from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the time interval between the first speaker of device A generating the first audio signal and the second speaker of device A generating the second audio signal.
[0013] The first audio segment and the second audio segment are determined from the first target audio signal based on the time corresponding to the maximum signal amplitude in the first target audio signal (i.e., the first target time), the distance between the two speakers of device A, and the sampling frequency of the first microphone of device B. This facilitates the subsequent determination of the first arrival time and the second arrival time, thereby avoiding multipath interference in the spatial transmission of audio signals and improving the accuracy of the relative position between devices.
[0014] In one feasible embodiment, determining a first audio segment from a first target audio signal based on a first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B includes:
[0015] A first time interval is determined based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B; the start time of the first time interval is ind_max-2*(d / v)*f, and the end time is ind_max+2*(D / v)*f; ind_max is the first target time, d is the first preset distance, D is the distance between the first and second speakers of device A, v is the speed of sound, and f is the sampling frequency of the first microphone of device B; a first audio segment is determined from the first target audio signal based on the first time interval, and the first audio segment is the audio segment corresponding to the first time interval in the first target audio signal.
[0016] Optionally, the first preset distance can be a preset value, which can be preset according to the application scenario. For example, in an open space, the preset distance is 10m, and in a room, the preset distance is 5m. Of course, this preset distance is still determined based on the product of the preset time and the speed of sound.
[0017] In one feasible embodiment, determining a second audio segment from the first target audio signal based on a first target time, the distance between the first and second speakers, the sampling frequency of the first microphone, and the time interval between the first speaker generating a first audio signal and the second speaker generating a second audio signal includes:
[0018] A second time interval is determined based on the first target time, the distance between the first and second speakers, the sampling frequency of the first microphone, and the time interval. The start time of the second time interval is ind_max - 2*(d / v)*f - T1, and the end time is ind_max + 2*(D / v)*f - T1. Ind_max is the first target time, d is the first preset distance, D is the distance between the first and second speakers, v is the speed of sound, f is the sampling frequency of the first microphone, and T1 is the time interval. A second audio segment is determined from the first target audio signal based on the second time interval; this second audio segment is the audio segment in the second target audio signal corresponding to the second time interval.
[0019] In one feasible embodiment, determining a second audio segment from the first target audio signal based on a first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the time interval between the first audio signal generated by the first speaker and the second audio signal generated by the second speaker of device A includes:
[0020] The third and fourth time intervals are determined based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the aforementioned time intervals. The third time interval begins at ind_max - 2*(d / v)*f + T1 and ends at ind_max + T1 + 2*(d / v)*f; the fourth time interval begins at ind_max - 2*(d / v)*f - T1 and ends at ind_max - T1 + 2*(d / v)*f; where ind_max is the first target time, d... The first preset distance is defined as follows: D is the distance between the first and second speakers of device A, v is the speed of sound, f is the sampling frequency of the first microphone of device B, and T1 is the time interval. The second audio segment is determined from the third and fourth audio segments, wherein the second audio segment is the audio segment in the third and fourth audio segments whose ratio of the maximum signal amplitude to the LOS signal amplitude is within a preset range, wherein the third audio segment is the audio segment corresponding to the third time interval in the first target audio signal, and the fourth audio segment is the audio segment corresponding to the fourth time interval in the first target audio signal.
[0021] The start and end times of the first time interval are determined by information such as the first target time. Then, the first audio segment is determined from the first target audio signal based on the first time interval. The third and fourth audio segments are determined based on the first target time and other information. Then, the second audio segment is determined from the third and fourth audio segments. This facilitates the subsequent determination of the first and second arrival times, thereby avoiding multipath interference in the spatial transmission of audio signals and improving the accuracy of the relative positions between devices.
[0022] In one feasible embodiment, the first target audio signal includes a third audio signal and a fourth audio signal. The third audio signal is a first audio signal received by the first microphone of device B and emitted by the first speaker of device A. The fourth audio signal is a second audio signal received by the first microphone of device B and emitted by the second speaker of device A. Determining the first audio segment and the second audio segment based on the first target time and the first target audio signal includes:
[0023] A fifth time interval is determined based on a first target time and a preset time threshold; a sixth time interval is determined based on a second target time and a preset time threshold; wherein, the first target time is the time determined in the third audio signal based on the target amplitude, the second target time is the time determined in the fourth audio signal based on the target amplitude, the end time of the fifth time interval is the first target time, the end time of the sixth time interval is the second target time, and the duration of both the fifth and sixth time intervals is a preset time threshold; a first audio segment is obtained from the third audio signal based on the fifth time interval, and a second audio segment is obtained from the fourth audio signal based on the sixth time interval, wherein the first audio segment is the audio signal segment in the third audio signal corresponding to the fifth time interval, and the second audio segment is the audio signal segment in the fourth audio signal corresponding to the sixth time interval.
[0024] The start and end times of the fifth time interval are determined by the first target time, and the start and end times of the sixth time interval are determined by the second target time. Thus, the fifth and sixth time intervals are determined. Based on the fifth and sixth time intervals, the first and second audio segments are determined from the third and fourth audio signals, respectively. This facilitates the subsequent determination of the first and second arrival times, thereby avoiding multipath interference in the spatial transmission of audio signals and improving the accuracy of the relative positions between devices.
[0025] In one feasible embodiment, the preset time threshold is determined based on a first preset distance and the time interval between the first speaker of device A generating a first audio signal and the second speaker generating a second audio signal.
[0026] In one feasible embodiment, determining the relative position between device A and device B based on a first arrival time and a second arrival time includes:
[0027] A first hyperbolic function is constructed based on the first arrival time and the second arrival time; the relative position between device A and device B is determined based on the first hyperbolic function and the distance between the first speaker and the second speaker.
[0028] In one feasible embodiment, the method of this application further includes:
[0029] The third arrival time and the fourth arrival time are obtained. The third arrival time and the fourth arrival time are the times corresponding to the third target peak and the fourth target peak, respectively. The third target peak is the peak with the earliest reception time among the peaks with signal amplitude greater than the third preset amplitude in the fifth audio segment. The fourth target peak is the peak with the earliest reception time among the peaks with signal amplitude greater than the fourth preset amplitude in the sixth audio segment. The fifth audio segment is the segment of the second target audio signal that is related to the first audio signal. The sixth audio segment is the segment of the second target audio signal that is related to the second audio signal. The second target audio signal is obtained by the second microphone of device B based on the first audio signal emitted by the first speaker of device A and the second audio signal emitted by the second speaker of device A.
[0030] Determining the relative position between device A and device B based on the first and second arrival times includes:
[0031] The relative positions of device A and device B are determined based on the first arrival time, the second arrival time, the third arrival time, the fourth arrival time, the distance between the first speaker and the second speaker, and the distance between the first microphone and the second microphone.
[0032] Optionally, the third preset amplitude and the fourth preset amplitude may be the same or different.
[0033] It should be noted that the methods for determining the third and fourth arrival times are the same as those for determining the first and second arrival times. The accuracy of the relative positions between the devices is improved by introducing a second microphone from device B.
[0034] In one feasible embodiment, the first microphone of device B satisfies the following condition:
[0035] Condition 1: Among the multiple microphones of device B, the microphone with the largest difference between its distance to the first speaker and its distance to the second speaker, and this difference is greater than a second preset distance; or,
[0036] Condition 2: Among the multiple microphones of device B, the microphone that is least obstructed by device B relative to the first speaker and the second speaker.
[0037] It should be noted that device B contains microphones that satisfy both condition 1 and condition 2. The microphone that satisfies the highest priority condition is selected as the first microphone of device B. Optionally, condition 1 may have a higher or lower priority than condition 2.
[0038] In one feasible embodiment, the first and second microphones of device B satisfy the following conditions:
[0039] Condition 3: The two microphones furthest apart from each other among the multiple microphones of device B; or,
[0040] Condition 4: Among the multiple microphones of device B, the difference between the distance between the microphone and the first speaker and the distance between the microphone and the second speaker is greater than a second preset distance for two microphones; or,
[0041] Condition 5: Among the multiple microphones of device B, the two microphones that are least obstructed by device B relative to the first and second speakers of device A.
[0042] It should be noted that when device B has multiple pairs of microphones that meet the above conditions 3, 4 and 5 (where each pair includes two microphones), the pair of microphones that meet the higher priority condition can be selected as the first microphone and second microphone of device B according to the priority of conditions 3, 4 and 5.
[0043] Optionally, condition 3 has a higher priority than condition 4, and condition 4 has a higher priority than condition 5; or condition 5 has a higher priority than condition 4, and condition 4 has a higher priority than condition 3; or condition 4 has a higher priority than condition 5, and condition 5 has a higher priority than condition 3. It should be understood that this is merely an example and not a limitation of this application; of course, the order of priority for conditions 3, 4, and 5 can also take other forms.
[0044] By selecting a suitable microphone to receive the audio signals from the first and second speakers of device A in the manner described above, the power consumption of devices A and B can be reduced, and the accuracy of the relative positions between the devices can also be improved.
[0045] In one feasible embodiment, device A is a projection device and device B is the device to which the screen is projected. After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the method of this application further includes:
[0046] The content displayed on the display interface of device A is displayed in a preset area of the display interface of device B; the position of the preset area in the display interface of device B is the same as the position of device A relative to device B.
[0047] By determining the relative positions between device A and device B, during multi-screen collaboration, device B can display the content of device A on the corresponding position of its display interface based on the relative position between device A and device B. For example, if device A is located to the right of device B, device B will display the content displayed on device A's display interface in the right area of its display interface, thus improving the user's screen casting experience.
[0048] Secondly, embodiments of this application provide a detection device, including:
[0049] The acquisition unit is used to acquire a first target audio signal through the first microphone of device B. The first target audio signal is acquired based on a first audio signal emitted by the first speaker and a second audio signal emitted by the second speaker of device A.
[0050] The determining unit is configured to determine a first audio segment and a second audio segment based on a first target time and a first target audio signal. The first target time is the time determined based on the target amplitude in the first target audio signal. The first audio segment is a segment in the first target audio signal that is related to the first audio signal. The second audio segment is a segment in the first target audio signal that is related to the second audio signal. The time intervals corresponding to the first audio segment and the time intervals corresponding to the second audio segment in the first target audio signal do not overlap.
[0051] The search unit is used to search the first audio segment and the second audio segment respectively to obtain the first arrival time and the second arrival time. The first arrival time is the time corresponding to the first target peak, and the second arrival time is the time corresponding to the second target peak. The first target peak is the peak with the earliest reception time among the peaks in the first audio segment whose signal amplitude is greater than the first preset amplitude, and the second target peak is the peak with the earliest reception time among the peaks in the second audio segment whose signal amplitude is greater than the second preset amplitude.
[0052] The determining unit is also used to determine the relative position between device A and device B based on the first arrival time and the second arrival time.
[0053] In one feasible embodiment, the determining unit is specifically used for:
[0054] A first audio segment is determined from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B; a second audio segment is determined from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the time interval between the generation of the first audio signal by the first speaker of device A and the generation of the second audio signal by the second speaker of device B.
[0055] In one feasible embodiment, in determining the first audio segment from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker of device A, and the sampling frequency of the first microphone of device B, the determining unit is specifically configured to:
[0056] A first time interval is determined based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B. The start time of the first time interval is ind_max-2*(d / v)*f, and the end time is ind_max+2*(D / v)*f. Ind_max is the first target time, d is the first preset distance, D is the distance between the first and second speakers of device A, v is the speed of sound, and f is the sampling frequency of the first microphone of device B. A first audio segment is determined from the first target audio signal based on the first time interval. The first audio segment is the audio segment in the first target audio signal corresponding to the first time interval.
[0057] In one feasible embodiment, in determining the second audio segment from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker, the sampling frequency of the first microphone, and the time interval between the first speaker generating the first audio signal and the second speaker generating the second audio signal, the determining unit is specifically configured to:
[0058] A second time interval is determined based on the first target time, the distance between the first and second speakers, the sampling frequency of the first microphone, and the time interval. The start time of the second time interval is ind_max - 2*(d / v)*f - T1, and the end time is ind_max + 2*(D / v)*f - T1. Ind_max is the first target time, d is the first preset distance, D is the distance between the first and second speakers, v is the speed of sound, f is the sampling frequency of the first microphone of device B, and T1 is the time interval. A second audio segment is determined from the first target audio signal based on the second time interval; this second audio segment is the audio segment corresponding to the second time interval in the second target audio signal.
[0059] In one feasible embodiment, in determining the second audio segment from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the time interval between the generation of audio signals by the first and second speakers of device A, the determining unit is specifically configured to:
[0060] The third and fourth time intervals are determined based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the time interval between the generation of the first audio signal by the first speaker of device A and the generation of the second audio signal by the second speaker of device B. The third time interval begins at ind_max - 2*(d / v)*f + T1 and ends at ind_max + T1 + 2*(D / v)*f; the fourth time interval begins at ind_max - 2*(d / v)*f - T1 and ends at ind_max - T1 + 2*(D / v). *f; ind_max is the first target time, d is the first preset distance, D is the distance between the first and second speakers of device A, v is the speed of sound, f is the sampling frequency of the first microphone of device B, and T1 is the time interval; the second audio segment is determined from the third and fourth audio segments, wherein the second audio segment is the audio segment in the third and fourth audio segments whose ratio of the maximum signal amplitude to the LOS signal amplitude is within a preset range, wherein the third audio segment is the audio segment corresponding to the third time interval in the first target audio signal, and the fourth audio segment is the audio segment corresponding to the fourth time interval in the first target audio signal.
[0061] In one feasible embodiment, the first target audio signal includes a third audio signal and a fourth audio signal. The third audio signal is a first audio signal received by the first microphone of device B and emitted by the first speaker of device A. The fourth audio signal is a second audio signal received by the first microphone of device B and emitted by the second speaker of device A. In determining the first audio segment and the second audio segment based on the first target time and the first target audio signal, the determining unit is specifically configured to:
[0062] A fifth time interval is determined based on a first target time and a preset time threshold; a sixth time interval is determined based on a second target time and a preset time threshold; wherein, the first target time is the time corresponding to the target amplitude in the third audio signal, the second target time is the time corresponding to the target amplitude in the fourth audio signal, the end time of the fifth time interval is the first target time, and the end time of the sixth time interval is the second target time; wherein, the duration of both the fifth and sixth time intervals is a preset time threshold; a first audio segment is obtained from the third audio signal based on the fifth time interval, and a second audio segment is obtained from the fourth audio signal based on the sixth time interval, wherein the first audio segment is the audio signal segment in the third audio signal corresponding to the fifth time interval, and the second audio segment is the audio signal segment in the fourth audio signal corresponding to the sixth time interval.
[0063] In one feasible embodiment, the preset time threshold is determined based on a first preset distance and the time interval between the first speaker of device A generating a first audio signal and the second speaker of device A generating a second audio signal.
[0064] In one feasible embodiment, in determining the relative position between device A and device B based on a first arrival time and a second arrival time, the determining unit is specifically configured to:
[0065] A first hyperbolic function is constructed based on the first arrival time and the second arrival time; the relative position between device A and device B is determined based on the first hyperbolic function and the distance between the first speaker and the second speaker of device A.
[0066] In one feasible embodiment, the detection device further includes:
[0067] The acquisition unit is used to acquire the third arrival time and the fourth arrival time. The third arrival time is the time corresponding to the third target peak, and the fourth arrival time is the time corresponding to the fourth target peak. The third target peak is the peak with the earliest reception time among the peaks in the fifth audio segment whose signal amplitude is greater than the third preset amplitude. The fourth target peak is the peak with the earliest reception time among the peaks in the sixth audio segment whose signal amplitude is greater than the fourth preset amplitude. The fifth audio segment is a segment in the second target audio signal that is related to the first audio signal, and the sixth audio segment is a segment in the second target audio signal that is related to the second audio signal. The second target audio signal is obtained by the second microphone of device B based on the first audio signal generated by the first speaker of device A and the second audio signal generated by the second speaker of device A.
[0068] In determining the relative position between device A and device B based on the first arrival time and the second arrival time, the determining unit is specifically used for:
[0069] The relative positions between device A and device B are determined based on the first arrival time, the second arrival time, the third arrival time, the fourth arrival time, the distance between the first speaker and the second speaker of device A, and the distance between the first microphone and the second microphone.
[0070] In one feasible embodiment, the first microphone of device B is:
[0071] Among the multiple microphones of device B, the microphone with the largest difference between its distance from the first speaker and its distance from the second speaker, and this difference is greater than a preset distance; or, among the multiple microphones of device B, the microphone that is least obstructed by device B relative to the first speaker and the second speaker.
[0072] In one feasible embodiment, the first and second microphones of device B include:
[0073] The two microphones of device B that are furthest apart; or, the two microphones of device B whose difference between their distance from the first speaker and their distance from the second speaker is greater than a preset distance; or, the two microphones of device B that are least obstructed by device B relative to the first and second speakers of device A.
[0074] In one feasible embodiment, device A is a projection device, device B is the device whose screen is being projected, and the detection device further includes:
[0075] The control unit is configured to, after determining the relative position between device A and device B based on a first arrival time and a second arrival time, display the content displayed on the display interface of device A in a preset area of the display interface of device B; the position of the preset area in the display interface of device B is the same as the position of device A relative to device B.
[0076] Thirdly, embodiments of this application provide a detection device, comprising:
[0077] Memory, used to store instructions; and processors coupled to memory;
[0078] Wherein, when the processor executes instructions, it performs part or all of the method as described in the first aspect.
[0079] Fourthly, embodiments of this application provide a chip system applied to an electronic device; the chip system includes one or more interface circuits and one or more processors; the interface circuits and the processors are interconnected via lines; the interface circuits are used to receive signals from the memory of the electronic device and send the signals to the processor, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device performs part or all of the method as described in the first aspect.
[0080] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform part or all of the method described in the first aspect.
[0081] Sixthly, embodiments of this application provide a computer program product, characterized in that it includes computer instructions that, when executed on a recommending device, cause the recommending device to perform part or all of the method described in the first aspect.
[0082] These or other aspects of this application will become more apparent in the following description of the embodiments. Attached Figure Description
[0083] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0084] Figure 1a A schematic diagram of a system architecture provided for an embodiment of the application;
[0085] Figure 1b Another system architecture diagram provided for the application embodiment;
[0086] Figure 2a Another system architecture diagram provided for the application embodiment;
[0087] Figure 2b Another system architecture diagram provided for the application embodiment;
[0088] Figure 3 This is a schematic diagram of the microphone position of device B provided in an embodiment of this application;
[0089] Figure 4 This is a schematic diagram illustrating the principle of a microphone selection strategy provided in an embodiment of this application;
[0090] Figure 5 A schematic diagram illustrating the principle of another microphone selection strategy provided in this application embodiment;
[0091] Figure 6a This is a schematic diagram showing the relative positions of the equipment.
[0092] Figure 6b This is a schematic diagram of the equipment structure;
[0093] Figure 7 A flowchart illustrating a method for detecting the relative position between devices provided in an embodiment of this application;
[0094] Figure 8a This is a schematic diagram illustrating the relationship between audio signals and audio segments;
[0095] Figure 8b This is a schematic diagram illustrating the relationship between the first and second audio segments;
[0096] Figure 8c This is a diagram illustrating the relationship between the first audio segment and the third and fourth audio segments.
[0097] Figure 8d A schematic diagram illustrating the principle of determining the time difference in sound transmission;
[0098] Figure 9 A schematic diagram illustrating the principle of determining arrival time, provided for an embodiment of this application;
[0099] Figure 10 This is a schematic diagram of the sound generation process provided in an embodiment of this application;
[0100] Figure 11 This is a schematic diagram showing the positional relationship between the first hyperbola and the first and second loudspeakers;
[0101] Figure 12 This is another schematic diagram of a sound generation process provided in an embodiment of this application;
[0102] Figure 13 This is a schematic diagram showing the positional relationship between the first hyperbola, the second hyperbola, and the first and second loudspeakers;
[0103] Figure 14a This is a schematic diagram of an application scenario based on the relative positions between devices;
[0104] Figure 14b This is a schematic diagram of another application scenario based on the relative positions between devices;
[0105] Figure 15 This is a schematic diagram of the structure of a detection device provided in an embodiment of this application;
[0106] Figure 16 This is a schematic diagram of the structure of a detection device provided in an embodiment of this application. Detailed Implementation
[0107] The following sections will provide detailed explanations.
[0108] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0109] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0110] "Multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0111] The embodiments of this application will now be described with reference to the accompanying drawings.
[0112] See Figure 1a , Figure 1a This is a schematic diagram of a system architecture provided for an embodiment of this application. For example... Figure 1a As shown, the system architecture includes device A and device B, where device A includes at least two speakers. Figure 1a The diagram only shows two speakers for device A, including a first speaker and a second speaker; optionally, the parameters of the first speaker and the second speaker are identical, and the first speaker and the second speaker are symmetrically distributed in device A; device B includes at least one microphone. Figure 1a Only one microphone from device B is shown in the image; this microphone is the first microphone.
[0113] Two of the at least two speakers of device A emit audio signals in sequence. The audio signals can be ultrasonic waves or audio signals with frequencies lower than ultrasonic waves, such as audible audio signals or audio signals with frequencies lower than audible audio signals.
[0114] The first microphone of at least one microphone of device B acquires audio signals emitted by the two microphones of device A, and device B determines the relative position between device B and device A based on the acquired audio signals.
[0115] Optionally, when the number of microphones in device B is greater than 1, the first microphone of device B satisfies the following condition:
[0116] Condition 1: Among the multiple microphones of device B, the microphone with the largest difference between its distance to the first speaker and its distance to the second speaker, and this difference is greater than a second preset distance; or,
[0117] Condition 2: Among the multiple microphones of device B, the microphone that is least obstructed by device B relative to the first speaker and the second speaker.
[0118] It should be noted that device B contains microphones that satisfy both condition 1 and condition 2. The microphone that satisfies the highest priority condition is selected as the first microphone of device B. Optionally, condition 1 may have a higher or lower priority than condition 2.
[0119] Optionally, to improve the accuracy of the relative position between device B and device A, device B includes at least two microphones. Figure 1b The diagram illustrates two microphones of device B, including a first microphone and a second microphone; the first and second microphones of device B collect audio signals generated by the two speakers of device A; the relative position between device A and device B is determined based on the audio signals collected by the first and second microphones of device B.
[0120] In a feasible embodiment, when device B includes more than 2 microphones, the first microphone and the second microphone of device B satisfy the following:
[0121] Condition 3: The two microphones that are furthest apart among the multiple microphones of device B, or;
[0122] Condition 4: Among the multiple microphones of device B, the difference between the distance between the microphone and the first speaker of device A and the distance between the microphone and the second speaker of device A is greater than a second preset distance for two microphones, or;
[0123] Condition 5: Among the multiple microphones of device B, the two microphones that are least obstructed by device B relative to the first and second speakers of device A.
[0124] It should be noted that when device B has multiple pairs of microphones that meet the above conditions 3, 4 and 5 (where each pair includes two microphones), the pair of microphones that meet the higher priority condition can be selected as the first microphone and second microphone of device B according to the priority of conditions 3, 4 and 5.
[0125] Optionally, condition 3 has a higher priority than condition 4, and condition 4 has a higher priority than condition 5; or condition 5 has a higher priority than condition 4, and condition 4 has a higher priority than condition 3; or condition 4 has a higher priority than condition 5, and condition 5 has a higher priority than condition 3. It should be understood that this is merely an example and not a limitation of this application; of course, the order of priority for conditions 3, 4, and 5 can also take other forms.
[0126] The degree to which device B's microphone is blocked by device B relative to device A can be determined using the following two methods:
[0127] Method 1: Determine the length of the line segment passing through device B in the line connecting the microphone and speaker. The longer the line segment, the greater the degree to which the microphone is obstructed by device B; for example... Figure 4 As shown in Figure a, the length of the line segment connecting mic0 and the first speaker that passes through device B is less than the length of the line segment connecting mic3 and the first speaker that passes through device B. Therefore, relative to the first speaker, the degree to which mic0 is blocked by device B is less than the degree to which mic3 is blocked by device B.
[0128] Method 2: Obtain the audio signal received by the microphone from the first speaker, and then process the audio signal according to the preprocessing method of this application to obtain the processed audio signal; then obtain the audio segment from the processed audio signal according to the method of this application, and then determine the number of peaks in the audio segment whose peak values exceed a preset amplitude; the larger the number, the higher the degree to which the microphone is blocked by device B.
[0129] Method 3: Device B uses the default microphone to collect the first audio signal emitted by the first speaker and the second audio signal emitted by the second speaker of Device A, and then determines a low-precision relative position relationship according to the method of this application. Since Device B knows the type of Device A, such as Huawei laptop or Huawei mobile phone, Device B knows the position of the speakers of Device A and the distance between the first and second speakers of Device A. Therefore, under the premise of low-precision relative position relationship, Device B selects one or two microphones with the lowest degree of obstruction from Device B according to Method 1.
[0130] Specifically, the first microphone and the second microphone of device B are two microphones among the multiple microphones of device B whose difference between the distance between them and the first speaker of device A and the distance between them and the second speaker of device A is greater than a second preset distance. This includes: when there are multiple microphones among the multiple microphones of device B whose difference between the distance between them and the first speaker of device A and the distance between them and the second speaker of device A is greater than the second preset distance, two microphones are randomly selected from the multiple microphones as the first microphone and the second microphone of device B, or the two microphones with the largest difference are selected from the multiple microphones as the first microphone and the second microphone of device B.
[0131] It should be noted that in the solution of this application, the relative position between device A and device B can be determined based on the difference in distance between the microphone and the two speakers. When the difference is small, the relative position between device A and device B cannot be accurately determined.
[0132] For example, let's take device A as a laptop and device B as a tablet to illustrate how to select the microphone: The laptop is on a desktop, and the tablet contains 5 microphones: mic0, mic1, mic2, mic3, and mic4. The positions of these 5 microphones are as follows: Figure 3 As shown;
[0133] When the Pad is placed on a stand on the table, and mic0, mic1, mic2, and mic3 are facing down (i.e., towards the tabletop), mic4 is completely blocked by the Pad because it is on the back of the Pad, and mic1 and mic2 may be blocked by the stand. Therefore, mic4, mic1, and mic2 are not considered when selecting microphones. The first and second microphones are mic0 and mic3. Furthermore, mic0 and mic3 are selected as the first and second microphones because they are the two microphones that are furthest apart from mic0, mic1, mic2, and mic3. In addition, the difference in distance between mic0 and the two speakers of the laptop and the difference in distance between mic3 and the two speakers of the laptop are both greater than the second preset distance.
[0134] When the Pad is placed on a stand on the table, and mic0, mic1, mic2, and mic3 are facing upwards (i.e., towards the ceiling or sky), mic4 is completely blocked by the Pad because it is on the back. Therefore, mic4 is not considered when selecting microphones. The first and second microphones are mic0 and mic3. The reason for choosing mic0 and mic3 as the first and second microphones is that they are the two microphones that are furthest apart from mic0, mic1, mic2, and mic3. Furthermore, mic0 and mic3 are the two microphones that are furthest apart from mic0, mic1, mic2, and mic3, and the difference in distance between mic0 and the two speakers of the laptop and the difference in distance between mic3 and the two speakers of the laptop are both greater than the second preset distance.
[0135] When the Pad is placed on a stand on the table, and mic0, mic1, mic2 and mic3 are to the left or right, if the difference between the distance between mic0 and the two speakers of the laptop and the difference between the distance between mic4 and the two speakers of the laptop are both greater than the second preset distance, then mic1 and mic2 are selected as the first microphone and the second microphone.
[0136] When the Pad is placed flat on the table and mic0, mic1, mic2, and mic3 are facing away from the laptop, or when the Pad is placed flat on the table and mic0, mic1, mic2, and mic3 are facing the laptop, mic4 is completely blocked by the back of the Pad. Therefore, mic4 is not considered when selecting microphones. The first and second microphones are mic0 and mic3. The reason for selecting mic0 and mic3 as the first and second microphones is that mic0 and mic3 are the two microphones that are furthest apart from mic0, mic1, mic2, and mic3. Furthermore, mic0 and mic3 are the two microphones that are furthest apart from mic0, mic1, mic2, and mic3, and the difference in distance between mic0 and the two speakers of the laptop and the difference in distance between mic3 and the two speakers of the laptop are both greater than the second preset distance.
[0137] When the tablet is placed flat on the table and microphones 0, 1, 2, and 3 are facing to the right, microphones 2 and 3 will be used as the primary and secondary microphones. Selecting microphones 0 and 1 may result in issues when the tablet is positioned in front of or to the right of the laptop, such as... Figure 4 As shown in Figures a and b, the difference between the distance between mic0 and the first speaker of the laptop and the distance between mic0 and the second speaker is less than the second preset distance. This results in a small difference between the time mic0 receives the audio signal from the first speaker and the time it receives the audio signal from the second speaker, making it impossible to calculate the position of the Pad relative to the laptop based on this difference. Therefore, mic2 and mic3 are selected as the first and second microphones, respectively. The difference between the distance between mic2 and the two speakers of the laptop and the difference between the distance between mic3 and the two speakers of the laptop are both greater than the second preset distance. This results in a larger difference between the times when mic2 and mic3 receive the audio signals generated by the two speakers, allowing the position of the Pad relative to the laptop to be calculated based on this difference.
[0138] When the tablet is placed flat on the table and microphones 0, 1, 2, and 3 are facing left, microphones 0 and 1 will be used as the primary and secondary microphones. Selecting microphones 2 and 3 may result in issues when the tablet is positioned in front of or to the left of the laptop, such as... Figure 5As shown in Figures a and b, the difference between the distance between mic3 and the first speaker of the laptop and the distance between mic3 and the second speaker is less than the second preset distance. This results in a small difference between the time mic3 receives the audio signal from the first speaker and the time it receives the audio signal from the second speaker, making it impossible to calculate the position of Pad relative to the laptop based on this difference. Therefore, mic0 and mic1 are selected as the first and second microphones, respectively. The difference between the distance between mic0 and the two speakers of the laptop and the difference between the distance between mic1 and the two speakers of the laptop are both greater than the second preset distance. The difference between the times when mic0 and mic1 receive the audio signals generated by the two speakers is large, and thus the position of Pad relative to the laptop can be calculated based on this difference.
[0139] Optionally, the microphone of device B can be manually predetermined in the manner described above, or it can be selected by device B according to the selection strategy described above.
[0140] It should be noted that device B can select its first microphone or its first and second microphones based on user instructions. Optionally, after performing a relative position check between devices, device B can automatically reselect its first microphone or its first and second microphones.
[0141] In one feasible embodiment, when device B has low computing power, device B sends the collected audio signal to device C. Device C determines the relative position between device B and device A based on the audio signal collected by device B. Device C then sends the relative position between device B and device A to device C. Figure 2a and Figure 2b As shown.
[0142] It should be noted that the relative position between device B and device A includes the position of device B relative to device A; after determining the position of device B relative to device A, the position of device A relative to device B can be determined based on the position of device B relative to device A.
[0143] like Figure 6a As shown, the position of device B relative to device A includes device B being in front of, behind, to the left, to the right, to the left front, to the left rear, to the right front, and to the right rear of device A. Optionally, the algorithm of this application yields an identifier representing the relative position, with different values representing different relative positions. For example, the identifier can take values in the range [1, 2, 3, 4, 5, 6, 7, 8], representing the aforementioned eight relative positions respectively.
[0144] In one feasible embodiment, when device A detects a user-triggered orientation sensing command, device A generates an orientation sensing request and sends the request to device B. The orientation sensing command can be a user's preset gesture, a user's touch command on device A's display interface, or a user's voice command; it can also be a command based on other methods. Device A's first and second speakers generate a first audio signal and a second audio signal, respectively. After receiving the orientation sensing request from device A, device B selects a microphone or a user-default microphone to acquire a target audio signal, which is obtained based on the first audio signal generated by device A's first speaker and the second audio signal generated by its second speaker. Optionally, the orientation sensing request carries the time when device A's first speaker emits the first audio signal and the time when its second audio signal is emitted; optionally, the orientation sensing request also carries the distance between device A's first and second speakers.
[0145] Optionally, when device B detects a location awareness command triggered by the user, device B generates a location awareness request and sends the location awareness request to device A; device B selects a microphone or the microphone set by the user in the above manner to receive the audio signals generated by the first speaker and the second speaker; after receiving the location awareness request, device A's first speaker and second speaker generate audio signals sequentially according to the time interval.
[0146] Optionally, when device C detects a location awareness command triggered by the user, device C generates a location awareness request and sends the location awareness request to devices A and B; after receiving the location awareness request, device B selects a microphone or the microphone set by the user in the manner described above to obtain the target audio signal, which is obtained based on the first audio signal generated by the first speaker and the second audio signal generated by the second speaker of device A; after receiving the location awareness request, device A's first speaker and second speaker respectively generate the first audio signal and the second audio signal.
[0147] Device B's microphone acquires a target audio signal, and then Device B can determine the relative position between Device A and Device B based on the acquired target audio signal according to the method of this application. Device B can also send the acquired target audio signal to Device A or Device C, and Device A or Device C determines the relative position between Device A and Device B according to the method of this application. If Device A determines the relative position between Device A and Device B, then Device A sends the relative position to Device B after determining the relative position between Device A and Device B. If Device C determines the relative position between Device A and Device B, then Device C sends the relative position between Device A and Device B to both Device A and Device B after determining the relative position between Device A and Device B.
[0148] Optionally, when executing Figure 7 When the main body of the embodiment shown is device B or device C, device A can also send to device B or device C the time when the first speaker of device A emits the first audio signal and the time when the second speaker of device A emits the second audio signal; optionally, device A can also send to device B or device C the distance between the first speaker and the second speaker of device A.
[0149] Optionally, the target audio signal includes a first target audio signal, and optionally, the target audio signal further includes a second target audio signal; wherein, the first target audio signal is obtained by the first microphone of device B based on the first audio signal emitted by the first speaker and the second audio signal emitted by the second speaker of device A, and the second target audio signal is obtained by the second microphone of device B based on the first audio signal emitted by the first speaker and the second audio signal emitted by the second speaker of device A.
[0150] In an optional embodiment, such as Figure 6b As shown, device A includes a sound generation system and a communication system, and device B includes a sound receiving system and a communication system. If device A determines the relative position between device A and device B based on the target audio signal acquired by device B according to the method of this application, device A also includes a computing system. The communication system of device A receives the target audio signal sent by device B through the communication system. The computing system of device A determines the relative position between device A and device B based on the acquired target audio signal according to the method of this application, and sends the relative position between device A and device B to device B through the communication system. Device B receives the relative position between device A and device B sent by device A through the communication system.
[0151] If device B determines the relative position between device A and device B based on the acquired target audio signal according to the method of this application, device B also includes a computing system. The computing system of device B determines the relative position between device A and device B based on the acquired target audio signal according to the method of this application, and sends the relative position between device A and device B to device A through a communication system. Device A receives the relative position between device A and device B sent by device A through the communication system. Optionally, device A sends to device B the time when the first speaker of device A emits the first audio signal and the time when the second speaker of device A emits the second audio signal through device A's communication system. Optionally, device A sends to device B the distance between the first speaker and the second speaker of device A through device A's communication system.
[0152] Optionally, both device A and device B also include a display system, and the display system of device A and the display system of device B display content based on the relative position between device A and device B.
[0153] The following describes how to determine the relative position between device A and device B based on the audio signal acquired by the microphone of device B.
[0154] See Figure 7 , Figure 7 This is a flowchart illustrating a method for detecting the relative position between devices, provided in an embodiment of this application. Figure 7 As shown, the method includes:
[0155] S701. Obtain a first target audio signal from the first microphone of device B. The first target audio signal is obtained based on a first audio signal emitted by the first speaker and a second audio signal emitted by the second speaker of device A.
[0156] The timing of the first audio signal emitted by the first speaker of device A and the timing of the second audio signal emitted by the second speaker may or may not overlap.
[0157] Optionally, the parameters of the first speaker and the second speaker of device A may be the same or different; the first speaker and the second speaker of device A are symmetrically distributed on device A, such as... Figure 1a , Figure 1b , Figure 2a and Figure 2b As shown, the first speaker and the second speaker of device A are symmetrically distributed on device A with the vertical line passing through the center point of device A as the axis of symmetry. It should be understood that this is only an example and not a limitation of this application. The first speaker and the second speaker of device A can be distributed on device A in other ways.
[0158] Specifically, the first target audio signal is acquired through the first microphone of device B, including:
[0159] Device B receives a first audio signal emitted by the first speaker and a second audio signal emitted by the second speaker of Device A. The received audio signals are then filtered to obtain a filtered audio signal. Optionally, the received audio signals are input into a bandpass filter for processing to obtain a filtered audio signal. The purpose of filtering is to remove noise at non-operating frequencies from the received audio signal. The received audio signal is then segmented in time to obtain multiple audio segments. It is then determined whether the energy of each audio segment exceeds a preset energy threshold. Audio segments whose energy does not exceed the preset energy threshold are deleted from the filtered audio signal to obtain the final audio signal. An energy-filtered audio signal; wherein the energy of an audio segment is defined as the integral of the sound intensity of that audio segment over time; the energy-filtered audio signal is subjected to matched filtering to obtain a matched-filtered audio signal; optionally, a matched filtering method corresponding to the type of the audio signal can be adopted; for example, when the received audio signal is a modulated signal, a matched filtering method corresponding to the modulated signal is used to filter it to obtain a matched-filtered audio signal. Using this method, the signal strength of the unmodulated audio signal is attenuated, and the signal strength of the modulated audio signal is enhanced; the matched-filtered audio signal is the aforementioned first target audio signal;
[0160] Optionally, the modulation signal can be a linear chirp signal or a non-linear chirp signal.
[0161] S702. Determine the first audio segment and the second audio segment based on the first target time and the first target audio signal.
[0162] Wherein, the first target time is the time corresponding to the target amplitude in the first target audio signal. When there are multiple times corresponding to the target amplitude in the first target audio signal, the first target time is the earliest time among these multiple times. The first audio segment and the second audio segment are segments of the first audio signal and the second audio signal, respectively, corresponding to segments of the first audio signal and segments of the second audio signal in the first target audio signal. The aforementioned target amplitude can be the average value of all peaks in the aforementioned first target audio signal, or it can be the maximum signal amplitude in the first target audio signal.
[0163] In a feasible embodiment, the first audio segment and the second audio segment can be determined using a first method, the specific process of which is as follows:
[0164] A first audio segment is determined from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B. A second audio segment is determined from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the time interval between the first audio signal emitted by the first speaker of device A and the second audio signal emitted by the second speaker of device A.
[0165] Further, determining a first audio segment from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B includes:
[0166] A first time interval is determined based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B; wherein, the start time of the first time interval is ind_max-2*(d / v)*f, and the end time is ind_max+2*(D / v)*f, where ind_max is the first target time, d is the first preset distance, D is the distance between the first and second speakers of device A, v is the speed of sound, and f is the sampling frequency of the first microphone of device B; a first audio segment is determined from the first target audio signal based on the first time interval, and the first audio segment is the audio segment in the first target audio signal corresponding to the first time interval.
[0167] Optionally, the first preset distance can be a preset value, which can be pre-set according to the application scenario. For example, in an open space, the preset distance is 10m, and in a room, the preset distance is 5m. Of course, this preset distance is still determined based on the product of a preset time and the speed of sound.
[0168] Illustrate the relationship between the first target audio signal, the first time interval, and the first audio segment with an example. Figure 8a As shown, the first time interval is [t0, t1], and the first audio segment is the audio signal segment corresponding to the first time interval [t0, t1] in the first target audio signal.
[0169] In one feasible embodiment, determining a second audio segment from the first target audio signal based on a first target time, the distance between the first and second speakers, the sampling frequency of the first microphone, and the time interval between the first speaker generating a first audio signal and the second speaker generating a second audio signal includes:
[0170] A second time interval is determined based on the first target time, the distance between the first and second speakers, the sampling frequency of the first microphone, and the time interval. The second time interval begins at ind_max - 2*(d / v)*f - T1 and ends at ind_max + 2*(D / v)*f - T1. Ind_max is the first target time, d is the first preset distance, D is the distance between the first and second speakers, v is the speed of sound, f is the sampling frequency of the first microphone, and T1 is the aforementioned time interval. A second audio segment is determined from the first target audio signal based on the second time interval.
[0171] like Figure 8b As shown, assume that the first speaker of device A emits the first audio signal first, and the second speaker emits the second audio signal afterward; Figure 8b As shown, in the first target audio signal of the first microphone of device B, the first audio segment comes first, followed by the second audio signal; after determining the first audio signal, based on the time interval [T] corresponding to the first audio segment... B ', T B From the time interval T1, we can know that the time interval of the second audio segment in the first target audio signal is [T]. B '-T1, T B -T1], thus the second audio segment can be determined from the first target audio signal.
[0172] Optionally, the second audio signal is determined from the first audio signal based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the time interval, including:
[0173] The third and fourth time intervals are determined based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the aforementioned time intervals. The third time interval begins at ind_max - 2*(d / v)*f + T1 and ends at ind_max + T1 + 2*(d / v)*f; the fourth time interval begins at ind_max - 2*(d / v)*f - T1 and ends at ind_max - T1 + 2*(d / v)*f. A second audio segment is obtained from the third and fourth audio segments. The second audio segment is an audio segment in the third and fourth audio segments whose maximum signal amplitude to LOS signal amplitude ratio is within a preset range. The third audio segment is the audio segment corresponding to the third time interval in the first target audio signal, and the fourth audio segment is the audio segment corresponding to the fourth time interval in the first target audio signal.
[0174] The following describes in detail how to determine the second audio segment from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the time interval between the audio signals generated by the first and second speakers of device A.
[0175] Since device B does not know the firing order of the first and second speakers of device A, the second audio segment may be located before or after the first audio segment. Therefore, after determining that the first audio segment has been identified from the first target audio signal, the device will search for the second audio segment before or after the first audio segment; for example... Figure 8c As shown, after determining the first audio signal, based on the time interval [T] corresponding to the first audio segment... B ', T B From the time interval T1, we can know that the time interval of the third audio segment in the first target audio signal is [T]. B '+T1,T B +T1] and the fourth audio segment have a time interval of [T] in the first target audio signal. B '-T1, T B -T1], and then determine the second audio segment from the third and fourth audio segments. Specifically, follow these steps:
[0176] Based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the aforementioned time interval, the third and fourth time intervals are determined. The start time of the third time interval is ind_max - 2*(d / v)*f + T1, and the end time is ind_max + T1 + 2*(D / v)*f. The start time of the fourth time interval is ind_max - 2*(d / v)*f - T1, and the end time is ind_max - T1 + 2*(D / v)*f. Here, ind_max is the first target time, d is the first preset distance, D is the distance between the first and second speakers of device A, v is the speed of sound, and f is the sampling frequency of the first microphone of device B. The sampling frequency of the wind, T1 is the aforementioned time interval; the third audio segment and the fourth audio segment are determined from the first target audio signal according to the third time interval and the fourth time interval, respectively. The third audio segment and the fourth audio segment are the audio segments corresponding to the third time interval and the fourth time interval in the first target audio signal, respectively; then, an audio segment that meets the preset conditions is selected from the third audio segment and the fourth audio segment, and this audio segment is the second audio segment; wherein, the preset conditions include: the ratio of the maximum signal amplitude to the LOS signal amplitude in the audio segment is within a preset range; optionally, the preset range can be [0.4, 0.6], and of course, it can also be other ranges. The LOS signal is the signal that is transmitted to the receiving end without being reflected by obstacles and with the shortest path.
[0177] Among them, the above T B '=ind_max-2*(d / v)*f,T B = ind_max + 2*(D / v).
[0178] Optionally, after determining the third time interval and the fourth time interval, firstly, based on any one of the third time interval and the fourth time interval, obtain the audio segment corresponding to that time interval from the first target audio signal, and then determine whether the audio segment meets the above-mentioned preset conditions; when the audio segment meets the above-mentioned preset conditions, the audio segment is used as the second audio segment; when the audio segment does not meet the above-mentioned preset conditions, the audio segment corresponding to the other time interval of the third time interval and the fourth time interval is used as the second audio segment.
[0179] It should be understood that among the audio segments corresponding to the third and fourth time intervals in the first target audio signal, there must be one audio signal that satisfies the above-mentioned preset conditions. Therefore, once it is determined that the audio segment corresponding to one time interval satisfies the above-mentioned preset conditions, there is no need to judge the audio segment corresponding to the other time interval.
[0180] In a feasible embodiment, the first audio segment and the second audio segment can be determined in a second manner, and the specific process is as follows:
[0181] The first target audio signal includes a third audio signal and a fourth audio signal. The third audio signal is the first audio signal emitted by the first speaker of device A and received by the first microphone of device B. The fourth audio signal is the second audio signal emitted by the second speaker of device A and received by the first microphone of device B. A fifth time interval is determined based on a first target time and a preset time threshold. A sixth time interval is determined based on a second target time and a preset time threshold. The first target time is the time determined based on the target amplitude in the third audio signal, the second target time is the time determined based on the target amplitude in the fourth audio signal, the end time of the fifth time interval is the first target time, the end time of the sixth time interval is the second target time, and the duration of both the fifth and sixth time intervals is a preset time threshold. A first audio segment is obtained from the third audio signal based on the fifth time interval, and a second audio segment is obtained from the fourth audio signal based on the sixth time interval. The first audio segment is the audio signal segment corresponding to the fifth time interval in the third audio signal, and the second audio segment is the audio signal segment corresponding to the sixth time interval in the fourth audio signal.
[0182] The preset time threshold is obtained based on the first preset distance and the time interval between the first speaker of device A generating the first audio signal and the second speaker generating the second audio signal.
[0183] Specifically, after obtaining the first target time ind_max and the second target time after ind_max', based on the first target time ind_max, the second target time after ind_max', and the preset time threshold T... A Determine the fifth and sixth time intervals, where the starting time of the fifth time interval is ind_max-T. A The termination time is ind_max, and the start time of the second time interval is ind_max'-T. A The termination time is 'ind_max', where the preset time threshold T is... A =T1 + 2*d / v, where T1 is the aforementioned time interval, d is the preset distance, and v is the speed of sound; T A The difference between the termination time and the start time is greater than the range when removing multipath interference; then, the first audio segment is obtained from the third audio signal according to the fifth time interval, and the second audio segment is obtained from the fourth audio signal according to the sixth time interval, wherein the first audio segment is the audio signal segment corresponding to the fifth time interval in the third audio signal, and the second audio segment is the audio signal segment corresponding to the sixth time interval in the fourth audio signal.
[0184] S703. Search the first audio segment and the second audio segment respectively to obtain the first arrival time and the second arrival time.
[0185] The first arrival time is the earliest received peak among the peaks in the first audio signal whose signal amplitude is greater than the first preset amplitude, and the second arrival time is the earliest received peak among the peaks in the second audio signal whose signal amplitude is greater than the second preset amplitude.
[0186] Optionally, the first preset amplitude and the second preset amplitude may be the same or different.
[0187] Specifically, after determining the first audio segment, a peak with a signal amplitude greater than a first preset amplitude is searched within the first audio segment. Then, the peak with the earliest reception time is selected from the peaks with a signal amplitude greater than the first preset amplitude, and the time corresponding to that peak is taken as the first arrival time. Similarly, in the second audio signal, a peak with a signal amplitude greater than a second preset amplitude is searched. Then, the peak with the earliest reception time is selected from the peaks with a signal amplitude greater than the second preset amplitude, and the time corresponding to that peak is taken as the second arrival time.
[0188] For example, the first audio segment is as follows: Figure 9 As shown, the time interval corresponding to this audio segment is [ind_max-T]. A In the first audio segment, peaks exceeding the first preset amplitude include peak 1 and peak 2. The reception time of peak 2 is earlier than the reception time of peak 1. Therefore, the time T1' corresponding to peak 2 is taken as the first arrival time.
[0189] The second arrival time can be determined based on the second audio segment using the method described above.
[0190] Optionally, the first preset amplitude is a1 * target amplitude, and the second preset amplitude is a2 * target amplitude, where a1 and a2 are constants; alternatively, a1 and a2 may be equal or unequal.
[0191] S704. Determine the relative positions between equipment A and equipment B based on the first arrival time and the second arrival time.
[0192] In one feasible embodiment, determining the relative position between device A and device B based on a first arrival time and a second arrival time includes:
[0193] A first hyperbolic function is constructed based on the first arrival time and the second arrival time; the relative position between device A and device B is determined based on the first hyperbolic function and the distance between the first speaker and the second speaker.
[0194] A first hyperbolic function is constructed based on the first arrival time, the second arrival time, the first time, and the second time; the relative position between device A and device B is determined based on the first hyperbolic function and the distance between the first speaker and the second speaker.
[0195] Optionally, the first moment can be the moment when the first audio signal is generated by the first speaker, and the second moment can be the moment when the second audio signal is generated by the second speaker. At this time, the first moment and the second moment are transmitted by device A to device B wirelessly. Device A can also transmit the distance between the first speaker and the second speaker to device B in this way. The wireless method includes Bluetooth, Wi-Fi, etc. The first moment can be the estimated value of the moment when the first audio signal is generated by the first speaker, and the second moment can be the estimated value of the moment when the second audio signal is generated by the second speaker.
[0196] like Figure 10 As shown, the sound emission time of the first speaker, or its estimated value, is the aforementioned first moment; the sound emission time of the second speaker, or its estimated value, is the aforementioned second moment. Based on the principle of sound propagation, the difference between the first arrival time and the first moment is proportional to the distance between the first speaker of device A and the first microphone of device B; the difference between the second arrival time and the second moment is proportional to the distance between the second speaker of device A and the first microphone of device B. Therefore, a first hyperbola is constructed based on (second arrival time - second moment) - (first arrival time - first moment) equaling a fixed value, as shown... Figure 11 As shown, points F1 and F2 represent the locations of the first and second speakers of device A, respectively. F1 and F2 are also the foci of the first hyperbola. Points on the first hyperbola represent the locations of the first microphone of device B. The first hyperbola can be seen as the position trajectory of the first microphone of device B. When selecting the second microphone, users generally choose a microphone on device B that is on the same horizontal or vertical line as the first microphone. In this case, the first and second microphones can be considered symmetrically distributed. Therefore, after determining the position of the first microphone, the position of the second microphone can be determined based on the symmetry, and thus the relative positions of device A and device B can be determined. Assuming that in Figure 11 In the coordinate system, the position of the first microphone of device B is Figure 11 Point P in the diagram is symmetrical to the position of the second microphone about the y-axis. Then the position of the second microphone in device B is: Figure 11 Point P1 in the diagram, based on the positional relationship between point P1 and P, and points F1 and F2, indicates that device B is located to the left of device A; the position of the first microphone of device B is... Figure 11 Point P in the diagram is symmetrical to the position of the second microphone about the x-axis. Then the position of the second microphone in device B is: Figure 11Based on point P2 and the positional relationship between point P and points F1 and F2, it can be determined that device B is located behind device A.
[0197] The position of device B relative to device A can be determined using the above method, but it is limited to determining whether device B is in front of, behind, to the left of, or to the right of device A.
[0198] Optionally, since a single microphone can only determine whether device B is in front of, behind, to the left of, or to the right of device A, the accuracy is low. To improve accuracy, a second microphone is introduced for device B, and the third and fourth arrival times are determined as described above. The third and fourth arrival times correspond to the times of the third and fourth target peaks, respectively. The third target peak is the earliest received peak among the peaks in the fifth audio segment whose signal amplitude is greater than a third preset amplitude. The fourth target peak is the earliest received peak among the peaks in the sixth audio segment whose signal amplitude is greater than a fourth preset amplitude. The fifth audio segment is a segment of the second target audio signal related to the first audio signal, and the sixth audio segment is a segment of the second target audio signal related to the second audio signal. The second target audio signal is obtained by the second microphone of device B based on the first audio signal emitted by the first speaker of device A and the second audio signal emitted by the second speaker of device A. Determining the relative position between device A and device B based on the first and second arrival times includes:
[0199] The relative positions of device A and device B are determined based on the first arrival time, the second arrival time, the third arrival time, the fourth arrival time, the distance between the first speaker and the second speaker, and the distance between the first microphone and the second microphone.
[0200] Specifically, a first hyperbolic function is constructed based on the first arrival time, the second arrival time, the first moment, and the second moment; a second hyperbolic function is constructed based on the third arrival time, the fourth arrival time, the first moment, and the second moment; in the same coordinate system, the relative position between device A and device B is determined based on the positional relationship between the graphs of the first hyperbolic function and the second hyperbolic function, the distance between the first speaker and the second speaker, and the distance between the first microphone and the second microphone of device B.
[0201] It should be noted that the methods for determining the third and fourth arrival times are the same as those for determining the first and second arrival times, and will not be described again here.
[0202] like Figure 12As shown, the sound emission time of the first speaker or its estimated value is the aforementioned first moment, and the sound emission time of the second speaker or its estimated value is the aforementioned second moment. Based on the principle of sound propagation, the difference between the first arrival time and the first moment is proportional to the distance between the first speaker of device A and the first microphone of device B; the difference between the second arrival time and the second moment is proportional to the distance between the second speaker of device A and the first microphone of device B; the difference between the third arrival time and the first moment is proportional to the distance between the first speaker of device A and the second microphone of device B; and the difference between the fourth arrival time and the second moment is proportional to the distance between the second speaker of device A and the second microphone of device B. Therefore, a first hyperbola is constructed based on (second arrival time - second moment) - (first arrival time - first moment) equaling a fixed value, as shown... Figure 13 As shown by the solid line in the figure, a second hyperbola is constructed based on the fact that (fourth arrival time - second time) - (third arrival time - first time) equals another fixed value, as shown in the figure. Figure 13 The dashed lines in the diagram illustrate this; where the first hyperbola and the second hyperbola represent the positions of the first and second speakers of device A, respectively, and points F1 and F2 are the foci of the first and second hyperbolas. The first and second hyperbolas can be viewed as the positional trajectories of the first and second microphones of device B, respectively. Based on the relative positions of the first and second microphones of device B, two points conforming to the relative positional relationship of the first and second microphones are determined from the first and second hyperbolas, as shown in the diagram. Figure 13 As shown, the first and second microphones of device B are mic0 and mic3, respectively. Based on the positional relationship between mic0 and mic3, the portions of the first and second hyperbolas located in the first and fourth quadrants of the coordinate system can be used to find two points that match the positional relationship between mic0 and mic3. When the two points matching the positional relationship between mic0 and mic3 are in the first quadrant of the coordinate system, mic0 and mic3 would be obscured by device B relative to device A, which does not meet the microphone selection criteria. Therefore, the two points matching the positional relationship between mic0 and mic3 cannot be in the first quadrant of the coordinate system, but can only be in the fourth quadrant. Thus, based on the positional relationship between the two points of the first and second hyperbolas in the fourth quadrant of the coordinate system and points F1 and F2, the positional relationship of device B relative to device A can be determined. The positional relationship includes eight directions: front, back, left, right, left rear, left front, right rear, and right front. Compared to relying on a single microphone, the positional information determined based on two microphones is more accurate.
[0203] Furthermore, after determining the position of device B relative to device A, the position of device A relative to device A can be determined based on that position.
[0204] As described above, the difference between (second arrival time - second time) and (first arrival time - first time) is used when constructing the hyperbola. In a feasible example, this difference can be obtained as follows:
[0205] like Figure 8d As shown, the speaker S of device A A An audio signal S1 is emitted, and after time t... A1 The audio signal S1 was received by the microphone of device A, and after time t... A3 The audio signal S1 is received by the microphone of device B; the speaker S1 of device B... B Audio signal S2 is emitted, and time t is elapsed. B3 The audio signal S2 was received by the microphone of device B, and after time t... B1 The audio signal S2 is received by the microphone of device A; the round-trip distance between the two devices is the sum of the times shown by the two light gray blocks. Mathematical principles can prove that it is approximately equal to the difference of the times shown by the two dark gray blocks, i.e. (x1+x2)=(y1-y2). In this way, the calculation of the time difference between the other end's sound transmission and its own sound reception is converted into the calculation of the sum of the times of its own two sound receptions.
[0206] It should be noted that the moment when the sound emitted by the speaker of one device is received by the microphone of another device can be found in the process of calculating the first arrival time or the second arrival time in this application, and will not be described again here.
[0207] In one feasible embodiment, device A is a projection device and device B is the device to which the screen is projected. After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the method of this application further includes:
[0208] The content displayed on the display interface of device A is displayed in a preset area of the display interface of device B. The position of the preset area of device B on the display interface of device B is the same as the position of device A relative to device B.
[0209] Let's take device A as a mobile phone and device B as a laptop as an example. Figure 14a As shown, the mobile phone is located to the right of the laptop; the content displayed on the mobile phone's screen is projected onto a preset area of the laptop's screen; wherein, the preset area on the laptop's screen is located to the right of the screen, which is the same position of the mobile phone relative to the laptop.
[0210] In the field of screen projection, if UWB technology is used, all devices need to have UWB chips, which is costly. If Bluetooth and WIFI technologies are used, the transmission speed of electromagnetic waves is the speed of light, and without a very good clock synchronization mechanism, the accuracy of short-distance detection is insufficient, making it impossible to determine the orientation and limiting projection to a fixed projection direction. However, the method of this application can achieve low-cost and high-precision positioning of devices without adding extra hardware, thus enabling screen projection in any direction.
[0211] Let's take device A as a tablet and device B as a laptop as an example. Figure 14b As shown, the Pad is on the left side of the laptop. Based on the relative position between the Pad and the laptop, the browser portion of the Pad's display is shown on the laptop's display, specifically on the left side of the laptop's display. The laptop's display acts as an extension of the Pad's screen, and the area on the laptop's display used to show the portion of the browser displayed by the Pad is positioned in the same way as the Pad is on the laptop.
[0212] It should be pointed out here that Figure 14a and Figure 14b The application scenario shown is merely a specific example and is not intended to limit this application.
[0213] As can be seen, in the solution of this application, the relative position between devices A and B is determined by the audio signals emitted by the first and second speakers of device A, which are collected by the microphone of device B. This achieves the determination of the relative position between devices without adding additional hardware. Determining the relative position between devices A and B based on the first and second arrival times avoids multipath interference during the spatial transmission of audio signals, thereby improving the accuracy of the relative position between devices. When selecting the microphone of device B, choosing a suitable microphone to receive the audio signals from the first and second speakers of device A, as disclosed in this application, can reduce the power consumption of devices A and B, and also improve the accuracy of the relative position between devices.
[0214] See Figure 15 , Figure 15 This is a schematic diagram of the structure of a detection device provided in an embodiment of this application. Figure 15 As shown, the testing device 1500 includes:
[0215] The acquisition unit 1501 is used to acquire a first target audio signal through the first microphone of device B. The first target audio signal is acquired based on a first audio signal emitted by the first speaker and a second audio signal emitted by the second speaker of device A.
[0216] The determining unit 1502 is used to determine a first audio segment and a second audio segment based on a first target time and a first target audio signal. The first target time is the time determined based on the target amplitude in the first target audio signal. The first audio segment is a segment in the first target audio signal that is related to the first audio signal. The second audio segment is a segment in the first target audio signal that is related to the second audio signal. The time intervals corresponding to the first audio segment and the time intervals corresponding to the second audio segment in the first target audio signal do not overlap.
[0217] The search unit 1503 is used to search the first audio segment and the second audio segment respectively to obtain the first arrival time and the second arrival time. The first arrival time is the time corresponding to the first target peak, and the second arrival time is the time corresponding to the second target peak. The first target peak is the peak with the earliest reception time among the peaks in the first audio segment whose signal amplitude is greater than the first preset amplitude, and the second target peak is the peak with the earliest reception time among the peaks in the second audio segment whose signal amplitude is greater than the second preset amplitude.
[0218] The determining unit 1502 is also used to determine the relative position between device A and device B based on the first arrival time and the second arrival time.
[0219] In one feasible embodiment, the determining unit 1502 is specifically used for:
[0220] A first audio segment is determined from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B; a second audio segment is determined from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the time interval between the generation of the first audio signal by the first speaker of device A and the generation of the second audio signal by the second speaker of device A.
[0221] In one feasible embodiment, in determining the first audio segment from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker of device A, and the sampling frequency of the first microphone of device B, the determining unit 1502 is specifically configured to:
[0222] A first time interval is determined based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B. The start time of the first time interval is ind_max-2*(d / v)*f, and the end time is ind_max+2*(D / v)*f. Ind_max is the first target time, d is the first preset distance, D is the distance between the first and second speakers of device A, v is the speed of sound, and f is the sampling frequency of the first microphone of device B. A first audio segment is determined from the first target audio signal based on the first time interval. The first audio segment is the audio segment in the first target audio signal corresponding to the first time interval.
[0223] In one feasible embodiment, in determining the second audio segment from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker, the sampling frequency of the first microphone, and the time interval between the first speaker generating the first audio signal and the second speaker generating the second audio signal, the determining unit 1502 is specifically configured to:
[0224] A second time interval is determined based on the first target time, the distance between the first and second speakers, the sampling frequency of the first microphone, and the time interval. The start time of the second time interval is ind_max - 2*(d / v)*f - T1, and the end time is ind_max + 2*(D / v)*f - T1. Ind_max is the first target time, d is the first preset distance, D is the distance between the first and second speakers, v is the speed of sound, f is the sampling frequency of the first microphone of device B, and T1 is the time interval. A second audio segment is determined from the first target audio signal based on the second time interval; this second audio segment is the audio segment corresponding to the second time interval in the second target audio signal.
[0225] In one feasible embodiment, in determining the second audio segment from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the time interval between the generation of the first audio signal by the first speaker of device A and the generation of the second audio signal by the second speaker of device A, the determining unit 1502 is specifically configured to:
[0226] The third and fourth time intervals are determined based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the time interval between the first audio signal generated by the first speaker of device A and the second audio signal generated by the second speaker of device A. The third time interval begins at ind_max - 2*(d / v)*f + T1 and ends at ind_max + T1 + 2*(d / v)*f; the fourth time interval begins at ind_max - 2*(d / v)*f - T1 and ends at ind_max - T1 + 2*(d / v)*f. f; ind_max is the first target time, d is the first preset distance, D is the distance between the first speaker and the second speaker of device A, v is the speed of sound, f is the sampling frequency of the first microphone of device B, and T1 is the time interval; the second audio segment is determined from the third audio segment and the fourth audio segment, wherein the second audio segment is the audio segment in the third audio segment and the fourth audio segment whose ratio of the maximum signal amplitude to the LOS signal amplitude is within a preset range, wherein the third audio segment is the audio segment corresponding to the third time interval in the first target audio signal, and the fourth audio segment is the audio segment corresponding to the fourth time interval in the first target audio signal.
[0227] In one feasible embodiment, the first target audio signal includes a third audio signal and a fourth audio signal. The third audio signal is a first audio signal received by the first microphone of device B and emitted by the first speaker of device A. The fourth audio signal is an audio signal received by the first microphone of device B and emitted by the second speaker of device A. In determining the first audio segment and the second audio segment based on the first target time and the first target audio signal, the determining unit 1502 is specifically configured to:
[0228] A fifth time interval is determined based on a first target time and a preset time threshold; a sixth time interval is determined based on a second target time and a preset time threshold; wherein, the first target time is the time determined in the third audio signal based on the target amplitude, the second target time is the time determined in the fourth audio signal based on the target amplitude, the end time of the fifth time interval is the first target time, and the end time of the sixth time interval is the second target time; wherein, the duration of the fifth and sixth time intervals is the preset time threshold; a first audio segment is obtained from the third audio signal based on the fifth time interval, and a second audio segment is obtained from the fourth audio signal based on the sixth time interval, wherein the first audio segment is the audio signal segment in the third audio signal corresponding to the fifth time interval, and the second audio segment is the audio signal segment in the fourth audio signal corresponding to the sixth time interval.
[0229] In one feasible embodiment, the preset time threshold is determined based on a preset distance and the time interval between the first and second speakers of device A generating audio signals.
[0230] In a feasible embodiment, in determining the relative position between device A and device B based on a first arrival time and a second arrival time, the determining unit 1502 is specifically configured to:
[0231] A first hyperbolic function is constructed based on the first arrival time and the second arrival time; the relative position between device A and device B is determined based on the first hyperbolic function and the distance between the first speaker and the second speaker of device A.
[0232] In a feasible embodiment, the acquisition unit 1501 is further configured to acquire a third arrival time and a fourth arrival time, wherein the third arrival time is the time corresponding to the third target peak, the fourth arrival time is the time corresponding to the fourth target peak, the third target peak is the peak with the earliest reception time among the peaks in the fifth audio segment whose signal amplitude is greater than the third preset amplitude, the fourth target peak is the peak with the earliest reception time among the peaks in the sixth audio segment whose signal amplitude is greater than the fourth preset amplitude, the fifth audio segment is the segment in the second target audio signal related to the first audio signal, the sixth audio segment is the segment in the second target audio signal related to the second audio signal, and the second target audio signal is obtained by the second microphone of device B based on the first audio signal emitted by the first speaker of device A and the second audio signal emitted by the second speaker of device A;
[0233] In determining the relative position between device A and device B based on the first arrival time and the second arrival time, the determining unit 1502 is specifically used for:
[0234] The relative positions between device A and device B are determined based on the first arrival time, the second arrival time, the third arrival time, the fourth arrival time, the distance between the first speaker and the second speaker of device A, and the distance between the first microphone and the second microphone.
[0235] In one feasible embodiment, the first microphone of device B is:
[0236] Among the multiple microphones of device B, the microphone with the largest difference between its distance from the first speaker and its distance from the second speaker, and this difference is greater than a preset distance; or, among the multiple microphones of device B, the microphone that is least obstructed by device B relative to the first speaker and the second speaker.
[0237] In one feasible embodiment, the first and second microphones of device B include:
[0238] The two microphones of device B that are furthest apart; or, the two microphones of device B whose difference between their distance from the first speaker and their distance from the second speaker is greater than a preset distance; or, the two microphones of device B that are least obstructed by device B relative to the first and second speakers of device A.
[0239] In one feasible embodiment, device A is a projection device, device B is the device whose screen is being projected, and the detection device further includes:
[0240] The control unit 1504 is used to display the content displayed on the display interface of device A in a preset area of the display interface of device B after determining the relative position between device A and device B according to the first arrival time and the second arrival time; the position of the preset area in the display interface of device B is the same as the position of device A relative to device B.
[0241] It should be noted that the aforementioned units (acquisition unit 1501, determination unit 1502, search unit 1503, and control unit 1504) are used to execute the relevant steps of the above method. For example, acquisition unit 1501 is used to execute the relevant content of S701, determination unit 1502, acquisition unit 1501, and control unit 1504 are used to execute the relevant content of S702 and S704, and search unit 1503 is used to execute the relevant content of S703.
[0242] In this embodiment, the detection device 1500 is presented in the form of a unit. Here, "unit" can refer to an application-specific integrated circuit (ASIC), a processor and memory executing one or more software or firmware programs, integrated logic circuits, and / or other devices that can provide the aforementioned functions. Furthermore, the acquisition unit 1501, determination unit 1502, search unit 1503, and control unit 1504 can be... Figure 16 The detection device shown is implemented by the processor 1601.
[0243] like Figure 16 The detection device 1600 shown can be used to Figure 16 The detection device 1600 is implemented using the structure described above. It includes at least one processor 1601, at least one memory 1602, and at least one communication interface 1603. The processor 1601, the memory 1602, and the communication interface 1603 are connected through the communication bus and communicate with each other.
[0244] Processor 1601 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of programs in the above scheme.
[0245] The communication interface 1603 is used to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Networks (WLAN), etc.
[0246] The memory 1602 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, digital universal discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory may exist independently and be connected to the processor via a bus. The memory may also be integrated with the processor.
[0247] The memory 1602 stores the application code for executing the above scheme, and its execution is controlled by the processor 1601. The processor 1601 executes the application code stored in the memory 1602.
[0248] The code stored in memory 1602 can execute any of the relative position detection methods between devices provided above. When processor 1601 executes the code stored in memory 1602, processor 1601 executes the following method:
[0249] The system acquires a first target audio signal from the first microphone of device B, which is obtained based on a first audio signal emitted by the first speaker and a second audio signal emitted by the second speaker of device A. Based on a first target time and the first target audio signal, a first audio segment and a second audio segment are determined. The first target time is the time determined based on the target amplitude in the first target audio signal. The first audio segment is a segment in the first target audio signal related to the first audio signal, and the second audio segment is a segment in the first target audio signal related to the second audio signal. The time intervals corresponding to the first audio segment and the second audio segment in the first target audio signal do not overlap. The system searches for the first and second audio segments to obtain a first arrival time and a second arrival time, where the first arrival time is the time corresponding to the first target peak, and the second arrival time is the time corresponding to the second target peak. The first target peak is the earliest received peak among the peaks in the first audio segment whose signal amplitude is greater than a first preset amplitude, and the second target peak is the earliest received peak among the peaks in the second audio segment whose signal amplitude is greater than a second preset amplitude. The system determines the relative position between device A and device B based on the first and second arrival times.
[0250] In one feasible embodiment, in determining the first audio segment and the second audio segment based on the first target time and the first target audio signal, the processor 1601 is specifically configured to:
[0251] A first audio segment is determined from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B; a second audio segment is determined from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the time interval between the first speaker of device A generating the first audio signal and the second speaker of device A generating the second audio signal.
[0252] In one feasible embodiment, in determining the first audio segment from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B, the processor 1601 is specifically configured to:
[0253] A first time interval is determined based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B; the start time of the first time interval is ind_max-2*(d / v)*f, and the end time is ind_max+2*(D / v)*f; ind_max is the first target time, d is the first preset distance, D is the distance between the first and second speakers of device A, v is the speed of sound, and f is the sampling frequency of the first microphone of device B; a first audio segment is determined from the first target audio signal based on the first time interval, wherein the first audio segment is the audio segment corresponding to the first time interval in the first target audio signal.
[0254] In one feasible embodiment, in determining the second audio segment from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker, the sampling frequency of the first microphone, and the time interval between the first speaker generating the first audio signal and the second speaker generating the second audio signal, the processor 1601 is specifically configured to:
[0255] A second time interval is determined based on the first target time, the distance between the first and second speakers, the sampling frequency of the first microphone, and the time interval. The second time interval begins at ind_max - 2*(d / v)*f - T1 and ends at ind_max + 2*(D / v)*f - T1. Ind_max represents the first target time, d represents the first preset distance, D represents the distance between the first and second speakers, v represents the speed of sound, f represents the sampling frequency of the first microphone, and T1 represents the time interval. A second audio segment is determined from the first target audio signal based on the second time interval; this second audio segment is the audio segment corresponding to the second time interval in the second target audio signal.
[0256] In one feasible embodiment, in determining the second audio segment from the first target audio signal based on the first target time, the distance between the first and second speakers of device A, the sampling frequency of the first microphone of device B, and the time interval between the first audio signal generated by the first speaker of device A and the second audio signal generated by the second speaker of device A, the processor 1601 is specifically configured to:
[0257] The third and fourth time intervals are determined based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency and time interval of the first microphone of device B. The third time interval begins at ind_max - 2*(d / v)*f + T1 and ends at ind_max + T1 + 2*(d / v)*f; the fourth time interval begins at ind_max - 2*(d / v)*f - T1 and ends at ind_max - T1 + 2*(d / v)*f; where ind_max is the first target time, d... Let D be the distance between the first and second speakers of device A, v be the speed of sound, f be the sampling frequency of the first microphone of device B, and T1 be the time interval. A second audio segment is determined from the third and fourth audio segments, wherein the second audio segment is the audio segment in the third and fourth audio segments whose ratio of the maximum signal amplitude to the LOS signal amplitude is within a preset range, and the third audio segment is the audio segment corresponding to the third time interval in the first target audio signal, and the fourth audio segment is the audio segment corresponding to the fourth time interval in the first target audio signal.
[0258] In one feasible embodiment, the first target audio signal includes a third audio signal and a fourth audio signal, wherein the third audio signal is a first audio signal received by a first speaker of device B and emitted by a first speaker of device A, and the fourth audio signal is a second audio signal received by a first microphone of device B and emitted by a second speaker of device A. In determining the first audio segment and the second audio segment based on the first target time and the first target audio signal, the processor 1601 is specifically configured to:
[0259] A fifth time interval is determined based on a first target time and a preset time threshold; a sixth time interval is determined based on a second target time and a preset time threshold; wherein, the first target time is the time determined in the third audio signal based on the target amplitude, the second target time is the time determined in the fourth audio signal based on the target amplitude, the end time of the fifth time interval is the first target time, the end time of the sixth time interval is the sixth target time, the duration of the fifth and sixth time intervals is the preset time threshold, a first audio segment is obtained from the third audio signal based on the fifth time interval, and a second audio segment is obtained from the fourth audio signal based on the sixth time interval, wherein the first audio segment is the audio signal segment corresponding to the fifth time interval in the third audio signal, and the second audio segment is the audio signal segment corresponding to the sixth time interval in the fourth audio signal.
[0260] In one feasible embodiment, the preset time threshold is based on a preset distance and the time interval between the first audio signal generated by the first speaker of device A and the second audio signal generated by the second speaker of device A.
[0261] In one feasible embodiment, in determining the relative position between device A and device B based on a first arrival time and a second arrival time, processor 1601 is specifically configured to:
[0262] A first hyperbolic function is constructed based on the first arrival time and the second arrival time; the relative position between device A and device B is determined based on the first hyperbolic function and the distance between the first speaker and the second speaker.
[0263] In one feasible embodiment, the processor 1601 is further specifically used for:
[0264] The third arrival time and the fourth arrival time are obtained. The third arrival time and the fourth arrival time are the times corresponding to the third target peak and the fourth target peak, respectively. The third target peak is the peak with the earliest reception time among the peaks with signal amplitude greater than the third preset amplitude in the fifth audio segment. The fourth target peak is the peak with the earliest reception time among the peaks with signal amplitude greater than the fourth preset amplitude in the sixth audio segment. The fifth audio segment is the segment of the second target audio signal related to the first audio signal. The sixth audio segment is the segment of the second target audio signal related to the second audio signal. The second target audio signal is obtained by the second microphone of device B based on the first audio signal emitted by the first speaker of device A and the second audio signal emitted by the second microphone of device A.
[0265] In determining the relative position between device A and device B based on the first arrival time and the second arrival time, processor 1601 is specifically configured to:
[0266] The relative positions of device A and device B are determined based on the first arrival time, the second arrival time, the third arrival time, the fourth arrival time, the distance between the first speaker and the second speaker, and the distance between the first microphone and the second microphone.
[0267] In one feasible embodiment, the first microphone of device B is:
[0268] Among the multiple microphones of device B, the microphone with the largest difference between its distance from the first speaker and its distance from the second speaker, and this difference is greater than a preset distance; or, among the multiple microphones of device B, the microphone that is least obstructed by device B relative to the first speaker and the second speaker.
[0269] In one feasible embodiment, the first and second microphones of device B include:
[0270] The two microphones of device B that are furthest apart; or, the two microphones of device B whose difference between their distance from the first speaker and their distance from the second speaker is greater than a preset distance; or, the two microphones of device B that are least obstructed by device B relative to the first and second speakers of device A.
[0271] In one feasible embodiment, device A is a screen projection device, device B is the device whose screen is being projected, and processor 1601 is further configured to:
[0272] After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the content displayed on the display interface of device A is displayed in a preset area of the display interface of device B; the position of the preset area in the display interface of device B is the same as the position of device A relative to device B.
[0273] This invention also provides a computer storage medium, wherein the computer storage medium may store a program, which, when executed, includes some or all of the steps of any of the relative position detection methods between devices described in the above method embodiments.
[0274] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0275] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0276] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0277] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0278] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0279] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0280] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0281] The embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for detecting the relative position between devices, characterized in that, include: The first target audio signal acquired by the first microphone of device B is obtained based on the first audio signal emitted by the first speaker and the second audio signal emitted by the second speaker of device A. A first audio segment and a second audio segment are determined based on a first target time and a first target audio signal; the first target time is the time determined based on the target amplitude in the first target audio signal; the first audio segment is a segment in the first target audio signal related to the first audio signal; the second audio segment is a segment in the first target audio signal related to the second audio signal; the time interval corresponding to the first audio segment and the time interval corresponding to the second audio segment in the first target audio signal do not overlap; The first audio segment and the second audio segment are searched separately to obtain the first arrival time and the second arrival time, wherein the first arrival time is the time corresponding to the first target peak, and the second arrival time is the time corresponding to the second target peak. The first target peak is the peak with the earliest reception time among the peaks in the first audio segment whose signal amplitude is greater than a first preset amplitude; the second target peak is the peak with the earliest reception time among the peaks in the second audio segment whose signal amplitude is greater than a second preset amplitude. The relative positions between device A and device B are determined based on the first arrival time and the second arrival time.
2. The method according to claim 1, characterized in that, The step of determining the first audio segment and the second audio segment based on the first target time and the first target audio signal includes: The first audio segment is determined from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker, and the sampling frequency of the first microphone; The second audio segment is determined from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker, the sampling frequency of the first microphone, and the time interval between the first speaker generating the first audio signal and the second speaker generating the second audio signal.
3. The method according to claim 2, characterized in that, Determining the first audio segment from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker, and the sampling frequency of the first microphone includes: A first time interval is determined based on the first target time, the distance between the first speaker and the second speaker, and the sampling frequency of the first microphone; wherein, the start time of the first time interval is ind_max-2*(d / v)*f, and the end time is ind_max+2*(D / v)*f; where ind_max is the first target time, d is the first preset distance, D is the distance between the first speaker and the second speaker, v is the speed of sound, and f is the sampling frequency of the first microphone; The first audio segment is determined from the first target audio signal based on the first time interval.
4. The method according to claim 2 or 3, characterized in that, The step of determining the second audio segment from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker, the sampling frequency of the first microphone, and the time interval between the first speaker generating the first audio signal and the second speaker generating the second audio signal includes: The second time interval is determined based on the first target time, the distance between the first speaker and the second speaker, the sampling frequency of the first microphone, and the time interval. Wherein, the start time of the second time interval is ind_max-2*(d / v)*f-T1, and the end time is ind_max+2*(D / v)*f-T1; where ind_max is the first target time, d is the first preset distance, D is the distance between the first speaker and the second speaker, v is the speed of sound, f is the sampling frequency of the first microphone, and T1 is the time interval; The second audio segment is determined from the first target audio signal based on the second time interval.
5. The method according to claim 2 or 3, characterized in that, The step of determining the second audio segment from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker, the sampling frequency of the first microphone, and the time interval between the first speaker generating the first audio signal and the second speaker generating the second audio signal includes: The third time interval and the fourth time interval are determined based on the first target time, the distance between the first speaker and the second speaker, the sampling frequency of the first microphone, and the time interval. Wherein, the start time of the third time interval is ind_max-2*(d / v)*f+T1, and the end time is ind_max+T1+2*(D / v)*f; the start time of the fourth time interval is ind_max-2*(d / v)*f-T1, and the end time is ind_max-T1+2*(D / v)*f; where ind_max is the first target time, d is the first preset distance, D is the distance between the first speaker and the second speaker, v is the speed of sound, f is the sampling frequency of the first microphone, and T1 is the time interval; The second audio segment is determined from the third and fourth audio segments, wherein the second audio segment is an audio segment in the third and fourth audio segments whose ratio of the maximum signal amplitude to the LOS signal amplitude is within a preset range, wherein the third audio segment is the audio segment corresponding to the third time interval in the first target audio signal, and the fourth audio segment is the audio segment corresponding to the fourth time interval in the first target audio signal.
6. The method according to claim 1, characterized in that, The first target audio signal includes a third audio signal and a fourth audio signal. The third audio signal is the first audio signal received by the first microphone and emitted by the first speaker. The fourth audio signal is the second audio signal received by the first microphone and emitted by the second speaker. Determining the first audio segment and the second audio segment based on the first target time and the first target audio signal includes: A fifth time interval is determined based on the first target time and a preset time threshold; a sixth time interval is determined based on the second target time and the preset time threshold; wherein, the first target time is the time determined in the third audio signal based on the target amplitude, the second target time is the time determined in the fourth audio signal based on the target amplitude, the end time of the fifth time interval is the first target time, the end time of the sixth time interval is the second target time, and the duration of both the fifth and sixth time intervals is the time threshold; The first audio segment is obtained from the third audio signal according to the fifth time interval, and the second audio segment is obtained from the fourth audio signal according to the sixth time interval.
7. The method according to claim 6, characterized in that, The preset time threshold is determined based on a first preset distance and the time interval between the first speaker generating the first audio signal and the second speaker generating the second audio signal.
8. The method according to claim 1, 2, 3, 6 or 7, characterized in that, Determining the relative position between device A and device B based on the first arrival time and the second arrival time includes: Construct a first hyperbolic function based on the first arrival time and the second arrival time; The relative positions of device A and device B are determined based on the first hyperbolic function and the distance between the first speaker and the second speaker.
9. The method according to claim 4, characterized in that, Determining the relative position between device A and device B based on the first arrival time and the second arrival time includes: Construct a first hyperbolic function based on the first arrival time and the second arrival time; The relative positions of device A and device B are determined based on the first hyperbolic function and the distance between the first speaker and the second speaker.
10. The method according to claim 5, characterized in that, Determining the relative position between device A and device B based on the first arrival time and the second arrival time includes: Construct a first hyperbolic function based on the first arrival time and the second arrival time; The relative positions of device A and device B are determined based on the first hyperbolic function and the distance between the first speaker and the second speaker.
11. The method according to claim 1, 2, 3, 6 or 7, characterized in that, The method further includes: The third arrival time and the fourth arrival time are obtained. The third arrival time is the time corresponding to the third target peak, and the fourth arrival time is the time corresponding to the fourth target peak. The third target peak is the peak with the earliest reception time among the peaks with signal amplitude greater than the third preset amplitude in the fifth audio segment. The fourth target peak is the peak with the earliest reception time among the peaks with signal amplitude greater than the fourth preset amplitude in the sixth audio segment. The fifth audio segment is a segment of the second target audio signal related to the first audio signal, and the sixth audio segment is a segment of the second target audio signal related to the second audio signal. The second target audio signal is obtained by the second microphone of device B based on the first audio signal emitted by the first speaker and the second audio signal emitted by the second speaker. Determining the relative position between device A and device B based on the first arrival time and the second arrival time includes: The relative positions of device A and device B are determined based on the first arrival time, the second arrival time, the third arrival time, the fourth arrival time, the distance between the first speaker and the second speaker, and the distance between the first microphone and the second microphone.
12. The method according to claim 4, characterized in that, The method further includes: The third arrival time and the fourth arrival time are obtained. The third arrival time is the time corresponding to the third target peak, and the fourth arrival time is the time corresponding to the fourth target peak. The third target peak is the peak with the earliest reception time among the peaks with signal amplitude greater than the third preset amplitude in the fifth audio segment. The fourth target peak is the peak with the earliest reception time among the peaks with signal amplitude greater than the fourth preset amplitude in the sixth audio segment. The fifth audio segment is a segment of the second target audio signal related to the first audio signal, and the sixth audio segment is a segment of the second target audio signal related to the second audio signal. The second target audio signal is obtained by the second microphone of device B based on the first audio signal emitted by the first speaker and the second audio signal emitted by the second speaker. Determining the relative position between device A and device B based on the first arrival time and the second arrival time includes: The relative positions of device A and device B are determined based on the first arrival time, the second arrival time, the third arrival time, the fourth arrival time, the distance between the first speaker and the second speaker, and the distance between the first microphone and the second microphone.
13. The method according to claim 5, characterized in that, The method further includes: The third arrival time and the fourth arrival time are obtained. The third arrival time is the time corresponding to the third target peak, and the fourth arrival time is the time corresponding to the fourth target peak. The third target peak is the peak with the earliest reception time among the peaks with signal amplitude greater than the third preset amplitude in the fifth audio segment. The fourth target peak is the peak with the earliest reception time among the peaks with signal amplitude greater than the fourth preset amplitude in the sixth audio segment. The fifth audio segment is a segment of the second target audio signal related to the first audio signal, and the sixth audio segment is a segment of the second target audio signal related to the second audio signal. The second target audio signal is obtained by the second microphone of device B based on the first audio signal emitted by the first speaker and the second audio signal emitted by the second speaker. Determining the relative position between device A and device B based on the first arrival time and the second arrival time includes: The relative positions of device A and device B are determined based on the first arrival time, the second arrival time, the third arrival time, the fourth arrival time, the distance between the first speaker and the second speaker, and the distance between the first microphone and the second microphone.
14. The method according to claim 1, 2, 3, 6, 7, 9 or 10, characterized in that, The first microphone of device B is: Among the multiple microphones of device B, the microphone with the largest difference between its distance from the first speaker and its distance from the second speaker, and whose difference is greater than a preset distance; or, The microphone among the multiple microphones of device B that is least obstructed by device B relative to the first speaker and the second speaker.
15. The method according to claim 4, characterized in that, The first microphone of device B is: Among the multiple microphones of device B, the microphone with the largest difference between its distance from the first speaker and its distance from the second speaker, and whose difference is greater than a preset distance; or, The microphone among the multiple microphones of device B that is least obstructed by device B relative to the first speaker and the second speaker.
16. The method according to claim 5, characterized in that, The first microphone of device B is: Among the multiple microphones of device B, the microphone with the largest difference between its distance from the first speaker and its distance from the second speaker, and whose difference is greater than a preset distance; or, The microphone among the multiple microphones of device B that is least obstructed by device B relative to the first speaker and the second speaker.
17. The method according to claim 8, characterized in that, The first microphone of device B is: Among the multiple microphones of device B, the microphone with the largest difference between its distance from the first speaker and its distance from the second speaker, and whose difference is greater than a preset distance; or, The microphone among the multiple microphones of device B that is least obstructed by device B relative to the first speaker and the second speaker.
18. The method according to claim 11, characterized in that, The first and second microphones of device B include: The two microphones furthest apart from the multiple microphones of device B; or, Of the multiple microphones in device B, two microphones have a difference between their distance from the first speaker and their distance from the second speaker that is greater than a preset distance; or, Among the multiple microphones of device B, the two microphones that are least obstructed by device B relative to the first speaker and the second speaker.
19. The method according to claim 12 or 13, characterized in that, The first and second microphones of device B include: The two microphones furthest apart from the multiple microphones of device B; or, Of the multiple microphones in device B, two microphones have a difference between their distance from the first speaker and their distance from the second speaker that is greater than a preset distance; or, Among the multiple microphones of device B, the two microphones that are least obstructed by device B relative to the first speaker and the second speaker.
20. The method according to claim 1, 2, 3, 6, 7, 9, 10, 12, 13, 15, 16, 17 or 18, characterized in that, Device A is a projection device, and device B is the device to which the screen is projected. After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the method further includes: The content displayed on the display interface of device A is displayed in a preset area of the display interface of device B; the position of the preset area in the display interface of device B is the same as the position of device A relative to device B.
21. The method according to claim 4, characterized in that, Device A is a projection device, and device B is the device to which the screen is projected. After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the method further includes: The content displayed on the display interface of device A is displayed in a preset area of the display interface of device B; the position of the preset area in the display interface of device B is the same as the position of device A relative to device B.
22. The method according to claim 5, characterized in that, Device A is a projection device, and device B is the device to which the screen is projected. After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the method further includes: The content displayed on the display interface of device A is displayed in a preset area of the display interface of device B; the position of the preset area in the display interface of device B is the same as the position of device A relative to device B.
23. The method according to claim 8, characterized in that, Device A is a projection device, and device B is the device to which the screen is projected. After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the method further includes: The content displayed on the display interface of device A is displayed in a preset area of the display interface of device B; the position of the preset area in the display interface of device B is the same as the position of device A relative to device B.
24. The method according to claim 11, characterized in that, Device A is a projection device, and device B is the device to which the screen is projected. After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the method further includes: The content displayed on the display interface of device A is displayed in a preset area of the display interface of device B; the position of the preset area in the display interface of device B is the same as the position of device A relative to device B.
25. The method according to claim 14, characterized in that, Device A is a projection device, and device B is the device to which the screen is projected. After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the method further includes: The content displayed on the display interface of device A is displayed in a preset area of the display interface of device B; the position of the preset area in the display interface of device B is the same as the position of device A relative to device B.
26. The method according to claim 19, characterized in that, Device A is a projection device, and device B is the device to which the screen is projected. After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the method further includes: The content displayed on the display interface of device A is displayed in a preset area of the display interface of device B; the position of the preset area in the display interface of device B is the same as the position of device A relative to device B.
27. A detection device, characterized in that, include: A memory for storing instructions; and a processor coupled to the memory; When the processor executes the instruction, it performs the following method: The first target audio signal acquired by the first microphone of device B is obtained based on the first audio signal emitted by the first speaker and the second audio signal emitted by the second speaker of device A. A first audio segment and a second audio segment are determined based on a first target time and a first target audio signal; the first target time is the time determined based on the target amplitude in the first target audio signal; the first audio segment is a segment in the first target audio signal related to the first audio signal; the second audio segment is a segment in the first target audio signal related to the second audio signal; the time interval corresponding to the first audio segment and the time interval corresponding to the second audio segment in the first target audio signal do not overlap; The first audio segment and the second audio segment are searched separately to obtain the first arrival time and the second arrival time. The first arrival time is the time corresponding to the first target peak, and the second arrival time is the time corresponding to the second target peak. The first target peak is the peak with the earliest reception time among the peaks in the first audio segment whose signal amplitude is greater than the first preset amplitude, and the second target peak is the peak with the earliest reception time among the peaks in the second audio segment whose signal amplitude is greater than the second preset amplitude. The relative positions between device A and device B are determined based on the first arrival time and the second arrival time.
28. The apparatus according to claim 27, characterized in that, In the aspect of determining the first audio segment and the second audio segment based on the first target time and the first target audio signal, the processor is specifically configured to: The first audio segment is determined from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker, and the sampling frequency of the first microphone; The second audio segment is determined from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker, the sampling frequency of the first microphone, and the time interval between the first speaker generating the first audio signal and the second speaker generating the second audio signal.
29. The apparatus according to claim 28, characterized in that, In the aspect of determining the first audio segment from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker, and the sampling frequency of the first microphone, the processor is specifically configured to: A first time interval is determined based on the first target time, the distance between the first and second speakers of device A, and the sampling frequency of the first microphone of device B; wherein, the start time of the first time interval is ind_max-2*(d / v)*f, and the end time is ind_max+2*(D / v)*f; where ind_max is the first target time, d is the first preset distance, D is the distance between the first and second speakers, v is the speed of sound, and f is the sampling frequency of the first microphone; The first audio segment is determined from the first target audio signal based on the first time interval.
30. The apparatus according to claim 28 or 29, characterized in that, In the aspect of determining the second audio segment from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker, the sampling frequency of the first microphone, and the time interval between the first speaker generating the first audio signal and the second speaker generating the second audio signal, the processor is specifically configured to: The second time interval is determined based on the first target time, the distance between the first speaker and the second speaker, the sampling frequency of the first microphone, and the time interval. Wherein, the start time of the second time interval is ind_max-2*(d / v)*f-T1, and the end time is ind_max-T1+2*(D / v)*f; where ind_max is the first target time, d is the first preset distance, D is the distance between the first speaker and the second speaker of the device A, v is the speed of sound, f is the sampling frequency of the first microphone, and T1 is the time interval; The second audio segment is determined from the first target audio signal based on the second time interval.
31. The apparatus according to claim 28 or 29, characterized in that, In the aspect of determining the second audio segment from the first target audio signal based on the first target time, the distance between the first speaker and the second speaker, the sampling frequency of the first microphone, and the time interval between the first speaker generating the first audio signal and the second speaker generating the second audio signal, the processor is specifically configured to: The third time interval and the fourth time interval are determined based on the first target time, the distance between the first speaker and the second speaker, the sampling frequency of the first microphone, and the time interval. Wherein, the start time of the third time interval is ind_max-2*(d / v)*f+T1, and the end time is ind_max+T1+2*(D / v)*f; the start time of the fourth time interval is ind_max-2*(d / v)*f-T1, and the end time is ind_max-T1+2*(D / v)*f; where ind_max is the first target time, d is the first preset distance, D is the distance between the first speaker and the second speaker of device A, v is the speed of sound, f is the sampling frequency of the first microphone, and T1 is the time interval; The second audio segment is determined from the third and fourth audio segments, wherein the second audio segment is an audio segment in the third and fourth audio segments whose ratio of the maximum signal amplitude to the LOS signal amplitude is within a preset range, wherein the third audio segment is the audio segment corresponding to the third time interval in the first target audio signal, and the fourth audio segment is the audio segment corresponding to the fourth time interval in the first target audio signal.
32. The apparatus according to claim 27, characterized in that, The first target audio signal includes a third audio signal and a fourth audio signal. The third audio signal is the first audio signal received by the first microphone and emitted by the first speaker. The fourth audio signal is the second audio signal received by the first microphone and emitted by the second speaker. In determining the first audio segment and the second audio segment based on the first target time and the first target audio signal, the processor is specifically configured to: A fifth time interval is determined based on the first target time and a preset time threshold; a sixth time interval is determined based on the second target time and the preset time threshold; wherein, the first target time is the time determined in the third audio signal based on the target amplitude, the second target time is the time determined in the fourth audio signal based on the target amplitude, the end time of the fifth time interval is the first target time, the end time of the sixth time interval is the second target time, and the duration of both the fifth and sixth time intervals is the time threshold; The first audio segment is obtained from the third audio signal according to the fifth time interval, and the second audio segment is obtained from the fourth audio signal according to the sixth time interval.
33. The apparatus according to claim 32, characterized in that, The preset time threshold is determined based on a first preset distance and the time interval between the first speaker of device A generating a first audio signal and the second speaker generating a second audio signal.
34. The apparatus according to claim 27, 28, 29, 32 or 33, characterized in that, In the aspect of determining the relative position between device A and device B based on the first arrival time and the second arrival time, the processor is specifically configured to: Construct a first hyperbolic function based on the first arrival time and the second arrival time; The relative positions of device A and device B are determined based on the first hyperbolic function and the distance between the first speaker and the second speaker.
35. The apparatus according to claim 30, characterized in that, In the aspect of determining the relative position between device A and device B based on the first arrival time and the second arrival time, the processor is specifically configured to: Construct a first hyperbolic function based on the first arrival time and the second arrival time; The relative positions of device A and device B are determined based on the first hyperbolic function and the distance between the first speaker and the second speaker.
36. The apparatus according to claim 31, characterized in that, In the aspect of determining the relative position between device A and device B based on the first arrival time and the second arrival time, the processor is specifically configured to: Construct a first hyperbolic function based on the first arrival time and the second arrival time; The relative positions of device A and device B are determined based on the first hyperbolic function and the distance between the first speaker and the second speaker.
37. The apparatus according to claim 27, 28, 29, 32 or 33, characterized in that, The processor is also used for: The third arrival time and the fourth arrival time are obtained. The third arrival time is the time corresponding to the third target peak, and the fourth arrival time is the time corresponding to the fourth target peak. The third target peak is the peak with the earliest reception time among the peaks in the fifth audio segment whose signal amplitude is greater than the third preset amplitude. The fourth target peak is the peak with the earliest reception time among the peaks in the sixth audio segment whose signal amplitude is greater than the fourth preset amplitude. The fifth audio segment is a segment in the second target audio signal that is related to the first audio signal, and the sixth audio segment is a segment in the second target audio signal that is related to the second audio signal. The second target audio signal is obtained by the second microphone of device B based on the first audio signal emitted by the first speaker and the second audio signal emitted by the second speaker. In the aspect of determining the relative position between device A and device B based on the first arrival time and the second arrival time, the processor is specifically configured to: The relative positions of device A and device B are determined based on the first arrival time, the second arrival time, the third arrival time, the fourth arrival time, the distance between the first speaker and the second speaker, and the distance between the first microphone and the second microphone.
38. The apparatus according to claim 30, characterized in that, The processor is also used for: The third arrival time and the fourth arrival time are obtained. The third arrival time is the time corresponding to the third target peak, and the fourth arrival time is the time corresponding to the fourth target peak. The third target peak is the peak with the earliest reception time among the peaks in the fifth audio segment whose signal amplitude is greater than the third preset amplitude. The fourth target peak is the peak with the earliest reception time among the peaks in the sixth audio segment whose signal amplitude is greater than the fourth preset amplitude. The fifth audio segment is a segment in the second target audio signal that is related to the first audio signal, and the sixth audio segment is a segment in the second target audio signal that is related to the second audio signal. The second target audio signal is obtained by the second microphone of device B based on the first audio signal emitted by the first speaker and the second audio signal emitted by the second speaker. In the aspect of determining the relative position between device A and device B based on the first arrival time and the second arrival time, the processor is specifically configured to: The relative positions of device A and device B are determined based on the first arrival time, the second arrival time, the third arrival time, the fourth arrival time, the distance between the first speaker and the second speaker, and the distance between the first microphone and the second microphone.
39. The apparatus according to claim 31, characterized in that, The processor is also used for: The third arrival time and the fourth arrival time are obtained. The third arrival time is the time corresponding to the third target peak, and the fourth arrival time is the time corresponding to the fourth target peak. The third target peak is the peak with the earliest reception time among the peaks in the fifth audio segment whose signal amplitude is greater than the third preset amplitude. The fourth target peak is the peak with the earliest reception time among the peaks in the sixth audio segment whose signal amplitude is greater than the fourth preset amplitude. The fifth audio segment is a segment in the second target audio signal that is related to the first audio signal, and the sixth audio segment is a segment in the second target audio signal that is related to the second audio signal. The second target audio signal is obtained by the second microphone of device B based on the first audio signal emitted by the first speaker and the second audio signal emitted by the second speaker. In the aspect of determining the relative position between device A and device B based on the first arrival time and the second arrival time, the processor is specifically configured to: The relative positions of device A and device B are determined based on the first arrival time, the second arrival time, the third arrival time, the fourth arrival time, the distance between the first speaker and the second speaker, and the distance between the first microphone and the second microphone.
40. The apparatus according to claim 27, 28, 29, 32, 33, 35 or 36, characterized in that... The first microphone of device B is: Among the multiple microphones of device B, the microphone with the largest difference between its distance from the first speaker and its distance from the second speaker, and whose difference is greater than a preset distance; or, The microphone among the multiple microphones of device B that is least obstructed by device B relative to the first speaker and the second speaker.
41. The apparatus according to claim 30, characterized in that... The first microphone of device B is: Among the multiple microphones of device B, the microphone with the largest difference between its distance from the first speaker and its distance from the second speaker, and whose difference is greater than a preset distance; or, The microphone among the multiple microphones of device B that is least obstructed by device B relative to the first speaker and the second speaker.
42. The apparatus according to claim 31, characterized in that... The first microphone of device B is: Among the multiple microphones of device B, the microphone with the largest difference between its distance from the first speaker and its distance from the second speaker, and whose difference is greater than a preset distance; or, The microphone among the multiple microphones of device B that is least obstructed by device B relative to the first speaker and the second speaker.
43. The apparatus according to claim 34, characterized in that... The first microphone of device B is: Among the multiple microphones of device B, the microphone with the largest difference between its distance from the first speaker and its distance from the second speaker, and whose difference is greater than a preset distance; or, The microphone among the multiple microphones of device B that is least obstructed by device B relative to the first speaker and the second speaker.
44. The apparatus according to claim 37, characterized in that, The first and second microphones of device B include: The two microphones furthest apart from the multiple microphones of device B; or, Of the multiple microphones in device B, two microphones have a difference between their distance from the first speaker and their distance from the second speaker that is greater than a preset distance; or, Among the multiple microphones of device B, the two microphones that are least obstructed by device B relative to the first speaker and the second speaker.
45. The apparatus according to claim 38 or 39, characterized in that, The first and second microphones of device B include: The two microphones furthest apart from the multiple microphones of device B; or, Of the multiple microphones in device B, two microphones have a difference between their distance from the first speaker and their distance from the second speaker that is greater than a preset distance; or, Among the multiple microphones of device B, the two microphones that are least obstructed by device B relative to the first speaker and the second speaker.
46. The apparatus according to claim 27, 28, 29, 32, 33, 35, 36, 38, 39, 41, 42, 43 or 44, characterized in that, Device A is a screen mirroring device, device B is the device whose screen is being mirrored, and the processor is specifically used for: After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the content displayed on the display interface of device A is displayed in a preset area of the display interface of device B. The preset area is located in the same position on the display interface of device B as the position of device A relative to device B.
47. The apparatus according to claim 30, characterized in that, Device A is a screen mirroring device, device B is the device whose screen is being mirrored, and the processor is specifically used for: After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the content displayed on the display interface of device A is displayed in a preset area of the display interface of device B. The preset area is located in the same position on the display interface of device B as the position of device A relative to device B.
48. The apparatus according to claim 31, characterized in that, Device A is a screen mirroring device, device B is the device whose screen is being mirrored, and the processor is specifically used for: After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the content displayed on the display interface of device A is displayed in a preset area of the display interface of device B. The preset area is located in the same position on the display interface of device B as the position of device A relative to device B.
49. The apparatus according to claim 34, characterized in that, Device A is a screen mirroring device, device B is the device whose screen is being mirrored, and the processor is specifically used for: After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the content displayed on the display interface of device A is displayed in a preset area of the display interface of device B. The preset area is located in the same position on the display interface of device B as the position of device A relative to device B.
50. The apparatus according to claim 37, characterized in that, Device A is a screen mirroring device, device B is the device whose screen is being mirrored, and the processor is specifically used for: After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the content displayed on the display interface of device A is displayed in a preset area of the display interface of device B. The preset area is located in the same position on the display interface of device B as the position of device A relative to device B.
51. The apparatus according to claim 40, characterized in that, Device A is a screen mirroring device, device B is the device whose screen is being mirrored, and the processor is specifically used for: After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the content displayed on the display interface of device A is displayed in a preset area of the display interface of device B. The preset area is located in the same position on the display interface of device B as the position of device A relative to device B.
52. The apparatus according to claim 45, characterized in that, Device A is a screen mirroring device, device B is the device whose screen is being mirrored, and the processor is specifically used for: After determining the relative position between device A and device B based on the first arrival time and the second arrival time, the content displayed on the display interface of device A is displayed in a preset area of the display interface of device B. The preset area is located in the same position on the display interface of device B as the position of device A relative to device B.
53. A chip system, characterized in that, The chip system is applied to an electronic device; the chip system includes one or more interface circuits and one or more processors; the interface circuits and the processors are interconnected via lines; the interface circuits are used to receive signals from the memory of the electronic device and send the signals to the processors, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device performs the method as described in any one of claims 1-26.