Sample frequency automatic detector and detection method in the audio digital to analog converter
(1) technical field
The present invention relates to audio frequency digital-to-analogue conversion (DAC) field, refer in particular to sample frequency automatic detector and method in a kind of audio digital to analog converter.
(2) background technology
∑-Δ data conversion technique is a technology that is widely used in the digital-to-analogue conversion of high accuracy audio frequency.The product typical structure of audio digital to analog converter DAC that utilizes ∑-Δ data conversion technique is referring to Fig. 1, audio digital to analog converter is on a silicone tube chip 100, mainly by forming: chip status machine CSM10 with lower module, the audio frequency serial port (meets SDATA, SCLK, the LRCK pin) 1, Serial Control port one 2, volume control unit 2,6, postemphasis/interpolation filter 3,7, multidigit ∑-Δ adjuster DSM and dynamic element matching unit DEM4,8, output amplification low pass device (meets output AOUTL, the AOUTR pin) 5,9, switch (connecing the PDNn pin) 14, null detector/noise reduction controller (connecing the MUTE pin) 13, reference voltage, current generator 15 and timer manager (connecing the CLKIN pin) 11.Wherein:
Chip status machine CSM10: the switching programme of controlling the normal and two kinds of mode switch of power saving of chip.
Audio frequency serial port 1: receive the serial audio signal of many forms from the SDATA/SCLK/LRCK pin, receive serial data and be converted into parallel form from the SDATA pin.
Serial Control port one 2: various mode of operations are set from SDM1/SPI_CLK/SCL, SDM0/SPI_DIN/SDA, DEM0/SPI_CSn/ADR0 pin.
Volume control unit 2,6: the voice data of the enough a kind of controlled manner decay inputs of energy.
Postemphasis/interpolation filter 3,7, multidigit ∑-Δ adjuster DSM and dynamic element matching unit DEM4,8: is the input data conversion of high-resolution (representative value is 16 to 24), low sample frequency (representative value is that 8KHz is to 200KHz) digital signal of low resolution (representative value is 1 to 6), high sample frequency (representative value is 32 to 128 times of incoming frequency).
Output amplification low pass device 5,9: the digital signal of above-mentioned low resolution, high sample frequency is converted into analog signal.
At present, most of digital to analog converter need be handled the velocity mode of 3 kinds of sample frequencys: single doubly fast SS (Single Speed), and sample frequency is from 0KHz to 50KHz; Double-speed DS (Double Speed), sample frequency is from 50KHz to 100KHz; Four times of fast QS (Quad Speed), sample frequency is from 100KHz to 200KHz.Therefore, DAC needs to differentiate the user and need use which kind of mode of operation.
In general, present commercial DAC adopts two kinds of methods to determine mode of operation.The one, come the setting speed pattern with dedicated pin, shortcoming be need be bigger encapsulation, thereby increased production cost.Another kind method is to write DAC by microcontroller to come the setting speed pattern, and this mode is owing to needing the user to set up the interface of microcontroller and DAC, so also increased production cost.
(3) summary of the invention
The objective of the invention is in order to solve the problem that above-mentioned prior art exists, propose sample frequency automatic detector and method in the audio digital to analog converter of the used sample frequency mode of operation of the low differentiation user of a kind of production cost.
The object of the present invention is achieved like this:
Sample frequency automatic detector in a kind of audio digital to analog converter, described audio digital to analog converter is on a silicone tube chip, mainly by forming: chip status machine CSM with lower module, meet SDATA, SCLK, the audio frequency serial port of LRCK pin, the Serial Control port, volume control unit postemphasises/interpolation filter, multidigit ∑-Δ adjuster DSM and dynamic element matching unit DEM, output amplification low pass device, switch, null detector/noise reduction controller, reference voltage, current generator and the timer manager that connects the CLKIN pin is characterized in that the structure of described sample frequency automatic detector is:
On the silicone tube chip of described audio digital to analog converter, the output that connects the timer manager of CLKIN pin is external to a frequency;
Described frequency is connected with an external voltage comparator;
Described voltage comparator is to link to each other with reference voltage, current generator on the described silicone tube chip, and described voltage comparator is judged the reference voltage of the output voltage of frequency and reference voltage, current generator after relatively the height of frequency;
The result that described voltage comparator will be judged delivers to the chip status machine CSM on the described silicone tube chip;
Described chip status machine CSM writes down the judged result of described voltage comparator, and controls the divide ratio of described timer manager.
A kind of sample frequency automatic testing method that utilizes the sample frequency automatic detector in the above-mentioned audio digital to analog converter, its feature comprises:
Step 1, the divide ratio that chip status machine CSM sets timer manager is 2n, and wherein n is a fixing constant, and making CLKIN produce sample frequency through timer manager is CLKIN/2n, and frequency is a voltage with this frequency translation;
Step 2, by voltage comparator to the reference voltage of the output voltage of frequency and reference voltage, current generator relatively after, judgement CLKIN is higher than or is lower than frequency f 1, f1=256 * 50KHz/ (1-d%), and wherein d% is the value that influenced by PVT;
Step 3, chip status machine CSM writes down the judged result of above-mentioned CLKIN for frequency f 1;
Step 4, the divide ratio that chip status machine CSM sets timer manager is 3n, and is identical with above-mentioned judgement flow process, continues to judge the frequency of CLKIN this moment;
Step 5 judges that by voltage comparator CLKIN is higher than or is lower than frequency f 2, f2=384 * 50KHz/ (1-d%), and wherein d% is the value that influenced by PVT;
Step 6, chip status machine CSM writes down the judged result of above-mentioned CLKIN for frequency f 2;
Step 7, the divide ratio that chip status machine CSM sets timer manager is 4n, and is identical with above-mentioned judgement flow process, continues to judge the frequency of CLKIN this moment;
Step 8 judges that by voltage comparator CLKIN is higher than or is lower than frequency f 3, f3=256 * 100KHz/ (1-d%), and wherein d% is the value that influenced by PVT;
Step 9, chip status machine CSM writes down the judged result of above-mentioned CLKIN for frequency f 3;
Step 10, according to the value of CLKIN on the silicone tube chip and LRCK, obtaining the CLKIN/LRCK ratio by the automatic test of timer manager is 128, or 192, or 256, or 384, or 512;
Step 11, according to following table, at this moment, it is single doubly fast SS that chip status machine CSM just judges the used sample frequency mode of operation of user, or double-speed DS, or four times of fast QS:
Table
。
Effect of the present invention:
Audio digital to analog converter and the method that has automatic detection sample frequency of the present invention, needn't set the velocity mode of sample frequency with dedicated pin, also needn't write DAC and come the setting speed pattern by microcontroller, but adopt the method that detects sample frequency automatically to differentiate the used mode of operation of user, reduced the manufacturing cost of audio digital to analog converter product.
For further specifying above-mentioned purpose of the present invention, design feature and effect, the present invention is described in detail below with reference to accompanying drawing.
(4) description of drawings
Fig. 1 is the structural representation of audio digital to analog converter DAC product;
Fig. 2 is for determining the frequency of the different required measurements of velocity mode:
2 (a) are 128,256,512 o'clock for the CLKIN/LRCK ratio,
2 (b) are 192,384 o'clock for the CLKIN/LRCK ratio;
Fig. 3 is for considering PVT and change and during typical audio detection value, the frequency configuration of analog frequency detector:
3 (a) are 128,256,512 o'clock for the CLKIN/LRCK ratio,
3 (b) are 192,384 o'clock for the CLKIN/LRCK ratio;
Fig. 4 is the structure calcspar of sample frequency automatic detector of the present invention.
(5) embodiment
Below in conjunction with accompanying drawing, sample frequency automatic detector and method in the audio digital to analog converter of the present invention are elaborated.
Under the voice applications environment, CLKIN/LRCK ratio in the audio digital to analog converter is (referring to the pin of audio frequency serial port 1 among Fig. 1 and timer manager 11) fixed, the CLKIN/LRCK ratio is tested automatically by timer manager 11 and is obtained the CLKIN/LRCK ratio in the audio digital to analog converter and the relation such as the table one of velocity mode:
Table one
As shown in Table 1, after the CLKIN/LRCK rate value is learnt, facilitate the measuring speed pattern that is used for.For example, if the ratio of CLKIN/LRCK is 128 o'clock, velocity mode is double-speed (DS) or four times of speed (QS), actually or so in order to determine four times of fast mode of operations of double-speed, we only need to measure differentiate CLKIN be greater than or less than 128 * 100KHz=12.8MHz.The principle of differentiating is as follows:
Above-mentioned: single doubly fast sample frequency: from 0KHz to 50KHz
The double-speed sample frequency: 50KHz is to 100KHz
Four times of fast sample frequencys: from 100KHz to 200KHz
At this moment, when the CLKIN/LRCK ratio is 128, shown in the described table one, or be the double-speed sample frequency, be four times of fast sample frequencys, and learn with the scope of sample frequency according to above-mentioned doubly speed, if at this moment measuring CLKIN is greater than 12.8MHz, illustrate that sample frequency surpasses 100KHz, then be four times of fast mode of operations, if less than 12.8MHz, sample frequency is described below 100KHz, then be the double-speed mode of operation.
Fig. 2 is complete has listed the frequency of determining the different required measurements of velocity mode, and 2 (a) are 128,256,512 o'clock for the CLKIN/LRCK ratio; 2 (b) are 192,384 o'clock for the CLKIN/LRCK ratio.
The detection of described sample frequency is finished in the simulation part with current source, resistance, electric capacity and switch, because the variation of PVT (technology, voltage and temperature) can not measure single-frequency.For example, if we come measuring frequency fo by the setpoint frequency detector, suppose to be subjected to PVT to influence to be+/-d%, the analog frequency detector can only measure the frequency that is lower than fo (1-d%) or is higher than fo (1+d%) so, and be in frequency between fo (1-d%) and the fo (1+d%) measure owing to PVT changes less than.
Under the voice applications environment, 48KHz, 96KHz and 192KHz are typical sample frequencys.Therefore, frequency detector can find that these three frequencies are very important.
Fig. 3 is considering that PVT changes and during typical audio detection value, the frequency configuration of analog frequency detector, and 2 (a) are 128,256,512 o'clock for the CLKIN/LRCK ratio; 2 (b) are 192,384 o'clock for the CLKIN/LRCK ratio.
In the present embodiment, the value d% of above-mentioned PVT influence is set as representative value 25%.
Described sample frequency automatic detector need detect three frequencies: please take off
f1=256×50KHz/(1-d%)
f2=384×50KHz/(1-d%)
f3=256×100KHz/(1-d%)
When d%=25%, f1=17MHz, f2=25.6MHz and f3=34MHz, as shown in Figure 3:
Frequency detector need be made three judgements:
CLKIN is higher than or is lower than f1
CLKIN is higher than or is lower than f2
CLKIN is higher than or is lower than f3
When the testing result of knowing the sample frequency automatic detector, according to the ratio of known CLKIN/LRCK, the velocity mode of sample frequency can be determined by table two again:
Table two
Frequency detector is made this three judgements, and two kinds of methods are arranged: the one, and the clock of a fixed frequency of needs, the reference voltage different with three are relatively; The the 2nd an and fixing reference voltage compared, but needs the clock of three kinds of different frequencies.Back one method only needs voltage comparator and a reference voltage to compare, thereby more accurate, and area is littler, has advantage in realization.Fig. 4 is the enforcement illustration of back one method, that is, Fig. 4 is the structure calcspar of sample frequency automatic detector of the present invention.
The structure of sample frequency automatic detector of the present invention is:
On the silicone tube chip 100 of existing audio digital to analog converter (shown in Figure 1), the output that connects the timer manager 10 of CLKIN pin is external to a frequency 16; Frequency 16 is connected with an external voltage comparator 17; Voltage comparator 17 links to each other with reference voltage, current generator 15 on the silicone tube chip 100 again, and described voltage comparator 17 is judged the reference voltage of the output voltage of frequency 16 and reference voltage, current generator 15 after relatively the height of frequency; The result that voltage comparator 17 will be judged delivers to the chip status machine CSM10 on the silicone tube chip 100; The judged result of chip status machine CSM10 recording voltage comparator 17, and the divide ratio of control timer manager.
Because the ratio of f1, f2 and f3 is fixed, be f1: f2: f3=2: 3: 4, therefore we can be easily to the CLKIN frequency division, so that incoming frequency is (just comparator reference voltage is fixed) of fixing with respect to frequency detector, but still can make the judgement of identical three frequency ranges.
The order of sample frequency automatic detector determination frequency scope of the present invention is as follows:
1, the divide ratio of chip status machine CSM10 setting timer manager 11 is 2n, and wherein n is a fixing constant, and making CLKIN produce sample frequencys through timer manager 10 is CLKIN/2n, and frequency 16 is a voltage with this frequency translation.
2, relatively judge that CLKIN is higher than or is lower than f1 in the back by the reference voltage of the output voltage of 17 pairs of frequency 16 of voltage comparator and reference voltage, current generator 15, f1=256 * 50KHz/ (1-d%), wherein d% is the value that influenced by PVT.
3, chip status machine CSM10 writes down the judged result of above-mentioned CLKIN for f1.
4, the divide ratio of chip status machine CSM10 setting timer manager 11 is 3n, and is identical with above-mentioned judgement flow process, continues to judge the frequency of CLKIN this moment.
5, judge that by voltage comparator 17 CLKIN are higher than or are lower than f2, f2=384 * 50KHz/ (1-d%), wherein d% is the value that influenced by PVT.
6, chip status machine CSM10 writes down the judged result of above-mentioned CLKIN for f2.
7, the divide ratio of chip status machine CSM10 setting timer manager 11 is 4n, and is identical with above-mentioned judgement flow process, continues to judge the frequency of CLKIN this moment.
8, judge that by voltage comparator 17 CLKIN are higher than or are lower than f3, f3=256 * 100KHz/ (1-d%), wherein d% is the value that influenced by PVT.
9, chip status machine CSM10 writes down the judged result of above-mentioned CLKIN for f3.
10, according to the value of CLKIN on the silicone tube chip 100 and LRCK, obtaining the CLKIN/LRCK ratio by timer manager 11 automatic tests is 128, or 192, or 256, or 384, or 512.
11, according to top table two, this moment, chip status machine CSM10 was single doubly fast SS with regard to judging the used mode of operation of user, or double-speed DS, or four times of fast QS.
Those of ordinary skill in the art will be appreciated that, above embodiment is used for illustrating the present invention, and be not to be used as limitation of the invention, as long as in connotation scope of the present invention, all will drop in the scope of claims of the present invention variation, the modification of the above embodiment.