Earphone impedance detection circuit and method

By combining a current-to-voltage module and an analog-to-digital converter, high-precision detection of headphone impedance is achieved, solving the problems of click noise and inaccurate impedance calibration, and achieving efficient and accurate detection results.

CN121933808APending Publication Date: 2026-04-28SHENZHEN SHENJU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN SHENJU TECH CO LTD
Filing Date
2026-01-04
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies are prone to clicking noise when testing headphone impedance and have difficulty accurately detecting the impedance difference between 16 ohms and 32 ohms, leading to inaccurate calibration.

Method used

The current-to-voltage module is used to replicate the output current of the LDO, and the detection voltage is obtained through an analog-to-digital converter and converted into a digital code value. Combined with an adjustable resistor and an operational amplifier, high-precision detection of the headphone speaker impedance is achieved.

Benefits of technology

It achieves high-precision detection of headphone impedance, avoids clicking noise, and can be accurately calibrated within the range of 16 ohms to 32 ohms, with detection accuracy controlled within ±5%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121933808A_ABST
    Figure CN121933808A_ABST
Patent Text Reader

Abstract

The invention discloses an earphone impedance detection circuit and method, and relates to the technical field of earphones. The circuit comprises an LDO, wherein the input end of the LDO is connected with an input power supply; the power supply end of the digital-to-analog converter is electrically connected with the output end of the LDO, and the digital-to-analog converter is used for acquiring a digital audio signal and converting the digital audio signal into an analog audio signal; the power supply end of the audio power amplifier is electrically connected with the output end of the LDO, and the audio power amplifier is used for performing power amplification on the analog audio signal so as to drive the earphone loudspeaker to make a sound; the current-to-voltage conversion module is used for copying the output current of the LDO to obtain detection current and converting the detection current into detection voltage; and the analog-to-digital converter is used for obtaining the detection voltage and converting the detection voltage into a digital code value, so that the processor obtains the impedance of the earphone loudspeaker according to the digital code value. The circuit can accurately detect the impedance of the earphone.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of headphone testing technology, and in particular to a headphone impedance detection circuit and method. Background Technology

[0002] Bluetooth headsets have become a frequently used electronic product for most people, with a vast consumer market. To meet consumer demand for a better headset experience and keep pace with technological advancements, headset products are constantly being iterated and innovated. Because the digital-to-analog converter chip in the audio output unit is designed for low noise to reduce signal path resistance, there is a significant difference in calibration values ​​between 16 ohms and 32 ohms during the final test (FT) calibration. If a customer switches to a headset with a different impedance, the production line needs a mechanism to detect the impedance of the existing headset and issue warnings if it does not conform to the default values.

[0003] To achieve a low-noise design, the internal resistance of the audio power amplifier was reduced. This resistor is connected in series with the headphone speaker impedance RL to divide the voltage. As a result, the output voltage of the audio power amplifier differs significantly when RL=16ohm or 32ohm. We want to meet the requirements with a single calibration between 16ohm and 32ohm, so there are requirements for the impedance of the headphones. The impedance is not too high or too low.

[0004] Currently, any electrical characteristic measurement performed directly on the headphone port on the device will inevitably introduce pop-click noise (PCN) problems. Therefore, appropriate and accurate methods must be used to detect the headphone impedance. Summary of the Invention

[0005] This invention aims to at least solve one of the technical problems existing in the prior art. To this end, this invention proposes a headphone impedance detection circuit and method, which can accurately detect the magnitude of headphone impedance and avoid causing clicking noise problems.

[0006] In a first aspect, the headphone impedance detection circuit according to an embodiment of the present invention includes: LDO, the input terminal of which is connected to the input power supply; A digital-to-analog converter (DAC) is provided, wherein the power supply terminal of the DAC is electrically connected to the output terminal of the LDO, and the DAC is used to acquire digital audio signals and convert the digital audio signals into analog audio signals. An audio power amplifier, wherein the power supply terminal of the audio power amplifier is electrically connected to the output terminal of the LDO, and the input terminal of the audio power amplifier is electrically connected to the output terminal of the digital-to-analog converter, and the audio power amplifier is used to amplify the analog audio signal to drive the headphone speaker to emit sound; A current-to-voltage module is used to replicate the output current of the LDO, obtain the detection current, and convert the detection current into a detection voltage; An analog-to-digital converter is used to acquire the detected voltage and convert the detected voltage into a digital code value, so that the processor can obtain the impedance of the headphone speaker based on the digital code value.

[0007] According to some embodiments of the present invention, the current-to-voltage module includes: A mirror MOSFET, wherein the source of the mirror MOSFET is electrically connected to the input power supply, and the gate of the mirror MOSFET is electrically connected to the gate of the power MOSFET of the LDO; An operational amplifier, wherein the inverting input terminal of the operational amplifier is electrically connected to the drain of the mirror MOS transistor, and the non-inverting input terminal of the operational amplifier is electrically connected to the output terminal of the LDO; An adjustable resistor is provided, one end of which is electrically connected to the inverting input terminal of the operational amplifier, and the other end of which is electrically connected to the output terminal of the operational amplifier. The output terminal of the operational amplifier is also electrically connected to the input terminal of the analog-to-digital converter.

[0008] According to some embodiments of the present invention, the LDO includes: An error amplifier, wherein the inverting input of the error amplifier is connected to a reference voltage; A power MOSFET, the gate of which is electrically connected to the output terminal of the error amplifier; The feedback module has one end electrically connected to the drain of the power MOSFET and the other end electrically connected to the non-inverting input of the error amplifier.

[0009] According to some embodiments of the present invention, the output voltage of the operational amplifier is: ; in, The output voltage of the operational amplifier is... IAVCC is the output voltage of the LDO, IAVCC is the output current of the LDO, and N is the W / L ratio of the power MOSFET and the mirror MOSFET. The value of the adjustable resistor is given.

[0010] According to some embodiments of the present invention, The value of / N makes The value satisfies the range of the analog-to-digital converter and ensures that the impedance detection accuracy of the headphone speaker meets the preset value.

[0011] According to some embodiments of the present invention, the adjustable range of the adjustable resistor is 32kΩ~44kΩ, and the adjustment accuracy is set to be adjustable in 2 positions with an interval of 4kΩ.

[0012] According to some embodiments of the present invention, when the loop between the inverting input and the feedback terminal of the operational amplifier is broken, and a small AC test signal is applied at the point of loop breakage, the voltage at the inverting input of the operational amplifier is expressed as follows: Then the output voltage of the operational amplifier is The loop gain of the current-to-voltage module is: The transfer function of the loop gain is: ; in, The voltage of the small AC test signal. The value of the small-signal equivalent resistance of the mirror MOS transistor is given. The resistance value of the adjustable resistor is given. Let s be the open-loop gain of the current-to-voltage module, and s be the complex frequency variable. This refers to the parasitic capacitance at the inverting input terminal of the operational amplifier. (s) is the transfer function of the operational amplifier; in addition to having two left-half-plane poles and one right-half-plane zero inside the operational amplifier, the current-to-voltage module also has a left-half-plane pole p3 at the inverting input of the operational amplifier, the expression of which is: .

[0013] Secondly, according to an embodiment of the present invention, a headphone impedance detection method based on the headphone impedance detection circuit described in the first aspect embodiment includes the following steps: The output current of the LDO is copied by a current-to-voltage module to obtain the detection current, and the detection current is converted into a detection voltage. The detection voltage is obtained by an analog-to-digital converter and converted into a digital code value; The impedance of the headphone speaker is calculated based on the digital code value.

[0014] According to some embodiments of the present invention, calculating the impedance of the headphone speaker based on the digital code value includes: Replace the headphone speaker with the first resistor to obtain the first digital code value of the analog-to-digital converter; The headphone speaker is replaced with a second resistor to obtain the second digital code value of the analog-to-digital converter; the resistance values ​​of the first resistor and the second resistor are different. Based on the resistance values ​​of the first resistor and the second resistor, the first digital code value and the second digital code value, the correspondence between the digital code value of the analog-to-digital converter and the impedance of the headphone speaker is determined; The impedance of the headphone speaker is calculated based on the correspondence and the digital code value.

[0015] According to some embodiments of the present invention, determining the correspondence between the digital code value of the analog-to-digital converter and the impedance of the headphone speaker based on the resistance values ​​of the first resistor and the second resistor, the first digital code value, and the second digital code value includes: Based on the resistance values ​​of the first resistor and the second resistor, and the first digital code value and the second digital code value, the following two equations are obtained: ; ; in, Here, K and b represent the base currents in the paths containing the digital-to-analog converter and the audio power amplifier, respectively, and are constants. R1 is the voltage value at the output terminal of the audio power amplifier, R2 is the resistance value of the first resistor, D1 is the first digital code value, and D2 is the second digital code value. Based on the two equations above, calculate The value of *K+b; according to The value of *K+b determines the correspondence between the digital code value of the analog-to-digital converter and the impedance of the headphone speaker as follows: ; Wherein, Rx is the impedance of the headphone speaker, and Dx is the digital code value.

[0016] The headphone impedance detection circuit and method according to embodiments of the present invention have at least the following advantages: The output current of the LDO is copied by a current-to-voltage module, then converted into a voltage signal, and the voltage signal is converted into a digital code value by an analog-to-digital converter. The headphone resistance is then calculated based on the conversion relationship between the digital code value and impedance. This circuit can achieve high-precision detection of headphone resistance in a simple and efficient manner, avoiding the clicking noise caused by directly measuring the headphone port.

[0017] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0018] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is a circuit diagram of the headphone impedance detection circuit according to an embodiment of the present invention; Figure 2 This is a circuit diagram of an earphone impedance detection circuit according to another embodiment of the present invention; Figure 3 This is a flowchart illustrating the steps of the headphone impedance detection method according to an embodiment of the present invention; Figure 4 for Figure 3 The flowchart showing the specific steps of step S300 is shown. Detailed Implementation

[0019] The embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0020] The embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0021] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.

[0022] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0023] In this invention, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0024] Bluetooth headsets have become a frequently used electronic product for most people, with a vast consumer market. To meet consumer demand for a better headset experience and keep pace with technological advancements, headset products are constantly being iterated and innovated. Because the digital-to-analog converter chip in the audio output unit is designed for low noise to reduce signal path resistance, there is a significant difference in calibration values ​​between 16 ohms and 32 ohms during the final test (FT) calibration. If a customer switches to a headset with a different impedance, the production line needs a mechanism to detect the impedance of the existing headset and issue warnings if it does not conform to the default values.

[0025] To achieve a low-noise design, the internal resistance of the audio power amplifier was reduced. This resistor is connected in series with the headphone speaker impedance RL to divide the voltage. As a result, the output voltage of the audio power amplifier differs significantly when RL=16ohm or 32ohm. We want to meet the requirements with a single calibration between 16ohm and 32ohm, so there are requirements for the impedance of the headphones. The impedance is not too high or too low.

[0026] Currently, any electrical characteristic measurement performed directly on the headphone port on the device will inevitably introduce pop-click noise (PCN) problems. Therefore, appropriate and accurate methods must be used to detect the headphone impedance.

[0027] Currently, there are two main methods for testing headphone impedance: 1. By providing a reference voltage VREF and a reference resistor RS, VREF is applied to one end of RS, and the other end of RS is connected to the headphone impedance, forming a voltage divider circuit. An analog-to-digital converter (ADC) is then used to sample the voltage drop across the headphone impedance to calculate the headphone resistance. 2. An ADC is used to directly sample the voltage drop across the headphone impedance, and then digital signal processing is performed to obtain the resistance value. Method 2 requires a 40kHz sine wave as input, while Method 1 requires a DC reference voltage VREF.

[0028] This application differs significantly from the two methods mentioned above for headphone impedance detection. Instead of directly sampling the headphone voltage drop through an analog-to-digital converter and processing the digital signal to obtain a code value, it innovates upon the existing chip system by detecting changes in headphone resistance through current detection. This current is then converted to voltage, and the resistance value is calculated from the code value output by the analog-to-digital converter. While the two methods mentioned above both use voltage detection, this application uses current detection. Furthermore, by simply adding a current-to-voltage module to the existing system, headphone impedance detection can be achieved in a simple and efficient indirect manner.

[0029] The headphone impedance detection circuit and method of the present invention will be described in detail below with reference to the accompanying drawings.

[0030] On one hand, embodiments of the present invention propose an earphone impedance detection circuit, such as... Figure 1 As shown, the circuit includes: an LDO100, a digital-to-analog converter (DAC) 200, an audio power amplifier (APA) 300, a current-to-voltage module 400, and an analog-to-digital converter (ADC) 500. The input of the LDO100 is connected to the input power supply VBAT, and its output is electrically connected to the power supplies of the DAC 200 and the audio power amplifier 300. The DAC 200 acquires digital audio signals and converts them into analog audio signals. The input of the audio power amplifier 300 is electrically connected to the output of the DAC 200, and it amplifies the analog audio signals to drive the headphone speaker SPK1 to produce sound. The current-to-voltage module 400 replicates the output current of the LDO100 to obtain a detection current and converts it into a detection voltage. The ADC 500 acquires the detection voltage and converts it into a digital code value to determine the impedance of the headphone speaker.

[0031] It should be noted that LDO100 refers to a Low-Dropout Regulator, which primarily provides a stable 3V operating power supply to the digital-to-analog converter 200 and the audio power amplifier 300. The digital-to-analog converter 200 and the audio power amplifier 300 constitute the headphone's audio output unit, generating a fixed DC bias voltage and an AC signal containing audio information to the headphone speaker SPK1, enabling SPK1 to produce pleasant sound. The LDO100 and the analog-to-digital converter 500 constitute a traditional headphone power management unit (PMU). While the PMU's battery voltage VBAT is typically converted to a digital signal, in this application, it is multiplexed to convert the voltage Vsen to a digital code value. The current-to-voltage module 400 converts the detected current signal into a voltage signal, which the analog-to-digital converter 500 then converts into a digital code value. Finally, the processor determines the impedance of the headphone speaker SPK1 based on the digital code value.

[0032] Furthermore, in some embodiments of this application, the current-to-voltage module 400 includes a mirror MOSFET Mpr, an operational amplifier OP2, and an adjustable resistor Rsen. The source of the mirror MOSFET Mpr is electrically connected to the input power supply VBAT, the gate of the mirror MOSFET Mpr is electrically connected to the gate of the power MOSFET Mp of the LDO100, the drain of the mirror MOSFET Mpr is electrically connected to the inverting input terminal of the operational amplifier OP2, and the non-inverting input terminal of the operational amplifier OP2 is electrically connected to the output terminal of the LDO100. One end of the adjustable resistor Rsen is electrically connected to the inverting input terminal of the operational amplifier OP2, and the other end of the adjustable resistor Rsen is electrically connected to the output terminal of the operational amplifier OP2. The output terminal of the operational amplifier OP2 is also electrically connected to the analog-to-digital converter 500.

[0033] In this example, the mirror MOSFET Mpr forms a current mirror for replicating the current of the power MOSFET Mp, with a replication ratio of N:1. The current-to-voltage module 400 converts the detected current signal into a voltage signal. The conversion to a voltage signal uses a trans-impedance amplifier (TIA) structure. Compared to directly sampling the voltage by applying the current to a fixed resistor, the TIA loop ensures that the drain voltages of the power MOSFET Mp and the mirror MOSFET Mpr are precisely consistent, reducing channel length modulation effects.

[0034] from Figure 1As can be seen, when the impedance RL of the headphone speaker SPK1 changes, the output current IAVCC of LDO100 changes, which in turn changes the current flowing through the power MOSFET Mp. The mirror MOSFET Mpr replicates the current of the power MOSFET Mp at a ratio of N:1, so the current Isense of the mirror MOSFET Mpr also changes. Combined with the adjustable resistor Rsen, this is converted into a voltage Vsen, and finally, the analog-to-digital converter 500 converts the voltage Vsen into a code value for output. It should be noted that the current-to-voltage module 400 is a module added to the original headphone circuit in this application, while the remaining parts (LDO100, digital-to-analog converter 200, audio power amplifier 300, and analog-to-digital converter 500) are original modules in the headphone circuit. This application reuses the original functions of each module, making the entire circuit simple and efficient.

[0035] like Figure 1 As shown, in some embodiments of this application, the LDO100 includes an error amplifier OP1, a power MOSFET Mp, and a feedback module. The inverting input of the error amplifier OP1 is connected to a reference voltage, and the gate of the power MOSFET Mp is electrically connected to the output of the error amplifier OP1. One end of the feedback module is electrically connected to the drain of the power MOSFET Mp, and the other end is electrically connected to the non-inverting input of the error amplifier OP1. The feedback module includes resistors Rf1 and Rf2, which form a voltage divider circuit. This circuit is used to acquire the output voltage of the error amplifier OP1, divide the output voltage of OP1, and output it to the non-inverting input of the error amplifier OP1. The voltage is compared with the reference voltage, and the switching process of the power MOSFET Mp is controlled based on the comparison result to stabilize the output voltage of the LDO100.

[0036] Since the LDO100, digital-to-analog converter 200, audio power amplifier 300 and analog-to-digital converter 400 all use relatively mature circuits, the circuits of these modules will not be described in detail here. The main focus is on the working principle of the current-to-voltage module 400.

[0037] Reference Figure 1 The formula for calculating Vsen satisfies: (1) in, This is the output voltage of operational amplifier OP2. IAVCC is the output voltage of LDO100, IAVCC is the output current of LDO100, and N is the W / L ratio of the power MOSFET Mp and the mirror MOSFET Mpr (W refers to the channel width of the MOSFET, and L refers to the channel length of the MOSFET). This is the resistance value of the adjustable resistor. More precisely, in equation (1) Should use Figure 1 V1 in the equation is different from VAVCC only by the offset voltage of operational amplifier OP2. According to the "virtual short" principle of op-amps, VAVCC can be used to replace V1. IAVCC consists of the power consumption of digital-to-analog converter 200 + audio power amplifier 300 and headphone current. The headphone current is obtained by dividing the output voltage Vo (20mV or 60mV) of audio power amplifier 300 by the headphone resistance RL. As can be seen from equation (1), the larger the headphone resistance, the smaller IAVCC will be, and the larger Vsen will be. At the same time, the larger the headphone resistance, the smaller ΔIAVCC will be as the headphone resistance changes, which will lead to a smaller ΔVsen. If ΔVsen does not meet the requirement of being greater than the least significant bit (LSB) of analog-to-digital converter 500, the ADC will not be able to distinguish the code value corresponding to Vsen.

[0038] The converted output voltage Vsen needs to be within the input range of 1.8~3.6V of the analog-to-digital converter 500; otherwise, the corresponding code value cannot be accurately read. Therefore, it is necessary to adjust the current-to-voltage conversion ratio to make Vsen as large as possible. Furthermore, the resistance detection accuracy setting in this application is no more than ±2 ohms. This means that two headphone resistors differing by 2 ohms need to be able to output their respective corresponding code values ​​by the analog-to-digital converter 500. Therefore, after conversion, it is also necessary to ensure that the corresponding Vsen interval meets the LSB of the analog-to-digital converter 500; otherwise, the analog-to-digital converter 500 will not be able to distinguish the corresponding code value. The LSB of the analog-to-digital converter 500 is 14mV.

[0039] There's a contradiction here: increasing Vsen contradicts ensuring the Vsen voltage interval meets the LSB of the 500 analog-to-digital converter. To increase Vsen, Rsen / N needs to be smaller. However, ΔVsen = ΔIAVCC * (Rsen / N), so a smaller Rsen / N results in a smaller ΔVsen, which won't meet the LSB of the 500 analog-to-digital converter. A compromise is needed, finding a suitable value. Therefore... The value of / N makes The value satisfies the range of the analog-to-digital converter 500 and ensures that the impedance detection accuracy of the headphone speaker SPK1 meets the preset value.

