Method, system, medium and equipment for measuring distance between wireless sound box and main sound box

The pulse modulation data ranging method between the wireless speaker and the main speaker solves the low efficiency and high error problems of manual measurement, realizes accurate speaker distance measurement, and improves the layout efficiency and sound quality of the speaker system.

CN120686247APending Publication Date: 2025-09-23MALANSHAN AUDIO & VIDEO LABORATORY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511069672.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In the prior art, during the arrangement of wireless speakers and main speakers, manual measurement methods are inefficient and inaccurate, resulting in low speaker system arrangement efficiency and poor sound quality, affecting user experience.

Method used

Pulse modulation data is played through the wireless speaker as a frequency test signal. The main speaker obtains the corresponding packaged data, calculates the transmission distance based on the time interval and ambient sound speed, and uses the delay characteristics of the pulse modulation data to perform accurate ranging.

Benefits of technology

It improves the efficiency and accuracy of speaker system layout, optimizes the layout of speakers, improves sound quality, and enhances the user's listening experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120686247A_ABST
    Figure CN120686247A_ABST
Patent Text Reader

Abstract

The invention provides a distance measurement method and system for a wireless sound box and a main sound box, a medium and equipment, and relates to the technical field of audio processing, and the method comprises the steps: enabling the main sound box to obtain the packaged data of the playing time corresponding to a frequency test signal after the wireless sound box plays pulse modulation data as the frequency test signal; the pulse modulation data is sent to the wireless sound box by the main sound box; determining signal playing time received by the main sound box according to the packed data and the time delay; acquiring a first time interval of the wireless sound box, a second time interval of the main sound box and an environmental sound velocity; calculating the transmission distance of each frequency test signal; and carrying out data processing on the transmission distance, and taking an obtained processing data value as an actual distance between the main sound box and the wireless sound box. According to the invention, the transmission distance of each frequency test signal can be accurately calculated. According to the method, the problems of low efficiency and high error of a traditional manual measurement mode are avoided, and the efficiency and the accuracy of sound box system arrangement are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of audio processing technology, and in particular to a method, system, medium and device for measuring the distance between a wireless speaker and a main speaker. Background Art

[0002] In modern audio systems, the combination of wireless speakers and main speakers is becoming increasingly common. They can provide users with a more flexible audio experience and meet the listening needs of different scenarios. However, most current speaker systems mainly rely on manual distance measurement to position and configure wireless speakers and main speakers.

[0003] Traditional manual measurement methods have numerous technical drawbacks. First, manual measurement is inefficient. Workers must use measuring tools (such as tape measures) to measure the distance between each wireless speaker and the main speaker at the installation site. This process is not only time-consuming but can also be limited by the complexity of the site (such as furniture placement and irregular spatial layout). This makes it difficult to complete measurements quickly, severely impacting the efficiency of speaker system deployment and failing to meet user demands for rapid installation and commissioning.

[0004] Secondly, the accuracy of manual measurement is difficult to guarantee. Measurement results are closely related to the operator's skills, experience, and sense of responsibility. Different personnel may have different understandings of measurement methods or perform improper operations (such as not keeping the measuring tool level or vertical during measurement, resulting in inaccurate readings). Furthermore, environmental factors (such as dim lighting and a small space) can interfere with manual measurement, further increasing measurement errors. Such errors can result in poor sound quality and an unbalanced sound field during audio playback from the speaker system, impacting the user's listening experience.

[0005] In summary, the existing manual measurement method has technical defects such as low placement efficiency, large measurement errors, and strong dependence on staff during the placement of wireless speakers and main speakers. It is urgent to improve and optimize it to enhance the placement quality of the speaker system and user experience. Summary of the Invention

[0006] The purpose of this application is to provide a distance measurement method, system, computer-readable storage medium, electronic device and computer program product for a wireless speaker and a main speaker, which can accurately measure the distance between the wireless speaker and the main speaker.

[0007] To solve the above technical problems, the present application provides a method for measuring the distance between a wireless speaker and a main speaker, including a main speaker and a wireless speaker. The specific technical solution is as follows:

[0008] After the wireless speaker plays the pulse modulated data as the frequency test signal, the main speaker obtains the packaged data corresponding to the playing time of the frequency test signal; the pulse modulated data is sent by the main speaker to the wireless speaker;

[0009] Determining the playback time of the signal received by the main speaker according to the packaged data and the time delay;

[0010] Obtaining a first time interval of the wireless speaker, a second time interval of the main speaker, and an ambient sound speed;

[0011] Calculating the transmission distance of each frequency test signal according to the play time, the signal play time, the first time interval, the second time interval, and the ambient sound speed;

[0012] The transmission distance is processed, and the obtained processed data value is used as the actual distance between the main speaker and the wireless speaker.

[0013] Optionally, before the wireless speaker plays the pulse modulation data as the frequency test signal, the method further includes:

[0014] The main speaker sends a clock frequency synchronization frame to calibrate the system time of the wireless speaker to obtain a system time deviation;

[0015] The system time deviation is written into the wireless speaker.

[0016] Optionally, the master speaker sends a clock frequency synchronization frame to calibrate the system time of the wireless speaker, and obtaining the system time deviation includes:

[0017] The main speaker sends at least two clock frequency synchronization frames and corresponding sending times to the wireless speaker;

[0018] If the time difference between the sending time of the clock frequency synchronization frame and the receiving time of the clock frequency synchronization frame by the wireless speaker does not exceed the delay threshold, calculating the clock frequency deviation according to the sending time and the receiving time;

[0019] Calculating a clock frequency adjustment value of the wireless speaker according to the clock frequency deviation;

[0020] After the clock frequency deviation converges to a set threshold, receiving a time synchronization request frame sent by the wireless speaker;

[0021] The master speaker sends a time synchronization response frame to the wireless speaker, and calculates an average link delay according to the clock frequency deviation, the physical sending time and the physical receiving time of the time synchronization request frame and the time synchronization response frame;

[0022] The system time offset between the wireless speaker and the main speaker is calculated according to the average link delay.

[0023] Optionally, before the wireless speaker plays the pulse modulation data as the frequency test signal, the method further includes:

[0024] The main speaker collects ambient sound through a microphone, and performs frequency domain analysis on the ambient sound to determine the noise frequency;

[0025] generating a plurality of ranging frequencies within the audible sound wave range according to the noise frequency;

[0026] The ranging frequency is sent to the wireless speaker, so that the wireless speaker eliminates useless ranging frequencies in the ranging frequency according to the speaker frequency response curve to obtain effective ranging frequencies, and generates an original data sequence for each of the effective ranging frequencies; the original data sequence is used to guide the wireless speaker to play the pulse modulation data.

[0027] Optionally, before calculating the transmission distance of each frequency test signal according to the play time, the signal play time, the first time interval, the second time interval, and the ambient sound speed, the method further includes:

[0028] After the main speaker replies a response frame to the wireless speaker according to the original data sequence, the main speaker receives the current temperature information fed back by the wireless speaker;

[0029] The ambient sound speed is calculated according to the current temperature.

[0030] Optionally, also include:

[0031] When the microphone of the main speaker collects the frequency test signal played by the wireless speaker, a reception timestamp is added to each frame of the frequency test signal;

[0032] performing frequency domain analysis on the frequency test signal according to the receiving timestamp to determine whether the frequency test signal is pulse modulation data sent from the main speaker to the wireless speaker;

[0033] If so, the step of calculating the transmission distance of each frequency test signal according to the play time, the signal play time, the first time interval, the second time interval and the ambient sound speed is performed.

[0034] The present application also provides a distance measurement system for a wireless speaker and a main speaker, comprising a main speaker and a wireless speaker, including:

[0035] a data acquisition module, configured to, after the wireless speaker plays pulse modulated data as a frequency test signal, cause the main speaker to acquire packaged data corresponding to the playing time of the frequency test signal; the pulse modulated data is sent by the main speaker to the wireless speaker;

[0036] A time calculation module, configured to determine the playback time of the signal received by the main speaker based on the packaged data and the time delay;

[0037] a parameter acquisition module, configured to acquire a first time interval of the wireless speaker, a second time interval of the main speaker, and an ambient sound velocity;

[0038] a distance calculation module, configured to calculate the transmission distance of each of the frequency test signals according to the play time, the signal play time, the first time interval, the second time interval, and the ambient sound speed;

[0039] The distance processing module is used to process the transmission distance and use the obtained processed data value as the actual distance between the main speaker and the wireless speaker.

[0040] The present application also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-described method when executed by a processor.

[0041] The present application also provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned method when calling the computer program in the memory.

[0042] The present application also provides a computer program product, comprising a computer program, which implements the steps of the method described above when the computer program is executed.

[0043] The present application provides a method for measuring the distance between a wireless speaker and a main speaker, including a main speaker and a wireless speaker, comprising: after the wireless speaker plays pulse modulated data as a frequency test signal, the main speaker obtains packaged data corresponding to the playback time of the frequency test signal; the pulse modulated data is sent by the main speaker to the wireless speaker; the playback time of the signal received by the main speaker is determined based on the packaged data and the time delay; a first time interval of the wireless speaker, a second time interval of the main speaker, and an ambient sound speed are obtained; the transmission distance of each frequency test signal is calculated based on the playback time, the signal playback time, the first time interval, the second time interval, and the ambient sound speed; and data processing is performed on the transmission distance, and the obtained processed data value is used as the actual distance between the main speaker and the wireless speaker.

[0044] This application uses wireless speakers to play pulse-modulated data as frequency test signals, and the main speaker obtains the corresponding packaged data, enabling accurate recording of signal transmission time. By utilizing the delay characteristics of pulse-modulated data, combined with the playback time, time interval, and ambient sound speed of the main and wireless speakers, the transmission distance of each frequency test signal can be accurately calculated. This method avoids the low efficiency and high error of traditional manual measurement methods, greatly improving the efficiency and accuracy of speaker system layout.

[0045] Furthermore, this application processes the transmission distance data to further ensure the reliability of the measurement results. The resulting processed data value, as the actual distance between the main speaker and the wireless speaker, can provide an accurate reference for the layout of the speaker system, thereby optimizing the speaker layout, improving the sound quality, and enhancing the user's listening experience.

[0046] The present application also provides a distance measurement system for a wireless speaker and a main speaker, a computer-readable storage medium, an electronic device, and a computer program product, which have the above-mentioned beneficial effects and are not described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0048] Figure 1 A flow chart of a method for measuring the distance between a wireless speaker and a main speaker provided in an embodiment of the present application;

[0049] Figure 2 A schematic diagram of the distance measurement process between the wireless speaker and the main speaker provided in an embodiment of the present application;

[0050] Figure 3 A flow chart of the clock frequency synchronization process provided in an embodiment of the present application;

[0051] Figure 4 A flowchart of the system time synchronization process provided in an embodiment of the present application;

[0052] Figure 5 A flow chart of the ranging process provided in an embodiment of the present application;

[0053] Figure 6 A schematic diagram of the distance measurement system between a wireless speaker and a main speaker provided in an embodiment of the present application;

[0054] Figure 7This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0056] Figure 1 This is a flow chart of a method for measuring the distance between a wireless speaker and a main speaker provided in an embodiment of the present application. The method includes:

[0057] S101: After the wireless speaker plays pulse modulation data as a frequency test signal, the main speaker obtains packaged data corresponding to the playing time of the frequency test signal; the pulse modulation data is sent by the main speaker to the wireless speaker;

[0058] S102: Determine the playback time of the signal received by the main speaker according to the packaged data and the delay;

[0059] S103: Acquire a first time interval of the wireless speaker, a second time interval of the main speaker, and an ambient sound velocity;

[0060] S104: Calculating the transmission distance of each frequency test signal according to the play time, the signal play time, the first time interval, the second time interval, and the ambient sound speed;

[0061] S105: Process the transmission distance and use the obtained processed data value as the actual distance between the main speaker and the wireless speaker.

[0062] During the test, the main speaker first generates data in the form of pulse modulation data. This data is a specially modulated signal that can be used as a frequency test signal. For example, pulse width modulation (PWM) technology can be used to convert the audio signal into a series of equal-amplitude pulses or a sine wave with a set variation pattern. The pulse width varies according to the set pattern to carry the audio information.

[0063] The main speaker transmits the pulse-modulated data format to the wireless speakers via a wireless communication module (such as Wi-Fi or Bluetooth). During transmission, signal integrity and stability are ensured to prevent data loss or distortion due to transmission interference. In one feasible implementation, the main speaker can transmit the data to the wireless speakers via the StarFlash module. The StarFlash module is a wireless communication module developed based on NearLink technology.

[0064] After receiving the pulse modulation data, the wireless speaker plays it as a frequency test signal according to the preset playing rules. During the playing process, the wireless speaker records the signal playing time of the frequency test signal for subsequent calculation.

[0065] While the wireless speaker is playing the frequency test signal, the main speaker uses its built-in audio acquisition module (e.g., microphone) to capture packetized data corresponding to the playback time of the frequency test signal. Packed data refers to the complete data packet of the audio signal collected by the main speaker within a certain time interval, including information such as the amplitude and phase of the frequency test signal.

[0066] The main speaker analyzes and processes the acquired packaged data. First, it converts the packaged data from the time domain to the frequency domain using a signal processing algorithm (such as Fast Fourier Transform (FFT)) to more clearly identify the characteristic frequency components of the frequency test signal.

[0067] In the frequency domain, the main speaker searches for the characteristic frequency signal corresponding to the pulse modulation data. Because the pulse modulation data has a specific frequency distribution pattern, the main speaker can accurately identify the frequency test signal based on these patterns.

[0068] The main speaker identifies the characteristic frequency components of the frequency test signal and combines them with the signal playback time recorded by the wireless speaker to calculate the time delay between the main speaker receiving the signal. Time delay is the time difference between the wireless speaker starting to play the frequency test signal and the main speaker receiving it.

[0069] The main speaker can determine the playing time of the frequency test signal by using the time delay and the signal playing time of the wireless speaker. The playing time is the duration of the wireless speaker playing the frequency test signal, usually in seconds.

[0070] While playing the frequency test signal, the wireless speaker records the first time interval during which it processes the signal. This first time interval is the interval between when the wireless speaker receives the pulse modulation data and when it starts playing the frequency test signal. This interval is primarily determined by the wireless speaker's hardware processing speed and software algorithms.

[0071] The wireless speaker sends the first time interval back to the main speaker through the wireless communication module, and the main speaker receives and stores the parameter.

[0072] While the main speaker receives and processes the frequency test signal, it also records the second time interval for its internal signal processing. This second time interval is the interval between when the main speaker receives the frequency test signal and when it completes the data acquisition. Again, this interval is related to the hardware performance and software algorithms of the main speaker.

[0073] The ambient sound velocity refers to the speed at which sound propagates in the current environment. Because the speed of sound is affected by environmental factors such as temperature, humidity, and air pressure, it is necessary to obtain the ambient sound velocity in real time.

[0074] In a feasible implementation manner, after the main speaker replies a response frame to the wireless speaker according to the original data sequence, it receives current temperature information fed back by the wireless speaker, and then calculates the ambient sound speed according to the current temperature.

[0075] The main speaker can measure ambient temperature, humidity, and other parameters using built-in environmental sensors (e.g., temperature and humidity sensors) within the wireless speaker. The main speaker then calculates the ambient sound velocity based on the relationship between sound velocity and ambient parameters (e.g., under standard atmospheric pressure, the relationship between sound velocity and temperature is v = 331.3 + 0.606 × T, where v is the sound velocity in meters per second and T is the temperature in degrees Celsius). In other implementations, local meteorological data can be obtained online to extract sound velocity information.

