A signal sampling synchronization method, apparatus, device, and storage medium

By acquiring the amount of sampled data and determining the sampling deviation amount, and adjusting the number of sampling points of the sampled data, the problem of low signal sampling synchronization accuracy in the prior art is solved, and higher precision signal sampling synchronization is achieved, and analog signal transmission quality is improved.

CN114785349BActive Publication Date: 2025-04-11ANHUI IFLYREC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210240864.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-10
Publication Date
2025-04-11
Estimated Expiration
2042-03-10

AI Technical Summary

Technical Problem

In the prior art, the signal sampling synchronization accuracy between the data acquisition end and the data output end during analog signal acquisition and transmission is low, resulting in a lower signal transmission quality.

Method used

By acquiring the sample data amount, the sampling deviation amount is determined, and when the deviation amount exceeds the preset range, the sampling point number is adjusted to achieve higher precision synchronization between the acquisition device and the output device.

Benefits of technology

The accuracy of signal sampling synchronization is improved, thereby improving the quality of analog signal transmission, especially in low-latency audio transmission scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114785349B_ABST
    Figure CN114785349B_ABST
Patent Text Reader

Abstract

The present application proposes a signal sampling synchronization method, device, equipment and storage medium, the method comprising: determining the difference between the number of sampling points of the digital signal to be processed by the output device and the number of sampling points of the digital signal that can be processed theoretically by the output device according to the buffer delay of the output device converting the digital signal into an analog signal and the amount of sampling data acquired in advance, and adjusting the sampling data corresponding to the amount of sampling data with the goal that the difference does not exceed the preset deviation range. According to the deviation between the number of sampling points of the digital signal to be processed by the output device and the number of sampling points of the digital signal that can be processed theoretically, the number of sampling points of the digital signal to be processed by the output device is adjusted, so that the number of sampling points of the digital signal sampled by the acquisition device is balanced with the number of sampling points of the digital signal that can be processed by the output device, thereby realizing the sampling synchronization control of the acquisition device and the output device at the sampling point granularity, and the signal sampling synchronization accuracy is higher, so as to improve the transmission quality of the analog signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data transmission, and in particular to a signal sampling synchronization method, device, equipment and storage medium. Background Art

[0002] In the process of analog signal acquisition and transmission, the data acquisition end usually uses the A / D conversion function to convert the analog signal into a digital signal and transmit it to the data output end, and the data output end uses the D / A conversion function to convert the received digital signal into an analog signal and output it. Among them, the synchronization between the analog signal sampling at the data acquisition end and the digital signal sampling at the data output end is crucial to the signal output quality of the data output end.

[0003] For example, in a wireless audio communication scenario, the transmitting device uses the A / D conversion function to sample the analog audio signal, converts the analog audio signal into a digital audio signal and transmits it to the receiving device. The receiving device uses the D / A conversion function to sample the digital audio signal, converts the received digital audio signal into an analog audio signal and plays it. Among them, the synchronization between the sampling of the analog audio signal by the transmitting device and the sampling of the digital audio signal by the receiving device will affect the audio playback quality of the receiving device. For example, if the sampling rate of the transmitting device is greater than the sampling rate of the receiving device, the digital audio signal of the receiving device will be backlogged, unable to be played in time, and even cause data overflow and loss; if the sampling rate of the transmitting device is less than the sampling rate of the receiving device, the digital audio signal of the receiving device will be in short supply, resulting in discontinuous audio playback.

[0004] At present, the signal sampling synchronization scheme between the data acquisition end and the data output end used in the analog signal acquisition and transmission process has low accuracy, making it difficult to achieve a significant synchronization effect, resulting in low signal transmission quality. Summary of the invention

[0005] Based on the above-mentioned defects and shortcomings of the prior art, the present application proposes a signal sampling synchronization method, device, equipment and storage medium, which can improve the signal sampling synchronization accuracy between the data acquisition end and the data output end, thereby improving the signal transmission quality.

[0006] A signal sampling synchronization method, comprising:

[0007] Acquire the amount of sampled data, wherein the amount of sampled data represents the number of sampling points of the digital signal obtained by sampling the analog signal by the acquisition device and not converted into the analog signal by the output device;

[0008] Determine a sampling deviation according to a buffer delay of the output device converting a digital signal into an analog signal and the amount of sampled data, wherein the sampling deviation represents a difference between the number of sampling points of the digital signal to be actually processed by the output device and the number of sampling points of the digital signal that can be theoretically processed by the output device;

[0009] When the sampling deviation exceeds the preset deviation range, the number of sampling points of the sampling data corresponding to the sampling data amount is adjusted with the goal that the sampling deviation does not exceed the preset deviation range.

[0010] Optionally, the sampled data volume includes: a first sampled data volume and a second sampled data volume, wherein the first sampled data volume represents the number of sampled points of the digital signal that has been collected by the collection device and not sent, and the second sampled data volume represents the number of sampled points of the digital signal that has been received by the output device and not converted into an analog signal;

[0011] The step of determining the sampling deviation amount according to the buffer delay of the output device converting the digital signal into the analog signal and the amount of sampled data comprises:

[0012] A sampling deviation amount is calculated according to the delayed data amount corresponding to the buffer delay, the first sampling data amount and the second sampling data amount, wherein the delayed data amount represents the number of sampling points corresponding to the buffer delay.

[0013] Optionally, the calculating the sampling deviation amount according to the delay data amount corresponding to the delay, the first sampling data amount, and the second sampling data amount includes:

[0014] Calculating the sum of the first sampling data amount and the time-delayed data amount as the number of sampling points of the digital signal that can be theoretically processed by the output device;

[0015] The difference between the second sampling data amount and the number of sampling points of the digital signal that can be processed by the output device theoretically is calculated as the sampling deviation amount.

[0016] Optionally, with the goal that the sampling deviation does not exceed a preset deviation range, adjusting the number of sampling points of the sampling data corresponding to the sampling data amount includes:

[0017] Determining the sampling rate relationship between the acquisition device and the output device according to the sampling deviation;

[0018] According to the sampling rate relationship, the number of sampling points of the sampling data corresponding to the sampling data amount is adjusted so that the sampling deviation does not exceed a preset deviation range.

[0019] Optionally, determining the sampling rate relationship between the acquisition device and the output device according to the sampling deviation includes:

[0020] If the sampling deviation is equal to a preset first deviation threshold, determining that the sampling rate of the output device is less than the sampling rate of the acquisition device;

[0021] If the sampling deviation is equal to a preset second deviation threshold, determining that the sampling rate of the output device is greater than the sampling rate of the acquisition device;

[0022] The first deviation threshold and the second deviation threshold are opposite numbers of each other.

[0023] Optionally, adjusting the number of sampling points of the sampled data corresponding to the sampled data amount according to the sampling rate relationship includes:

[0024] Based on the sampling rate relationship, determining an adjustment method for the sampling data;

[0025] Based on a preset calculation method, the sampling point data in the sampling data is calculated to obtain a first quantity of sampling adjustment data;

[0026] According to the adjustment method, the sampling data is adjusted using the first number of sampling adjustment data.

[0027] Optionally, the calculating the sampling point data in the sampling data based on a preset calculation method to obtain a first quantity of sampling adjustment data includes:

[0028] According to a preset extraction quantity, extracting adjacent sampling point data from the sampled data as data to be adjusted;

[0029] Based on a preset calculation method, the data to be adjusted is calculated to obtain a first quantity of sampled adjustment data;

[0030] Wherein, the preset extraction quantity is greater than the first quantity.

[0031] Optionally, the calculating the data to be adjusted based on a preset calculation method to obtain a first quantity of sampled adjustment data includes:

[0032] Calculating the average value of the data to be adjusted as sampled adjustment data;

[0033] or,

[0034] Based on the data to be adjusted, a first number of sampling point data continuous with the data to be adjusted is predicted and obtained as sampling adjustment data.

[0035] Optionally, determining the adjustment method for the sampled data based on the sampling rate relationship includes:

[0036] If the sampling rate relationship indicates that the sampling rate of the output device is less than the sampling rate of the acquisition device, then determining that the adjustment method is de-value adjustment;

[0037] If the sampling rate relationship indicates that the sampling rate of the output device is greater than the sampling rate of the acquisition device, it is determined that the adjustment method is interpolation adjustment.

[0038] Optionally, adjusting the sampling data by using the first number of sampling adjustment data according to the adjustment manner includes:

[0039] If the adjustment method is de-value adjustment, the data to be deleted in the sampled data is replaced with the first number of sampled adjustment data; the data to be deleted is the data to be adjusted, or a second number of data adjacent to the data to be adjusted, and the first number is smaller than the second number;