[0040] During circuit design simulation, Figure 1The LDO100 section uses an equivalent load resistor for simplified simulation, generating a current of 1.5mA~6mA. With VAVCC set to 3V, the load resistance of the LDO100 is 0.5kΩ~2kΩ. The power MOSFET Mp has dimensions W / L = 36u / 0.5u, and M = 240 (M indicates that the power MOSFET Mp is composed of M identical units connected in parallel). Therefore, the Mpr has dimensions W / L = 36u / 0.5u, and M = 1. This means N = 240, indicating that the ratio between the power MOSFET Mp and the mirror MOSFET Mpr is 240:1. For matching, N can only be a maximum of 240. To minimize the current drawn after replication, N needs to be larger. This is partly to reduce power consumption, and partly because the replication current flows into the output of operational amplifier OP2. OP2 is a two-stage general-purpose op-amp with Miller compensation. The first stage is a differential five-transistor OTA (Operational Transconductance Amplifier), and the second stage is a common-source amplifier with a current source load. If the current flowing into the output is large, the bias current at the op-amp output needs to be sufficiently large; otherwise, the entire TIA loop will not function properly, and the voltages at the input inverting terminal and the output will be forcibly pulled high. Therefore, N is set to 240 to maximize the reduction of the Isense current and lower power consumption. Since N is large, Rsen also needs to be large to ensure that Rsen / N is a reasonable compromise.

[0041] In addition, the mirror MOSFET Mpr will increase the parasitic capacitance at the output of the error amplifier OP1 of LDO100. Since LDO100 has an external load capacitor and its dominant pole is at the output, N should also be larger in order to prevent the phase margin of LDO100 from deteriorating.

[0042] Assuming Vsen = 2V at the maximum current of 6mA, then: (2) With Vavcc=3 and N=240, Rsen=40kΩ. When the minimum input current is 1.5mA, Vsen=3-(1.5m / 240)*40kΩ= 2.75V<3.6V. All current values, after conversion, fall within the dynamic range of the analog-to-digital converter 500.

[0043] With Vavcc = 3.3V, N = 240, and Rsen = 40kΩ, Vsen = 2.3V when the maximum input current is 6mA. When the minimum input current is 1.5mA, Vsen = 3.45V < 3.6V. All current values, after conversion, fall within the ADC's dynamic range.

[0044] Rsen needs to be adjustable, with an adjustable range of 32k~44k, and the adjustment accuracy is set to 2-bit adjustable, with an interval of 4k. This is used to calibrate the large power consumption deviation of the digital-to-analog converter 200, audio power amplifier 300, and LDO100 due to process fluctuations, as well as the current mirror mismatch of the power MOSFET Mpr current, the large offset voltage of the operational amplifier OP2, and other factors that cause a large deviation in Vsen, resulting in Vsen deviating from the input range of the ADC at the boundary.

[0045] Since the goal is to detect the headphone resistance within the required range, Vsen does not need to be ultra-precise. However, it must ensure that the voltage can be recognized by the analog-to-digital converter 500, and then the resistance can be calculated from the code value within a 2-ohm deviation range. Rsen's 2-bit calibration is sufficient, saving area on the efuse (Electronic Fuse as OTP Memory). Its calibration shifts all data in the same direction to the same degree, not just individual data points. If sufficient area is available, enough calibration bits can be designed to ensure that even with large deviations, Vsen can calibrate back to the input range of the analog-to-digital converter 500, while also improving Vsen's accuracy, and consequently, the accuracy of the measured resistance. In this application, RSEN<1:0>=0~3, and the values ​​of Rsen correspond to 32 kΩ, 36 kΩ, 40 kΩ, and 44 kΩ respectively. The typical value used in this application is 40 kΩ because to calibrate Vsen back to above 1.8V, the Rsen value needs to be reduced. To ensure sufficient margin, the typical value is chosen to be slightly higher than the calibration value. If calibration is insufficient, the IAVCC can be reduced by decreasing the output voltage Vo of the DAC+APA, thereby increasing the Vsen value. For example, the output voltage Vo of the DAC+APA can be set to 15mV.

[0046] During the design process, the following risk points also need to be considered: 1. In order not to affect the normal operation of the original PMU and AOU systems, a separate switch control module needs to be designed to control whether the current-to-voltage module 400 is working; 2. The LDO100 output has pads. Careful consideration must be given to ESD (Electro-Static Discharge) at the points where it connects to the pads. First, GGNMOS (Gate-Grounded NMOS, an N-type MOSFET with its gate grounded) and GDPMOS (Gate-Drain PMOS, a P-type MOSFET with its gate and drain shorted) or other diode-type ESD protection should be added at the pads. A 200-ohm small resistor should be added to the gsd terminal of the MOSFET connected to the pads inside the circuit. The resistor L should be relatively large, for example, L / W=5u / 2u, to prevent the MOSFET port from breaking down the internal PN junction due to excessive voltage when there is a large current. 3. Due to the internal resistance at the output of the DAC+APA, the output voltage Vo is not exactly 20mV, which will cause errors in the measured results. At the same time, the inaccuracy of device parameters caused by current mirror mismatch or process fluctuations, such as inaccurate resistance values, requires calibration and optimization using Rsen resistance values. It is necessary to reasonably select the calibration range of Rsen. 4. Increase circuit testability by adding a PAD to the Vsen output terminal. When a problem is detected in the output code value, the faulty component can be quickly located by measuring the Vsen voltage value.

[0047] 5. The stability of the TIA loop also needs to be considered. Therefore, we have derived the loop transfer function below: By breaking the loop between the inverting input and feedback terminals of operational amplifier OP2, and applying a small AC test signal Vin at the point of loop breakage, the loop gain can be obtained by calculating the ratio of the output Vsen to Vin. The result is the same whether the loop is broken at the inverting input or the feedback terminal of operational amplifier OP2.

[0048] The voltage at input terminal V1 of operational amplifier OP2 is: (3) in, For AC testing of small-signal voltage, The value of the small-signal equivalent resistance of the mirror MOSFET Mpr is given. This is the resistance value of the adjustable resistor; According to equation (3), Vsen can be obtained as: (4) in, Given the open-loop gain of the current-to-voltage converter 400, the low-frequency loop gain of the TIA is: (5) The transfer function of the loop gain is: (6) Where s is a complex frequency variable, Let p be the parasitic capacitance at the inverting input of operational amplifier OP2, and Av(s) be the transfer function of operational amplifier OP2. In addition to the two left-half-plane poles and one right-half-plane zero inside operational amplifier OP2, the current-to-voltage module 400 also has a left-half-plane pole p3 at the inverting input of operational amplifier OP2, whose expression is: (7) Since both rop and Ca are relatively small, and the two poles of the operational amplifier OP2 are at a higher frequency, the main pole is located at the first stage output of the op-amp due to Miller compensation. Therefore, the loop of the entire current-to-voltage module 400 has good stability.