[0076] Afterwards, based on the known playback time, signal playback time, first time interval, second time interval and ambient sound speed. In a feasible implementation, the transmission distance [D1,…,Dn] of each frequency signal in the air can be calculated according to the formula Dn = (Bln – Bn – (Ts + Tr)) * v, the outliers in [D1,…,Dn] are eliminated and the remaining data is averaged to obtain the transmission distance D, and then the transmission distance D is sent to the wireless speaker. The wireless speaker broadcasts the transmission distance between the wireless speaker and the main speaker through text-to-speech. At this point, the ranging is completed. The above formula includes the signal playback time Bln received by the main speaker, the wireless speaker signal playback time Bn, the time interval Ts for the wireless speaker CPU to send audio data to the speaker to emit a sound wave signal, the time interval Tr from the main speaker microphone receiving the audio signal to actually generating the audio signal data and storing it in the cache, and the ambient sound speed v.

[0077] The embodiment of the present application plays pulse modulated data as a frequency test signal through a wireless speaker, and the main speaker obtains the corresponding packaged data, which can achieve accurate recording of the signal transmission time. By utilizing the delay characteristics of the pulse modulated data, combined with the playback time, time interval and ambient sound speed of the main speaker and the wireless speaker, the transmission distance of each frequency test signal can be accurately calculated. This method avoids the low efficiency and high error problems of traditional manual measurement methods, and greatly improves the efficiency and accuracy of the speaker system layout. At the same time, this embodiment processes the transmission distance data to further ensure the reliability of the measurement results. The final processed data value is used as the actual distance between the main speaker and the wireless speaker, which can provide an accurate reference basis for the layout of the speaker system, thereby optimizing the layout of the speakers, improving the sound quality, and enhancing the user's listening experience.

[0078] In one feasible implementation, verification can also be performed before ranging. Specifically, when the microphone of the main speaker collects the frequency test signal played by the wireless speaker, a reception timestamp is added to each frame of the frequency test signal; the frequency test signal is subjected to frequency domain analysis based on the reception timestamp to determine whether the frequency test signal is pulse modulated data sent from the main speaker to the wireless speaker; if the determination result is yes, ranging is performed.

[0079] At this point, after receiving the positive response frame from the main speaker via the Star Flash module, the wireless speaker begins playing the generated PCM data through its speakers. It also records the start [B1,…,Bn] and end [E1,…,En] times of each frequency test signal. After completion, these times are packaged into a playback time frame and sent to the main speaker. When the main speaker's microphone collects data, it adds a received timestamp to each frame of audio data. A certain amount of time after receiving the playback time information frame sent by the wireless speaker, the main speaker stops collecting and begins frequency domain analysis of the received microphone data. Based on the previously saved PCM raw data and the collected microphone data's time-frequency information, it calculates the local start [BL1,…,BLn] and end [EL1,…,ELn] times of each frequency and segment of the ranging signal received by the main speaker. It then verifies whether the length of each frequency signal matches the length in the saved PCM raw data. If so, distance calculation begins; otherwise, the ranging process is reinitiated.

[0080] In one feasible embodiment, before the wireless speaker plays pulse-modulated data as a frequency test signal, system time calibration can be performed to avoid time errors caused by time deviation between the main and wireless speaker motherboards. Specifically, the main speaker sends a clock frequency synchronization frame to calibrate the system time of the wireless speaker, obtaining a system time deviation, which is then written to the wireless speaker.

[0081] A feasible system time calibration process includes the following steps:

[0082] In the first step, the main speaker sends at least two clock frequency synchronization frames and corresponding sending times to the wireless speaker;

[0083] Step 2: If the time difference between the sending time of the clock frequency synchronization frame and the receiving time of the clock frequency synchronization frame by the wireless speaker does not exceed the delay threshold, calculate the clock frequency deviation according to the sending time and the receiving time;

[0084] Step 3: calculating a clock frequency adjustment value of the wireless speaker according to the clock frequency deviation;

[0085] Step 4: After the clock frequency deviation converges to a set threshold, receiving a time synchronization request frame sent by the wireless speaker;

[0086] Step 5: The master speaker sends a time synchronization response frame to the wireless speaker, and calculates the average link delay based on the clock frequency deviation, the physical sending time and the physical receiving time of the time synchronization request frame and the time synchronization response frame;

[0087] Step 6: Calculate the system time offset between the wireless speaker and the main speaker based on the average link delay.

[0088] The master speaker first generates and transmits at least two clock synchronization frames to the wireless speaker. Each time a frame is transmitted, the master speaker records the corresponding transmission time. A clock synchronization frame is a special signal frame used to calibrate the clock frequencies between the master speaker and the wireless speaker. The transmission time is accurately recorded by the master speaker's internal clock module, typically in milliseconds or microseconds. For example, the master speaker can transmit a clock synchronization frame at a regular interval (e.g., 100 milliseconds) to ensure that the wireless speaker receives enough synchronization frames for calculation.

[0089] After receiving the clock frequency synchronization frame, the wireless speaker records the corresponding reception time. It then compares the reception time with the master speaker's transmission time and calculates the time difference between the two. If the time difference does not exceed the set delay threshold (for example, the delay threshold can be set to 10 milliseconds to ensure real-time signal transmission), the clock frequency deviation is calculated based on the transmission and reception times.

[0090] Based on the calculated clock frequency deviation, the wireless speaker calculates its own clock frequency adjustment value. This adjustment value is used to adjust the wireless speaker's clock frequency to align with the main speaker's clock frequency. The wireless speaker then adjusts the frequency of its internal clock module based on this adjustment value to synchronize with the main speaker's clock frequency.

[0091] After the clock frequency deviation converges to the set threshold, the wireless speaker sends a time synchronization request frame to the master speaker. After receiving the request frame, the master speaker records the reception time and immediately sends a time synchronization response frame to the wireless speaker. The master speaker also records the transmission time of the response frame. After receiving the response frame, the wireless speaker also records the reception time. The threshold setting is not limited here; for example, the threshold could be 0.1%, indicating that the clock frequency deviation is within the acceptable range.

[0092] Based on the physical transmission and reception times of the time synchronization request and response frames, the main speaker and wireless speakers can calculate the average link delay. Average link delay refers to the average time it takes for a signal to travel back and forth between the main speaker and the wireless speaker. By calculating the average link delay, the impact of link delay on time synchronization can be eliminated, ensuring the accuracy of time synchronization. Finally, based on the average link delay, the main speaker and wireless speakers can calculate the system time offset between them. System time offset refers to the time difference between the main speaker and the wireless speaker, the actual time offset after link delay correction.

[0093] This embodiment enables high-precision time synchronization between the main speaker and wireless speakers. In practical applications, it can effectively improve the audio playback quality of a multi-speaker system, ensuring synchronized playback of audio signals across multiple speakers, optimizing the sound field layout, and enhancing the user's listening experience. Furthermore, it is highly adaptable to wireless communication delays and clock frequency differences, enabling stable operation in complex real-world environments.

[0094] Based on the above embodiment, before the wireless speaker plays the frequency test signal, the main speaker may first generate an original data sequence for the wireless speaker to play and thus perform distance measurement. The specific process may be as follows:

[0095] In the first step, the main speaker collects ambient sound through a microphone and performs frequency domain analysis on the ambient sound to determine the noise frequency;

[0096] Step 2: generating a plurality of ranging frequencies within the audible sound wave range according to the noise frequency;

[0097] The third step is to send the ranging frequency to the wireless speaker, so that the wireless speaker eliminates useless ranging frequencies in the ranging frequency according to the speaker frequency response curve to obtain effective ranging frequencies, and generates an original data sequence for each effective ranging frequency.

[0098] The main speaker's built-in microphone collects ambient sound. The microphone converts the collected ambient sound signals into electrical signals and transmits them to the main speaker's audio processing module. The audio processing module performs frequency domain analysis on the collected ambient sound signals, typically using a fast Fourier transform (FFT) algorithm to convert the time domain signals into frequency domain signals. This frequency domain analysis allows the main speaker to determine the primary frequency components of the ambient noise. For example, if the ambient noise is primarily concentrated in the low-frequency band (such as the hum of an air conditioner) or the high-frequency band (such as high-frequency interference from electronic devices), the main speaker can identify these noise frequencies.

[0099] Based on the analyzed noise frequencies, the main speaker generates several ranging frequencies within the audible range. The audible range is typically 20 Hz to 20,000 Hz. When generating ranging frequencies, the main speaker avoids identified noise frequencies to minimize interference from ambient noise on the ranging signal. For example, if ambient noise is primarily concentrated around 1,000 Hz, the main speaker might generate ranging signals at frequencies such as 500 Hz and 1,500 Hz. The number of generated ranging frequencies can be adjusted based on actual needs and system complexity, typically ranging from three to five different frequencies.

[0100] The main speaker wirelessly transmits the generated ranging frequencies to the wireless speakers. After receiving the ranging frequencies, the wireless speakers filter the frequencies based on their own speaker frequency response curves. Speaker frequency response curves describe the response characteristics of a speaker at different frequencies and are typically provided by the speaker manufacturer. The wireless speaker uses these frequency response curves to eliminate frequencies where the speaker responds poorly (i.e., useless ranging frequencies) to determine the effective ranging frequencies.

[0101] For each valid ranging frequency, the wireless speaker generates a corresponding raw data sequence. This raw data sequence is a specific signal pattern that instructs the wireless speaker to play pulse-modulated data. Pulse-modulated data is a modulated audio signal that can be used for subsequent distance measurement. The wireless speaker plays the pulse-modulated data according to the raw data sequence, ensuring that the signal for each valid ranging frequency is accurately received and processed by the main speaker.

[0102] This embodiment can effectively improve the ranging accuracy between the main speaker and the wireless speakers. By analyzing the ambient noise frequency and generating effective ranging frequencies, and combining the wireless speaker's speaker frequency response curve to eliminate useless frequencies, the impact of environmental interference on ranging can be significantly reduced. Furthermore, using the original data sequence to guide the wireless speaker in playing pulse-modulated data can further improve the quality and reliability of the ranging signal. In practical applications, this method can optimize the sound field layout of a multi-speaker system, improve audio playback quality, and enhance the user's listening experience.

[0103] See also Figure 2 , Figure 2This is a schematic diagram of the distance measurement process between the wireless speaker and the main speaker provided in an embodiment of the present application. Figure 2 The distance measurement method between the wireless speaker and the main speaker provided above is exemplified by a specific application process of the present application:

[0104] The ranging system consists of Figure 2 As shown, the relevant interactive information of ranging is sent and received by the Star Flash module between the main speaker and the wireless speaker; the accuracy of the clock frequency is guaranteed by the high-precision clock of the main speaker, and the time error between the wireless speaker and the main speaker system is guaranteed to be within the allowable range through the time synchronization interaction process; the system calculates the distance between the wireless speaker and the main speaker by measuring the time difference between the time when the wireless speaker emits a certain frequency audible sound wave sequence and the time when the main speaker microphone receives the certain frequency sound wave sent by the wireless speaker, and multiplying it by the current sound speed.

[0105] The wireless speaker ranging process is mainly divided into five steps: pre-factory calibration, wireless speaker clock frequency synchronization, wireless speaker system time synchronization, main environmental noise frequency measurement, audible sound wave audio signal generation for ranging, and ranging.

[0106] Before the system leaves the factory, a certain number of samples should be taken for calibration of relevant time intervals. These calibrated time intervals should be written to the system configuration file for subsequent ranging. These time intervals primarily include the time interval between the wireless speaker CPU sending audio data and the speaker emitting a sound wave signal, as well as the time interval between the main speaker microphone receiving the audio signal and actually generating the audio signal data and storing it in the cache. One feasible calibration method is to have the CPU pull the corresponding pin high or low when sending and receiving audio data, connect this pin to an oscilloscope, and simultaneously connect the speaker or microphone input or output signal line to the oscilloscope. The oscilloscope is then used to measure the time interval Ts, from the wireless speaker CPU sending audio data to the speaker emitting a sound wave signal, and the time interval Tr, from the main speaker microphone receiving the audio signal to actually generating the audio signal data and storing it in the cache.

[0107] See also Figure 3 , Figure 3 This is a flow chart of the clock frequency synchronization process provided by the embodiment of the present application. The main speaker sends the clock frequency synchronization frame through the Star Flash module at a certain interval and records the hardware-level sending time T1. Then, the sending time T1 is sent to the wireless speaker through another frame message. The physical layer of the wireless speaker records the hardware-level time T2 of receiving the clock frequency synchronization frame through the Star Flash module; similarly, the main speaker sends the clock frequency synchronization frame again at time T3, and the wireless speaker receives the clock frequency synchronization frame at time T4; the interval time between the clock frequency synchronization frames should be as short as possible to avoid large fluctuations in the delay of the two synchronization message transmission links. If the two transmission links are delayed (i.e. , ) exceeds the set threshold, the message will not be processed. Otherwise, the wireless speaker and the main speaker can be calculated as:

[0108] ;

[0109] After obtaining the clock frequency deviation, the PID algorithm is used to calculate the wireless speaker clock frequency adjustment value and modify it to the system. This process is repeated until the distance measurement is completed.

[0110] See also Figure 4 , Figure 4 This is a flow chart of the system time synchronization process provided by the embodiment of the present application. When the wireless speaker detects that the clock frequency deviation in step 1 has converged to the specified threshold, it starts to initiate the system time synchronization process. The wireless speaker actively sends a time synchronization request frame through the Star Flash module at T5 (wireless speaker hardware-level system time). The main speaker receives the time synchronization request frame through the Star Flash module at T6 (main speaker hardware-level system time). The main speaker sends a time synchronization response frame through the Star Flash module at T7 (main speaker hardware-level system time). The wireless speaker receives the time synchronization response frame through the Star Flash module at T8 (wireless speaker hardware-level system time). The wireless speaker needs to determine whether the difference between the link delays in the two directions of T8-T7 and T6-T5 exceeds the threshold. If it exceeds the threshold, it is considered that the link delay fluctuations in the two directions of this transmission are too large, and the next time synchronization request will be initiated. If the difference between the two link delays meets the requirements, the system time deviation calculation will be started. First, the average link delay is calculated. Then, obtain the current hardware-level system time Tc of the wireless speaker and calculate the system time deviation between the current wireless speaker and the main speaker as follows:

[0111] ;

[0112] The wireless speaker obtains the appropriate adjustment value through the PID algorithm and writes it into the wireless speaker system.

[0113] Once the time difference between the wireless speaker and the main speaker converges to a threshold, the wireless speaker sends a signal to the main speaker via the Star Flash module, informing it that ranging can begin. Upon receiving the ranging start signal from the wireless speaker via the Star Flash module, the main speaker first uses its microphone to collect ambient sound for a certain period of time and then performs frequency domain analysis on the collected ambient sound to determine the frequencies of the main noises in the current environment.

[0114] Generate several ranging frequencies within the audible sound wave range based on the noise frequency obtained; and send the generated ranging frequencies to the wireless speaker. After receiving the ranging frequencies, the wireless speaker eliminates inappropriate ranging frequencies based on the frequency response curve of the wireless speaker to obtain the final ranging frequency. , and generates a certain number and length of PCM raw data sequences for each ranging frequency, and sends these number and length information to the main speaker. The main speaker saves these number and length information and replies to the wireless speaker with a positive response frame. The positive response frame is used to instruct the wireless speaker how to generate pulse modulation data, that is, it contains the format information of the pulse modulation data. At the same time, the microphone starts to receive the ranging signal and read the current temperature w. According to the formula Calculate the current ambient sound speed v.