[0040] If the adjustment method is interpolation adjustment, the sampled adjustment data is inserted into a target position in the sampled data, and the target position is any position in the data to be adjusted, or a subsequent adjacent position of the data to be adjusted.

[0041] Optionally, the sampled data includes: first sampled data not sent by the acquisition device and second sampled data not output by the output device;

[0042] If the number of acquisition devices is greater than or equal to one, and the number of output devices is one, the step of adjusting the number of sampling points of the sampled data corresponding to the sampled data volume includes:

[0043] Adjusting the number of sampling points of the first sampling data or the second sampling data;

[0044] If the number of acquisition devices is one and the number of output devices is greater than one, the step of adjusting the number of sampling points of the sampled data corresponding to the sampled data volume includes:

[0045] The number of sampling points of the second sampling data is adjusted.

[0046] A signal sampling synchronization device, comprising:

[0047] An acquisition unit, configured to acquire a sampled data amount, wherein the sampled data amount represents the number of sampling points of a digital signal obtained by sampling an analog signal by an acquisition device and not converted into an analog signal by an output device;

[0048] A deviation determination unit, configured to determine a sampling deviation according to a buffer delay of the output device converting a digital signal into an analog signal and the amount of sampled data, wherein the sampling deviation represents a difference between the number of sampling points of the digital signal to be actually processed by the output device and the number of sampling points of the digital signal that can be theoretically processed by the output device;

[0049] The adjustment unit is used to adjust the number of sampling points of the sampling data corresponding to the sampling data amount with the goal of ensuring that the sampling deviation does not exceed the preset deviation range when the sampling deviation exceeds the preset deviation range.

[0050] A signal sampling synchronization device, comprising:

[0051] Memory and processor;

[0052] Wherein, the memory is connected to the processor and is used to store programs;

[0053] The processor is used to implement the above-mentioned signal sampling synchronization method by running the program in the memory.

[0054] A storage medium stores a computer program, and when the computer program is executed by a processor, the signal sampling synchronization method described above is implemented.

[0055] The signal sampling synchronization method proposed in the present application first determines the difference between the number of sampling points of the actual digital signal to be processed by the output device and the number of sampling points of the digital signal that can be processed theoretically by the output device as the sampling deviation when performing signal sampling synchronization. When the sampling deviation exceeds the preset deviation range, the number of sampling points of the sampling data corresponding to the sampling data volume is adjusted with the goal of not exceeding the preset deviation range. The above processing process adjusts the number of sampling points of the actual digital signal to be processed by the output device according to the deviation between the number of sampling points of the actual digital signal to be processed by the output device and the number of sampling points of the digital signal that can be processed theoretically, so that the number of sampling points of the digital signal sampled by the acquisition device is balanced with the number of sampling points of the digital signal that can be processed by the output device.

[0056] This solution realizes the synchronous control of sampling of acquisition equipment and output equipment at the sampling point granularity, and its signal sampling synchronization accuracy is higher, thereby improving the quality of analog signal transmission. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0058] Figure 1 This is a schematic diagram of an application scenario of two-transmit and one-receive wireless audio communication provided by an embodiment of the present application;

[0059] Figure 2It is a flowchart of a signal sampling synchronization method provided in an embodiment of the present application;

[0060] Figure 3 This is a schematic diagram of data caching of an audio receiving terminal provided in an embodiment of the present application;

[0061] Figure 4 It is a flowchart of another signal sampling synchronization method provided in an embodiment of the present application;

[0062] Figure 5 It is a schematic diagram of a processing flow of adjusting the number of sampling points of sampled data corresponding to the sampled data amount provided by an embodiment of the present application;

[0063] Figure 6 It is another schematic diagram of a processing flow of adjusting the number of sampling points of sampled data corresponding to the sampled data amount provided by an embodiment of the present application;

[0064] Figure 7 It is another schematic diagram of a processing flow of adjusting the number of sampling points of sampled data corresponding to the sampled data amount provided by an embodiment of the present application;

[0065] Figure 8 It is a structural schematic diagram of a signal sampling synchronization device provided in an embodiment of the present application;

[0066] Fig. 9 It is a structural diagram of a signal sampling synchronization device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0067] The technical solution of the embodiment of the present application is applicable to the application scenario of sampling synchronization between the acquisition device and the output device. By adopting the technical solution of the embodiment of the present application, the number of sampling points of the sampled data can be adjusted by determining the deviation between the number of sampling points of the digital signal to be processed by the output device and the number of sampling points of the digital signal that can be processed by the output device in theory, with the goal that the deviation does not exceed the preset deviation range, thereby achieving higher-precision sampling synchronization between the acquisition device and the output device.

[0068] In the process of analog signal acquisition and transmission, the signal acquisition end usually uses the A / D conversion function to convert the analog signal into a digital signal and transmit it to the signal output end, and the signal output end uses the D / A conversion function to convert the received digital signal into an analog signal and output it.

[0069] For example Figure 1As shown, in the wireless audio communication scenario, the transmitting end (signal acquisition end) and the receiving end (signal output end) of the audio transceiver device can be used to transmit audio. In addition, the transmitting end and the receiving end can use low-latency transmission to exchange data between the two. The communication components used for low-latency transmission can be 2.4G wireless communication components, 5G wireless communication components, or 1G wireless communication components. Among them, the transmitting end is composed of a microphone, a CODEC chip, and an MCU. The CODEC chip performs A / D conversion on the analog audio signal picked up by the microphone, and performs audio encoding on the converted digital audio signal through the MCU, and sends the encoded digital audio signal to the receiving end through the communication component.

[0070] The receiving end is composed of a CODEC chip, an MCU, and a playback component (such as a speaker or Lineout, etc.). The receiving end decodes the received encoded digital audio signal through the MCU and stores the decoded digital audio signal in the MCU's RAM. The CODEC chip performs D / A conversion on the digital audio signal stored in the RAM and drives the playback component to play the converted analog audio signal. The audio transceiver usually encodes every 2.5ms of audio data into one frame of audio, and the sampling rate of the receiving end is usually set to 48K, which can also be set to 16K, 8K, etc.

[0071] When the A / D conversion rate of the signal acquisition end is not equal to the D / A conversion rate of the signal output end, that is, when there is a deviation between the sampling rate of the signal acquisition end and the sampling rate of the signal output end, it will cause abnormal audio playback. For example, when the A / D conversion rate of the signal acquisition end is greater than the D / A conversion rate of the signal output end, that is, the sampling rate of the signal acquisition end is greater than the sampling rate of the signal output end, it will cause the digital signal of the signal output end to be accumulated, unable to be output in time, and even cause data overflow and loss; when the A / D conversion rate of the signal acquisition end is less than the D / A conversion rate of the signal output end, that is, the sampling rate of the signal acquisition end is less than the sampling rate of the signal output end, it will cause the digital signal of the signal output end to be in short supply, and the signal output will be incoherent. Therefore, in order to ensure the quality of signal transmission and avoid sampling imbalance between the signal acquisition end and the signal output end, it is necessary to synchronize the sampling of the signal acquisition end and the signal output end.

[0072] At present, the traditional sampling synchronization scheme used for sampling synchronization between the signal acquisition end and the signal output end has low synchronization accuracy and poor synchronization effect, making it difficult to ensure the transmission quality of analog signals. Especially in low-latency audio transmission scenarios, the traditional low-precision sampling synchronization scheme cannot guarantee the audio transmission effect at all.

[0073] In view of the above-mentioned deficiencies of the existing sampling synchronization technology and the actual demand for higher-precision sampling synchronization, the inventors of the present application have proposed a signal sampling synchronization method after research and experiments. The method can realize sampling synchronization control of the acquisition device and the output device at the sampling point granularity, and its signal sampling synchronization accuracy is higher, thereby improving the quality of analog signal transmission.

[0074] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0075] The present application embodiment provides a signal sampling synchronization method, which can be exemplarily applied to the following Figure 1 The wireless audio communication scenario shown.

[0076] It should be noted that Figure 1 The wireless audio communication scenario shown is a specific example of an analog signal transmission scenario, which can reflect the principle processing process of analog signal transmission. In the field of analog signal transmission, the number of signal acquisition terminals and signal output terminals can both be one, or the number of signal acquisition terminals can be multiple and the number of signal output terminals can be one, or the number of signal acquisition terminals can be one and the number of signal output terminals can be multiple. Figure 1 The wireless audio communication scenario shown represents a multi-transmit and one-receive analog signal transmission scenario. In other scenarios, when the number of signal acquisition terminals and signal output terminals changes, the working process can also refer to Figure 1 examples to understand.