[0049] To determine the resistance value of the headphones based on the code value, the following test method can be used: In the Final Test (FT) stage, prepare two resistors with precisely known impedances (e.g., 4 ohms and 32 ohms), which can be configured to be connected to the output of the audio power amplifier 300. Assuming the base current of the DAC+APA path is Ib, then the equation is: (8) (9) Where K and b are constants, Vo = 20mV or 60mV, and D1 and D2 are the ADC readout values ​​under these two load conditions, which are known during the Fourier Transform (FT) stage. The expression for K can be obtained as: (10) Then, substituting K into equation (8) or (9), we can find Ib*K+b. Therefore, when the actual application connects to the headphone speaker SPK1 with impedance Rx, the following condition is met: (11) The value of Rx can be solved by the values ​​of Dx, D1, R1, and R2. Then Ib*K+b can be calculated. Ib does not need to be solved. Two known resistance values ​​and their corresponding code values ​​are needed. The resistance value of the headphones can be obtained without measuring the size of IAVCC.

[0050] The circuit architecture of the headphone impedance detection circuit according to this application is as follows: Figure 1As shown, the circuit consists of an LDO+ADC from the PMU, a DAC+APA from the AOU, and a current-to-voltage module 400. The current-to-voltage module 400 comprises a current mirror that replicates the current of the power MOSFET of the LDO100, an adjustable resistor Rsen, and an operational amplifier OP2, converting the detected current signal into a voltage signal. The principle of this circuit is as follows: when the headphones are connected to the circuit, it's equivalent to connecting a load to the output of the DAC+APA. Dividing the output voltage by the headphone resistance generates a load current. Since the DAC+APA is powered by the LDO100, the load current of the LDO100 will change. A mirror MOSFET Mpr replicates the current from the power MOSFET Mp, and then the reduced current is converted into a voltage. The resulting voltage is sent to an ADC for code value output. The headphone resistance is calculated based on the code value and the conversion relationship. This circuit can achieve high-precision detection of headphone resistance in a simple and efficient manner, with an error rate controlled below ±5%. It is currently the best solution for headphone impedance detection, avoiding the clicking noise caused by direct measurement at the headphone port.

[0051] Table 1 summarizes the simulation results of the circuit in this application. ISENSE refers to the current-to-voltage module 400 of this application. The simulated code value is used to calculate the headphone resistance Ro using the resistance calculation method proposed above. The simulation results show that the resistance error rate can be controlled below ±5%, exhibiting good accuracy.

[0052]

[0053] Table 1 like Figure 2 As shown, the headphone impedance detection circuit of this application can also be used in... Figure 1 Based on this, optimization is performed by adding a Miller capacitor in parallel to the adjustable resistor Rsen, introducing a zero to optimize the phase margin. At this point, the transfer function of the loop gain is: ; ; Where Cs is the parallel Miller capacitor. Besides having two poles and one zero inside operational amplifier OP2, this circuit also has a left-half-plane pole p3 and a left-half-plane zero z1 at the input, as expressed below: ; ; p3 will be pushed to lower frequencies by Cs, so the value of Cs must be small, and Ca must also be small to ensure that p3 is outside the secondary pole. The zero in the left half-plane introduced by z1 can increase the phase by 45°, which can improve the phase margin.

[0054] On the other hand, based on the aforementioned headphone impedance detection circuit, this application also proposes a headphone impedance detection method, such as... Figure 2 As shown, the method includes the following steps: Step S100: Copy the output current of LDO100 through the current-to-voltage module 400 to obtain the detection current, and convert the detection current into the detection voltage; Step S200: Obtain the detection voltage through the analog-to-digital converter 500 and convert the detection voltage into a digital code value; Step S300: Calculate the impedance of the headphone speaker SPK1 based on the digital code value.

[0055] It should be noted that the LDO100 is mainly used to provide a stable 3V operating power supply for the digital-to-analog converter 200 and the audio power amplifier 300. The digital-to-analog converter 200 and the audio power amplifier 300 constitute the headphone's audio output unit, used to generate a fixed DC bias voltage and an AC signal containing audio information to the headphone speaker SPK1, enabling the headphone speaker SPK1 to emit pleasant sound. The LDO100 and the analog-to-digital converter 500 constitute a traditional headphone power management unit (PMU). The analog-to-digital converter 500 is originally used to convert the PMU's battery voltage VBAT into a digital signal, but in this application, it is multiplexed to convert the voltage Vsen into a digital code value. The current-to-voltage module 400 is used to convert the detected current signal into a voltage signal, so that the analog-to-digital converter 500 can convert the voltage signal into a digital code value, which the processor can then use to determine the impedance of the headphone speaker SPK1 based on the digital code value.

[0056] like Figure 1 As shown, in some embodiments of this application, the current-to-voltage module 400 includes a mirror MOSFET Mpr, an operational amplifier OP2, and an adjustable resistor Rsen. The source of the mirror MOSFET Mpr is electrically connected to the input power supply VBAT, the gate of the mirror MOSFET Mpr is electrically connected to the gate of the power MOSFET Mp of the LDO100, the drain of the mirror MOSFET Mpr is electrically connected to the inverting input terminal of the operational amplifier OP2, and the non-inverting input terminal of the operational amplifier OP2 is electrically connected to the output terminal of the LDO100. One end of the adjustable resistor Rsen is electrically connected to the inverting input terminal of the operational amplifier OP2, and the other end of the adjustable resistor Rsen is electrically connected to the output terminal of the operational amplifier OP2. The output terminal of the operational amplifier OP2 is also electrically connected to the analog-to-digital converter 500.

[0057] In this example, the mirror MOSFET Mpr forms a current mirror for replicating the current of the power MOSFET, with a replication ratio of N:1. The current-to-voltage module 400 converts the detected current signal into a voltage signal. The conversion to a voltage signal uses a trans-impedance amplifier (TIA) structure. Compared to directly sampling the voltage by applying the current to a fixed resistor, the TIA loop allows the drain voltages of the power MOSFETs Mp and Mpr to be precisely consistent, reducing channel length modulation effects.

[0058] from Figure 1 As can be seen, when the impedance RL of the headphone speaker SPK1 changes, the output current IAVCC of LDO100 changes, which in turn changes the current flowing through the power MOSFET Mp. The mirror MOSFET Mpr replicates the current of the power MOSFET Mp at a ratio of N:1, so the current Isense of the mirror MOSFET Mpr also changes. Combined with the adjustable resistor Rsen, this is converted into a voltage Vsen, and finally, the analog-to-digital converter 500 converts the voltage Vsen into a code value for output. It should be noted that the current-to-voltage module 400 is a module added to the original headphone circuit in this application, while the remaining parts (LDO100, digital-to-analog converter 200, audio power amplifier 300, and analog-to-digital converter 500) are original modules in the headphone circuit. This application reuses the original functions of each module, making the entire circuit simple and efficient.

[0059] Since the LDO100, digital-to-analog converter 200, audio power amplifier 300 and analog-to-digital converter 400 all use relatively mature circuits, the circuits of these modules will not be described in detail here. The main focus is on the working principle of the current-to-voltage module 400.