[0115] Finally, the wireless speaker receives the positive response frame from the main speaker through the Star Flash module and starts playing the generated PCM data through the speaker, and records the start and end time of each frequency test signal [B1,…,Bn] When the main speaker MIC collects data, it adds the received timestamp to each frame of audio data at the bottom layer. The main speaker stops collecting after a certain period of time after receiving the playback time information frame sent by the wireless speaker, and starts frequency domain analysis of the received MIC data. Based on the previously saved PCM original data information and the collected MIC data time-frequency information, it calculates the start time of the main speaker receiving the ranging signal of each frequency segment. and end Local time. Verify that the length of each frequency signal is consistent with the length of the saved PCM original data information. If they are consistent, the distance calculation can be started. Otherwise, the ranging process will be restarted.

[0116] In the data processing stage, according to the formula Calculate the propagation distance of each frequency signal in the air , remove The outlier is detected and the remaining data is averaged to obtain the distance D. This distance D is then sent to the wireless speaker, which broadcasts the distance between the wireless speaker and the main speaker via text-to-speech. At this point, the distance measurement is complete.

[0117] See also Figure 6 , Figure 6 This is a schematic diagram of a distance measurement system for a wireless speaker and a main speaker provided in an embodiment of the present application. The system includes:

[0118] a data acquisition module, configured to, after the wireless speaker plays pulse modulated data as a frequency test signal, cause the main speaker to acquire packaged data corresponding to the playing time of the frequency test signal; the pulse modulated data is sent by the main speaker to the wireless speaker;

[0119] A time calculation module, configured to determine the playback time of the signal received by the main speaker based on the packaged data and the time delay;

[0120] a parameter acquisition module, configured to acquire a first time interval of the wireless speaker, a second time interval of the main speaker, and an ambient sound velocity;

[0121] a distance calculation module, configured to calculate the transmission distance of each of the frequency test signals according to the play time, the signal play time, the first time interval, the second time interval, and the ambient sound speed;

[0122] The distance processing module is used to process the transmission distance and use the obtained processed data value as the actual distance between the main speaker and the wireless speaker.

[0123] Based on the above embodiment, as a preferred embodiment, it also includes:

[0124] The system time calibration module is used for the main speaker to send a clock frequency synchronization frame to perform system time calibration on the wireless speaker to obtain a system time deviation; and write the system time deviation into the wireless speaker.

[0125] Based on the above embodiment, as a preferred embodiment, the system time calibration module includes:

[0126] The system time deviation calculation unit is used to perform the following steps:

[0127] The main speaker sends at least two clock frequency synchronization frames and corresponding sending times to the wireless speaker;

[0128] If the time difference between the sending time of the clock frequency synchronization frame and the receiving time of the clock frequency synchronization frame by the wireless speaker does not exceed the delay threshold, calculating the clock frequency deviation according to the sending time and the receiving time;

[0129] Calculating a clock frequency adjustment value of the wireless speaker according to the clock frequency deviation;

[0130] After the clock frequency deviation converges to a set threshold, receiving a time synchronization request frame sent by the wireless speaker;

[0131] The master speaker sends a time synchronization response frame to the wireless speaker, and calculates an average link delay according to the clock frequency deviation, the physical sending time and the physical receiving time of the time synchronization request frame and the time synchronization response frame;

[0132] The system time offset between the wireless speaker and the main speaker is calculated according to the average link delay.

[0133] Based on the above embodiment, as a preferred embodiment, it also includes:

[0134] The raw data sequence generation module is configured to collect ambient sound through a microphone, perform frequency domain analysis on the ambient sound, and determine a noise frequency; generate a plurality of ranging frequencies within an audible sound wave range based on the noise frequency; transmit the ranging frequencies to the wireless speaker so that the wireless speaker eliminates useless ranging frequencies from the ranging frequencies according to a speaker frequency response curve to obtain effective ranging frequencies; and generate a raw data sequence for each effective ranging frequency; the raw data sequence is used to guide the wireless speaker to play the pulse modulation data.

[0135] Based on the above embodiment, as a preferred embodiment, it also includes:

[0136] The ambient sound speed acquisition module is used to receive the current temperature information fed back by the wireless speaker after replying a response frame to the wireless speaker according to the original data sequence; and calculate the ambient sound speed according to the current temperature.

[0137] Based on the above embodiment, as a preferred embodiment, it also includes:

[0138] The verification module is configured to add a reception timestamp to each frame of the frequency test signal when collecting the frequency test signal played by the wireless speaker through a microphone; perform frequency domain analysis on the frequency test signal according to the reception timestamp to determine whether the frequency test signal is pulse modulated data sent by the main speaker to the wireless speaker; and if so, execute the step of calculating the transmission distance of each frequency test signal based on the playback time, the signal playback time, the first time interval, the second time interval, and the ambient sound speed.

[0139] The present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in the above method embodiment.

[0140] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, 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. The computer software product is stored in a storage medium and executes all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.

[0141] The computer-readable storage medium provided in this embodiment includes the above-mentioned method, and the effect is the same as above.

[0142] The present application also provides a computer program product, including a computer program, which implements the steps of the corresponding methods in the above embodiments when the computer program is executed.

[0143] This application also provides an electronic device, see Figure 7 , a structural diagram of an electronic device provided in an embodiment of the present application, such as Figure 7 As shown, a processor 1410 and a memory 1420 may be included.

[0144] The processor 1410 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1410 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1410 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1410 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1410 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0145] The memory 1420 may include one or more computer-readable storage media, which may be non-transitory. The memory 1420 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 1420 is at least used to store the following computer program 1421, wherein, after the computer program is loaded and executed by the processor 1410, it can implement the relevant steps in the method performed by the electronic device side disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 1420 may also include an operating system 1422 and data 1423, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 1422 may include Windows, Linux, Android, etc.