[0077] based on Figure 1 As shown in the scenario diagram, the embodiment of the present application takes the signal sampling synchronization between one of the transmitting end and the receiving end as the research unit, and introduces the sampling synchronization control scheme between the transmitting end and the receiving end to exemplarily demonstrate the processing flow of the signal sampling synchronization method proposed in the present application. For the sampling synchronization between other transmitting ends and receiving ends, it can be executed with reference to the introduction of the embodiment of the present application. Similarly, in other scenarios, when the number of signal acquisition ends and signal output ends changes, for each pair of sampling synchronization between the signal acquisition end and the signal output end, it can be processed with reference to the scheme introduced in the embodiment of the present application, and the embodiment of the present application will no longer be introduced in detail for each scenario.

[0078] See also Figure 2 As shown, the signal sampling synchronization method proposed in the embodiment of the present application includes:

[0079] S201. Obtain the amount of sampling data.

[0080] Specifically, the above-mentioned sampling data volume refers to the amount of sampling data obtained by sampling the analog signal to be transmitted. Specifically, the sampling data volume represents the number of sampling points of the digital signal obtained by sampling the analog signal by the acquisition device and not converted into an analog signal by the output device.

[0081] like Figure 1 As shown in , the transmitting end continuously samples the analog audio signal to obtain a series of sampling point signals, and these sampling point signals are arranged in a sampling order to form a digital audio signal. The digital audio signal is encoded and sent to the receiving end, and the receiving end first stores the received digital audio signal in the RAM, and then reads the digital audio signal from the RAM and converts it into an analog audio signal for playback. In the above process, the digital audio signal is sampled by the transmitting end and converted by the receiving end into an analog audio signal for output. The digital audio signal between the sampling at the transmitting end and the conversion of the analog audio signal at the receiving end is the sampling data. The number of sampling points included in the sampling data, that is, the number of sampling point signals contained in the digital audio signal in the above transmission process, is the sampling data volume.

[0082] It can be understood that the above-mentioned amount of sampled data can truly reflect the number of sampling points of the digital signal between the acquisition device and the output device.

[0083] S202: Determine a sampling deviation amount according to a buffer delay of an output device converting a digital signal into an analog signal and the amount of sampled data.

[0084] Specifically, after receiving the digital signal sent by the acquisition device, the output device does not immediately perform D / A conversion on the digital signal, but caches it first, and then performs D / A conversion and playback when a certain amount of data is cached. That is, there is a cache delay between the output device receiving the digital signal and performing D / A conversion on the received digital signal.

[0085] For example, in Figure 1 In the wireless audio communication scenario shown, when the receiving end of the audio transceiver device receives the first packet of audio data sent by the transmitting end, in order to avoid jamming of the audio playback, the audio data packet is not sent directly to the CODEC chip for D / A conversion. Instead, the audio data packet is cached first. After at least two packets of audio data are cached, the first packet of audio data is sent to the CODEC chip for D / A conversion. The duration of the cached audio data packet is the buffering delay.

[0086] like Figure 3As shown, a packet of audio data is a frame of audio, and the duration of a frame of audio is preferably set to 2.5ms. If the transmitting end and the receiving end of the audio transceiver device perform low-latency transmission, in order to adapt to the low latency, the number of cached audio frames is preferably less than or equal to four frames, preferably three frames, then the buffering delay corresponding to the cache of three frames of audio is 2.5×3=7.5ms. Therefore, for each sampling point signal, there will be a buffering delay of 7.5ms from the time it is received by the receiving end to the time it is converted into an analog signal.

[0087] When the sampling rate of the output device deviates from the sampling rate of the acquisition device, the number of sampling points of the digital signal actually to be processed by the output device will deviate from the number of sampling points of the digital signal that the output device can theoretically process, thereby causing the D / A conversion process of the output device to be unsmooth.

[0088] The actual digital signal to be processed by the output device refers to the digital signal that has been received by the output device at the current moment and has not been converted into an analog signal.

[0089] The digital signal that the output device can theoretically process refers to the digital signal that exists at both ends of the transmitter and receiver and is to be converted into an analog signal by the output device when the sampling rate of the output device is equal to the sampling rate of the acquisition device. Based on the data cache mechanism of the output device, during the analog signal transmission process, the output device continuously reads digital signals from the cached digital signals and converts them into analog signals for output. At the same time, the acquisition device sends the digital signals that have been collected but not yet sent to the output device to the output device, and collects the analog signals to generate new digital signals. Then, when the output device and the acquisition device sample synchronously, the digital signal to be converted into an analog signal by the output device is always the sum of the digital signals cached by the output device and the digital signals that have been collected by the acquisition device but not yet sent to the output device. The total amount of digital signals is the total amount of digital signals that the output device can theoretically process.

[0090] It can be understood that at a certain moment, if the actual total amount of digital signals to be processed by the output device exceeds the above-mentioned theoretical total amount of digital signals that can be processed, it means that the sampling rate of the acquisition device is greater than the sampling rate of the output device, resulting in a backlog of digital signals of the output device; if the actual total amount of digital signals to be processed by the output device is less than the above-mentioned theoretical total amount of digital signals that can be processed, it means that the sampling rate of the acquisition device is less than the sampling rate of the output device, which may cause insufficient supply of digital signals for the output device.

[0091] Since the sampling deviation represents the difference between the number of sampling points of the digital signal to be processed by the output device and the number of sampling points of the digital signal that can be processed theoretically by the output device, it is necessary to determine the sampling deviation based on the buffer delay and the amount of sampled data obtained. Specifically, the sampling deviation can be calculated by subtracting the number of sampling points of the digital signal that can be processed theoretically by the output device from the number of sampling points of the digital signal that can be processed by the output device, or by subtracting the number of sampling points of the digital signal that can be processed theoretically by the output device from the number of sampling points of the digital signal that can be processed by the output device. It can be seen that the sampling deviation may be a positive value or a negative value. In addition, in the embodiment of the present application, the sampling deviation may also take an absolute value.

[0092] S203: When the sampling deviation exceeds a preset deviation range, adjusting the number of sampling points of the sampling data corresponding to the sampling data amount with the goal of ensuring that the sampling deviation does not exceed the preset deviation range.

[0093] Specifically, if the determined sampling deviation is within the preset deviation range, it means that the difference between the number of sampling points of the digital signal actually to be processed by the output device and the number of sampling points of the digital signal that the output device can theoretically process is within an acceptable range. It can be considered that the signal sampling of the output device and the acquisition device are synchronized. At this time, there is no need to perform synchronization control on the sampling between the acquisition device and the output device.

[0094] Among them, when the sampling deviation value is not an absolute value but a positive or negative value, the preset deviation range can be -x~x. When the sampling deviation value is an absolute value, the preset deviation range can be 0~x, where x is a positive integer. The smaller the x value, the higher the accuracy of the sampling synchronization between the acquisition device and the output device.

[0095] If the determined sampling deviation exceeds the preset deviation range, it means that the difference between the number of sampling points of the digital signal to be processed by the output device and the number of sampling points of the digital signal that the output device can theoretically process has exceeded the acceptable range, and it can be considered that the signal sampling of the output device and the acquisition device is not synchronized. In order to avoid the backlog of digital signals of the output device, which cannot be output in time or even cause data overflow and loss, or the digital signal of the output device is in short supply, resulting in incoherent signal output, the embodiment of the present application adjusts the number of sampling points of the sampling data corresponding to the sampling data amount to ensure that the sampling deviation does not exceed the preset deviation range. Among them, the adjustment of the number of sampling points of the sampling data can specifically be to insert a sampling point signal in the sampling data to increase the number of sampling points, or to delete a certain sampling point signal in the sampling data to reduce the number of sampling points.

[0096] For example, when the sampling deviation is calculated by subtracting the number of sampling points of the digital signal that the output device can theoretically process from the number of sampling points of the digital signal to be processed by the output device, then if the sampling deviation is ≥x, it means that the digital signal of the output device is backlogged and the number of sampling points needs to be reduced, that is, the data of a certain sampling point in the sampling data needs to be deleted to ensure that the sampling deviation is within the preset deviation range; if the sampling deviation is ≤-x, it means that the digital signal of the output device is in short supply and it is necessary to increase the sampling point data, that is, insert the corresponding data into the sampling data to ensure that the sampling deviation is within the preset deviation range.