[0060] Reference Figure 1 The formula for calculating Vsen satisfies: (1) in, This is the output voltage of operational amplifier OP2. IAVCC is the output voltage of LDO100, IAVCC is the output current of LDO100, and N is the W / L ratio of the power MOSFET Mp and the mirror MOSFET Mpr (W refers to the channel width of the MOSFET, and L refers to the channel length of the MOSFET). This is the resistance value of the adjustable resistor. More precisely, in equation (1) Should use Figure 1V1 in the equation is different from VAVCC only by the offset voltage of operational amplifier OP2. According to the "virtual short" principle of op-amps, VAVCC can be used to replace V1. IAVCC consists of the power consumption of digital-to-analog converter 200 + audio power amplifier 300 and headphone current. The headphone current is obtained by dividing the output voltage Vo (20mV or 60mV) of audio power amplifier 300 by the headphone resistance RL. As can be seen from equation (1), the larger the headphone resistance, the smaller IAVCC will be, and the larger Vsen will be. At the same time, the larger the headphone resistance, the smaller ΔIAVCC will be as the headphone resistance changes, which will lead to a smaller ΔVsen. If ΔVsen does not meet the requirement of being greater than the least significant bit (LSB) of analog-to-digital converter 500, the ADC will not be able to distinguish the code value corresponding to Vsen.

[0061] The converted output voltage Vsen needs to be within the input range of 1.8~3.6V of the analog-to-digital converter 500; otherwise, the corresponding code value cannot be accurately read. Therefore, it is necessary to adjust the current-to-voltage conversion ratio to make Vsen as large as possible. Furthermore, the resistance detection accuracy setting in this application is no more than ±2 ohms. This means that two headphone resistors differing by 2 ohms need to be able to output their respective corresponding code values ​​by the analog-to-digital converter 500. Therefore, after conversion, it is also necessary to ensure that the corresponding Vsen interval meets the LSB of the analog-to-digital converter 500; otherwise, the analog-to-digital converter 500 will not be able to distinguish the corresponding code value. The LSB of the analog-to-digital converter 500 is 14mV.

[0062] There's a contradiction here: increasing Vsen contradicts ensuring the Vsen voltage interval meets the LSB of the 500 analog-to-digital converter. To increase Vsen, Rsen / N needs to be smaller. However, ΔVsen = ΔIAVCC * (Rsen / N), so a smaller Rsen / N results in a smaller ΔVsen, which won't meet the LSB of the 500 analog-to-digital converter. A compromise is needed, finding a suitable value. Therefore... The value of / N makes The value satisfies the range of the analog-to-digital converter 500 and ensures that the impedance detection accuracy of the headphone speaker SPK1 meets the preset value.

[0063] During circuit design simulation, Figure 1The LDO100 section uses an equivalent load resistor for simplified simulation, generating a current of 1.5mA~6mA. With VAVCC set to 3V, the load resistance of the LDO100 is 0.5kΩ~2kΩ. The power MOSFET Mp has dimensions W / L = 36u / 0.5u, and M = 240 (M indicates that the power MOSFET Mp is composed of M identical units connected in parallel). Therefore, the Mpr has dimensions W / L = 36u / 0.5u, and M = 1. This means N = 240, indicating that the ratio between the power MOSFET Mp and the mirror MOSFET Mpr is 240:1. For matching, N can only be a maximum of 240. To minimize the current drawn after replication, N needs to be larger. This is partly to reduce power consumption, and partly because the replication current flows into the output of operational amplifier OP2. OP2 is a two-stage general-purpose op-amp with Miller compensation. The first stage is a differential five-transistor OTA (Operational Transconductance Amplifier), and the second stage is a common-source amplifier with a current source load. If the current flowing into the output is large, the bias current at the op-amp output needs to be sufficiently large; otherwise, the entire TIA loop will not function properly, and the voltages at the input inverting terminal and the output will be forcibly pulled high. Therefore, N is set to 240 to maximize the reduction of the Isense current and lower power consumption. Since N is large, Rsen also needs to be large to ensure that Rsen / N is a reasonable compromise.

[0064] In addition, the mirror MOSFET Mpr will increase the parasitic capacitance at the output of the error amplifier OP1 of LDO100. Since LDO100 has an external load capacitor and its dominant pole is at the output, N should also be larger in order to prevent the phase margin of LDO100 from deteriorating.

[0065] Assuming Vsen = 2V at the maximum current of 6mA, then: (2) With Vavcc=3 and N=240, Rsen=40kΩ. When the minimum input current is 1.5mA, Vsen=3-(1.5m / 240)*40kΩ= 2.75V<3.6V. All current values, after conversion, fall within the dynamic range of the analog-to-digital converter 500.

[0066] With Vavcc = 3.3V, N = 240, and Rsen = 40kΩ, Vsen = 2.3V when the maximum input current is 6mA. When the minimum input current is 1.5mA, Vsen = 3.45V < 3.6V. All current values, after conversion, fall within the ADC's dynamic range.

[0067] Rsen needs to be adjustable, with an adjustable range of 32k~44k, and the adjustment accuracy is set to 2-bit adjustable, with an interval of 4k. This is used to calibrate the large power consumption deviation of the digital-to-analog converter 200, audio power amplifier 300, and LDO100 due to process fluctuations, as well as the current mirror mismatch of the power MOSFET Mpr current, the large offset voltage of the operational amplifier OP2, and other factors that cause a large deviation in Vsen, resulting in Vsen deviating from the input range of the ADC at the boundary.

[0068] Since the goal is to detect the headphone resistance within the required range, Vsen does not need to be ultra-precise. However, it must ensure that the voltage can be recognized by the analog-to-digital converter 500, and then the resistance can be calculated from the code value within a 2-ohm deviation range. Rsen's 2-bit calibration is sufficient, saving area on the efuse (Electronic Fuse as OTP Memory). Its calibration shifts all data in the same direction to the same degree, not just individual data points. If sufficient area is available, enough calibration bits can be designed to ensure that even with large deviations, Vsen can calibrate back to the input range of the analog-to-digital converter 500, while also improving Vsen's accuracy, and consequently, the accuracy of the measured resistance. In this application, RSEN<1:0>=0~3, and the values ​​of Rsen correspond to 32 kΩ, 36 kΩ, 40 kΩ, and 44 kΩ respectively. The typical value used in this application is 40 kΩ because to calibrate Vsen back to above 1.8V, the Rsen value needs to be reduced. To ensure sufficient margin, the typical value is chosen to be slightly higher than the calibration value. If calibration is insufficient, the IAVCC can be reduced by decreasing the output voltage Vo of the DAC+APA, thereby increasing the Vsen value. For example, the output voltage Vo of the DAC+APA can be set to 15mV.