[0146] In some embodiments, the electronic device may further include a display screen 1430 , an input / output interface 1440 , a communication interface 1450 , a sensor 1460 , a power supply 1470 , and a communication bus 1480 .

[0147] certainly, Figure 7 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiment of the present application. In actual applications, the electronic device may include Figure 7 More or fewer components than shown, or combinations of certain components.

[0148] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the systems provided in the embodiments, since they correspond to the methods provided in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0149] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core ideas of this application. It should be noted that for those skilled in the art, without departing from the principles of this application, various improvements and modifications can be made to this application, and such improvements and modifications also fall within the scope of protection of this application.

[0150] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.

Claims

1. A method for measuring the distance between a wireless speaker and a main speaker, comprising a main speaker and a wireless speaker, characterized in that: include: After the wireless speaker plays the pulse modulation data as the frequency test signal, the main speaker obtains the packaged data corresponding to the playing time of the frequency test signal; The pulse modulation data is sent from the main speaker to the wireless speaker; Determining the playback time of the signal received by the main speaker according to the packaged data and the time delay; Obtaining a first time interval of the wireless speaker, a second time interval of the main speaker, and an ambient sound speed; Calculating the transmission distance of each frequency test signal according to the play time, the signal play time, the first time interval, the second time interval, and the ambient sound speed; The transmission distance is processed, and the obtained processed data value is used as the actual distance between the main speaker and the wireless speaker.

2. The distance measurement method according to claim 1, wherein: Before the wireless speaker plays the pulse modulation data as the frequency test signal, the method further includes: The main speaker sends a clock frequency synchronization frame to calibrate the system time of the wireless speaker to obtain a system time deviation; The system time deviation is written into the wireless speaker.

3. The distance measurement method according to claim 2, wherein: The master speaker sends a clock frequency synchronization frame to calibrate the system time of the wireless speaker, and the system time deviation is obtained, which includes: The main speaker sends at least two clock frequency synchronization frames and corresponding sending times to the wireless speaker; If the time difference between the sending time of the clock frequency synchronization frame and the receiving time of the clock frequency synchronization frame by the wireless speaker does not exceed the delay threshold, calculating the clock frequency deviation according to the sending time and the receiving time; Calculating a clock frequency adjustment value of the wireless speaker according to the clock frequency deviation; After the clock frequency deviation converges to a set threshold, receiving a time synchronization request frame sent by the wireless speaker; The master speaker sends a time synchronization response frame to the wireless speaker, and calculates an average link delay according to the clock frequency deviation, the physical sending time and the physical receiving time of the time synchronization request frame and the time synchronization response frame; The system time offset between the wireless speaker and the main speaker is calculated according to the average link delay.

4. The distance measurement method according to claim 1, wherein: Before the wireless speaker plays the pulse modulation data as the frequency test signal, the method further includes: The main speaker collects ambient sound through a microphone and performs frequency domain analysis on the ambient sound to determine; generating a plurality of ranging frequencies within the audible sound wave range according to the noise frequency; The ranging frequency is sent to the wireless speaker, so that the wireless speaker eliminates useless ranging frequencies in the ranging frequency according to the speaker frequency response curve to obtain effective ranging frequencies, and generates an original data sequence for each of the effective ranging frequencies; the original data sequence is used to guide the wireless speaker to play the pulse modulation data.

5. The distance measurement method according to claim 4, characterized in that: Before calculating the transmission distance of each frequency test signal according to the play time, the signal play time, the first time interval, the second time interval, and the ambient sound speed, the method further includes: After the main speaker replies a response frame to the wireless speaker according to the original data sequence, the main speaker receives the current temperature information fed back by the wireless speaker; The ambient sound speed is calculated according to the current temperature.

6. The distance measurement method according to claim 1, wherein: Also includes: When the microphone of the main speaker collects the frequency test signal played by the wireless speaker, a reception timestamp is added to each frame of the frequency test signal; performing frequency domain analysis on the frequency test signal according to the receiving timestamp to determine whether the frequency test signal is pulse modulation data sent from the main speaker to the wireless speaker; If so, the step of calculating the transmission distance of each frequency test signal according to the play time, the signal play time, the first time interval, the second time interval and the ambient sound speed is performed.

7. A distance measurement system between a wireless speaker and a main speaker, comprising a main speaker and a wireless speaker, characterized in that: include: a data acquisition module, configured to enable the main speaker to acquire packaged data corresponding to the playing time of the frequency test signal after the wireless speaker plays the pulse modulation data as the frequency test signal; The pulse modulation data is sent from the main speaker to the wireless speaker; A time calculation module, configured to determine the playback time of the signal received by the main speaker based on the packaged data and the time delay; a parameter acquisition module, configured to acquire a first time interval of the wireless speaker, a second time interval of the main speaker, and an ambient sound velocity; a distance calculation module, configured to calculate the transmission distance of each of the frequency test signals according to the play time, the signal play time, the first time interval, the second time interval, and the ambient sound speed; The distance processing module is used to process the transmission distance and use the obtained processed data value as the actual distance between the main speaker and the wireless speaker.

8. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the method according to any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which implements the steps of the method according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 6 when the computer program is executed.

Citation Information

Cited By

  • Audio adaptive adjustment control method and related device

    CN121568013A