A frequency point processing method, audio playback device and audio playback system
By analyzing and calculating the window number and frequency point energy in the audio data packet, and adjusting the calculation results using the weight coefficient, the problem of inconsistent frequency point information of multiple audio devices under different playback sequences is solved, and the rhythm consistency of the light control display and the rapid convergence of frequency point information are achieved.
Patent Information
- Application Number
- CN202110323577.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-25
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2041-03-25
AI Technical Summary
When multiple audio devices play at the same time, due to the different playback order, interference, packet loss, etc. during wireless transmission, the frequency point information is inconsistent, which affects the rhythm consistency of the light control display.
By receiving the data packets sent by the main device, analyzing the window number, calculating the frequency point energy, and adjusting the frequency point energy calculation through the weight coefficient to ensure that the frequency point information of the receiving device and the main device is consistent.
The frequency point information consistency of multiple audio playback devices under different playback sequences is realized, ensuring the rhythm consistency of the light control display, and converging to close or the same frequency point information within up to M data packets after packet loss occurs.
Smart Images

Figure CN115132236B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio processing technology, and in particular to a frequency point processing method, an audio playback device and an audio playback system. Background Art
[0002] With the development of audio technology, multiple audio devices can play the same song at the same time to improve the playback effect. During the playback process, the playback order of multiple audio devices may be different. The playback order means that the audio playback device can join the playback at any time and can also exit the playback at any time. Multiple audio devices may use wireless or wired methods to transmit audio data. Due to different playback orders, interference and packet loss during wireless transmission, the frequency information of different playback devices may be inconsistent. If the frequency information is inconsistent, using this frequency information for light control display, multiple devices will obviously have inconsistent rhythms, that is, the visual effect will show that the display rhythms of multiple devices are chaotic.
[0003] In the prior art, frequency information is generally obtained by a single device. If multiple devices need the same frequency information, they usually play at the same time to ensure the same frequency information. However, this has limitations on application use. In a broadcast environment, any device can join or leave at any time. At this time, it is necessary to ensure that the frequency information of the devices is still consistent. The prior art does not have a good solution. Summary of the invention
[0004] In view of this, the main purpose of the embodiments of the present invention is to provide a frequency point processing method, which can ensure that the frequency point information collected by multiple audio playback devices is consistent.
[0005] The embodiment of the present invention is implemented as follows: a frequency point processing method, comprising:
[0006] Receive data packets sent by the master device;
[0007] Parsing the data packet to obtain the window number of the data packet;
[0008] The frequency point energy is calculated according to the window number.
[0009] Furthermore, the method further comprises:
[0010] The data packet is received until a difference between a frequency energy of the data packet and a frequency energy of the master device is within a preset range.
[0011] Furthermore, the calculating the frequency energy according to the window number further includes:
[0012] The current frequency energy result is calculated based on the current data packet, the historical frequency energy result is calculated based on the historical data packet, and the final result of the frequency energy is calculated according to the weight coefficient.
[0013] Furthermore, each M data packets are a processing cycle, the historical frequency energy result is H, the initial value of H is 0, corresponding to the weight coefficient Hw, the current frequency energy result is N, corresponding to the weight coefficient Nw, and the final result of the current data packet frequency energy is S; the final result is: Si=Hi*Hwi+Ni*Nwi, where 1≤i≤M.
[0014] Further, the weight coefficient Hw gradually decreases from data packet 1 to M, the interval is 1 to 0, and the interval is 1 / M; or
[0015] The weight coefficient Hw gradually increases from data packet 1 to M, the interval is 0 to 1, and the interval is 1 / M.
[0016] Furthermore, the Hi and Ni use the calculation result of the previous data packet as estimated values.
[0017] According to another aspect of the embodiment of the present invention, the main purpose of the embodiment of the present invention is to provide a frequency point processing method in multi-device audio playback, which can ensure that the frequency point information collected by multiple audio playback devices is consistent.
[0018] The embodiment of the present invention is implemented as follows: a frequency point processing method in multi-device audio playback, comprising:
[0019] The master device determines the duration and sampling frequency of the sampling window of the data packet to be sent, and sends the data packet;
[0020] The master device determines a data packet window number according to the frame number of the data packet;
[0021] After receiving the data packet, the receiving device parses the data packet to obtain the window number;
[0022] The receiving device calculates frequency point energy according to the window number.
[0023] Furthermore, the method further comprises:
[0024] The receiving device receives the data packet until a difference between a frequency energy of the data packet and a frequency energy of the master device is within a preset range.
[0025] Furthermore, each M data packets are a processing cycle, the historical frequency energy result is H, the initial value of H is 0, corresponding to the weight coefficient Hw, the current frequency energy result is N, corresponding to the weight coefficient Nw, and the final result of the current data packet frequency energy is S; the final result is: Si=Hi*Hwi+Ni*Nwi, where 1≤i≤M.
[0026] According to another aspect of the embodiment of the present invention, the main purpose of the embodiment of the present invention is also to provide an audio playback device, which can ensure that the frequency point information collected by multiple audio playback devices is consistent.
[0027] The embodiment of the present invention is implemented as follows: an audio playback device, comprising:
[0028] A receiving device, used for receiving a data packet sent by a master device;
[0029] A second parsing device, used for parsing the data packet to obtain the window number of the data packet;
[0030] The second calculation device is used to calculate the frequency point energy according to the window number.
[0031] According to another aspect of the embodiment of the present invention, the main purpose of the embodiment of the present invention is also to provide an audio playback system, which can ensure that the frequency point information collected by multiple audio playback devices is consistent.
[0032] The embodiment of the present invention is implemented as follows: an audio playback system includes: a main device and a receiving device,
[0033] The main device comprises:
[0034] A sending device, used to determine the duration and sampling frequency of a sampling window of a data packet to be sent, and send the data packet;
[0035] A first parsing device, used to determine a data packet window number according to the frame number of the data packet;
[0036] A first calculation device, used for calculating frequency point energy according to the window number;
[0037] The receiving device comprises:
[0038] A receiving device, used for receiving a data packet sent by the master device;
[0039] A second parsing device, used for parsing the data packet to obtain the window number of the data packet;
[0040] The second calculation device is used to calculate the frequency point energy according to the window number.
[0041] According to the above technical scheme, the embodiment of the present invention has the following effects: the receiving device adjusts the calculation of the frequency energy according to the window number of the audio data packet, and gradually obtains the same or similar frequency information as the main device, so that although the main device and the receiving device do not play at the same time, because the calculated frequency information is basically the same, these frequency information can be used for more personalized processing; after packet loss occurs, the calculation results of the main device and the receiving device can converge to relatively close or identical results within a maximum of M data packets; the audio playback device can enter playback at any time, and can also exit playback, and can ensure that even if multiple devices have different playback timings, the frequency information collected at a certain moment is as similar as possible. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0043] Figure 1 A flow chart of a frequency point processing method provided by the present application is shown;
[0044] Figure 2 A flow chart of a frequency point processing method in multi-device audio playback provided by the present application is shown. DETAILED DESCRIPTION
[0045] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant inventions, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the present invention are shown in the accompanying drawings.
[0046] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. The order of steps in the following embodiments is only for exemplification and can be adjusted in the absence of conflict.
[0047] like Figure 1 As shown, a frequency point processing method provided by an embodiment of the present invention includes the following steps:
[0048] S101, receiving a data packet sent by a master device;
[0049] S102, parsing the data packet to obtain a window number of the data packet;
[0050] S103: Calculate frequency point energy according to the window number.
[0051] The data packet is continuously received to obtain frequency information close to or the same as that of the main device.
[0052] Specifically, the embodiment of the present invention is a frequency processing method for a receiving device, wherein the main device determines the duration and sampling frequency of the sampling window of the audio data to be sent and sends the audio data packet and its frame number and other information when calculating the frequency energy; each time data is sent, the window number of the currently sent data packet is determined according to the frame number of the sent data packet and other information; the receiving device receives the data packet sent by the main device when the receiving device starts playing, and after receiving a packet of data, parses the data packet window number of the data sent by the main device; the receiving device calculates the frequency energy according to the window number, the receiving device continues to receive the data packet sent by the main device and gradually adjusts the calculation of the frequency energy, and gradually obtains close or identical frequency information with the main device until the difference between the frequency energy of the data packet and the frequency energy of the main device is within a preset range. It is worth noting that the preset range can be customized so that the frequency energy of the data packet can meet the consistent effect, that is, the frequency energy of the data packet received from the device can converge to the frequency energy of the main device infinitely; in this embodiment, preferably, the difference between the frequency energy of the data packet and the frequency energy of the main device calculated is 0, that is, the frequency energy of the data packet received from the device is exactly the same as the frequency energy of the main device.
[0053] The present invention provides an embodiment, which, based on the above-mentioned embodiment, adopts a weight coefficient and calculates the frequency energy according to the window number. Specifically: the current frequency energy result is calculated based on the current data packet, the historical frequency energy result is calculated based on the historical data packet, and the final result of the frequency energy is calculated according to the weight coefficient. The window number of the data packet represents the order of the data packet. Usually, a data window may include multiple audio data packets.
[0054] The above calculation method is described in detail below: The frequency information calculation algorithm of the receiving device is as follows: every M data packets are a processing cycle, the historical frequency energy result H, the initial value of H is 0, the corresponding weight coefficient Hw, the current frequency energy result is N, the corresponding weight coefficient Nw, and the final result of the frequency energy of the current data packet is S; the final result is: Si=Hi*Hwi+Ni*Nwi, where 1≤i≤M, wherein the weight coefficient Hw gradually decreases from data packet 1 to M, and is a calculated coefficient, and the specific weight coefficient value range is 1 to 0, and the interval is 1 / M; similarly, the weight coefficient Hw gradually increases from data packet 1 to M, and the interval is 0 to 1, and the interval is 1 / M. The larger the specific weight coefficient is during the calculation process, the more reference historical frequency energy results are, and the smaller the weight coefficient is, the fewer reference historical frequency energy results are; wherein the frequency energy result is a relative value, which is generally determined by the amount of PCM data or presented by dB decibel value.
[0055] For the first data packet in the current cycle, a new historical frequency point energy result H1 is calculated based on the PCM data of the current data packet, and N1 is initially calculated according to the frequency point synchronization information of the first data packet. The final result is S1 = H1 * Hw1 + N1 * Nw1; where the historical frequency point energy result used in the current data packet is the calculation result of the previous data packet; the calculation of the frequency point energy result of the current data packet is based on the historical pcm data stream by performing a fast Fourier transform to obtain the current frequency point energy result N of the target frequency point.
[0056] If the i-th (1 < i ≤ M) data packet in the current cycle is not discarded, a new historical frequency point energy result Hi is calculated based on the PCM data of the current data packet, and a new historical frequency point energy result Ni is calculated based on the PCM data of the current data packet. The final result is S1 = Hi * Hwi + Ni * Nwi;
[0057] If the i-th (1 ≤ i ≤ M) data packet in the current cycle is discarded, the calculation results of the previous data packet are used as estimates for Hi and Ni. For example, they are the same as the calculation results of the previous data packet. The final result is S1 = Hi * Hwi + Ni * Nwi. In this case, due to the continuous and extended characteristics of energy, selecting the estimated value can make the calculation result closer to the true result. The calculation results of the previous data packet are used as estimates for Hi and Ni, that is, the current values of Hi and Ni are actually the calculation results H i-1 and N i-1
[0058] From the above process, it can be seen that after packet loss occurs, the calculation results of the master device and the receiving device can converge to relatively close or the same frequency point information results within at most M data packets.
[0059] According to another aspect of the embodiments of the present invention, as Figure 2 shown, a frequency point processing method in multi-device audio playback provided by the embodiments of the present invention includes the following steps:
[0060] S201, the master device determines the duration and sampling frequency of the sampling window of the data packet to be sent and sends the data packet;
[0061] S202, the master device determines the data packet window number according to the number of frames of the data packet;
[0062] S203, after receiving the data packet, the receiving device parses the data packet to obtain the window number;
[0063] S204, the receiving device calculates the frequency point energy according to the window number.
[0064] The receiving device continuously receives the data packets and gradually obtains frequency point information that is close to or the same as that of the master device.
[0065] Specifically, the embodiment of the present invention is a frequency point processing method for multiple devices. When the master device calculates the frequency point energy, it determines the duration and sampling frequency of the sampling window of the audio data to be sent and sends information such as the audio data packet and its frame number; each time data is sent, the packet window number of the currently sent data packet is determined according to information such as the frame number of the sent data packet; when the receiving device starts playing, it receives the data packets sent by the master device. After receiving a packet of data, it parses out the packet window number of the data sent by the master device; the receiving device calculates the frequency point energy according to this window number, continuously receives the data packets sent by the master device and gradually adjusts the calculation of the frequency point energy, and gradually obtains frequency point information that is close to or the same as that of the master device until the difference between the frequency point energy of the data packet and the frequency point energy of the master device is within a preset range. The master device and the receiving device both adopt the same frequency point energy calculation method.
[0066] The present invention provides a preferred embodiment. On the basis of the foregoing embodiment, a weight coefficient is adopted and the frequency point energy is calculated according to the window number. Specifically: the current frequency point energy result is calculated based on the current data packet, the historical frequency point energy result is calculated based on the historical data packet, and the final result of the frequency point energy is calculated according to the weight coefficient.
[0067] The following is a detailed description of the above calculation method: The frequency point calculations of the master device and the receiving device adopt exactly the same algorithm. Every M data packets are a processing cycle. The historical frequency point energy result is H, the initial value of H is 0, the corresponding weight coefficient is Hw, the frequency point energy result is N, the corresponding weight coefficient is Nw, and the calculation result of the frequency point energy of the current data packet is S; the final result is: Si = Hi * Hwi + Ni * Nwi, where 1 ≤ i ≤ M. The weight coefficient Hw gradually decreases from data packet 1 to M, the interval is from 1 to 0, and the interval is 1 / M; similarly, the weight coefficient Hw gradually increases from data packet 1 to M, the interval is from 0 to 1, and the interval is 1 / M.
[0068] For the first data packet of the current cycle, a new historical frequency point energy result H1 is calculated based on the PCM data of the current data packet, and N1 is initially calculated according to the frequency point synchronization information of the first data packet. When the final result is i = 1, S1 = H1 * Hw1 + N1 * Nw1;
[0069] If the i-th (1 < i ≤ M) data packet of the current cycle is not discarded, a new historical frequency point energy result Hi is calculated based on the PCM data of the current data packet, and a new historical frequency point energy result Ni is calculated based on the PCM data of the current data packet. The final result is Si = Hi * Hwi + Ni * Nwi;
[0070] If the i-th (1≤i≤M) data packet of the current cycle is discarded, Hi and Ni use estimated values, for example, consistent with the calculation result of the previous data packet, and the final result is Si=Hi*Hwi+Ni*Nwi;
[0071] From the above process, we can see that after packet loss occurs, the calculation results of the master device and the receiving device can converge to relatively close or identical frequency information results within a maximum of M data packets.
[0072] According to another aspect of an embodiment of the present invention, an embodiment of the present invention further provides an audio playback device, including:
[0073] A receiving device, used for receiving a data packet sent by a master device;
[0074] A second parsing device, used for parsing the data packet to obtain the window number of the data packet;
[0075] The second calculation device is used to calculate the frequency point energy according to the window number.
[0076] According to another aspect of the embodiment of the present invention, the embodiment of the present invention further provides an audio playback system, including: a main device and a receiving device,
[0077] The main device comprises:
[0078] A sending device, used to determine the duration and sampling frequency of a sampling window of a data packet to be sent, and send the data packet;
[0079] A first parsing device, used to determine a data packet window number according to the frame number of the data packet;
[0080] A first calculation device, used for calculating frequency point energy according to the window number;
[0081] The receiving device comprises:
[0082] A receiving device, used for receiving a data packet sent by the master device;
[0083] A second parsing device, used for parsing the data packet to obtain the window number of the data packet;
[0084] The second calculation device is used to calculate the frequency point energy according to the window number.
[0085] The technical solutions of the audio playback device and system of the above-mentioned embodiment are essentially consistent with the frequency point processing method of the above-mentioned embodiment, and will not be described in detail here.
[0086] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the present application.
Claims
1. A frequency point processing method, characterized in that: include: Receive data packets sent by the master device; Parsing the data packet to obtain the window number of the data packet; Calculating the frequency energy according to the window number includes: calculating the current frequency energy result based on the current data packet, calculating the historical frequency energy result based on the historical data packet, and calculating the final result of the frequency energy according to the weight coefficient; each M data packets are a processing cycle, the historical frequency energy result H, the initial value of H is 0, corresponding to the weight coefficient Hw, the current frequency energy result is N, corresponding to the weight coefficient Nw, and the final result of the frequency energy of the current data packet is S; the final result is: Si=Hi*Hwi+Ni*Nwi, where 1≤i≤M; the weight coefficient Hw gradually decreases from data packet 1 to M, the interval is 1 to 0, and the interval is 1 / M; or the weight coefficient Hw gradually increases from data packet 1 to M, the interval is 0 to 1, and the interval is 1 / M; The method further comprises: The data packet is received until a difference between a frequency energy of the data packet and a frequency energy of the master device is within a preset range.
2. The frequency point processing method according to claim 1, characterized in that: The Hi and Ni use the calculation results of the previous data packet as estimated values.
3. A frequency point processing method in multi-device audio playback, characterized in that: include: The master device determines the duration and sampling frequency of the sampling window of the data packet to be sent, and sends the data packet; The master device determines a data packet window number according to the frame number of the data packet; After receiving the data packet, the receiving device parses the data packet to obtain the window number; The receiving device calculates the frequency energy according to the window number, including: calculating the current frequency energy result based on the current data packet, calculating the historical frequency energy result based on the historical data packet, and calculating the final result of the frequency energy according to the weight coefficient; each M data packets are a processing cycle, the historical frequency energy result H, the initial value of H is 0, corresponding to the weight coefficient Hw, the current frequency energy result is N, corresponding to the weight coefficient Nw, and the final result of the frequency energy of the current data packet is S; the final result is: Si=Hi*Hwi+Ni*Nwi, where 1≤i≤M; the weight coefficient Hw gradually decreases from data packet 1 to M, the interval is 1 to 0, and the interval is 1 / M; or the weight coefficient Hw gradually increases from data packet 1 to M, the interval is 0 to 1, and the interval is 1 / M; The method further comprises: The data packet is received until a difference between a frequency energy of the data packet and a frequency energy of the master device is within a preset range.
4. An audio playback device, characterized in that: include: A receiving device, used to receive a data packet sent by a master device, and receive the data packet until a difference between a frequency point energy of the data packet and a frequency point energy of the master device is within a preset range; A second parsing device, used for parsing the data packet to obtain the window number of the data packet; A second calculation device is used to calculate the frequency energy according to the window number, including: calculating the current frequency energy result based on the current data packet, calculating the historical frequency energy result based on the historical data packet, and calculating the final result of the frequency energy according to the weight coefficient; Every M data packets are a processing cycle, the historical frequency energy result is H, the initial value of H is 0, corresponding to the weight coefficient Hw, the current frequency energy result is N, corresponding to the weight coefficient Nw, and the final result of the frequency energy of the current data packet is S; the final result is: Si=Hi*Hwi+Ni*Nwi, where 1≤i≤M; the weight coefficient Hw gradually decreases from data packet 1 to M, with a range of 1 to 0 and an interval of 1 / M; or the weight coefficient Hw gradually increases from data packet 1 to M, with a range of 0 to 1 and an interval of 1 / M.
5. An audio playback system, characterized in that: include: Master and receiving devices, The main device comprises: A sending device, used to determine the duration and sampling frequency of a sampling window of a data packet to be sent, and send the data packet; A first parsing device, used to determine a data packet window number according to the frame number of the data packet; A first calculation device, used for calculating frequency point energy according to the window number; The receiving device comprises: A receiving device, configured to receive a data packet sent by the master device, and receive the data packet until a difference between a frequency energy of the data packet and a frequency energy of the master device is within a preset range; A second parsing device, used for parsing the data packet to obtain the window number of the data packet; A second calculation device, used to calculate the frequency point energy according to the window number; The frequency energy calculation according to the window number includes: calculating the current frequency energy result based on the current data packet, calculating the historical frequency energy result based on the historical data packet, and calculating the final result of the frequency energy according to the weight coefficient; each M data packets is a processing cycle, the historical frequency energy result H, the initial value of H is 0, corresponding to the weight coefficient Hw, the current frequency energy result is N, corresponding to the weight coefficient Nw, and the final result of the frequency energy of the current data packet is S; the final result is: Si=Hi*Hwi+Ni*Nwi, where 1≤i≤M; the weight coefficient Hw gradually decreases from data packet 1 to M, with a range of 1 to 0 and an interval of 1 / M; or the weight coefficient Hw gradually increases from data packet 1 to M, with a range of 0 to 1 and an interval of 1 / M.
Citation Information
Patent Citations
Digital watermarking embedding and detecting method of radio broadcast audio
CN107799121A