[0069] During the design process, the following risk points also need to be considered: 1. In order not to affect the normal operation of the original PMU and AOU systems, a separate switch control module needs to be designed to control whether the current-to-voltage module 400 is working; 2. The LDO100 output has pads. Careful consideration must be given to ESD (Electro-Static Discharge) at the points where it connects to the pads. First, GGNMOS (Gate-Grounded NMOS, an N-type MOSFET with its gate grounded) and GDPMOS (Gate-Drain PMOS, a P-type MOSFET with its gate and drain shorted) or other diode-type ESD protection should be added at the pads. A 200-ohm small resistor should be added to the gsd terminal of the MOSFET connected to the pads inside the circuit. The resistor L should be relatively large, for example, L / W=5u / 2u, to prevent the MOSFET port from breaking down the internal PN junction due to excessive voltage when there is a large current. 3. Due to the internal resistance at the output of the DAC+APA, the output voltage Vo is not exactly 20mV, which will cause errors in the measured results. At the same time, the inaccuracy of device parameters caused by current mirror mismatch or process fluctuations, such as inaccurate resistance values, requires calibration and optimization using Rsen resistance values. It is necessary to reasonably select the calibration range of Rsen. 4. Increase circuit testability by adding a PAD to the Vsen output terminal. When a problem is detected in the output code value, the faulty component can be quickly located by measuring the Vsen voltage value.

[0070] 5. The stability of the TIA loop also needs to be considered. Therefore, we have derived the loop transfer function below: By breaking the loop between the inverting input and feedback terminals of operational amplifier OP2, and applying a small AC test signal Vin at the point of loop breakage, the loop gain can be obtained by calculating the ratio of the output Vsen to Vin. The result is the same whether the loop is broken at the inverting input or the feedback terminal of operational amplifier OP2.

[0071] The voltage at input terminal V1 of operational amplifier OP2 is: (3) in, For AC testing of small-signal voltage, The value of the small-signal equivalent resistance of the mirror MOSFET Mpr is given. This is the resistance value of the adjustable resistor; According to equation (3), Vsen can be obtained as: (4) in, Given the open-loop gain of the current-to-voltage converter 400, the low-frequency loop gain of the TIA is: (5) The transfer function of the loop gain is: (6) Where s is a complex frequency variable, Let p be the parasitic capacitance at the inverting input of operational amplifier OP2, and Av(s) be the transfer function of operational amplifier OP2. In addition to the two left-half-plane poles and one right-half-plane zero inside operational amplifier OP2, the current-to-voltage module 400 also has a left-half-plane pole p3 at the inverting input of operational amplifier OP2, whose expression is: (7) Since both rop and Ca are relatively small, and the two poles of the operational amplifier OP2 are at a higher frequency, the main pole is located at the first stage output of the op-amp due to Miller compensation. Therefore, the loop of the entire current-to-voltage module 400 has good stability.

[0072] Furthermore, such as Figure 3 As shown, in some embodiments of this application, step S300 specifically includes the following four steps: Step S310: Replace the headphone speaker SPK1 with the first resistor to obtain the first digital code value of the analog-to-digital converter 500; Step S320: Replace the headphone speaker SPK1 with the second resistor to obtain the second digital code value of the analog-to-digital converter 500; the resistance values ​​of the first resistor and the second resistor are different; Step S330: Determine the correspondence between the digital code value of the analog-to-digital converter 500 and the impedance of the headphone speaker SPK1 based on the resistance values ​​of the first resistor and the second resistor, the first digital code value and the second digital code value. Step S340: Calculate the impedance of the headphone speaker SPK1 based on the correspondence and digital code value.

[0073] Specifically, during the FT (Final Test) stage, prepare two resistors with precisely known impedances, designated as the first resistor and the second resistor. The first and second resistors have different resistance values ​​(e.g., 4 ohms and 32 ohms), and can be configured to be connected to the output of the audio power amplifier 300. Assuming the base current of the DAC+APA path is Ib, then the equation is: (8) (9) Where K and b are constants, R1 is the resistance of the first resistor, R2 is the resistance of the second resistor, Vo = 20mV or 60mV, and D1 and D2 are the first and second digital code values, respectively, which can be known during the FT stage. The expression for K can be obtained as: (10) Then, substituting K into equation (7) or (8), we can find Ib*K+b. Therefore, when the actual application connects to the headphone speaker SPK1 with impedance Rx, the following condition is met: (11) The value of Rx can be solved by the values ​​of Dx, D1, R1, and R2. Then Ib*K+b can be calculated. Ib does not need to be solved. Two known resistance values ​​and their corresponding code values ​​are needed. The resistance value of the headphones can be obtained without measuring the size of IAVCC.

[0074] The headphone impedance detection method described in this application operates on the following principle: When headphones are connected to the circuit, it's equivalent to connecting a load to the output of the DAC+APA. Dividing the output voltage by the headphone resistance generates a load current. Since the DAC+APA is powered by an LDO100, the load current of the LDO100 will change. A mirror MOSFET Mpr copies the current from the power MOSFET Mp, and then converts the reduced current into a voltage. The resulting voltage is fed into an ADC for code value output. The headphone resistance is calculated based on the code value and the conversion relationship. This circuit can achieve high-precision headphone resistance detection in a simple and efficient manner, with an error rate controlled below ±5%. It is currently the best solution for headphone impedance detection, avoiding the clicking noise caused by direct measurement at the headphone port.

[0075] On the other hand, embodiments of the present invention also provide a storage medium, which is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described headphone impedance detection method.

[0076] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate, and may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0077] Although specific embodiments are described herein, those skilled in the art will recognize that many other modifications or alternative embodiments are also within the scope of this disclosure. For example, any of the functions and / or processing capabilities described in connection with a particular device or component can be performed by any other device or component. Furthermore, while various exemplary embodiments and architectures have been described according to embodiments of this disclosure, those skilled in the art will recognize that many other modifications to the exemplary embodiments and architectures described herein are also within the scope of this disclosure.

[0078] The foregoing description, with reference to block diagrams and flowcharts of systems, methods, systems, and / or computer program products according to exemplary embodiments, has described certain aspects of this disclosure. It should be understood that one or more blocks in the block diagrams and flowcharts, as well as combinations of blocks in the block diagrams and flowcharts, can be implemented by executing computer-executable program instructions, respectively. Similarly, according to some embodiments, some blocks in the block diagrams and flowcharts may not need to be executed in the order shown, or may not all need to be executed. Furthermore, additional components and / or operations beyond those shown in the blocks in the block diagrams and flowcharts may exist in some embodiments.

[0079] Therefore, blocks in block diagrams and flowcharts support combinations of means for performing a specified function, combinations of elements or steps for performing a specified function, and program instruction means for performing a specified function. It should also be understood that each block in a block diagram and flowchart, and combinations of blocks in block diagrams and flowcharts, can be implemented by a dedicated hardware computer system or a combination of dedicated hardware and computer instructions that performs a specific function, element, or step.

[0080] The program modules, applications, etc., described herein may include one or more software components, including, for example, software objects, methods, data structures, etc. Each such software component may include computer-executable instructions that, in response to execution, cause at least a portion of the functionality described herein (e.g., one or more operations of the exemplary methods described herein) to be performed.