[0097] From the above introduction, it can be seen that the signal sampling synchronization method proposed in the embodiment of the present application first obtains the number of sampling points of the digital signal obtained by the acquisition device from sampling the analog signal and not converted into the analog signal by the output device as the sampling data amount, and then determines the difference between the number of sampling points of the digital signal to be processed by the output device and the number of sampling points of the digital signal that can be processed theoretically by the output device according to the buffer delay and the sampling data amount of the digital signal converted by the output device into the analog signal as the sampling deviation amount. When the sampling deviation amount exceeds the preset deviation range, the sampling point number of the sampling data corresponding to the sampling data amount is adjusted with the sampling deviation amount not exceeding the preset deviation range as the goal. The above processing process adjusts the number of sampling points of the digital signal to be processed by the output device according to the deviation between the number of sampling points of the digital signal to be processed by the output device and the number of sampling points of the digital signal that can be processed theoretically, so that the number of sampling points of the digital signal sampled by the acquisition device is balanced with the number of sampling points of the digital signal that can be processed by the output device. This scheme realizes the sampling point granularity of the acquisition device and the output device sampling synchronization control, and its signal sampling synchronization accuracy is higher, thereby improving the transmission quality of analog signals.

[0098] As a preferred implementation method, the embodiment of the present application proposes that the above-mentioned acquisition of the sampling data volume is specifically to obtain the sampling data volume at the current moment every preset interval, so that the sampling deviation at the current moment can be determined every preset interval, and sampling synchronization can be performed when the acquisition device and the output device at the current moment need sampling synchronization, thereby improving the real-time performance of signal sampling synchronization.

[0099] Among them, the above-mentioned preset interval duration can be determined according to the crystal oscillator frequency of the acquisition device and the output device. Specifically, there is a deviation between the crystal oscillators in the acquisition device and the output device. Even if the crystal oscillators of the two devices are of the same model, due to process problems, there is a deviation between the crystal oscillators of different individuals, and the deviation is usually less than 20ppm. Based on the above deviation, when the signal is collected after a time period of N, the difference in the sampling frequency of the two may exceed the acceptable range, then sampling synchronization intervention is required at this time. At this time, the above-mentioned duration N can be used as the preset interval duration, so that after each sampling of N duration, the acquisition device and the output device are sampled synchronously and controlled once, so as to avoid further widening the sampling frequency difference between the two in the subsequent sampling process. In the actual test process, it was found that when the crystal oscillator deviation of the acquisition device and the receiving device was less than 20ppm, the above-mentioned preset interval duration was set to 10s to achieve a better sampling synchronization control effect.

[0100] As a preferred implementation, another embodiment of the present application discloses that the above-mentioned sampling data volume includes: a first sampling data volume and a second sampling data volume. The first sampling data volume represents the number of sampling points of the digital signal that has been collected by the collection device and has not yet been sent to the output device, and the second sampling data volume represents the number of sampling points of the digital signal that has been received by the output device and has not yet been converted into an analog signal.

[0101] The above-mentioned determining the sampling deviation amount according to the buffer delay of the output device converting the digital signal into the analog signal and the amount of sampled data includes:

[0102] A sampling deviation amount is calculated based on the delay data amount corresponding to the buffer delay, the first sampling data amount, and the second sampling data amount.

[0103] Specifically, the delay data volume indicates the number of sampling points corresponding to the buffer delay. The delay data volume needs to be calculated based on the buffer delay and the sampling rate of the preset output device. Specifically, the delay data volume is the product of the buffer delay and the sampling rate of the preset output device. For example, when the buffer delay is 7.5ms and the sampling rate of the preset output device is 48K, the delay data volume is the number of sampling points in the data collected within this 7.5ms period, that is, 7.5×48=360. This embodiment does not limit the sampling rate preset by the output device, which can be 48K, 16K, 8K, etc.

[0104] The embodiment of the present application calculates the sampling deviation amount according to the delay data amount, the first sampling data amount and the second sampling data amount.

[0105] Optional, see Figure 4As shown, another embodiment of the present application discloses that the sampling deviation amount is calculated based on the delay data amount corresponding to the buffer delay, the first sampling data amount and the second sampling data amount, including:

[0106] S402: Calculate the sum of the first sampling data amount and the delayed data amount as the number of sampling points of the digital signal that can be processed by the output device in theory.

[0107] S403: Calculate the difference between the second sampling data amount and the number of sampling points that the output device can theoretically process digital signals as a sampling deviation.

[0108] Specifically, the MCU of the output device is provided with a storage component RAM, and the RAM stores the digital signal received by the output device, and the data transmitted by the MCU to the CODEC chip is not the data of one sampling point at a time, but a packet of data at a time. For example, in an audio transceiver device, the MCU at the receiving end will transmit one frame of audio to the CODEC chip at a time, rather than the audio data of one sampling point. Therefore, there are also digital signals in the CODEC chip that have not completed the D / A conversion. It can be seen that the second sampling data amount includes not only the number of sampling points of the digital signal stored in the RAM of the output device, but also the number of sampling points of the digital signal that has not been converted into an analog signal in the CODEC chip.

[0109] The delay data volume indicates the number of sampling points of the digital signal that the output device theoretically needs to process during the delay period. The first sampling data volume indicates the number of sampling points of the digital signal that the acquisition device has collected but not sent and needs to be processed by the output device. The digital signal that the output device theoretically needs to process includes not only the digital signal cached during the delay period, but also the digital signal that the acquisition device has not yet sent to the output device. Therefore, the sum of the first sampling data volume and the delay data volume indicates the number of sampling points of all sampling points of the digital signal that the output device can theoretically process. According to the above content, it can be known that the second sampling data volume is the number of sampling points of all unprocessed digital signals in the output device, that is, the second sampling data volume is the number of sampling points of the digital signal to be processed by the output device. Since the sampling deviation value indicates the difference between the number of sampling points of the digital signal to be processed by the output device and the number of sampling points of the digital signal that the output device can theoretically process, the embodiment of the present application calculates the second sampling data volume, as well as the sum of the first sampling data volume and the delay data volume, and the difference between the two is used as the sampling deviation value.

[0110] Figure 4 In the embodiment shown, step S401 is Figure 2 Step S201 in the method embodiment shown corresponds to, Figure 4 Step S404 in the embodiment shown is Figure 2The specific contents of step S401 and step S404 correspond to step S203 in the method embodiment shown in FIG. Figure 2 The contents of the method embodiment shown will not be repeated here.

[0111] As a preferred implementation, another embodiment of the present application discloses that the above-mentioned step of adjusting the number of sampling points of the sampling data corresponding to the sampling data amount with the goal of the sampling deviation not exceeding the preset deviation range includes:

[0112] First, the sampling rate relationship between the acquisition device and the output device is determined based on the sampling deviation.

[0113] Specifically, if the number of sampling points of the digital signal to be processed by the output device is different from the number of sampling points of the digital signal that can be processed by the output device in theory, it means that the number of sampling points of the digital signal sampled by the acquisition device is out of balance with the number of sampling points of the digital signal that can be processed by the output device. If the sampling deviation is calculated by subtracting the number of sampling points of the digital signal that can be processed by the output device in theory from the number of sampling points of the digital signal that can be processed by the output device, then when the sampling deviation is positive, the sampling rate of the output device is less than the sampling rate of the acquisition device, and when the sampling deviation is negative, the sampling rate of the output device is greater than the sampling rate of the acquisition device; if the sampling deviation is calculated by subtracting the number of sampling points of the digital signal that can be processed by the output device in theory from the number of sampling points of the digital signal that can be processed by the output device, then when the sampling deviation is positive, the sampling rate of the output device is greater than the sampling rate of the acquisition device, and when the sampling deviation is negative, the sampling rate of the output device is less than the sampling rate of the acquisition device. Therefore, the sampling rate size relationship between the sampling rate of the acquisition device and the sampling rate of the output device can be determined based on the sampling deviation. Among them, the sampling rate size relationship can indicate that the sampling rate of the output device is less than the sampling rate of the acquisition device, or that the sampling rate of the output device is greater than the sampling rate of the acquisition device.

[0114] Secondly, according to the sampling rate relationship, the number of sampling points of the sampling data corresponding to the sampling data volume is adjusted so that the sampling deviation does not exceed a preset deviation range.

[0115] Specifically, if the sampling rate relationship between the acquisition device and the output device is different, then the way to adjust the number of sampling points of the sampled data will also be different. Therefore, when adjusting the number of sampling points of the sampled data, it is necessary to adjust according to the sampling rate relationship so that the adjusted sampling deviation does not exceed the preset deviation range. For example, when the sampling rate of the output device is less than the sampling rate of the acquisition device, it is easy to cause a backlog of digital signals of the output device. Therefore, a certain sampling point signal in the sampled data can be deleted to reduce the number of sampling points. When the sampling rate of the output device is greater than the sampling rate of the acquisition device, it is easy to cause the digital signal of the output device to be in short supply. Therefore, the sampling point signal can be inserted in the sampled data to increase the number of sampling points, so that the number of sampling points of the digital signal sampled by the acquisition device and the number of sampling points of the digital signal that can be processed by the output device reach a new balance.

