CN111901719B - Audio data compensation method and device, electronic equipment and storage medium - Google Patents

Audio data compensation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111901719B
CN111901719B CN202010761458.4A CN202010761458A CN111901719B CN 111901719 B CN111901719 B CN 111901719B CN 202010761458 A CN202010761458 A CN 202010761458A CN 111901719 B CN111901719 B CN 111901719B
Authority
CN
China
Prior art keywords
resistance value
audio data
earphone
resistance
ground wire
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010761458.4A
Other languages
Chinese (zh)
Other versions
CN111901719A (en
Inventor
叶文煊
韩跃坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202010761458.4A priority Critical patent/CN111901719B/en
Publication of CN111901719A publication Critical patent/CN111901719A/en
Application granted granted Critical
Publication of CN111901719B publication Critical patent/CN111901719B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • H04R1/1083Reduction of ambient noise
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones
    • H04R3/02Circuits for transducers, loudspeakers or microphones for preventing acoustic reaction, i.e. acoustic oscillatory feedback

Abstract

The disclosure relates to an audio data compensation method and device, an electronic device and a storage medium. The method comprises the following steps: acquiring first audio data to be output to a left channel and a first compensation coefficient corresponding to the left channel, and second audio data to be output to a right channel and a second compensation coefficient corresponding to the right channel; compensating the first audio data according to the first compensation coefficient and the second audio data, and compensating the second audio data according to the second compensation coefficient and the first audio data. In this embodiment, the audio data of each channel can be compensated, and the audio data generated by the mutual crosstalk between the left channel and the right channel can be offset, so that the actual audio effect is consistent with the expected audio effect, the effect of eliminating the crosstalk between the two earphones is achieved, and the use experience is improved.

Description

Audio data compensation method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of audio processing technologies, and in particular, to an audio data compensation method and apparatus, an electronic device, and a storage medium.
Background
With the widespread use of mobile phones, more and more users use earphones to watch audio, enjoy music, and the like. The existing analog earphone comprises an earphone plug, and the audio can be heard by inserting the earphone plug into an earphone seat of the mobile phone. Wherein, including 4 lines in the earphone: the left channel line (L), the right channel line (R), the microphone line (MIC) and the ground line (GND), that is, the left channel and the right channel of the headphone share the same ground line. Because the ground wire has resistance, the left and right sound channels have crosstalk (crosstalk) problem, and the use experience is reduced.
Disclosure of Invention
The present disclosure provides an audio data compensation method and apparatus, an electronic device, and a storage medium to solve the disadvantages of the related art.
According to a first aspect of the embodiments of the present disclosure, there is provided an audio data compensation method, which is applied to an electronic device, the method including:
acquiring first audio data to be output to a left channel and a first compensation coefficient corresponding to the left channel, and second audio data to be output to a right channel and a second compensation coefficient corresponding to the right channel; the first compensation coefficient is used for representing the crosstalk intensity generated when the audio data of the right channel acts on the left channel, and the second compensation coefficient is used for representing the crosstalk intensity generated when the audio data of the left channel acts on the right channel;
compensating the first audio data according to the first compensation coefficient and the second audio data, and compensating the second audio data according to the second compensation coefficient and the first audio data.
Optionally, obtaining a first compensation coefficient corresponding to the left channel includes:
the method comprises the steps of obtaining a first resistance value of a ground wire resistor between a plug of the earphone and a ground wire junction point in the earphone, a second resistance value of the ground wire resistor between a ground wire and a battery cathode in an earphone socket of the electronic equipment, and obtaining a third resistance value of a left earphone resistor and a fourth resistance value of a right earphone resistor in the earphone;
obtaining the sum of the first resistance value and the second resistance value to obtain a common resistance value representing the ground wire resistance from the cathode of the battery to the junction point;
obtaining a first parallel resistance value according to the fourth resistance value and the public resistance value, wherein the first parallel resistance value is used for representing the resistance value of an equivalent resistor formed by connecting the right earphone resistor and a ground wire resistor between the cathode of the battery and a junction point in parallel;
calculating the first compensation factor based on a ratio of the first parallel resistance value to the third resistance value.
Optionally, obtaining a second compensation coefficient corresponding to the left channel includes:
the method comprises the steps of obtaining a first resistance value of a ground wire resistor between a plug of the earphone and a ground wire junction point in the earphone, a second resistance value of the ground wire resistor between a ground wire and a battery cathode in an earphone socket of the electronic equipment, and obtaining a third resistance value of a left earphone resistor and a fourth resistance value of a right earphone resistor in the earphone;
obtaining the sum of the first resistance value and the second resistance value to obtain a common resistance value representing the ground wire resistance from the cathode of the battery to the junction point;
obtaining a second parallel resistance value according to the third resistance value and the public resistance value, wherein the second parallel resistance value is used for representing the resistance value of the equivalent resistance after the left earphone resistance is connected in parallel with the ground wire resistance from the cathode of the battery to the junction point;
calculating the second compensation coefficient based on a ratio of the second parallel resistance value to the fourth resistance value.
Optionally, compensating the first audio data according to the first compensation coefficient and the second audio data includes:
obtaining a product of the first compensation coefficient and the second audio data, wherein the product is used for representing crosstalk data generated by the second audio data on a left earphone;
and calculating a difference value between the first audio data and the product, and taking the difference value as audio data output to a left channel.
Optionally, the third resistance value is an average value of third resistance values of a plurality of preset sample earphones; and/or the presence of a gas in the gas,
the fourth resistance value is an average value of fourth resistance values of a plurality of preset sample earphones.
Optionally, compensating the second audio data according to the second compensation coefficient and the first audio data includes:
obtaining a product of the second compensation coefficient and the first audio data, wherein the product is used for representing crosstalk data generated by the first audio data on the right earphone;
and calculating a difference value between the second audio data and the product, and taking the difference value as audio data output to a right channel.
According to a second aspect of the embodiments of the present disclosure, there is provided an audio data compensation apparatus adapted to an electronic device, the apparatus including:
the compensation coefficient acquisition module is used for acquiring first audio data to be output to a left channel and a first compensation coefficient corresponding to the left channel, and second audio data to be output to a right channel and a second compensation coefficient corresponding to the right channel; the first compensation coefficient is used for representing the crosstalk strength generated when the audio data of the right channel acts on the left channel, and the second compensation coefficient is used for representing the crosstalk strength generated when the audio data of the left channel acts on the right channel;
and the audio data compensation module is used for compensating the first audio data according to the first compensation coefficient and the second audio data, and compensating the second audio data according to the second compensation coefficient and the first audio data.
Optionally, the apparatus further includes a first coefficient obtaining module, where the first coefficient obtaining module includes:
the electronic equipment comprises a resistance value acquisition unit, a first resistance value acquisition unit and a second resistance value acquisition unit, wherein the resistance value acquisition unit is used for acquiring a first resistance value of a ground wire resistor between an earphone plug and a ground wire junction point in an earphone, a second resistance value of the ground wire resistor between a ground wire and a battery cathode in an earphone socket of the electronic equipment, and a third resistance value of a left earphone resistor and a fourth resistance value of a right earphone resistor in the earphone;
the common resistance obtaining unit is used for obtaining the sum of the first resistance value and the second resistance value to obtain a common resistance value representing the ground wire resistance from the cathode of the battery to the junction point;
the first resistance obtaining unit is used for obtaining a first parallel resistance value according to the fourth resistance value and the public resistance value, wherein the first parallel resistance value is used for representing the resistance value of an equivalent resistance formed by the parallel connection of a right earphone resistance and a ground wire resistance from a battery cathode to a junction point;
a first coefficient obtaining unit configured to calculate the first compensation coefficient based on a ratio of the first parallel resistance value to the third resistance value.
Optionally, the apparatus further includes a second coefficient obtaining module, where the second coefficient obtaining module includes:
the electronic equipment comprises a resistance value acquisition unit, a first resistance value acquisition unit and a second resistance value acquisition unit, wherein the resistance value acquisition unit is used for acquiring a first resistance value of a ground wire resistor between an earphone plug and a ground wire junction point in an earphone, a second resistance value of the ground wire resistor between a ground wire and a battery cathode in an earphone socket of the electronic equipment, and a third resistance value of a left earphone resistor and a fourth resistance value of a right earphone resistor in the earphone;
the common resistance obtaining unit is used for obtaining the sum of the first resistance value and the second resistance value to obtain a common resistance value representing the ground wire resistance from the cathode of the battery to the junction point;
the second resistance obtaining unit is used for obtaining a second parallel resistance value according to the third resistance value and the public resistance value, wherein the second parallel resistance value is used for representing the resistance value of the equivalent resistance after the left earphone resistance is connected in parallel with the ground wire resistance from the negative electrode of the battery to the junction point;
a second coefficient obtaining unit configured to calculate the second compensation coefficient based on a ratio of the second parallel resistance value to the fourth resistance value.
Optionally, the third resistance value is an average value of third resistance values of a plurality of preset sample earphones; and/or the presence of a gas in the gas,
the fourth resistance value is an average value of fourth resistance values of a plurality of preset sample earphones.
Optionally, the audio data compensation module includes:
a product obtaining unit, configured to obtain a product of the first compensation coefficient and the second audio data, where the product is used to represent crosstalk data generated by the second audio data on the left-side headphone;
and the audio data compensation unit is used for calculating the difference between the first audio data and the product and taking the difference as the audio data output to the left channel.
Optionally, the audio data compensation module includes:
a product obtaining unit, configured to obtain a product of the second compensation coefficient and the first audio data, where the product is used to represent crosstalk data generated by the first audio data on the right earphone;
and the audio data compensation unit is used for calculating the difference between the second audio data and the product and taking the difference as the audio data output to the right channel.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing a computer program executable by the processor;
wherein the processor is configured to execute the computer program in the memory to implement the steps of the method as described above.
Optionally, the electronic device further includes an encoder and an earphone socket, a reference voltage collection line is not provided between the encoder and the earphone socket, and the reference voltage collection line is used for collecting a voltage on a ground line between a ground line in the earphone socket and a negative electrode of the battery to serve as a reference voltage.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, in which an executable computer program is capable of implementing the steps of the method as described above when executed by a processor.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
it can be known from the foregoing embodiments that, in the embodiments of the present disclosure, the compensation coefficient corresponding to each channel may be obtained, and then the audio data of the channel is compensated by using the compensation coefficient and the audio data of another channel, so as to obtain the compensated audio data. Therefore, the audio data of each channel can be compensated in the embodiment, and the audio data generated by mutual crosstalk of the left channel and the right channel can be offset, so that the actual audio effect is consistent with the expected audio effect, the effect of eliminating crosstalk between two earphones is achieved, and the use experience is favorably improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic circuit diagram of compensating for crosstalk in the related art.
Fig. 2 is a schematic circuit diagram showing the acquisition lines removed, according to an example embodiment.
Fig. 3 is a flowchart illustrating an audio data compensation method according to an exemplary embodiment.
Fig. 4 is a flowchart illustrating obtaining a first compensation factor according to an exemplary embodiment.
Fig. 5 is a flowchart illustrating obtaining a second compensation factor according to an exemplary embodiment.
Fig. 6 is a schematic diagram illustrating compensating first audio data according to an exemplary embodiment.
Fig. 7 is a flowchart illustrating compensating for second audio data according to an exemplary embodiment.
FIG. 8 is a schematic diagram illustrating audio signal flow according to an exemplary embodiment.
Fig. 9 is a block diagram illustrating an audio data compensating apparatus according to an exemplary embodiment.
FIG. 10 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The following exemplary described embodiments do not represent all embodiments consistent with the present disclosure. Rather, they are merely examples of devices consistent with certain aspects of the present disclosure as recited in the claims below.
With the widespread use of mobile phones, more and more users use earphones to watch audio, enjoy music, and the like. The existing analog earphone comprises an earphone plug, and the audio can be heard by inserting the earphone plug into an earphone seat of the mobile phone. Wherein, including 4 lines in the earphone: the left channel line (L), the right channel line (R), the microphone line (MIC) and the ground line (GND), that is, the left channel and the right channel of the headphone share the same ground line. Because the ground wire has resistance, the left and right sound channels have crosstalk (crosstalk) problem, and the use experience is reduced.
In the related art, referring to fig. 1, a pin of an encoder is used as a reference ground, the reference ground is connected to a ground line of an earphone socket in an electronic device, and a voltage at a point a is collected to replace a voltage at a point B, so that resistance impedance of a ground line inside an earphone and impedance of an earphone socket are ignored, and resistance of a common ground line in the earphone, that is, Rcom, is uncontrollable, which finally results in that crosstalk cannot be eliminated cleanly, and usage experience is affected.
In order to solve the above technical problem, an embodiment of the present disclosure further provides an audio data compensation method, where the method may be applied to an electronic device, and the electronic device may include a smart phone, a personal computer, or a server. The electronic equipment comprises an earphone socket, and after the earphone plug is inserted into the earphone socket, the audio can be listened through the earphone. The electronic device and the headphone may form the circuit schematic shown in fig. 1, so that the acquisition line between the point a and the reference pin HPH _ REF of the encoder may not acquire a voltage signal when the above method is performed, i.e. the encoder may turn off the audio compensation function.
In an embodiment, to execute the above method, the connection manner shown in fig. 1 may be adjusted in this embodiment, and the acquisition line between the point a and the reference pin HPH _ REF of the encoder is removed, so as to obtain the equivalent circuit shown in fig. 2. Thus, in the embodiment, the pin data of the encoder can be reduced, and the acquisition line is not needed, so that the hardware cost can be saved. The scheme of each embodiment is described in the following embodiments based on the circuit shown in fig. 2.
Fig. 3 is a flowchart illustrating an audio data compensation method according to an exemplary embodiment, and referring to fig. 3, an audio data compensation method includes steps 31 to 32:
in step 31, first audio data to be output to a left channel and a first compensation coefficient corresponding to the left channel, and second audio data to be output to a right channel and a second compensation coefficient corresponding to the right channel are acquired.
In this embodiment, a plurality of application programs may be installed in the electronic device, and a user may select one of the application programs to play audio or video, and then describe the scheme of each embodiment only with audio data. The application may write the audio to be played to local memory or local cache. The processor reads audio data to be output to the left channel (hereinafter referred to as first audio data) and audio data to be output to the right channel (hereinafter referred to as second audio data) from the local memory or the local cache.
In this embodiment, the compensation coefficient corresponding to the left channel (hereinafter referred to as a first compensation coefficient) and the compensation coefficient corresponding to the right channel (hereinafter referred to as a second compensation coefficient) may be stored in the electronic device in advance. In this way, the electronic device can locally read the first compensation coefficient and the second compensation coefficient each time audio is played, that is, when the electronic device has a need to compensate audio data.
In one example, the electronic device may obtain the first compensation coefficient by obtaining, in step 41, a resistance value of a ground resistor between the earphone plug and the ground junction in the earphone (hereinafter referred to as a first resistance value), a resistance value of a ground resistor between the ground and the negative electrode of the battery in the earphone socket of the electronic device (hereinafter referred to as a second resistance value), and a resistance value of a left earphone resistor in the earphone (hereinafter referred to as a third resistance value) and a resistance value of a right earphone resistor in the earphone (hereinafter referred to as a fourth resistance value), respectively, with reference to fig. 4.
The ground wire junction point in the earphone refers to a junction point at which the ground wire of the left earphone and the ground wire of the right earphone are joined into one ground wire.
The first resistance value, the second resistance value, the third resistance value, and the fourth resistance value may be stored in a local memory of the electronic device in advance, or may be stored in an external memory, so that the electronic device can acquire the first resistance value, the second resistance value, the third resistance value, and the fourth resistance value.
The first resistance value, the second resistance value, the third resistance value, and the fourth resistance value may be measured and stored by a user. In one example, the third resistance value and the fourth resistance value are obtained by: selecting a preset plurality (such as 1000) of sample earphones from the market, wherein the model number of the sample earphones is enough (exceeds a model number threshold) and the number of the sample earphones is enough (exceeds a business number threshold), or selecting different models of earphones produced by different suppliers from the market, and the smaller the number of the sample earphones is, the better the number of the sample earphones is, so as to highlight the uniqueness of the sample earphones. And then respectively acquiring a third resistance value and a fourth resistance value of each sample earphone, and then calculating the average value of the third resistance values and the average value of the fourth resistance values of all the sample earphones. In this way, the average value of the third resistance value and the average value of the fourth resistance value can be used as the third resistance value and the fourth resistance value of the headphone, respectively.
Of course, the first resistance value, the second resistance value, the third resistance value and the fourth resistance value may also be provided with corresponding detection circuits in the electronic device, and the detection circuits are measured by the electronic device.
In step 42, the electronic device may obtain the sum of the first resistance value and the second resistance value to obtain a common resistance value representing the resistance of the ground line from the negative terminal of the battery to the junction, such as the resistance R shown in FIG. 2COMAnd a resistance RGNDSum of resistance values after series connection.
In step 43, the electronic device may obtain a first parallel resistance value according to the fourth resistance value and the common resistance value, where the first parallel resistance value is used to represent a resistance value of an equivalent resistance after the right earphone resistance is connected in parallel with a ground line resistance from the negative electrode of the battery to the junction point.
In step 44, the electronic device may calculate a first compensation factor based on a ratio of the first parallel resistance value to the third resistance value, as shown in the following equation:
Figure BDA0002613203920000091
in the formula of ULDenotes a first compensation coefficient, R'COMIs the sum of the first resistance value and the second resistance value, RL、RRRespectively, a third resistance value and a fourth resistance value.
It can be understood that in the formula (1)
Figure BDA0002613203920000092
The ratio of the first parallel resistance to the third resistance is shown, which can be used to characterize the ratio of the audio data corresponding to the first parallel resistance to the audio data corresponding to the third resistance. Further analysis can obtain the ratio of audio data in the audio data of the left channel caused by the existence of the ground wire resistor, namely the ratio of crosstalk data.
In another example, the electronic device may obtain the second compensation coefficient in the following manner, referring to fig. 5, in step 51, the first resistance value, the second resistance value, the third resistance value, and the fourth resistance value may be respectively obtained, and the detailed principle may refer to step 41 and the content thereof, which is not described herein again. In step 52, the electronic device may obtain the common resistance value, and for the specific principle, reference may be made to step 41 and the content thereof, which are not described herein again. In step 53, the electronic device may obtain a parallel resistance value (hereinafter, referred to as a second parallel resistance value) from the third resistance value and the common resistance value. In step 54, the electronic device may calculate a second compensation factor based on a ratio of the second parallel resistance value to the fourth resistance value, as shown in the following equation:
Figure BDA0002613203920000093
in the formula of URDenotes a second compensation coefficient, R'COMIs the sum of the first resistance value and the second resistance value, RL、RRRespectively representing a third resistance value and a fourth resistance value.
It can be understood that in the formula (2)
Figure BDA0002613203920000101
The ratio of the second parallel resistance to the fourth resistance is shown, which may be used to characterize the ratio of the audio data corresponding to the second parallel resistance to the audio data corresponding to the fourth resistance. Further analysis can obtain the ratio of the audio data caused by the existence of the ground wire resistance in the audio data of the right channel, namely the crosstalk numberAccording to the ratio.
It should be noted that, in this embodiment, the electronic device may directly calculate the first compensation coefficient and the second compensation coefficient, and may also store the first compensation coefficient and the second compensation coefficient in a local memory of the electronic device in advance, so that the electronic device may read the compensation coefficients from the local memory, thereby saving the calculation time.
In step 22, the first audio data is compensated according to the first compensation coefficient and the second audio data, and the second audio data is compensated according to the second compensation coefficient and the first audio data.
In this embodiment, the electronic device may compensate the first audio data by using the first compensation coefficient and the second audio data. Referring to fig. 6, in step 61, the electronic device may obtain a product of the first compensation coefficient and the second audio data, the product being used to characterize crosstalk data generated by the second audio data on the left earpiece. In step 62, the electronic device may calculate a difference between the first audio data and the product, and use the difference as the audio data output to the left channel, i.e., the compensated audio data, according to the following formula (3):
VL’=VL-UL*VR; (3)
in the formula (3), VL' denotes compensated Audio data, VLRepresenting first audio data, ULDenotes a first compensation coefficient, VRRepresenting the second audio data.
In this embodiment, the electronic device may compensate the second audio data by using the second compensation coefficient and the first audio data. Referring to fig. 7, in step 71, the electronic device may obtain a product of the second compensation coefficient and the first audio data, the product being used to characterize crosstalk data generated by the first audio data on the right earpiece. In step 72, the electronic device may calculate a difference between the second audio data and the product, and output the difference as the audio data output to the right channel, i.e. the compensated audio data, according to the following formula (4):
VR’=VR-UR*VL; (4)
in the formula (4), VR' denotes compensated Audio data, VRRepresenting second audio data, URDenotes a second compensation coefficient, VLRepresenting first audio data.
In this embodiment, the flow of the audio data in the electronic device and the headset may be as shown in fig. 8: processor in electronic equipment acquires first audio data V from memoryLSecond audio data VRAnd obtaining a first compensation coefficient ULA second compensation coefficient UR. Then, the processor may compensate the audio data according to the above compensation coefficient, as shown in equation (3) and equation (4). The processor may then output the compensated audio data to the encoder, where the encoder performs corresponding processing on the compensated audio data and sends the processed audio data to the left channel and the right channel, respectively. Considering that the left channel and the right channel share the ground wire, the left channel and the right channel have crosstalk in sequence, and the original audio data read from the memory can be obtained after the crosstalk because the audio data formed by the crosstalk is subtracted in advance, that is, the actual audio effect is consistent with the expected audio effect.
Therefore, in the embodiment of the present disclosure, the compensation coefficient corresponding to each channel may be obtained, and then the audio data of the channel is compensated by using the compensation coefficient and the audio data of another channel, so as to obtain the compensated audio data. Therefore, in the embodiment, the audio data of each channel can be compensated, the audio data generated by mutual crosstalk between the left channel and the right channel can be offset, and the audio data generated by crosstalk is superposed in the audio playing process, so that the actual audio effect is consistent with the expected audio effect, the effect of eliminating crosstalk between two earphones is achieved, and the use experience is favorably improved.
On the basis of the audio data compensation method, an embodiment of the present disclosure further provides an audio data compensation apparatus, referring to fig. 9, adapted to an electronic device, where the apparatus includes:
a compensation coefficient obtaining module 91, configured to obtain first audio data to be output to a left channel and a first compensation coefficient corresponding to the left channel, and second audio data to be output to a right channel and a second compensation coefficient corresponding to the right channel; the first compensation coefficient is used for representing the crosstalk strength generated when the audio data of the right channel acts on the left channel, and the second compensation coefficient is used for representing the crosstalk strength generated when the audio data of the left channel acts on the right channel;
an audio data compensation module 92, configured to compensate the first audio data according to the first compensation coefficient and the second audio data, and compensate the second audio data according to the second compensation coefficient and the first audio data.
Optionally, the apparatus further includes a first coefficient obtaining module, where the first coefficient obtaining module includes:
the electronic equipment comprises a resistance value acquisition unit, a first resistance value acquisition unit and a second resistance value acquisition unit, wherein the resistance value acquisition unit is used for acquiring a first resistance value of a ground wire resistor between an earphone plug and a ground wire junction point in an earphone, a second resistance value of the ground wire resistor between a ground wire and a battery cathode in an earphone socket of the electronic equipment, and a third resistance value of a left earphone resistor and a fourth resistance value of a right earphone resistor in the earphone;
the common resistance obtaining unit is used for obtaining the sum of the first resistance value and the second resistance value to obtain a common resistance value representing the ground wire resistance from the cathode of the battery to the junction point;
the first resistance obtaining unit is used for obtaining a first parallel resistance value according to the fourth resistance value and the public resistance value, wherein the first parallel resistance value is used for representing the resistance value of an equivalent resistance formed by the parallel connection of a right earphone resistance and a ground wire resistance from a battery cathode to a junction point;
a first coefficient obtaining unit configured to calculate the first compensation coefficient based on a ratio of the first parallel resistance value to the third resistance value.
Optionally, the apparatus further includes a second coefficient obtaining module, where the second coefficient obtaining module includes:
the resistance value acquisition unit is used for acquiring a first resistance value of a ground wire resistor between the earphone plug and a ground wire junction point in the earphone, a second resistance value of the ground wire resistor between a ground wire and a battery cathode in the earphone socket of the electronic equipment, and a third resistance value of a left earphone resistor in the earphone and a fourth resistance value of a right earphone resistor in the earphone;
the common resistance obtaining unit is used for obtaining the sum of the first resistance value and the second resistance value to obtain a common resistance value representing the ground wire resistance from the cathode of the battery to the junction point;
the second resistance obtaining unit is used for obtaining a second parallel resistance value according to the third resistance value and the public resistance value, wherein the second parallel resistance value is used for representing the resistance value of the equivalent resistance after the left earphone resistance is connected in parallel with the ground wire resistance from the negative electrode of the battery to the junction point;
a second coefficient obtaining unit configured to calculate the second compensation coefficient based on a ratio of the second parallel resistance value to the fourth resistance value.
Optionally, the third resistance value is an average value of third resistance values of a plurality of preset sample earphones; and/or the presence of a gas in the gas,
the fourth resistance value is an average value of fourth resistance values of a plurality of preset sample earphones.
Optionally, the audio data compensation module includes:
a product obtaining unit, configured to obtain a product of the first compensation coefficient and the second audio data, where the product is used to represent crosstalk data generated by the second audio data on the left-side headphone;
and the audio data compensation unit is used for calculating the difference between the first audio data and the product and taking the difference as the audio data output to the left channel.
Optionally, the audio data compensation module includes:
a product obtaining unit, configured to obtain a product of the second compensation coefficient and the first audio data, where the product is used to represent crosstalk data generated by the first audio data on the right headphone;
and the audio data compensation unit is used for calculating the difference between the second audio data and the product and taking the difference as the audio data output to the right channel.
It can be understood that the apparatus provided in the embodiments of the present disclosure corresponds to the method described above, and specific contents may refer to the contents of each embodiment of the method, which are not described herein again.
FIG. 10 is a block diagram of an electronic device shown in accordance with an example embodiment. For example, the electronic device 1000 may be a smartphone, a computer, a digital broadcast terminal, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
Referring to fig. 10, electronic device 1000 may include one or more of the following components: processing components 1002, memory 1004, power components 1006, multimedia components 1008, audio components 1010, input/output (I/O) interfaces 1012, sensor components 1014, communication components 1016, and image capture components 1018.
The processing component 1002 generally controls overall operation of the electronic device 1000, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 1002 may include one or more processors 1020 to execute computer programs. Further, processing component 1002 may include one or more modules that facilitate interaction between processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate interaction between the multimedia component 1008 and the processing component 1002.
The memory 1004 is configured to store various types of data to support operations at the electronic device 1000. Examples of such data include computer programs for any application or method operating on the electronic device 1000, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1004 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 1006 provides power to the various components of the electronic device 1000. The power components 1006 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 1000. The power supply assembly 1006 may include a power chip, and the controller may communicate with the power chip to control the power chip to turn on or off the switching device, so that the battery supplies power or does not supply power to the motherboard circuit.
The multimedia component 1008 includes a screen that provides an output interface between the electronic device 1000 and the target object. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a target object. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
The audio component 1010 is configured to output and/or input audio signals. For example, the audio component 1010 may include a Microphone (MIC) configured to receive external audio signals when the electronic device 1000 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 1004 or transmitted via the communication component 1016. In some embodiments, audio component 1010 also includes a speaker for outputting audio signals.
I/O interface 1012 provides an interface between processing component 1002 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc.
The sensor assembly 1014 includes one or more sensors for providing various aspects of status assessment for the electronic device 1000. For example, the sensor assembly 1014 may detect an open/closed state of the electronic device 1000, a relative positioning of components, such as a display and keypad of the electronic device 1000, a change in position of the electronic device 1000 or a component, a presence or absence of a target object in contact with the electronic device 1000, an orientation or acceleration/deceleration of the electronic device 1000, and a change in temperature of the electronic device 1000.
The communication component 1016 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 may access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 1016 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 1016 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 1000 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components.
In an exemplary embodiment, a non-transitory readable storage medium is also provided, such as the memory 1004 including instructions, that includes an executable computer program that is executable by the processor. The readable storage medium may be, among others, ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (13)

1. An audio data compensation method applied to an electronic device, the method comprising:
acquiring first audio data to be output to a left channel and a first compensation coefficient corresponding to the left channel, and second audio data to be output to a right channel and a second compensation coefficient corresponding to the right channel; the first compensation coefficient is used for representing the crosstalk intensity generated when the audio data of the right channel acts on the left channel, and the second compensation coefficient is used for representing the crosstalk intensity generated when the audio data of the left channel acts on the right channel;
compensating the first audio data according to the first compensation coefficient and the second audio data, and compensating the second audio data according to the second compensation coefficient and the first audio data;
wherein obtaining a first compensation coefficient corresponding to the left channel comprises:
the method comprises the steps of obtaining a first resistance value of a ground wire resistor between a plug of the earphone and a ground wire junction point in the earphone, a second resistance value of the ground wire resistor between a ground wire and a battery cathode in an earphone socket of the electronic equipment, and obtaining a third resistance value of a left earphone resistor and a fourth resistance value of a right earphone resistor in the earphone;
obtaining the sum of the first resistance value and the second resistance value to obtain a common resistance value representing the ground wire resistance from the cathode of the battery to the junction point;
acquiring a first parallel resistance value according to the fourth resistance value and the public resistance value, wherein the first parallel resistance value is used for representing the resistance value of an equivalent resistor formed by connecting the right earphone resistor and a ground wire resistor between the cathode of the battery and a junction point in parallel;
calculating the first compensation coefficient based on a ratio of the first parallel resistance value to the third resistance value.
2. The audio data compensation method of claim 1, wherein obtaining the second compensation coefficient corresponding to the right channel comprises:
the method comprises the steps of obtaining a first resistance value of a ground wire resistor between a plug of the earphone and a ground wire junction point in the earphone, a second resistance value of the ground wire resistor between a ground wire and a battery cathode in an earphone socket of the electronic equipment, and obtaining a third resistance value of a left earphone resistor and a fourth resistance value of a right earphone resistor in the earphone;
obtaining the sum of the first resistance value and the second resistance value to obtain a common resistance value representing the ground wire resistance from the cathode of the battery to the junction point;
obtaining a second parallel resistance value according to the third resistance value and the public resistance value, wherein the second parallel resistance value is used for representing the resistance value of the equivalent resistance after the left earphone resistance is connected in parallel with the ground wire resistance from the cathode of the battery to the junction point;
calculating the second compensation coefficient based on a ratio of the second parallel resistance value to the fourth resistance value.
3. The audio data compensation method of claim 1, wherein compensating the first audio data according to the first compensation coefficient and the second audio data comprises:
obtaining a product of the first compensation coefficient and the second audio data, wherein the product is used for representing crosstalk data generated by the second audio data on a left earphone;
and calculating a difference value between the first audio data and the product, and taking the difference value as audio data output to a left channel.
4. The audio data compensation method of claim 1 or 2, wherein the third resistance value is an average value of third resistance values of a preset plurality of sample earphones; and/or the presence of a gas in the gas,
the fourth resistance value is an average value of fourth resistance values of a plurality of preset sample earphones.
5. The audio data compensation method of claim 1, wherein compensating the second audio data according to the second compensation coefficient and the first audio data comprises:
obtaining a product of the second compensation coefficient and the first audio data, wherein the product is used for representing crosstalk data generated by the first audio data on the right earphone;
and calculating a difference value between the second audio data and the product, and taking the difference value as audio data output to a right channel.
6. An audio data compensation apparatus, adapted for use in an electronic device, the apparatus comprising:
the compensation coefficient acquisition module is used for acquiring first audio data to be output to a left channel and a first compensation coefficient corresponding to the left channel, and second audio data to be output to a right channel and a second compensation coefficient corresponding to the right channel; the first compensation coefficient is used for representing the crosstalk strength generated when the audio data of the right channel acts on the left channel, and the second compensation coefficient is used for representing the crosstalk strength generated when the audio data of the left channel acts on the right channel;
the audio data compensation module is used for compensating the first audio data according to the first compensation coefficient and the second audio data and compensating the second audio data according to the second compensation coefficient and the first audio data;
wherein the apparatus further comprises a first coefficient obtaining module, the first coefficient obtaining module comprising:
the resistance value acquisition unit is used for acquiring a first resistance value of a ground wire resistor between the earphone plug and a ground wire junction point in the earphone, a second resistance value of the ground wire resistor between a ground wire and a battery cathode in the earphone socket of the electronic equipment, and a third resistance value of a left earphone resistor in the earphone and a fourth resistance value of a right earphone resistor in the earphone;
the common resistance obtaining unit is used for obtaining the sum of the first resistance value and the second resistance value to obtain a common resistance value representing the ground wire resistance from the cathode of the battery to the junction point;
the first resistance obtaining unit is used for obtaining a first parallel resistance value according to the fourth resistance value and the public resistance value, wherein the first parallel resistance value is used for representing the resistance value of an equivalent resistance formed by the parallel connection of a right earphone resistance and a ground wire resistance from a battery cathode to a junction point;
a first coefficient obtaining unit configured to calculate the first compensation coefficient based on a ratio of the first parallel resistance value to the third resistance value.
7. The audio data compensation apparatus of claim 6, further comprising a second coefficient acquisition module, the second coefficient acquisition module comprising:
the resistance value acquisition unit is used for acquiring a first resistance value of a ground wire resistor between the earphone plug and a ground wire junction point in the earphone, a second resistance value of the ground wire resistor between a ground wire and a battery cathode in the earphone socket of the electronic equipment, and a third resistance value of a left earphone resistor in the earphone and a fourth resistance value of a right earphone resistor in the earphone;
the common resistance obtaining unit is used for obtaining the sum of the first resistance value and the second resistance value to obtain a common resistance value representing the ground wire resistance from the cathode of the battery to the junction point;
the second resistance obtaining unit is used for obtaining a second parallel resistance value according to the third resistance value and the public resistance value, wherein the second parallel resistance value is used for representing the resistance value of the equivalent resistance after the left earphone resistance is connected in parallel with the ground wire resistance from the negative electrode of the battery to the junction point;
a second coefficient obtaining unit configured to calculate the second compensation coefficient based on a ratio of the second parallel resistance value to the fourth resistance value.
8. The audio data compensation apparatus of claim 6 or 7, wherein the third resistance value is an average value of third resistance values of a preset plurality of sample earphones; and/or the presence of a gas in the gas,
the fourth resistance value is an average value of fourth resistance values of a plurality of preset sample earphones.
9. The audio data compensation apparatus of claim 6, wherein the audio data compensation module comprises:
a product obtaining unit, configured to obtain a product of the first compensation coefficient and the second audio data, where the product is used to represent crosstalk data generated by the second audio data on the left-side headphone;
and the audio data compensation unit is used for calculating the difference between the first audio data and the product and taking the difference as the audio data output to the left channel.
10. The audio data compensation apparatus of claim 6, wherein the audio data compensation module comprises:
a product obtaining unit, configured to obtain a product of the second compensation coefficient and the first audio data, where the product is used to represent crosstalk data generated by the first audio data on the right headphone;
and the audio data compensation unit is used for calculating the difference between the second audio data and the product and taking the difference as the audio data output to the right channel.
11. An electronic device, comprising:
a processor;
a memory for storing a computer program executable by the processor;
wherein the processor is configured to execute the computer program in the memory to implement the steps of the method according to any of claims 1-5.
12. The electronic device according to claim 11, wherein the electronic device further comprises an encoder and an earphone socket, and a reference voltage collecting line is not provided between the encoder and the earphone socket and is configured to collect a voltage on a ground line between a ground line in the earphone socket and a negative electrode of the battery as a reference voltage.
13. A computer-readable storage medium, in which an executable computer program is stored which, when executed by a processor, is capable of carrying out the steps of a method according to any one of claims 1 to 5.
CN202010761458.4A 2020-07-31 2020-07-31 Audio data compensation method and device, electronic equipment and storage medium Active CN111901719B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010761458.4A CN111901719B (en) 2020-07-31 2020-07-31 Audio data compensation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010761458.4A CN111901719B (en) 2020-07-31 2020-07-31 Audio data compensation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111901719A CN111901719A (en) 2020-11-06
CN111901719B true CN111901719B (en) 2022-06-03

Family

ID=73183478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010761458.4A Active CN111901719B (en) 2020-07-31 2020-07-31 Audio data compensation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111901719B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106060719A (en) * 2016-05-31 2016-10-26 维沃移动通信有限公司 Terminal audio output control method and terminal
CN107645689A (en) * 2016-07-22 2018-01-30 展讯通信(上海)有限公司 Eliminate the method, apparatus and phonetic codec chip of acoustic crosstalk
CN108430003A (en) * 2018-03-30 2018-08-21 广东欧珀移动通信有限公司 Audio compensation method and device, readable storage medium storing program for executing, terminal
CN208940176U (en) * 2018-10-30 2019-06-04 歌尔科技有限公司 A kind of earphone

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102056054B (en) * 2009-10-30 2013-09-18 扬智科技股份有限公司 Sound playing device and compensation method thereof
US9936317B2 (en) * 2014-10-31 2018-04-03 Fairchild Semiconductor Corporation Audio crosstalk calibration switch
US9888318B2 (en) * 2015-11-25 2018-02-06 Mediatek, Inc. Method, system and circuits for headset crosstalk reduction
CN107071658A (en) * 2017-04-28 2017-08-18 维沃移动通信有限公司 It is a kind of to reduce the method and mobile terminal of mobile terminal cross-talk

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106060719A (en) * 2016-05-31 2016-10-26 维沃移动通信有限公司 Terminal audio output control method and terminal
CN107645689A (en) * 2016-07-22 2018-01-30 展讯通信(上海)有限公司 Eliminate the method, apparatus and phonetic codec chip of acoustic crosstalk
CN108430003A (en) * 2018-03-30 2018-08-21 广东欧珀移动通信有限公司 Audio compensation method and device, readable storage medium storing program for executing, terminal
CN208940176U (en) * 2018-10-30 2019-06-04 歌尔科技有限公司 A kind of earphone

Also Published As

Publication number Publication date
CN111901719A (en) 2020-11-06

Similar Documents

Publication Publication Date Title
KR102042152B1 (en) Control method and device for playing audio
EP3664291A1 (en) Audio signal adjustment method and device, storage medium, and terminal
CN107493500B (en) Multimedia resource playing method and device
RU2636580C2 (en) Method and device for displaying conversational interface
CN104281432A (en) Method and device for regulating sound effect
CN105338389A (en) Method and apparatus for controlling intelligent television
CN106851451B (en) A kind of earpiece volume control method and device
CN105120337A (en) Video special effect processing method, video special effect processing device and terminal equipment
CN108845787B (en) Audio adjusting method, device, terminal and storage medium
CN107135452B (en) Hearing aid fitting method and device
CN108076199B (en) Method and device for detecting air tightness of microphone
CN104378715A (en) Device and method for lowering earphone POP sound
CN106888327B (en) Voice playing method and device
CN109614470B (en) Method and device for processing answer information, terminal and readable storage medium
CN104394137A (en) Voice call reminding method and device
CN104464674B (en) Liquid crystal display method of adjustment and device
CN106033397A (en) Method and device for adjusting memory buffer, and terminal
CN105101013A (en) Method and device for playing voice signals
CN104796875A (en) Call mode selection method and device
CN105516451A (en) Sound effect adjustment method and device
CN111880681A (en) Touch screen sampling rate adjusting method and device and computer storage medium
CN108093132B (en) Terminal device and ringtone volume control method
CN111988704B (en) Sound signal processing method, device and storage medium
CN104794074A (en) External connection device identification method and device
CN113079493A (en) Information matching display method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant