Audio processing device and audio processing method
Through the combination of data processor, frequency generator and buffer memory in the audio processing device, the accurate audio sampling frequency is calculated and generated, which solves the problems of extended audio playback waiting time and high design cost, and achieves fast and accurate audio frequency recovery.
Patent Information
- Application Number
- CN202010088414.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-12
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2040-02-12
AI Technical Summary
The existing technology requires an increased waiting time during audio playback to ensure the accuracy of the audio sampling frequency, and compensation and correction through hardware circuits will increase design costs.
Through the combination of data processor, frequency generator and buffer memory, the frequency information in the audio input packet is used to calculate the operation value, and the accurate audio sampling frequency is generated according to the link clock signal, reducing the time required for frequency correction and compensation.
The waiting time for audio playback is shortened, the design cost is reduced, and the accuracy of the audio sampling frequency is improved.
Smart Images

Figure CN113257258B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to an audio processing device and an audio processing method, and more particularly to an audio processing device and an audio processing method for improving sampling frequency. Background Art
[0002] With the development of technology, electronic devices with audio playback functions have been widely used in people's daily lives, such as various audio and video appliances. Since digital audio data does not include or retain the sampling frequency of the original audio when it is transmitted, the receiving end (Sink) device must perform audio clock regeneration to reconstruct the audio sampling frequency.
[0003] However, in order to obtain an accurate audio sampling frequency, the waiting time before the audio is broadcasted will be increased. If the audio sampling frequency is compensated and corrected by a hardware circuit, the design cost will also be increased. Therefore, how to improve the above-mentioned problem of audio sampling frequency is an important topic in this field. Summary of the invention
[0004] One aspect of the present application is an audio processing device, which includes a data processor, a frequency generator, and a buffer memory. The data processor is used to obtain a calculation value according to a plurality of audio frequency information included in a plurality of audio input packets. The frequency generator is used to generate an audio sampling frequency according to the calculation value and a link clock signal. The buffer memory is used to generate a plurality of corresponding audio output packets according to the audio sampling frequency from the audio input packets.
[0005] Another aspect of the present application is to an audio processing method, comprising: obtaining a calculation value based on multiple audio frequency information included in multiple audio input packets; generating an audio sampling frequency based on the calculation value and a link clock signal; and generating corresponding multiple audio output packets from the audio input packets according to the audio sampling frequency. BRIEF DESCRIPTION OF THE DRAWINGS
[0006] Figure 1 is a schematic diagram of an audio processing device according to an embodiment of the present application.
[0007] Figure 2 is a schematic diagram of a data processor according to an embodiment of the present application.
[0008] Figure 3 The present invention is a flowchart of an audio processing method according to an embodiment of the present application.
[0009] Figure 4 A statistical result chart according to an embodiment of the present application.
[0010] Comply with the description:
[0011]
[0012] DETAILED DESCRIPTION
[0013] The following will list embodiments and provide detailed descriptions with reference to the accompanying drawings. However, the specific embodiments described are only used to explain the present application and are not used to limit the present application. The description of structural operations is not used to limit the order of their execution. Any structure recombined by components to produce a device with the same function is within the scope of the present application.
[0014] When digital audio data is transmitted through various audio transmission lines such as DisplayPort (DP), High Definition Multimedia Interface (HDMI), Universal Serial Bus (USB), etc., the digital audio data does not include or retain the original audio sampling frequency. Therefore, the receiving end (Sink) device must perform audio clock regeneration to reconstruct the audio sampling frequency.
[0015] For the sake of convenience, this application will take the DisplayPort standard as an example, but it is not intended to limit this application. A person skilled in the art can apply this to other audio transmission standards to quickly obtain an accurate audio sampling frequency. In the DisplayPort standard, information about the audio sampling frequency is provided through the audio clock frequency information in the Audio Time-stamp Packet according to the following formula (1).
[0016] Maud / Naud=512×fs / fclk (1)
[0017] Among them, Maud and Naud are audio frequency information, fclk is a link symbol clock signal, and fs is a sampling frequency of the audio stream being transmitted.
[0018] Generally speaking, the audio frequency information Maud (M value for Audio) and Naud (N value for Audio) can be used to set the initial frequency of the audio clock recovery circuit, and the frequency can be finely adjusted according to the data temporary storage amount of the audio First In First Out (FIFO) memory. Therefore, if an accurate audio sampling frequency is to be obtained, it is necessary to wait for the frequency compensation adjustment, resulting in an increase in the waiting time of the audio broadcast. In addition, since the frequency compensation adjustment is often performed through a hardware circuit, the design cost is increased.
[0019] To further explain, since the minimum precision of the FIFO memory is one audio packet, the frequency error must be accumulated to the size of one audio packet to produce sufficient changes. Assuming that the actual audio sampling frequency is 32kHz and the frequency error target is within 10ppm (parts per million), it means that 32,000 audio packets can be received in 1 second, and there can only be one audio packet error in 100,000 audio packets. Therefore, according to the following formula (2), at least 3.125 seconds are required to accumulate enough 100,000 audio packets to distinguish the sampling accuracy of 10ppm.
[0020]
[0021] In other words, if the audio sampling frequency is obtained by relying on the change of the data temporary storage amount of the FIFO memory, even if the initial value is completely consistent with the actual value, it still takes 3.125 seconds to confirm. In other words, when the initial value does not meet the actual value and needs to be compensated, the waiting time for audio broadcasting will inevitably be longer. In addition, if the audio sampling frequency changes during audio playback, such as from 192kHz to 48kHz or 48kHz to 192kHz, it is also necessary to use a lookup table and adjust it by frequency division or frequency multiplication to regenerate a new set of sampling frequencies.
[0022] In order to solve the above problems, the present application proposes an audio processing device and an audio processing method. First, the following formula (3) can be derived from formula (1).
[0023]
[0024] Where Naud is a constant, Maud and fclk are variables. Although the link clock signal fclk will be affected by the spread spectrum, the influence of the spread spectrum can be eliminated by making the input frequency of the frequency generator refer to the frequency of the link clock signal fclk. Therefore, according to formula (3), as long as the accurate Maud can be calculated, the accurate audio sampling frequency fs can be obtained.
[0025] In other words, the present application will obtain accurate Maud through the audio processing method, and generate accurate audio sampling frequency fs through the frequency generator in the audio processing device, so as to shorten the waiting time of audio playback. The audio processing device and the audio processing method will be described in the following paragraphs.
[0026] Please refer to Figure 1 . Figure 1 FIG. 1 is a schematic diagram of an audio processing device 100 according to an embodiment of the present application. Figure 1 As shown, the audio processing device 100 includes a data processor 120 , a frequency generator 140 , and a buffer memory 160 . Structurally, the data processor 120 is coupled to the frequency generator 140 . The frequency generator 140 is coupled to the buffer memory 160 .
[0027] In operation, the data processor 120 is used to receive the audio input packet Ain, and obtain the operation value M1 through the audio processing method according to the audio frequency information included in the audio input packet Ain, and then output the operation value M1 to the frequency generator 140. In some embodiments, the data processor 120 is a digital filter or a circuit or component capable of performing audio data acquisition and operation. In some embodiments, the audio input packet Ain is an audio timestamp packet, or other transmission packets including the above-mentioned audio frequency information Maud and Naud.
[0028] The frequency generator 140 is used to receive the operation value M1 and the link clock signal fclk to generate an audio sampling frequency fs, and output the audio sampling frequency fs to the buffer memory 160. In some embodiments, the frequency generator 140 can be implemented by a phase-locked loop (PLL) or a direct digital synthesis device (DDS), but the present application is not limited thereto. For example, the frequency generator 140 uses feedback control so that the output audio sampling frequency fs and the received link clock signal fclk have the ratio in the above formula (3). That is, when the frequency or phase of the link clock signal fclk changes, the frequency generator 140 will detect these changes and adjust the output signal through an internal feedback mechanism so that the audio sampling frequency fs and the link clock signal fclk remain synchronized.
[0029] The buffer memory 160 generates a corresponding audio output packet Aout from the audio input packet Ain according to the audio sampling frequency fs, so as to stabilize the input and output of the audio packet. Specifically, when the frequency generator 140 can quickly output the accurate audio sampling frequency fs, the buffer memory 160 can output the audio output packet Aout from the received audio input packet Ain at the accurately restored audio sampling frequency fs. In some embodiments, the buffer memory 160 can be implemented by a First In First Out (FIFO) memory, but the present application is not limited thereto.
[0030] In some embodiments, the operation value M1 is an arithmetic mean, a weighted average, a geometric mean, a moving average, a median or a mode, but the present application is not limited thereto. For the sake of convenience, the following details about the data processor 120 will be described with the operation value M1 being an arithmetic mean.
[0031] Please refer to Figure 2 . Figure 2 FIG. 1 is a schematic diagram of a data processor 120 according to an embodiment of the present application. Figure 2 As shown, the data processor 120 includes a packet receiver 122, an accumulator 124, a counter 126, and a divider 128. Structurally, the packet receiver 122 is coupled to the accumulator 124 and the counter 126. The divider 128 is coupled to the accumulator 124 and the counter 126.
[0032] In operation, the packet receiver 122 is used to receive a plurality of audio input packets Ain, and obtain a plurality of audio frequency information Maud from the audio input packets Ain to output to the accumulator 124 and the counter 126. The accumulator 124 is used to receive the audio frequency information Maud and sum them up to generate a data sum value Msum. The counter 126 is used to receive the audio frequency information Maud and calculate the number thereof to generate a data number Mcout. The divider 128 is used to receive the data sum value Msum from the accumulator 124 and the data number Mcout from the counter 126, and divide the data sum value Msum by the data number Mcout to generate an arithmetic mean as the calculation value M1.
[0033] It is worth noting that although Figure 2 The data processor 120 is used to perform arithmetic mean calculation on all received audio frequency information Maud, but the present application is not limited thereto. In other embodiments, the data processor 120 may perform other processing on the audio frequency information Maud according to the audio processing method, for example, screening multiple audio frequency information Maud according to default conditions. Further details are described below.
[0034] Please refer to Figure 3 . Figure 3 FIG. 3 is a flowchart of an audio processing method 300 according to an embodiment of the present application. For the sake of convenience and clarity of description, the following audio processing method 300 is used in conjunction with Figure 1 and Figure 2 The embodiments shown are for illustration only, but are not limited thereto. Any person skilled in the art can make various modifications and adjustments without departing from the spirit and scope of the present application. Figure 3 As shown, the audio processing method 300 includes operations S310, S320, S330, S340, S350, and S360.
[0035] First, in operation S310, the data processor 120 receives an audio input packet Ain. Specifically, the packet receiver 122 in the data processor 120 receives the audio input packet Ain and obtains the audio frequency information Maud included in the audio input packet Ain.
[0036] Next, in operation S320, the data processor 120 determines whether the variation range of the audio frequency information Maud exceeds the tolerance value. Specifically, according to the DisplayPort standard, if the variation range of the audio frequency information Maud exceeds the spread spectrum range of plus or minus 0.5%, it means that the current audio frequency is considered to be in an unstable state. Therefore, when the variation range of the audio frequency information Maud exceeds the tolerance value, operation S330 is performed, and the data processor 120 clears the accumulator 124 and the counter 126 to recalculate.
[0037] In this way, by judging whether the variation range of the audio frequency information Maud exceeds the tolerance value, it is determined whether the audio frequency is stable, thereby avoiding the influence of the calculation result due to the acquisition of invalid or unreasonable data.
[0038] When the variation range of the audio frequency information Maud does not exceed the tolerance value (i.e., the audio frequency has stabilized), operation S340 is performed, and the data processor 120 performs accumulation and counting on the audio frequency information Maud. Specifically, the accumulator 124 of the data processor 120 adds up the audio frequency information Maud to generate a data sum value Msum, and the counter 126 of the data processor 120 counts the number of audio frequency information Maud to generate a data entry number Mcout. For example, the data processor 120 performs an accumulation and counting operation on the audio frequency information Maud according to a fixed number of receptions or a fixed reception period.
[0039] Next, in operation S350, the data processor 120 determines whether the number of data items Mcout is greater than a preset number of items. Specifically, the preset number of items may be 100 to 2000 items, and this value may be set according to actual needs and is not used to limit the present application. In other embodiments, in operation S350, the data processor 120 may also determine whether the accumulated time since the start of receiving the audio input packet Ain is greater than a preset period. Specifically, the preset period may be 5 to 30 milliseconds (ms), and this value may be set according to actual needs and is not used to limit the present application.
[0040] When the number of data items Mcout is not greater than the preset number of items (or the accumulated time is not greater than the preset period), operation S320 is performed again. When the number of data items Mcout is greater than the preset number of items (or the accumulated time is greater than the preset period), operation S360 is performed, and the data processor 120 obtains the calculation value M1 according to the audio frequency information Maud. Specifically, in some embodiments, the divider 128 of the data processor 120 divides the data sum value Msum by the number of data items Mcout to generate the calculation value M1.
[0041] It is worth noting that in some embodiments, the audio processing method 300 may omit operation S320, that is, use all received audio frequency information Maud for calculation. In some embodiments, the audio processing method 300 also includes other operations for filtering the audio frequency information Maud to ensure that the used audio frequency information Maud is valid data.
[0042] In other embodiments, the data processor 120 may also be used to perform other operations on the audio frequency information Maud, such as weighted average, geometric mean, moving average, median or mode, etc. A person skilled in the art may design a suitable data processor 120 according to actual needs, which will not be elaborated herein.
[0043] In this way, through the audio processing method 300, the data processor 120 performs calculation processing on the received multiple audio frequency information Maud, and can quickly obtain the calculation value M1 as accurate audio frequency information, so that the frequency generator 140 can generate an accurate audio sampling frequency fs according to the accurate audio frequency information. Since the audio sampling frequency generated by the frequency generator 140 is extremely accurate, the speed at which the audio input packet enters the buffer memory 160 and the speed at which the audio output packet is output from the buffer memory 160 are almost equal, so the time consumed by frequency correction compensation can be saved. In addition, compared with the feedback compensation mechanism using an integrated circuit or hardware, the method of correcting the frequency to be consistent with the actual audio frequency in the present application saves hardware circuit components, so that the design cost can be reduced.
[0044] Please refer to Table 1 and Figure 4 Table 1 shows the relationship between the cumulative number of samplings and the sampling frequency error according to an embodiment of the present application.
[0045]
[0046]
[0047] Table 1
[0048] Generally speaking, the audio frequency information included in the audio timestamp packet is 16 bits, and the Maud average value calculated by this application is 24 bits, which will make the analysis of the audio frequency information more accurate. According to Table 1, as the number of cumulative sampling items increases, the trend of sampling frequency error will decrease. Figure 4 It can be seen that when the number of samples accumulated reaches about 550, the sampling frequency error can converge to less than 20ppm, and the convergence process only takes about 8.14 milliseconds of processing time. When the number of samples accumulated reaches about 1500, the processing time is about 22.2 milliseconds, and the sampling frequency error can be stably converged within 10ppm. In other words, compared with the traditional audio frequency processing method, which takes at least 3 seconds to distinguish a frequency error of 10ppm and requires multiple frequency correction procedures to obtain a frequency accuracy of 10ppm, the present application can greatly shorten the processing time for obtaining accurate audio frequency information.
[0049] In summary, by means of the data processor 120 of the audio processing device 100 performing calculations on the received multiple audio frequency information Maud according to the audio processing method 300, accurate audio frequency information can be quickly obtained, so that the frequency generator 140 can generate an accurate audio sampling frequency fs according to the accurate audio frequency information, thereby shortening the waiting time before audio broadcasting.
[0050] Although the above discloses the implementation methods of the present application, it is not intended to limit the present application. A person skilled in the art may make various modifications and adjustments without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the attached claims.
Claims
1. An audio processing device, characterized in that: The audio processing device comprises: A data processor, used for obtaining a calculation value according to a plurality of audio frequency information included in a plurality of audio input packets; A frequency generator, used for generating an audio sampling frequency according to the operation value and a link clock signal; and A buffer memory, used for generating corresponding multiple audio output packets from the multiple audio input packets according to the audio sampling frequency; Wherein, the data processor comprises: An accumulator, used for summing the plurality of audio frequency information to generate a data sum value; A counter, used for counting the number of the plurality of audio frequency information to generate a data entry number; and A divider, used for dividing the data sum value by the number of data items to generate the operation value; When a variation range of the plurality of audio frequency information does not exceed a tolerance value and the accumulated time length is greater than a preset period, the divider divides the data sum value by the number of data items to generate the calculation value.
2. The audio processing device according to claim 1, characterized in that The plurality of audio input packets are audio data transmitted by a display port (DisplayPort) or a high-definition multimedia interface or a universal serial bus.
3. The audio processing device according to claim 1, characterized in that The data processor also includes a packet receiver for obtaining the plurality of audio frequency information from the plurality of audio input packets.
4. The audio processing device according to claim 1, characterized in that: When a variation range of the plurality of audio frequency information exceeds a tolerance value, the data processor is further configured to clear the accumulator and the counter to recalculate.
5. The audio processing device according to claim 1, characterized in that: When a variation range of the plurality of audio frequency information does not exceed a tolerance value and the number of data items is greater than a preset number of data items, the divider divides the data sum value by the number of data items to generate the operation value.
6. The audio processing device according to claim 1, characterized in that: The calculated value is the median, the arithmetic mean or the moving average.
7. The audio processing device according to claim 1, characterized in that: The frequency generator is a phase-locked loop or a direct digital synthesis device.
8. An audio processing method, characterized in that: The audio processing method comprises: Obtaining calculation values according to a plurality of audio frequency information included in a plurality of audio input packets; generating an audio sampling frequency according to the operation value and the link clock signal; and The plurality of audio input packets generate corresponding plurality of audio output packets according to the audio sampling frequency, The plurality of audio frequency information are summed up to generate a data sum value; the number of the plurality of audio frequency information is calculated to generate a data number; and the data sum value is divided by the data number to generate the operation value. When a variation range of the plurality of audio frequency information does not exceed a tolerance value and the accumulated time length is greater than a preset period, the divider divides the data sum value by the number of data items to generate the calculation value.