[0116] Preferably, another embodiment of the present application discloses that the above-mentioned determining the sampling rate relationship between the acquisition device and the output device according to the sampling deviation includes:

[0117] First, if the sampling deviation is equal to a preset first deviation threshold, it is determined that the sampling rate of the output device is less than the sampling rate of the acquisition device.

[0118] Specifically, the two critical values ​​in the preset deviation range are respectively a first deviation threshold and a second deviation threshold, and the first deviation threshold and the second deviation threshold are opposite numbers of each other.

[0119] If the sampling deviation is calculated by subtracting the number of sampling points of the digital signal that the output device can theoretically process from the number of sampling points of the digital signal that the output device can actually process, then the first deviation threshold is a positive value and the second deviation threshold is a negative value. If the sampling deviation is calculated by subtracting the number of sampling points of the digital signal that the output device can theoretically process from the number of sampling points of the digital signal that the output device can actually process, then the first deviation threshold is a negative value and the second deviation threshold is a positive value.

[0120] When the sampling deviation is equal to the first deviation threshold, the number of sampling points of the digital signal to be processed by the output device is greater than the number of sampling points of the digital signal that can be processed by the output device theoretically. At this time, the sampling rate of the output device is less than the sampling rate of the acquisition device.

[0121] Second, if the sampling deviation is equal to a preset second deviation threshold, it is determined that the sampling rate of the output device is greater than the sampling rate of the acquisition device.

[0122] When the sampling deviation is equal to the second deviation threshold, the number of sampling points of the digital signal actually to be processed by the output device is less than the number of sampling points of the digital signal theoretically processable by the output device. At this time, the sampling rate of the output device is greater than the sampling rate of the acquisition device.

[0123] For example, the second sampling data volume includes not only the number of sampling points of the digital signal stored in the RAM of the output device, but also the number of sampling points of the digital signal that has not been converted into an analog signal in the CODEC chip. Assume that the number of sampling points of the digital signal stored in the RAM of the output device is y, the number of sampling points of the digital signal that has not been converted into an analog signal in the CODEC chip is z, the first sampling data volume is x, and the delay data volume is a. Then, at this time, the number of sampling points of the digital signal to be processed by the output device is y+z, and the number of sampling points of the digital signal that can be processed by the output device in theory is x+360.

[0124] If the sampling deviation is calculated by subtracting the number of sampling points of the digital signal that the output device can theoretically process from the number of sampling points of the digital signal that the output device actually processes, the preset deviation range is -1 to 1, and the first deviation threshold is 1 and the second deviation threshold is -1. When y+zx-360=1, the sampling rate of the output device is less than the sampling rate of the acquisition device. At this time, the amount of sampled data is too much, causing the digital signal of the output device to be accumulated, unable to be output in time, and even causing data overflow and loss. When y+zx-360=-1, the sampling rate of the output device is greater than the sampling rate of the acquisition device. At this time, the amount of sampled data is too small, causing the digital signal of the output device to be in short supply, resulting in an incoherent signal output phenomenon.

[0125] Preferably, see Figure 5 As shown, another embodiment of the present application discloses that, according to the sampling rate relationship, the number of sampling points of the sampling data corresponding to the sampling data amount is adjusted so that the sampling deviation does not exceed the preset deviation range, including:

[0126] S502: Determine an adjustment method for the sampling data based on the sampling rate relationship.

[0127] Specifically, the relationship between the sampling rates of the acquisition device and the output device is different, and the method of adjusting the number of sampling points of the sampled data will also be different.

[0128] Furthermore, if the sampling rate size relationship indicates that the sampling rate of the output device is less than the sampling rate of the acquisition device, it means that the number of sampling points of the digital signal to be processed by the output device is greater than the number of sampling points of the digital signal that the output device can theoretically process, then the amount of sampling data needs to be reduced in order to reduce the sampling rate of the acquisition device, that is, it is necessary to delete some of the sampling data corresponding to the sampling data amount, and at this time, it can be determined that the adjustment method for the sampling data is de-value adjustment. If the sampling rate size relationship indicates that the sampling rate of the output device is greater than the sampling rate of the acquisition device, it means that the number of sampling points of the digital signal to be processed by the output device is less than the number of sampling points of the digital signal that the output device can theoretically process, then the amount of sampling data needs to be increased in order to increase the sampling rate of the acquisition device, that is, it is necessary to insert some of the sampling data corresponding to the sampling data amount, and at this time, it can be determined that the adjustment method for the sampling data is interpolation adjustment.

[0129] S503: Calculate the sampling point data in the sampling data based on a preset calculation method to obtain a first quantity of sampling adjustment data.

[0130] Specifically, if the number of sampling points of the sampled data is adjusted, it is necessary to calculate the data for adjusting the sampled data as the sampling adjustment data, wherein, when it is necessary to insert the sampling point data into the sampled data, the sampling adjustment data is the inserted sampling point data, and when it is necessary to delete the sampling point data in the sampled data, the sampling adjustment data can be used to replace a number of sampling point data in the sampled data that is greater than the number of the sampling adjustment data, thereby reducing the amount of the sampled data. Therefore, the calculation of the sampling adjustment data needs to be calculated based on a number of sampling point data in the sampled data, for example, the data of adjacent sampling points of a number of sampling point data can be determined as the sampling adjustment data by calculating the mean or predicting the amplitude based on the number of sampling point data. In addition, the sampling adjustment data can be multiple, for example, when the preset deviation range is -2 to 2, that is, the first deviation threshold is 2, the number of the sampling adjustment data can be 1 or 2, so that when the number of sampling points of the sampled data is adjusted, one number can be adjusted, or two numbers can be adjusted, so that the sampling deviation is controlled within the preset deviation range.

[0131] S504: According to the adjustment method, use the first number of sampling adjustment data to adjust the sampling data.

[0132] Specifically, if the adjustment method is interpolation adjustment, the first number of sampling adjustment data is inserted into the corresponding position of the sampling data to increase the sampling data amount by the first number; if the adjustment method is de-value adjustment, the first number of sampling adjustment data replaces the corresponding data in the sampling data to reduce the sampling data amount by the first number.

[0133] For example, when the first number is 1, interpolation adjustment is to directly insert one sampling adjustment data into the corresponding position of the sampling data, and the amount of sampling data increases by 1, and de-value adjustment is to replace two corresponding adjacent data in the sampling data with one sampling adjustment data, and the amount of sampling data decreases by 1. When the first number is 2, interpolation adjustment is to insert two sampling adjustment data into the corresponding positions of the sampling data, and the amount of sampling data increases by 2, and de-value adjustment is to replace two corresponding adjacent data in the sampling data with two sampling adjustment data, that is, the two sampling adjustment data replace a total of 4 sampling point data in the sampling data, and the amount of sampling data decreases by 2.

[0134] Figure 5 Step S501 in the illustrated embodiment corresponds to step "determining the sampling rate relationship between the acquisition device and the output device based on the sampling deviation" in the above method embodiment. The specific content of step S501 can be found in the content of the above method embodiment and will not be repeated here.

[0135] Preferably, see Figure 6 As shown, another embodiment of the present application discloses that the above-mentioned calculation method based on the preset calculation method is used to calculate the sampling point data in the sampling data to obtain a first amount of sampling adjustment data, including:

[0136] S603: extract adjacent sampling point data from the sampled data as data to be adjusted according to a preset extraction quantity.

[0137] Specifically, a preset number of sampling point data is randomly selected from all the sampling data corresponding to the sampling data amount, and the sampling point data are adjacent data, and are used as the data to be adjusted. In addition, the preset number of sampling points must be greater than the first number.

[0138] S604: Calculate the data to be adjusted based on a preset calculation method to obtain a first quantity of sampled adjustment data.

[0139] Specifically, the preset calculation methods that can be used to calculate the data to be adjusted include average value calculation or amplitude prediction.

[0140] Exemplarily, the specific process of calculating the average value includes:

[0141] The average value of the data to be adjusted is calculated as the sampled adjustment data.

[0142] For example, when the first number of sampled adjustment data is 1, the preset extraction number may be 2, and two adjacent sampled point data are randomly extracted from the sampled data as the data to be adjusted, and then the average value of the two sampled point data is calculated as the sampled adjustment data. When the first number of sampled adjustment data is 2, the preset extraction number may be 4, and four sampled point data are randomly extracted from the sampled data as the data to be adjusted, wherein the four sampled point data may be four adjacent data, or may be adjacent in pairs. If the data to be adjusted is four adjacent data, the average value of the first two adjacent data is calculated as the first sampled adjustment data, and the average value of the last two adjacent data is calculated as the second sampled adjustment data. If the data to be adjusted is adjacent in pairs, the average values ​​of the two adjacent data are calculated as the two sampled adjustment data.

