The present disclosure relates to an audio data processing circuit and an audio data processing method, in particular to an audio data processing circuit and an audio data processing method that can quickly detect an audio transmission interface
There are a variety of audio transmission interfaces for digital microphones (DMIC, Digital Microphone) on the current market. Commonly audio transmission interfaces include inter-chip audio transmission (I2S, Inter-IC Sound), time division multiplexing, and other DMIC audio transmission interfaces.
Referring to
Please refer to
The I2S transmission protocol has the advantage of not requiring an audio decoder, but it can only transmit two-channel audio data at the same time. The TDM transmission protocol can connect 1 to 16 chips in series as required, but requires more pins. Therefore, when various transmission protocols have their own advantages and disadvantages, digital microphones usually have interfaces that can transmit these two protocols at the same time. Therefore, the audio processing module of the digital microphone needs to determine which transmission protocol is used for the received audio data, then determine the bit depth of the audio data and the number of channels of the I2S transmission protocol to process the audio data. However, it takes too much time to determine the bit depth and the number of channels, resulting in too slow audio processing speeds.
Therefore, it is necessary to provide an audio data processing circuit and an audio data processing method that can quickly detect the transmitted audio data protocol interface to accelerate the processing speed of the audio data.
The present disclosure provides an audio data processing circuit configured to process audio data. The audio data processing circuit includes a word select interface, a clock signal interface and an audio data interface. The word select interface is configured to receive a word select signal. The clock signal interface is configured to receive a clock signal, and generating an audio data interface signal according to a number of clocks of the clock signal in one period of the word select signal. The audio data interface is configured to transmit the audio data to a processing unit through a first transmission protocol or a second transmission protocol.
Preferably, the audio data processing circuit includes a counter, a first logic unit, and a second logic unit. The counter is configured to count the number of clocks of the clock signal. The first logic unit is configured to generate the audio data interface signal according to the word select signal and a channel selection signal. The second logic unit is configured to calculate the number of clocks of the clock signal in one period of the word select signal.
Preferably, a bit depth of the audio data is 32 bits.
Preferably, the first transmission protocol is an inter-IC sound protocol, and the second transmission protocol is a time division multiplexing protocol.
Preferably, when the number of clocks in one period of the word select signal is more than 64 clock signals, the audio data is transmitted to the processing unit through the second transmission protocol.
The present disclosure also provides an audio data processing method including steps one to four. step 1: detecting a word select signal in an audio data; step 2: determining whether a period of the word select signal is 64 clock signals and going to step 3 if the period of the word select signal is 64 clock signals, else going to step 4; step 3: sending the audio data to the processing unit through a first transmission protocol; and step 4: sending the audio data to the processing unit through a second transmission protocol.
Preferably, a bit depth of the audio data is 32 bits.
Preferably, the step 2 further includes calculating the number of clocks of a clock signal in one period of the word select signal by a counter of the processing unit, and determining whether the number of clocks in one period of the word select signal is 64 clock signals.
Preferably, the step 2 further includes: generating an audio data interface signal according to a channel selection signal and the word select signal by a first logic unit of the processing unit and transmitting the audio data to the processing unit through the first transmission protocol or the second transmission protocol according to the audio data interface signal.
Preferably, the step 2 includes determining a number of channels of the audio data according to the period of the word select signal by a second logic unit of the processing unit.
With the audio data processing circuit and audio processing method of the present disclosure, a simple circuit can be configured to process audio data received by two transmission protocols of I2S and TDM, and to quickly determine the transmission protocol interface and channel number of the audio data, to transmit the audio data to the corresponding audio chip to process the audio data.
In order to make the above and other objectives, features, and advantages of the present disclosure more obvious and understandable, the following will specifically enumerate the preferred embodiments of the present disclosure, together with the accompanying figures, and describe in detail as follows. Furthermore, the directional terms mentioned in the present disclosure, such as up, down, top, bottom, front, back, left, right, inside, outside, side, surrounding, center, horizontal, horizontal, vertical, vertical, axial, the radial direction, the uppermost layer or the lowermost layer, etc., are only the direction of reference to the attached figures. Therefore, the directional terms are used to describe and understand the present disclosure, rather than to limit the present disclosure.
Please refer to the schematic diagram of the I2S transmission circuit in
Please also refer to
In the audio data processing circuit 10 of the present disclosure, the counter 112 is configured to calculate the number of clock signals SCK transmitted by the clock signal interface 104 in the period of a word select signal transmitted by the word select interface 108 (i.e. the WS signal in
The feature of the audio data processing circuit of the present disclosure is that the processing unit 20 presets the bit depth of the audio data as 32 bits, because the counter 112 counts the number of clock signals. The second logic unit 124 determines the number of channels according to the number of clock signals. When the number of clock signals is 64, the number of channels is 1 to 2. When the number of clock signals is 128, the number of channels is 3 to 4. When the number of clock signals is 256, the number of channels is 5 to 8. When the number of clock signals is 512, the number of channels is 9 to 16. Since only TDM audio chips can connect more than 3 audio chips in series, when the number of channels exceeds 2, it means that the audio data is transmitted by the TDM transmission interface. When the number of channels is 2, the audio data may be transmitted by the I2S transmission interface or the TDM transmission interface. However, for the audio processing module of the prior art, it is only necessary to switch the polarity of the channel selection interface 102, and the audio data processing circuit 10 can process the audio data transmitted through the I2S transmission interface and TDM transmission interface. In detail, when the processing unit 20 processes the audio data by the audio data processing circuit 10 through the I2S transmission interface, the channel selection interfaces 102 in the two audio data processing circuits 10 are respectively connected to a high electrical potential (LR=1) and low electrical potential (LR=0). When the processing unit 20 processes the audio data processed by the audio data processing circuit 10 through the TDM transmission interface, the channel selection interfaces 10 in all the audio data processing circuits 10 are connected to the high electrical potential (LR=1 or CONFIG=1). In the preferred embodiment of the present disclosure, regardless of whether the audio data processing circuit 10 processes the audio data transmitted through the I2S transmission interface or the TDM transmission interface, the channel selection interface 10 is essentially the same pin, when the audio data processing unit 20 processes the audio data transmitted through the I2S transmission interface, the channel selection interface is regarded as the LR pin of the I2S audio chip. when the audio data processing unit 20 processes the audio data transmitted through the TDM transmission interface, the channel selection interface is regarded as the CONFIG pin of the TDM audio chip. A pulse interval between the word select signal of the audio data circuit of current level and the word select signal of the next level of audio data circuit (such as the first-level word select signal WS and the second-level word select signal WS(2)) is 32T (i.e. 32 clock signals SCK).
Step S112: determining whether the electrical potential of the channel selection interface 102 is logic 1 (i.e., high potential). When the channel selection interface 102 is at the high electrical potential (LR=1), it means that the audio data is the right channel of the I2S audio transmission interface or transmitted by 1 to 2 TDM audio chips. When the channel selection interface 102 is at the low electrical potential (LR=0), it means that the audio data is the left channel of the I2S audio transmission interface.
Step S106: detecting whether the period of the word select signal WS is 128 clock signals SCK, that is, detecting the number of clock signals SCK in the time required for the word select signal WS to complete the cycle of high electrical potential and the low electrical potential is 128 clock signals? If yes, it means that the audio data is transmitted through 3 to 4 TDM audio chips, so performing step S206 to process 3-4 channels of TDM audio data. If not, performing step S108.
Step S108 detecting whether the cycle of the word select signal WS is 256 clock signals SCK, that is, detecting the number of clock signals SCK in the time required for the word select signal WS to complete the cycle of the high electrical potential and the low electrical potential is 64 clock signals? If yes, it means that the audio data is transmitted through 5 to 8 TDM audio chips, then performing step S208 to process 5-8 channels of TDM audio data. If not, performing step S110.
Step S110, detecting whether the cycle of the word select signal WS is 512 clock signals SCK, that is, the number of clock signals SCK in the time required for the word select signal WS to complete the cycle of the high electrical potential and the low electrical potential is 64 clocks? If yes, it means that the audio data is transmitted through 9 to 16 TDM audio chips, so performing step S210 to process 9-16 channels of TDM audio data.
By the audio data processing circuit and audio data processing method of the present disclosure, no additional pins and settings are required. Simply change the polarity of the channel selection interface to make the audio data processing circuit and audio data processing method of the present disclosure can process the audio data of the I2S audio transmission interface and the TDM audio transmission interface, so as to reduce the circuit production cost required by the audio data processing circuit, and at the same time improve the efficiency of the audio data processing method.
Although the present disclosure has been disclosed in preferred embodiments, it is not intended to limit the present disclosure. Anyone who is familiar with the art can make various changes and modifications without departing from the spirit and scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to those defined by the scope of the attached claims.
Number | Date | Country | Kind |
---|---|---|---|
108144519 | Dec 2019 | TW | national |