[0081] Software components can be coded using any of a variety of programming languages. An exemplary programming language could be a low-level programming language, such as assembly language associated with a specific hardware architecture and / or operating system platform. Software components including assembly language instructions may need to be converted into executable machine code by an assembler before being executed by the hardware architecture and / or platform. Another exemplary programming language could be a higher-level programming language that is portable across multiple architectures. Software components including higher-level programming languages ​​may need to be converted into an intermediate representation by an interpreter or compiler before execution. Other examples of programming languages ​​include, but are not limited to, macro languages, shell or command languages, job control languages, scripting languages, database query or search languages, or report writing languages. In one or more exemplary embodiments, a software component containing instructions from one of the above-described programming language examples can be executed directly by the operating system or other software components without first being converted into another form.

[0082] Software components can be stored as files or other data storage structures. Software components of similar type or related function can be stored together in a specific directory, folder, or library. Software components can be static (e.g., pre-defined or fixed) or dynamic (e.g., created or modified at runtime).

[0083] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.

Claims

1. A headphone impedance detection circuit, characterized in that, include: LDO, the input terminal of which is connected to the input power supply; A digital-to-analog converter (DAC) is provided, wherein the power supply terminal of the DAC is electrically connected to the output terminal of the LDO, and the DAC is used to acquire digital audio signals and convert the digital audio signals into analog audio signals. An audio power amplifier, wherein the power supply terminal of the audio power amplifier is electrically connected to the output terminal of the LDO, and the input terminal of the audio power amplifier is electrically connected to the output terminal of the digital-to-analog converter, and the audio power amplifier is used to amplify the analog audio signal to drive the headphone speaker to emit sound; A current-to-voltage module is used to replicate the output current of the LDO, obtain the detection current, and convert the detection current into a detection voltage; An analog-to-digital converter is used to acquire the detected voltage and convert the detected voltage into a digital code value, so that the processor can obtain the impedance of the headphone speaker based on the digital code value.

2. The headphone impedance detection circuit according to claim 1, characterized in that, The current-to-voltage module includes: A mirror MOSFET, wherein the source of the mirror MOSFET is electrically connected to the input power supply, and the gate of the mirror MOSFET is electrically connected to the gate of the power MOSFET of the LDO; An operational amplifier, wherein the inverting input terminal of the operational amplifier is electrically connected to the drain of the mirror MOS transistor, and the non-inverting input terminal of the operational amplifier is electrically connected to the output terminal of the LDO; An adjustable resistor is provided, one end of which is electrically connected to the inverting input terminal of the operational amplifier, and the other end of which is electrically connected to the output terminal of the operational amplifier. The output terminal of the operational amplifier is also electrically connected to the input terminal of the analog-to-digital converter.

3. The headphone impedance detection circuit according to claim 1, characterized in that, The LDO includes: An error amplifier, wherein the inverting input of the error amplifier is connected to a reference voltage; A power MOSFET, the gate of which is electrically connected to the output terminal of the error amplifier; The feedback module has one end electrically connected to the drain of the power MOSFET and the other end electrically connected to the non-inverting input of the error amplifier.

4. The headphone impedance detection circuit according to claim 2, characterized in that, The output voltage of the operational amplifier is: ; in, The output voltage of the operational amplifier is... IAVCC is the output voltage of the LDO, IAVCC is the output current of the LDO, and N is the W / L ratio of the power MOSFET and the mirror MOSFET. The value of the adjustable resistor is given.

5. The headphone impedance detection circuit according to claim 4, characterized in that, The value of / N makes The value satisfies the range of the analog-to-digital converter and ensures that the impedance detection accuracy of the headphone speaker meets the preset value.

6. The headphone impedance detection circuit according to claim 2, characterized in that, The adjustable resistor has an adjustable range of 32kΩ to 44kΩ, and the adjustment accuracy is set to 2 adjustable positions with an interval of 4kΩ.

7. The headphone impedance detection circuit according to claim 2, characterized in that, When the loop between the inverting input and feedback terminals of the operational amplifier is broken, and a small AC test signal is applied at the point of loop breakage, the voltage at the inverting input of the operational amplifier is expressed as follows: Then the output voltage of the operational amplifier is The loop gain of the current-to-voltage module is: The transfer function of the loop gain is: ; in, The voltage of the small AC test signal. The value of the small-signal equivalent resistance of the mirror MOS transistor is given. The resistance value of the adjustable resistor is given. Let s be the open-loop gain of the current-to-voltage module, and s be the complex frequency variable. This refers to the parasitic capacitance at the inverting input terminal of the operational amplifier. (s) is the transfer function of the operational amplifier; in addition to having two left-half-plane poles and one right-half-plane zero inside the operational amplifier, the current-to-voltage module also has a left-half-plane pole p3 at the inverting input of the operational amplifier, the expression of which is: .

8. A method for detecting the impedance of headphones, characterized in that, Based on the headphone impedance detection circuit as described in any one of claims 1-7, the method includes the following steps: The output current of the LDO is copied by a current-to-voltage module to obtain the detection current, and the detection current is converted into a detection voltage. The detection voltage is obtained by an analog-to-digital converter and converted into a digital code value; The impedance of the headphone speaker is calculated based on the digital code value.

9. The headphone impedance detection method according to claim 8, characterized in that, The step of calculating the impedance of the headphone speaker based on the digital code value includes: Replace the headphone speaker with the first resistor to obtain the first digital code value of the analog-to-digital converter; The headphone speaker is replaced with a second resistor to obtain the second digital code value of the analog-to-digital converter; the resistance values ​​of the first resistor and the second resistor are different. Based on the resistance values ​​of the first resistor and the second resistor, the first digital code value and the second digital code value, the correspondence between the digital code value of the analog-to-digital converter and the impedance of the headphone speaker is determined; The impedance of the headphone speaker is calculated based on the correspondence and the digital code value.

10. The headphone impedance detection method according to claim 9, characterized in that, The step of determining the correspondence between the digital code value of the analog-to-digital converter and the impedance of the headphone speaker based on the resistance values ​​of the first resistor and the second resistor, the first digital code value, and the second digital code value includes: Based on the resistance values ​​of the first resistor and the second resistor, and the first digital code value and the second digital code value, the following two equations are obtained: ; ; in, Here, K and b represent the base currents in the paths containing the digital-to-analog converter and the audio power amplifier, respectively, and are constants. R1 is the voltage value at the output terminal of the audio power amplifier, R2 is the resistance value of the first resistor, D1 is the first digital code value, and D2 is the second digital code value. Based on the two equations above, calculate The value of *K+b; according to The value of *K+b determines the correspondence between the digital code value of the analog-to-digital converter and the impedance of the headphone speaker as follows: ; Wherein, Rx is the impedance of the headphone speaker, and Dx is the digital code value.