[0143] Exemplarily, the specific processing of amplitude prediction includes:

[0144] Based on the data to be adjusted, a first number of sampling point data continuous with the data to be adjusted is predicted and obtained as sampling adjustment data.

[0145] Specifically, a preset number of adjacent sampling point data is randomly selected from the sampled data as the data to be adjusted, and the preset number of sampling points must be greater than the first number, so that the sampling point data that is continuous with the data to be adjusted can be predicted as the sampling adjustment data. The more the preset number of sampling points is, the more accurate the predicted sampling adjustment data is.

[0146] Figure 6 Step S601 in the embodiment shown is similar to the above Figure 5 Step S501 in the method embodiment shown corresponds to, Figure 6 Step S602 in the embodiment shown is similar to the above Figure 5 Step S502 in the method embodiment shown corresponds to, Figure 6 Step S605 in the embodiment shown is similar to the above Figure 5 The specific contents of step S601, step S602 and step S605 correspond to step S504 in the method embodiment shown, and will not be described in detail herein.

[0147] As a preferred implementation, see Figure 7 As shown, another embodiment of the present application discloses that the above-mentioned adjusting method uses the first number of sampling adjustment data to adjust the sampling data, including:

[0148] S705: If the adjustment method is de-value adjustment, use the first number of sampled adjustment data to replace the data to be deleted in the sampled data.

[0149] Specifically, when the sampled adjustment data is obtained by calculating the average value, the data to be deleted is the previously extracted data to be adjusted.

[0150] For example, if the first number is 1, the extracted data to be adjusted is two adjacent sampling point data in the sampled data, and the sampled adjustment data is the average value of the two adjacent sampling point data. At this time, the de-value adjustment needs to replace the two adjacent sampling point data with the average value of the two adjacent sampling point data. If the first number is 2, the extracted data to be adjusted is four sampling point data in the sampled data, and each sampled adjustment data is the average value of two data in the four sampling point data. Therefore, at this time, the de-value adjustment needs to replace the corresponding two sampling point data with each sampled adjustment data. In this way, the amount of sampled data can be reduced, so that the sampling rate of the acquisition device can be improved to ensure the balance between the sampling rate of the acquisition device and the sampling rate of the output device.

[0151] When the sampled adjustment data is obtained by amplitude prediction, the data to be deleted is a second number of data adjacent to the data to be adjusted, wherein the first number is smaller than the second number.

[0152] For example, when the amount of sampled data needs to be reduced by one, the extracted data to be adjusted can be used to predict a continuous sampled adjustment data, and then the sampled adjustment data can be used to replace the two adjacent data after the data to be adjusted, so that the amount of sampled data can be reduced by one. When the amount of sampled data needs to be reduced by two, the extracted data to be adjusted can be used to predict two continuous sampled adjustment data, and then the two sampled adjustment data can be used to replace the four adjacent data after the data to be adjusted, so that the amount of sampled data can be reduced by two, so that the sampling rate of the acquisition device can be improved to ensure the balance between the sampling rate of the acquisition device and the sampling rate of the output device.

[0153] S706: If the adjustment method is interpolation adjustment, insert the sample adjustment data into a target position in the sample data.

[0154] Specifically, when the sampled adjustment data is obtained by calculating the average value, the target position is any position in the data to be adjusted.

[0155] For example, if the first number is 1, the extracted data to be adjusted is two adjacent sampling point data in the sampled data, and the sampled adjustment data is the average value of the two adjacent sampling point data. At this time, the interpolation adjustment needs to insert the average value between the two adjacent sampling points. If the first number is 2, the extracted data to be adjusted is four sampling point data in the sampled data, and each sampled adjustment data is the average value of two data in the four sampling point data. Therefore, the interpolation adjustment at this time needs to insert each sampled adjustment data between its corresponding two sampling point data. In this way, the amount of sampled data can be increased, so that the sampling rate of the acquisition device can be reduced to ensure the balance between the sampling rate of the acquisition device and the sampling rate of the output device.

[0156] When the sampling adjustment data is obtained by amplitude prediction, the target position is the position adjacent to the data to be adjusted. That is, all the predicted sampling adjustment data are inserted into the position adjacent to the extracted data to be adjusted, so as to increase the amount of sampling data and reduce the sampling rate of the acquisition device to ensure the balance between the sampling rate of the acquisition device and the sampling rate of the output device.

[0157] In addition, the present application performs sampling synchronization control on the acquisition device and the output device at the sampling point granularity, which is more adaptable to the scenario where the acquisition device and the output device communicate with each other with low latency, and ensures the sampling synchronization of the acquisition device and the output device under low latency communication conditions.

[0158] Figure 7 Steps S701-S704 in the embodiment shown are similar to those described above. Figure 6 The steps S601-S604 in the method embodiment shown correspond to each other. The specific contents of steps S701-S704 can refer to the contents of the above method embodiment and will not be described in detail.

[0159] As a preferred implementation method, the embodiment of the present application can be used in a variety of scenarios, for example, a scenario of multiple acquisition devices and one output device, a scenario of one acquisition device and one output device, and a scenario of one acquisition device and multiple output devices.

[0160] The sampling data includes first sampling data and second sampling data, wherein the first sampling data is data of all sampling points corresponding to the first sampling data amount, that is, data of each sampling point corresponding to the digital signal that has been collected and not sent by the collection device. The second sampling data is data of all sampling points corresponding to the second sampling data amount, that is, data of each sampling point corresponding to the digital signal that has been received and not converted into an analog signal by the output device.

[0161] When there are multiple acquisition devices and one output device or one acquisition device and one output device, that is, the number of acquisition devices is greater than or equal to one, and the number of output devices is one, the number of sampling points of the sampled data corresponding to the sampled data amount is adjusted, including:

[0162] The number of sampling points of the first sampling data or the second sampling data is adjusted.

[0163] Specifically, when the sampling deviation exceeds the preset deviation range, when extracting a preset number of data to be adjusted, it can be extracted from the first sampling data or from the second sampling data. Then, when performing de-value adjustment or interpolation adjustment, the first sampling data can be adjusted or the second sampling data can be adjusted.

[0164] If the number of acquisition devices is greater than or equal to one and the number of output devices is one, then each acquisition device needs to determine the sampling deviation with the output device, so as to perform sampling synchronization when the sampling deviation exceeds the preset deviation range, that is, adjust the number of sampling points of the first sampling data or the second sampling data.

[0165] For example, in a scenario of two acquisition devices and one output device, the output device includes a digital signal sent by each acquisition device. Assuming that the number of sampling points of the digital signal that has been acquired and not sent by the first acquisition device is x1, and the number of sampling points of the digital signal that has been acquired and not sent by the second acquisition device is x2, the output device includes the number of sampling points Y1 of the digital signal received and sent by the first acquisition device and not converted into an analog signal, and the number of sampling points Y2 of the digital signal received and sent by the second acquisition device and not converted into an analog signal. At this time, the sampling deviation between the first acquisition device and the output device is determined based on x1, Y1, and the buffer delay corresponding to the output device. When the sampling deviation exceeds the preset deviation range, the number of sampling points of the sampling point data corresponding to x1 and the sampling point data corresponding to Y1 are also adjusted. The sampling deviation between the second acquisition device and the output device is determined based on x2, Y2, and the buffer delay. When the sampling deviation exceeds the preset deviation range, the number of sampling points of the sampling point data corresponding to x2 and the sampling point data corresponding to Y2 are also adjusted.

[0166] When there is one acquisition device and multiple output devices, that is, the number of acquisition devices is one and the number of output devices is greater than one, the number of sampling points of the sampled data corresponding to the sampled data volume is adjusted, including: adjusting the number of sampling points of the second sampled data.

[0167] Specifically, when the sampling deviation exceeds the preset deviation range, when extracting the preset number of data to be adjusted, only the second sampling data can be extracted, and then only the second sampling data can be adjusted when performing de-value adjustment or interpolation adjustment.

[0168] If the number of acquisition devices is one and the number of output devices is greater than one, the acquisition device needs to determine the sampling deviation with each output device, so as to perform sampling synchronization when the sampling deviation exceeds the preset deviation range, that is, adjust the number of sampling points of the second sampling data.

[0169] For example, in a scenario with one acquisition device and two output devices, the acquisition device needs to send the digital signal after A / D conversion to each output device respectively. Assume that the number of sampling points of the digital signal that has been acquired and not sent by the acquisition device is x3, the number of sampling points of the digital signal sent by the acquisition device and not converted into an analog signal received by the first output device is Y3, and the number of sampling points of the digital signal sent by the acquisition device and not converted into an analog signal received by the second output device is Y4. At this time, the sampling deviation between the acquisition device and the first output device is determined based on x3, Y3 and the buffer delay corresponding to the first output device. When the sampling deviation exceeds the preset deviation range, only the sampling point data corresponding to Y3 is adjusted. The sampling deviation between the acquisition device and the second output device is determined based on x3, Y4 and the buffer delay corresponding to the second output device. When the sampling deviation exceeds the preset deviation range, only the sampling point data corresponding to Y4 is adjusted.

[0170] In the scenario of one acquisition device and two output devices, x3 is required not only when the acquisition device is synchronized with the first output device, but also when the acquisition device is synchronized with the second output device. Therefore, when adjusting the number of sampling points, only the sampling point data corresponding to the output device can be adjusted. If the sampling point data corresponding to the acquisition device is also adjusted at this time, x3 will change, causing the output device that has been synchronized with the acquisition device to have a sampling imbalance with the acquisition device again. Therefore, in the scenario of one acquisition device and multiple output devices, only the number of sampling points of the second sampling data can be adjusted.

[0171] Corresponding to the above-mentioned signal sampling synchronization method, the embodiment of the present application also proposes a signal sampling synchronization device, see Figure 8 As shown, the device comprises:

[0172] An acquisition unit 100 is used to acquire a sampled data amount, wherein the sampled data amount represents the number of sampling points of a digital signal obtained by sampling an analog signal by an acquisition device and not converted into an analog signal by an output device;

[0173] The deviation determining unit 110 is used to determine the sampling deviation according to the buffer delay of the output device converting the digital signal into the analog signal and the sampling data amount, wherein the sampling deviation represents the difference between the number of sampling points of the digital signal to be processed by the output device and the number of sampling points of the digital signal that can be processed by the output device theoretically;

[0174] The adjusting unit 120 is configured to adjust the number of sampling points of the sampling data corresponding to the sampling data amount with the goal of ensuring that the sampling deviation does not exceed the preset deviation range when the sampling deviation exceeds the preset deviation range.

[0175] The signal sampling synchronization device proposed in the embodiment of the present application, the acquisition unit 100 acquires the number of sampling points of the digital signal obtained by the acquisition device from sampling the analog signal and not converted into the analog signal by the output device as the sampling data amount, the deviation determination unit 110 determines the difference between the number of sampling points of the digital signal to be processed by the output device and the number of sampling points of the digital signal that can be processed theoretically by the output device according to the buffer delay and the sampling data amount of the digital signal converted by the output device into the analog signal as the sampling deviation amount, when the sampling deviation amount exceeds the preset deviation range, the adjustment unit 120 adjusts the number of sampling points of the sampling data corresponding to the sampling data amount with the sampling deviation amount not exceeding the preset deviation range as the goal. The above-mentioned processing process adjusts the number of sampling points of the digital signal to be processed by the output device according to the deviation between the number of sampling points of the digital signal to be processed by the output device and the number of sampling points of the digital signal that can be processed theoretically, so that the number of sampling points of the digital signal sampled by the acquisition device is balanced with the number of sampling points of the digital signal that can be processed by the output device. This scheme realizes the sampling synchronization control of the acquisition device and the output device at the sampling point granularity, and its signal sampling synchronization accuracy is higher, thereby improving the transmission quality of analog signals.

[0176] As an optional implementation method, another embodiment of the present application also discloses that the sampling data amount includes: a first sampling data amount and a second sampling data amount, the first sampling data amount represents the number of sampling points of the digital signal that the acquisition device has collected and not sent, and the second sampling data amount represents the number of sampling points of the digital signal that the output device has received and not converted into an analog signal.

[0177] The deviation determining unit 110 determines the sampling deviation amount according to the buffer delay of the output device converting the digital signal into the analog signal and the sampling data amount, specifically for:

[0178] A sampling deviation amount is calculated according to the delayed data amount corresponding to the buffer delay, the first sampling data amount and the second sampling data amount, wherein the delayed data amount represents the number of sampling points corresponding to the buffer delay.

[0179] As an optional implementation, the deviation determining unit 110 includes:

[0180] A first calculation unit, used for calculating the sum of the first sampling data amount and the time-delayed data amount as the number of sampling points of the digital signal that can be processed by the output device in theory;

[0181] The second calculation unit is used to calculate the difference between the second sampling data amount and the number of sampling points of the digital signal that can be processed by the output device theoretically as the sampling deviation amount.

[0182] As an optional implementation, the adjustment unit 120 includes:

[0183] A size relationship determining unit, used to determine the size relationship of the sampling rates between the acquisition device and the output device according to the sampling deviation;

[0184] The sampling point quantity adjustment unit is used to adjust the sampling point quantity of the sampling data corresponding to the sampling data quantity according to the sampling rate size relationship, so that the sampling deviation does not exceed a preset deviation range.

[0185] As an optional implementation, when the size relationship determining unit determines the size relationship of the sampling rates between the acquisition device and the output device according to the sampling deviation, it is specifically used to:

[0186] If the sampling deviation is equal to the preset first deviation threshold, it is determined that the sampling rate of the output device is less than the sampling rate of the acquisition device; if the sampling deviation is equal to the preset second deviation threshold, it is determined that the sampling rate of the output device is greater than the sampling rate of the acquisition device; wherein the first deviation threshold and the second deviation threshold are opposite numbers of each other.

[0187] As an optional implementation manner, when the sampling point quantity adjustment unit adjusts the sampling point quantity of the sampling data corresponding to the sampling data amount according to the sampling rate size relationship, it is specifically used to:

[0188] Based on the sampling rate relationship, determining an adjustment method for the sampling data;

[0189] Based on a preset calculation method, the sampling point data in the sampling data is calculated to obtain a first quantity of sampling adjustment data;

[0190] According to the adjustment method, the sampling data is adjusted using the first number of sampling adjustment data.

[0191] As an optional implementation manner, the calculating the sampling point data in the sampling data based on a preset calculation method to obtain a first quantity of sampling adjustment data includes:

[0192] Adjacent sampling point data are extracted from the sampled data as data to be adjusted according to a preset extraction quantity; the data to be adjusted are calculated based on a preset calculation method to obtain a first quantity of sampled adjustment data; wherein the preset extraction quantity is greater than the first quantity.

[0193] As an optional implementation manner, the calculating the sampling point data in the sampling data based on a preset calculation method to obtain a first quantity of sampling adjustment data includes:

[0194] Calculate the average value of the data to be adjusted as sampled adjustment data; or,

[0195] Based on the data to be adjusted, a first number of sampling point data continuous with the data to be adjusted is predicted and obtained as sampling adjustment data.

[0196] As an optional implementation manner, when the sampling point quantity adjustment unit determines the adjustment method for the sampling data based on the sampling rate size relationship, it is specifically used to:

[0197] If the sampling rate relationship indicates that the sampling rate of the output device is less than the sampling rate of the acquisition device, then determining that the adjustment method is de-value adjustment;

[0198] If the sampling rate relationship indicates that the sampling rate of the output device is greater than the sampling rate of the acquisition device, it is determined that the adjustment method is interpolation adjustment.

[0199] As an optional implementation manner, when the sampling point quantity adjustment unit adjusts the sampling data according to the adjustment manner using the first quantity of sampling adjustment data, it is specifically used to:

[0200] If the adjustment method is de-value adjustment, the data to be deleted in the sampled data is replaced with the first number of sampled adjustment data; the data to be deleted is the data to be adjusted, or a second number of data adjacent to the data to be adjusted, and the first number is smaller than the second number;

[0201] If the adjustment method is interpolation adjustment, the sampled adjustment data is inserted into a target position in the sampled data, and the target position is any position in the data to be adjusted, or a subsequent adjacent position of the data to be adjusted.

[0202] As an optional implementation manner, the sampled data includes: first sampled data not sent by the acquisition device and second sampled data not output by the output device.

[0203] When the adjusting unit adjusts the number of sampling points of the sampled data corresponding to the sampled data amount, the adjusting unit is specifically used to:

[0204] If the number of acquisition devices is greater than or equal to one, the number of output devices is one, and the number of sampling points of the first sampling data or the second sampling data is adjusted.

[0205] If the number of acquisition devices is one and the number of output devices is greater than one, the number of sampling points of the second sampling data is adjusted.

[0206] Specifically, for the specific working contents of each unit of the above-mentioned signal sampling synchronization device, please refer to the introduction of the above-mentioned method embodiment, which will not be repeated here.

[0207] Another embodiment of the present application also discloses a signal sampling synchronization device, see Fig. 9 As shown, the device includes: a memory 200 and a processor 210; wherein the memory 200 is connected to the processor 210 and is used to store programs; the processor 210 is used to implement the signal sampling synchronization method disclosed in any of the above embodiments by running the program stored in the memory 200.

[0208] Specifically, the signal sampling synchronization device may further include: a bus, a communication interface 220 , an input device 230 and an output device 240 .

[0209] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are connected to each other via a bus.

[0210] A bus may include a pathway that transfers information between components of a computer system.

[0211] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0212] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.

[0213] The memory 200 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.

[0214] The input device 230 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.

[0215] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.

[0216] The communication interface 220 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.

[0217] The processor 2102 executes the program stored in the memory 200 and calls other devices, which can be used to implement each step of the signal sampling synchronization method provided in the embodiment of the present application.

[0218] Another embodiment of the present application further provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, each step of the signal sampling synchronization method provided in any of the above embodiments is implemented.

[0219] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0220] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0221] The steps in the methods of the various embodiments of the present application can be adjusted in order, combined, and deleted according to actual needs.

[0222] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.

[0223] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0224] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0225] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.

[0226] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0227] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0228] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used 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 "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0229] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A signal sampling synchronization method, characterized in that: include: Acquire the amount of sampled data, wherein the amount of sampled data includes: the number of sampling points of digital signals obtained by sampling the analog signal by the acquisition device and not sent, and the number of sampling points of digital signals received by the output device and not converted into analog signals; According to the buffer delay of the output device converting the digital signal into an analog signal and the amount of sampled data, a sampling deviation is determined, wherein the sampling deviation represents the difference between the number of sampling points of the digital signal to be actually processed by the output device and the number of sampling points of the digital signal that can be theoretically processed by the output device; the digital signal that can be theoretically processed by the output device includes: the digital signal cached within the buffer delay and the digital signal that has been collected and not sent by the collection device, and the digital signal that is actually to be processed by the output device includes: the digital signal that has been received by the output device and has not been converted into an analog signal; When the sampling deviation exceeds the preset deviation range, the number of sampling points of the sampling data corresponding to the sampling data amount is adjusted with the goal that the sampling deviation does not exceed the preset deviation range.

2. The signal sampling synchronization method according to claim 1, characterized in that: The sampling data volume includes: a first sampling data volume and a second sampling data volume, wherein the first sampling data volume represents the number of sampling points of the digital signal that has been collected by the collection device and not sent, and the second sampling data volume represents the number of sampling points of the digital signal that has been received by the output device and not converted into an analog signal; The step of determining the sampling deviation amount according to the buffer delay of the output device converting the digital signal into the analog signal and the amount of sampled data comprises: A sampling deviation amount is calculated according to the delay data amount corresponding to the buffer delay, the first sampling data amount and the second sampling data amount, wherein the delay data amount represents the number of sampling points corresponding to the buffer delay.

3. The signal sampling synchronization method according to claim 2, characterized in that: The calculating the sampling deviation amount according to the delay data amount corresponding to the delay, the first sampling data amount and the second sampling data amount includes: Calculating the sum of the first sampling data amount and the time-delayed data amount as the number of sampling points of the digital signal that can be theoretically processed by the output device; The difference between the second sampling data amount and the number of sampling points of the digital signal that can be processed by the output device theoretically is calculated as the sampling deviation amount.

4. The signal sampling synchronization method according to claim 1, characterized in that: With the sampling deviation amount not exceeding a preset deviation range as a goal, the number of sampling points of the sampling data corresponding to the sampling data amount is adjusted, including: Determining the sampling rate relationship between the acquisition device and the output device according to the sampling deviation; According to the sampling rate relationship, the number of sampling points of the sampling data corresponding to the sampling data amount is adjusted so that the sampling deviation does not exceed a preset deviation range.

5. The signal sampling synchronization method according to claim 4, characterized in that: Determining the sampling rate relationship between the acquisition device and the output device according to the sampling deviation includes: If the sampling deviation is equal to a preset first deviation threshold, determining that the sampling rate of the output device is less than the sampling rate of the acquisition device; If the sampling deviation is equal to a preset second deviation threshold, determining that the sampling rate of the output device is greater than the sampling rate of the acquisition device; The first deviation threshold and the second deviation threshold are opposite numbers of each other.

6. The signal sampling synchronization method according to claim 4, characterized in that: The step of adjusting the number of sampling points of the sampled data corresponding to the sampled data amount according to the sampling rate relationship includes: Based on the sampling rate relationship, determining an adjustment method for the sampling data; Based on a preset calculation method, the sampling point data in the sampling data is calculated to obtain a first quantity of sampling adjustment data; According to the adjustment method, the sampling data is adjusted using the first number of sampling adjustment data.

7. The signal sampling synchronization method according to claim 6, characterized in that: The step of calculating the sampling point data in the sampling data based on a preset calculation method to obtain a first amount of sampling adjustment data includes: According to a preset extraction quantity, extracting adjacent sampling point data from the sampled data as data to be adjusted; Based on a preset calculation method, the data to be adjusted is calculated to obtain a first quantity of sampled adjustment data; Wherein, the preset extraction quantity is greater than the first quantity.

8. The signal sampling synchronization method according to claim 7, characterized in that: The step of calculating the data to be adjusted based on a preset calculation method to obtain a first quantity of sampled adjustment data includes: Calculating the average value of the data to be adjusted as sampled adjustment data; or, Based on the data to be adjusted, a first number of sampling point data continuous with the data to be adjusted is predicted and obtained as sampling adjustment data.

9. The signal sampling synchronization method according to claim 7, characterized in that: Based on the sampling rate relationship, determining an adjustment method for the sampling data includes: If the sampling rate relationship indicates that the sampling rate of the output device is less than the sampling rate of the acquisition device, then determining that the adjustment method is de-value adjustment; If the sampling rate relationship indicates that the sampling rate of the output device is greater than the sampling rate of the acquisition device, it is determined that the adjustment method is interpolation adjustment.

10. The signal sampling synchronization method according to claim 9, characterized in that: According to the adjustment method, adjusting the sampling data using the first number of sampling adjustment data includes: If the adjustment method is de-value adjustment, the data to be deleted in the sampled data is replaced with the first number of sampled adjustment data; the data to be deleted is the data to be adjusted, or a second number of data adjacent to the data to be adjusted, and the first number is smaller than the second number; If the adjustment method is interpolation adjustment, the sampled adjustment data is inserted into a target position in the sampled data, and the target position is any position in the data to be adjusted, or a subsequent adjacent position of the data to be adjusted.

11. The signal sampling synchronization method according to claim 1, characterized in that: The sampled data includes: first sampled data not sent by the acquisition device and second sampled data not output by the output device; If the number of acquisition devices is greater than or equal to one, and the number of output devices is one, the step of adjusting the number of sampling points of the sampled data corresponding to the sampled data volume includes: Adjusting the number of sampling points of the first sampling data or the second sampling data; If the number of acquisition devices is one and the number of output devices is greater than one, the step of adjusting the number of sampling points of the sampled data corresponding to the sampled data volume includes: The number of sampling points of the second sampling data is adjusted.

12. A signal sampling synchronization device, characterized in that: include: An acquisition unit, configured to acquire a sampled data volume, wherein the sampled data volume includes: a number of sampling points of a digital signal obtained by sampling an analog signal by an acquisition device and not sent, and a number of sampling points of a digital signal received by an output device and not converted into an analog signal; The deviation determination unit is used to determine the sampling deviation according to the buffer delay of the output device converting the digital signal into the analog signal and the sampling data volume, wherein the sampling deviation represents the difference between the number of sampling points of the digital signal to be actually processed by the output device and the number of sampling points of the digital signal that can be theoretically processed by the output device; the digital signal that can be theoretically processed by the output device includes: the digital signal cached within the buffer delay and the digital signal that has been collected and not sent by the collection device, and the digital signal that is actually to be processed by the output device includes: the digital signal that has been received by the output device and has not been converted into an analog signal; The adjustment unit is used to adjust the number of sampling points of the sampling data corresponding to the sampling data amount with the goal of ensuring that the sampling deviation does not exceed the preset deviation range when the sampling deviation exceeds the preset deviation range.

13. A signal sampling synchronization device, characterized in that: include: Memory and processor; Wherein, the memory is connected to the processor and is used to store programs; The processor is used to implement the signal sampling synchronization method according to any one of claims 1 to 11 by running the program in the memory.

14. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the signal sampling synchronization method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Synchronization method and device of audio equipment

    CN112887773A

  • Method for resampling at transmission and reception of a digital signal with digital band translation

    CN1830147A