CN115824271A - Capacitance detection method, capacitance detection device and electronic equipment - Google Patents

Capacitance detection method, capacitance detection device and electronic equipment Download PDF

Info

Publication number
CN115824271A
CN115824271A CN202111092492.8A CN202111092492A CN115824271A CN 115824271 A CN115824271 A CN 115824271A CN 202111092492 A CN202111092492 A CN 202111092492A CN 115824271 A CN115824271 A CN 115824271A
Authority
CN
China
Prior art keywords
frame
capacitance data
original
original capacitance
variation corresponding
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.)
Pending
Application number
CN202111092492.8A
Other languages
Chinese (zh)
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.)
Shenzhen Goodix Technology Co Ltd
Original Assignee
Shenzhen Goodix Technology 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 Shenzhen Goodix Technology Co Ltd filed Critical Shenzhen Goodix Technology Co Ltd
Priority to CN202111092492.8A priority Critical patent/CN115824271A/en
Publication of CN115824271A publication Critical patent/CN115824271A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Electronic Switches (AREA)

Abstract

The embodiment of the application provides a method and a device for capacitance detection, wherein the method comprises the following steps: determining a first variation corresponding to an nth frame of original capacitance data according to a difference between the nth frame of original capacitance data and an (n-M) th frame of original capacitance data output by a detection channel in the capacitance detection device, wherein n is a positive integer greater than M and M is a positive integer greater than or equal to 1; determining a temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variable quantity corresponding to the n-th frame of original capacitance data; and determining the effective capacitance data in the n-th frame of original capacitance data according to the temperature compensation coefficient corresponding to the n-th frame of original capacitance data and the n-th frame of original capacitance data. The method and the device can obtain more accurate effective capacitance data.

Description

Capacitance detection method, capacitance detection device and electronic equipment
Technical Field
The embodiments of the present application relate to the field of sensors, and more particularly, to a method for capacitance detection, a capacitance detection apparatus, and an electronic device.
Background
The capacitance detection device may be generally a device capable of recognizing whether a person approaches. Whether a person approaches is judged by comparing the original capacitance data output by the capacitance detection device with a preset threshold value. For example, when the original capacitance data is greater than the approach threshold, it is determined that a person approaches the capacitance detection device; and when the original capacitance data is smaller than or equal to the approach threshold, judging that no person approaches the capacitance detection device.
In practical applications, such as capacitive in-ear detection, specific Absorption Rate (SAR) applications, etc., original capacitance data output by a capacitance detection device may drift due to a change in an ambient temperature, and if the original capacitance data is not subjected to temperature drift processing, the original capacitance data output by the capacitance detection device may include temperature interference without disturbance, which may cause inaccurate functions applied based on the original capacitance data, such as erroneous determination of proximity recognition.
Disclosure of Invention
The embodiment of the application provides a capacitance detection method, a capacitance detection device and electronic equipment, which are used for reducing the interference of temperature drift on original capacitance data output by the capacitance detection device so as to obtain more accurate effective capacitance data.
In a first aspect, a method for capacitance detection is provided, where the method is applied to a capacitance detection device, and the method includes: determining a first variation corresponding to an nth frame of original capacitance data according to a difference between the nth frame of original capacitance data and an (n-M) th frame of original capacitance data output by a detection channel in the capacitance detection device, wherein n is a positive integer greater than M and M is a positive integer greater than or equal to 1; determining a temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variable quantity corresponding to the n-th frame of original capacitance data; and determining the effective capacitance data in the n-th frame of original capacitance data according to the temperature compensation coefficient corresponding to the n-th frame of original capacitance data and the n-th frame of original capacitance data.
By dynamically adjusting the temperature compensation coefficient, the environmental temperature change can be eliminated more accurately, the influence of the environmental temperature change on the original capacitance data output by the detection channel is optimized, and more accurate effective capacitance data can be obtained. So as to be better suited for various applications based on capacitive detection, such as wear detection, SRA, pressure detection, touch gesture operation, etc. For example, when the approach detection is performed, the method is favorable for reducing the misjudgment probability of the approach identification, and when a human body approaches the capacitance detection device, the influence of temperature drift is also favorably reduced, and the signal-to-noise ratio of the detected capacitance signal is improved. For another example, in a scene of wearing the headset, the wearing state of the headset can be accurately identified, so that the user experience can be improved.
In one possible implementation, the method further includes: determining a difference value between the nth frame reference capacitance data and the initial reference capacitance data output by a reference channel in the capacitance detection device as a second variation corresponding to the nth frame original capacitance data, wherein the second variation is used for representing noise capacitance data output by the reference channel and caused by environmental temperature change; the determining a temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variation corresponding to the n-th frame of original capacitance data includes: and under the condition that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variation corresponding to the n-th frame of original capacitance data, the second variation corresponding to the n-th frame of original capacitance data and the n-th frame of original capacitance data.
When the first variation corresponding to the original capacitance data is not updated, or when the first variation corresponding to the current original capacitance data is equal to the first variation corresponding to the previous frame of original capacitance data, the change of the current original capacitance data is caused by the change of the environmental temperature, at the moment, the corresponding temperature compensation coefficient is updated based on the determined original capacitance data and the first variation and the second variation corresponding to the original capacitance data, and the noise capacitance data caused by the change of the environmental temperature in the original capacitance data can be accurately removed, so that the accurate effective capacitance data can be obtained.
In a possible implementation manner, in a case that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variation corresponding to the n-th frame of original capacitance data, the second variation corresponding to the n-th frame of original capacitance data, and the n-th frame of original capacitance data, includes: determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the following formula under the condition that the first variation corresponding to the n-th frame of original capacitance data is not equal to the first variation corresponding to the (n-1) -th frame of original capacitance data:
Figure BDA0003268061940000021
wherein k (n) represents the temperature compensation coefficient corresponding to the n-th frame of original capacitance data, rawdata (n) represents the n-th frame of original capacitance data, and S 0 (n) represents the first variation corresponding to the n-th frame of original capacitance data, δ ref (n) represents the second variation corresponding to the n-th frame of original capacitance data, P is an integer greater than or equal to 0 and P is less than n.
The computational requirements can be simplified by employing a linear solution process.
In a possible implementation manner, in a case that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variation corresponding to the n-th frame of original capacitance data, the second variation corresponding to the n-th frame of original capacitance data, and the n-th frame of original capacitance data, includes: under the condition that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data by solving a minimum mean square error for the following objective function:
Figure BDA0003268061940000031
wherein k (n) represents the temperature compensation coefficient corresponding to the n-th frame of original capacitance data when J (n) is the minimum value, rawdata (n) represents the n-th frame of original capacitance data, and S 0 (n) represents the first variation corresponding to the n-th frame of original capacitance data, δ ref (n) represents the second variation corresponding to the n-th frame of original capacitance data, P is an integer greater than or equal to 0 and P is less than n.
By solving the minimum mean square error of the objective function, the error of obtaining the temperature compensation coefficient can be reduced.
In a possible implementation manner, the determining a temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variation corresponding to the n-th frame of original capacitance data includes: and under the condition that the first variation corresponding to the n-th frame of original capacitance data is not equal to the first variation corresponding to the (n-1) th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the (n-1) th frame of original capacitance data as the temperature compensation coefficient corresponding to the n-th frame of original capacitance data.
When the first variation is updated, that is, when the first variation corresponding to the original capacitance data of the current frame is not equal to the first variation corresponding to the original capacitance data of the previous frame, the temperature compensation coefficient may not be updated, so as to avoid causing a large calculation error.
In a possible implementation manner, the determining, according to a difference between an nth frame of original capacitance data output by a detection channel in the capacitance detection apparatus and an (n-M) th frame of original capacitance data, a first variation corresponding to the nth frame of original capacitance data includes: determining the first variation corresponding to the n-th frame of original capacitance data according to the following formula when the absolute value of the difference between the n-th frame of original capacitance data and the (n-M) -th frame of original capacitance data is greater than a fluctuation threshold:
S 0 (n)=S 0 (n-1)+Diffchange(n),
wherein S is 0 (n) the first variation corresponding to the n-th frame of original capacitance dataAmount, S 0 (n-1) represents the first variation corresponding to the (n-1) th frame of original capacitance data, and Diffchange (n) represents the difference between the n-th frame of original capacitance data and the (n-M) th frame of original capacitance data.
In a possible implementation manner, the determining, according to a difference between an nth frame of original capacitance data output by a detection channel in the capacitance detection device and an (n-M) th frame of original capacitance data, a first variation corresponding to an nth frame of time includes: determining the first variation corresponding to the (n-1) th frame of original capacitance data as the first variation corresponding to the nth frame of original capacitance data when the absolute value of the difference between the nth frame of original capacitance data and the (n-M) th frame of original capacitance data is less than or equal to a fluctuation threshold.
Through the size relation between the differential capacitance data and the fluctuation threshold value, the estimated value of the effective capacitance data can be accurately determined, and the method is favorable for obtaining a proper temperature compensation coefficient, so that better temperature compensation can be made for the original capacitance data, and the method is better suitable for various applications based on capacitance detection.
In a possible implementation manner, the determining the effective capacitance data in the n-th frame of original capacitance data according to the temperature compensation coefficient corresponding to the n-th frame of original capacitance data and the n-th frame of original capacitance data includes: determining the effective capacitance data in the n-th frame of original capacitance data according to the following formula:
Rawdatanew(n)=Rawdata(n)-k(n)*δref(n)),
wherein, rawdatanew (n) represents the effective capacitance data in the nth frame of original capacitance data, rawdata (n) represents the nth frame of original capacitance data, k (n) represents the temperature compensation coefficient corresponding to the nth frame of original capacitance data, and δ ref (n) represents the difference between the nth frame of reference capacitance data and the initial reference capacitance data output by the reference channel in the capacitance detecting device.
The original capacitance data is subjected to temperature compensation, effective capacitance data is extracted, and the method can be better suitable for various applications based on capacitance detection.
In one possible implementation, the valid capacitance data in the n-th frame of raw capacitance data is used to determine whether a target object is close to the capacitance detecting device.
When approaching detection, the temperature compensation coefficient acquired by the embodiment of the application is adopted to carry out temperature compensation on original capacitance data, so that the misjudgment probability of approaching identification is favorably reduced, the influence of temperature drift is favorably reduced when a human body approaches the capacitance detection device, and the signal-to-noise ratio of the detected capacitance signal is improved.
In one possible implementation, M is determined based on a detection period of the capacitance detection device and/or a rate of change of an ambient temperature.
And M is adaptively adjusted according to the detection period of the capacitance detection device and/or the change rate of the environmental temperature, so that a proper temperature compensation coefficient can be obtained, and more accurate effective capacitance data can be obtained.
In a second aspect, there is provided a capacitance detection device comprising: a first determining unit, configured to determine a first variation corresponding to an nth frame of original capacitance data output by a detection channel in the capacitance detection device according to a difference between the nth frame of original capacitance data and an (n-M) th frame of original capacitance data, where n is a positive integer greater than M and M is a positive integer greater than or equal to 1; the second determining unit is used for determining a temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variable quantity corresponding to the n-th frame of original capacitance data; and the third determining unit is used for determining the effective capacitance data in the n-th frame of original capacitance data according to the temperature compensation coefficient corresponding to the n-th frame of original capacitance data and the n-th frame of original capacitance data.
In one possible implementation, the capacitance detection apparatus further includes: a fourth determining unit, configured to determine a difference between an nth frame of reference capacitance data output by a reference channel in the capacitance detection apparatus and the initial reference capacitance data as a second variation corresponding to the nth frame of original capacitance data, where the second variation is used to represent noise capacitance data output by the reference channel and caused by an ambient temperature change; the second determining unit is specifically configured to: and under the condition that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the n-th frame of original capacitance data, the first variation corresponding to the n-th frame of original capacitance data and the second variation corresponding to the n-th frame of original capacitance data.
In a possible implementation manner, the second determining unit is specifically configured to: determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the following formula under the condition that the first variation corresponding to the n-th frame of original capacitance data is not equal to the first variation corresponding to the (n-1) -th frame of original capacitance data:
Figure BDA0003268061940000051
wherein k (n) represents the temperature compensation coefficient corresponding to the n-th frame of original capacitance data, rawdata (n) represents the n-th frame of original capacitance data, and S 0 (n) represents the first variation corresponding to the n-th frame of original capacitance data, δ ref (n) represents the second variation corresponding to the n-th frame of original capacitance data, P is an integer greater than or equal to 0 and P is less than n.
In a possible implementation manner, the second determining unit is specifically configured to: determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data by solving a minimum mean square error for the following objective function under the condition that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data:
Figure BDA0003268061940000061
wherein k (n) represents the temperature compensation coefficient corresponding to the n-th frame of original capacitance data when J (n) is the minimum value, rawdata (n) represents the n-th frame of original capacitance data, and S 0 (n) represents the first variation corresponding to the n-th frame of original capacitance data, δ ref (n) represents the second variation corresponding to the n-th frame of original capacitance dataAnd (b) reducing the amount, wherein P is an integer greater than or equal to 0 and is less than n.
In a possible implementation manner, the second determining unit is specifically configured to: and determining the temperature compensation coefficient corresponding to the (n-1) th frame of original capacitance data as the temperature compensation coefficient corresponding to the n-th frame of original capacitance data when the first variation corresponding to the n-th frame of original capacitance data is not equal to the first variation corresponding to the (n-1) th frame of original capacitance data.
In a possible implementation manner, the first determining unit is specifically configured to: determining the first variation corresponding to the n-th frame of original capacitance data according to the following formula when the absolute value of the difference between the n-th frame of original capacitance data and the (n-M) -th frame of original capacitance data is greater than a fluctuation threshold:
S 0 (n)=S 0 (n-1)+Diffchange(n),
wherein S is 0 (n) the first variation, S, corresponding to the n-th frame of original capacitance data 0 (n-1) represents the first variation corresponding to the (n-1) th frame of original capacitance data, and Diffchange (n) represents the difference between the n-th frame of original capacitance data and the (n-M) th frame of original capacitance data.
In a possible implementation manner, the first determining unit is specifically configured to: determining the first variation corresponding to the (n-1) th frame of original capacitance data as the first variation corresponding to the nth frame of original capacitance data when an absolute value of a difference between the nth frame of original capacitance data and the (n-M) th frame of original capacitance data is less than or equal to a fluctuation threshold.
In a possible implementation manner, the third determining unit is specifically configured to: determining the effective capacitance data in the n-th frame of raw capacitance data according to the following formula:
Rawdatanew(n)=Rawdata(n)-k(n)*δref(n)),
wherein, rawdatanew (n) represents the effective capacitance data in the nth frame of original capacitance data, rawdata (n) represents the nth frame of original capacitance data, k (n) represents the temperature compensation coefficient corresponding to the nth frame of original capacitance data, and δ ref (n) represents the difference between the nth frame of reference capacitance data and the original reference capacitance data output by the reference channel in the capacitance detection device.
In one possible implementation, the valid capacitance data in the n-th frame of raw capacitance data is used to determine whether a target object is close to the capacitance detecting device.
In one possible implementation, M is determined based on a detection period of the capacitance detection device and/or a rate of change of an ambient temperature.
In a third aspect, a capacitance detection apparatus is provided, including: a processor and a memory, the memory being used for storing a computer program, and the processor being used for calling and executing the computer program stored in the memory, and executing the method of the first aspect or its implementation manner.
In a fourth aspect, an electronic device is provided, which includes the capacitance detection apparatus in the second aspect or its implementation manners.
In a fifth aspect, a chip is provided, which includes: and a processor, configured to call and run the computer program from the memory, so that the device on which the chip is installed performs the method in the first aspect or each implementation manner thereof.
A sixth aspect provides a computer-readable storage medium for storing a computer program, the computer program causing a computer to perform the method of the first aspect or its implementations.
Drawings
Fig. 1 is an application scenario diagram according to an embodiment of the present application.
Fig. 2 is a schematic diagram of the change of the raw capacitance data and the reference capacitance data with the change process of the environmental temperature and the approach process of the human body.
Fig. 3 is a schematic block diagram of a method of capacitance detection of an embodiment of the present application.
Fig. 4 is a schematic diagram of changes in raw capacitance data and changes in differential capacitance data at M =1 and M =5 in the case where a human body approaches and a temperature changes.
Fig. 5 is a schematic diagram of changes in raw capacitance data and differential capacitance data at M =1 and M =5 in the case where no human body approaches only the temperature change.
Fig. 6 shows a schematic diagram of the result of temperature compensation by a fixed temperature compensation coefficient.
Fig. 7 shows a schematic diagram of the results of temperature compensation by dynamically adjusted temperature compensation coefficients.
Fig. 8 is a schematic block diagram of a capacitance detection device according to an embodiment of the present application.
Fig. 9 is another schematic block diagram of a capacitance detection device according to an embodiment of the present application.
Fig. 10 is a schematic block diagram of another capacitance detection device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 shows an application scenario diagram according to an embodiment of the present application. As shown in fig. 1, the capacitance detection device includes a detection channel for sensing the approach of a conductor (e.g., a human body) and a reference channel for sensing the change of an ambient temperature, the detection channel includes a sensor (sensor) and a sensing capacitor Cs, the reference channel includes a sensing capacitor Cr, and the detection channel and the reference channel each include an Analog-Front-End (AFE) capable of detecting the capacitance change amount on the sensing capacitor Cs and the sensing capacitor Cr, and include an operational Amplifier (AMP) and an Analog-to-Digital Converter (ADC). When the environmental temperature changes and the human body approaches the capacitance detection device at the same time, raw capacitance data Rawdata output by the detection channel comprises capacitance variation caused by approach and capacitance variation caused by environmental temperature change, and reference capacitance data Refdata output by the reference channel only comprises the capacitance variation caused by the environmental temperature change. A Digital Processing Unit (DPU) performs arithmetic processing on Rawdata and Refdata to identify whether a human body approaches the capacitance detection device.
In the embodiment of the present application, the capacitance variation caused by the proximity may also be referred to as effective capacitance data, and the capacitance variation caused by the ambient temperature change may also be referred to as noise capacitance data, that is, the raw capacitance data output by the detection channel includes the effective capacitance data and the noise capacitance data.
Fig. 2 is a schematic diagram showing the change of the raw capacitance data and the reference capacitance data along with the change of the ambient temperature and the approach of the human body. Under the condition that the influence of the ambient temperature is not considered, the original capacitance data is compared with an approach threshold value, and if the original capacitance data is larger than the approach threshold value, the fact that a human body approaches the capacitance detection device is judged; and if the original capacitance data is smaller than or equal to the approach threshold, judging that no person approaches the capacitance detection device. However, since the ambient temperature generally changes slowly, when the ambient temperature rises to be greater than the approach threshold, it may be determined that a person approaches the capacitance detection device by mistake even if no human body approaches the capacitance detection device. Therefore, some processing of the raw capacitance data is required to reduce the effects of temperature drift.
Generally, when the reference channel and the detection channel can be completely matched on the premise of the design of the constraint structure, that is, the reference capacitance data can completely reflect the influence of the environmental temperature change in the original capacitance data, the influence of the environmental temperature change can be subtracted from the original capacitance data to obtain effective capacitance data rawdataew, that is, rawdataew = Rawdata-Refdata, and the effective capacitance data rawdataew is compared with the approach threshold, so that whether a human body approaches the capacitance detection device at present can be judged. Under the condition that the matching degree of the reference channel and the detection channel is good, in a scene with relatively stable environmental change, the relative change of the environmental temperature can be subtracted by using a fixed coefficient mode, and the environmental influence is roughly subtracted, as shown in formula 1:
Rawdatanew(n)=Rawdata(n)-k*(Refdata(n)-Refdata(1))(1)
here, n denotes a frame number, k denotes a temperature compensation coefficient, that is, rawdata (n) denotes raw capacitance data of an nth frame, refdata (n) denotes reference capacitance data of the nth frame, refdata (1) denotes initial reference capacitance data of a reference channel output when the capacitance detection device is powered on, and Rawdatanew (n) denotes effective capacitance data of the nth frame, which may also be referred to as effective capacitance data in the raw capacitance data of the nth frame.
However, in practical application, due to the structural design, the capacitance deviation of the reference channel and the detection channel, the matching degree may be poor, and in a scene with severe temperature change, such as a targeted cyclic temperature rise and drop test scene, an indoor and outdoor temperature difference mutation scene, and a scene with large temperature change of a power amplification device in mobile phone application, the method of fixing the temperature compensation coefficient may have more problems, and if the temperature influence is not reduced enough, the human body may be erroneously judged to be close; or the temperature influence is reduced too much, it may be misjudged that someone is approaching as nobody is approaching. Such misjudgment may bring about a great influence in a specific application, for example, the in-ear detection function may cause misjudgment as wearing or dropping, or, in an SAR application scenario, the misjudgment may affect adjustment of antenna transmission power, thereby affecting the overall function.
Fig. 3 shows a schematic block diagram of a method 100 of detecting capacitance of an embodiment of the present application. The method 100 may be performed by a processor, for example, may be performed by a DPU as shown in fig. 1, and as shown in fig. 3, the method 100 may include some or all of the following:
s110, determining a first variable corresponding to an nth frame of original capacitance data according to a difference value between the nth frame of original capacitance data and an (n-M) th frame of original capacitance data output by a detection channel in the capacitance detection device, wherein n is a positive integer larger than M and M is a positive integer larger than or equal to 1;
s120, determining a temperature compensation coefficient corresponding to the nth frame of original capacitance data according to a first variable quantity corresponding to the nth frame of original capacitance data;
and S130, determining effective capacitance data in the n-th frame of original capacitance data according to the temperature compensation coefficient corresponding to the n-th frame of original capacitance data and the n-th frame of original capacitance data.
First, for convenience of description, the nth frame raw capacitance data is represented as Rawdata (n), the (n-M) th frame raw capacitance data is represented as Rawdata (n-M), and a first variation corresponding to the nth frame raw capacitance data is represented as S 0 (n), expressing the temperature compensation coefficient corresponding to the n frame original capacitance data as k (n), and expressing the effective capacitance in the n frame original capacitance dataThe data is represented as Rawdatanew (n), and the difference between the original capacitance data of the nth frame and the original capacitance data of the (n-M) th frame is represented as Diffchange (n), where n represents the nth frame.
Specifically, the processor may first obtain Rawdata (n) and Rawdata (n-M); and calculating Diffchange (n), namely Diffchange (n) = Rawdata (n) -Rawdata (n-M); next, S is determined based on Diffchange (n) 0 (n); again, according to S 0 (n), determining k (n); and finally determining Rawdatanew (n) according to k (n) and Rawdata (n). It should be noted that this method is suitable for the case where n is greater than M, and if n is less than or equal to M, the fixed temperature compensation coefficient k in formula 1 may be adopted.
For example, M =3, the technical solution provided by the present application is performed starting from n = 4. Firstly, diffchange (4) = Rawdata (4) -Rawdata (1) is calculated; from Diffchange (4), S is determined 0 (4) (ii) a According to S 0 (4) Determining k (4); and determining Rawdatanew (4) according to k (4) and Rawdata (4). When the Rawdata (5) is acquired, diffchange (5) = Rawdata (5) -Rawdata (2); from Diffchange (5), S is determined 0 (5) (ii) a According to S 0 (5) Determining k (5); and determining Rawdatanew (5) according to the k (5) and the Rawdata (5). .., the above steps may be performed in sequence each time one raw data is obtained, so as to obtain the corresponding raw.
Therefore, the capacitance detection method of the embodiment of the application can more accurately eliminate the ambient temperature change by dynamically adjusting the temperature compensation coefficient, optimizes the influence of the ambient temperature change on the original capacitance data output by the detection channel, and can obtain more accurate effective capacitance data. So as to be better suited for various applications based on capacitive detection, such as wear detection, SRA, pressure detection, touch gesture operation, etc. For example, when the approach detection is performed, the method is favorable for reducing the misjudgment probability of the approach identification, and when a human body approaches the capacitance detection device, the influence of temperature drift is also favorably reduced, and the signal-to-noise ratio of the detected capacitance signal is improved. For another example, in a scene of wearing the headset, the wearing state of the headset can be accurately identified, so that the user experience can be improved.
Optionally, in this embodiment of the present application, determining, according to a difference between an nth frame of original capacitance data output by a detection channel in the capacitance detection apparatus and an (n-M) th frame of original capacitance data, a first variation corresponding to the nth frame of original capacitance data includes: determining a first variation corresponding to the n-th frame of original capacitance data according to the following formula when the absolute value of the difference between the n-th frame of original capacitance data and the (n-M) -th frame of original capacitance data is greater than a fluctuation threshold:
S 0 (n)=S 0 (n-1)+Diffchange(n),
wherein S is 0 (n) represents a first variation corresponding to the n-th frame of original capacitance data, S 0 (n-1) represents a first variation corresponding to the original capacitance data of the (n-1) th frame, and Diffchange (n) represents a difference between the original capacitance data of the nth frame and the original capacitance data of the (n-M) th frame.
Optionally, in this embodiment of the present application, determining, according to a difference between an nth frame of original capacitance data output by a detection channel in the capacitance detection apparatus and an (n-M) th frame of original capacitance data, a first variation corresponding to the nth frame of original capacitance data includes: and determining a first variation corresponding to the (n-1) th frame of original capacitance data as a first variation corresponding to the nth frame of original capacitance data when the absolute value of the difference between the nth frame of original capacitance data and the (n-M) th frame of original capacitance data is less than or equal to a fluctuation threshold. That is, S 0 (n)=S 0 (n-1)。
Specifically, if the absolute value of Diffchange (n) is greater than the fluctuation threshold, the change in Rawdata (n) can be considered to be mainly caused by valid behavior, e.g., approaching and departing behavior; if the absolute value of Diffchange (n) is less than or equal to the fluctuation threshold, the change in Rawdata (n) can be considered to be caused solely by the change in ambient temperature. That is, by comparing Diffchange (n) with the fluctuation threshold, it is possible to roughly determine the position where the valid behavior occurs, that is, the position where the valid behavior occurs at which frame time. Taking a proximity detection scene as an example, fig. 4 shows a change diagram of raw capacitance data Rawdata and a change diagram of differential capacitance data Diffchange at M =1 and M =5 in the case where a human body approaches and the temperature changes. Fig. 5 shows a schematic diagram of the change of raw capacitance data Rawdata and a schematic diagram of the change of differential capacitance data Diffchange at M =1 and M =5 when no human body is close and only temperature changes occur. Wherein the abscissa represents the number of frames and the ordinate represents the amplitude. As can be seen from the figure, the differential capacitance data Diffchange when M is greater than 1 can eliminate the influence of partial ambient temperature variation.
For each Diffchange, once the absolute value is judged to be larger than the fluctuation threshold value, the corresponding S is determined 0 Updating to the last acquired S 0 With the sum of currently acquired Diffchanges, e.g. if the absolute value of Diffchange (n) is greater than the fluctuation threshold, S 0 (n)=S 0 (n-1) + Diffchange (n); and does not update S once the absolute value of Diffchange is judged to be less than or equal to the fluctuation threshold value 0 I.e. S taken immediately before 0 Determining the S corresponding to the current Diffchange 0 For example, if the absolute value of Diffchange (n) is less than or equal to the fluctuation threshold, S 0 (n)=S 0 (n-1)。
The first variation is used to estimate the effective capacitance data in the raw capacitance data output by the detection channel, in other words, the process of determining the first variation can also be understood as the process of estimating the effective capacitance data in the raw capacitance data output by the detection channel.
It should be noted that, when the capacitance detection device is powered on, S 0 The initial value of (2) can be an initial value Rawdata (1) of original capacitance data output by the detection channel, and when no effective action exists, S corresponding to each frame Rawdata output by the detection channel 0 Are all fixed as S 0 I.e., rawdata (1). When the effective action occurs for the first time, S corresponding to each frame of Rawdata output by the detection channel is detected 0 Then an update is made, i.e. at S 0 The Diffchange in the period is superimposed on the initial value of (a). After the effective behavior disappears, detecting S corresponding to each frame of Rawdata output by the channel 0 Then no update is made, i.e. the last updated S when valid behavior exists is maintained 0 . Similarly, when the second occurrence of the effective action occursDetecting S corresponding to each frame of Rawdata output by the channel 0 Updated, i.e. the last updated S when the first valid action occurs 0 On the basis of the difference of the second effective action generation period, and so on.
Through the size relation between the differential capacitance data and the fluctuation threshold value, the estimated value of the effective capacitance data can be accurately determined, and the method is favorable for obtaining a proper temperature compensation coefficient, so that better temperature compensation can be made for the original capacitance data, and the method is better suitable for various applications based on capacitance detection.
Optionally, in an embodiment of the present application, the method 100 further includes: determining a difference value between the nth frame reference capacitance data and the initial reference capacitance data output by a reference channel in the capacitance detection device as a second variation corresponding to the nth frame original capacitance data, wherein the second variation is used for representing noise capacitance data output by the reference channel and caused by environmental temperature change; determining a temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to a first variation corresponding to the n-th frame of original capacitance data, including: and under the condition that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variation corresponding to the n-th frame of original capacitance data, the second variation corresponding to the n-th frame of original capacitance data and the n-th frame of original capacitance data.
For convenience of description, the second variation corresponding to the raw capacitance data of the nth frame may be represented as δ ref (n), δ ref (n) = Refdata (n) -Refdata (1). Refdata (n) represents the nth frame of reference capacitance data, and Refdata (1) represents initial reference capacitance data when the capacitance detection device is powered on, namely the 1 st frame of reference capacitance data output by a reference channel after the capacitance detection device is powered on.
When the first variation corresponding to the original capacitance data is not updated, that is, when the first variation corresponding to the original capacitance data of the current frame is equal to the first variation corresponding to the original capacitance data of the previous frame, it indicates that the change of the original capacitance data is caused by the change of the environmental temperature, and at this time, based on the determined original capacitance data and the corresponding first variation and second variation, the corresponding temperature compensation coefficient is updated, so that the noise capacitance data caused by the change of the environmental temperature in the original capacitance data can be accurately removed, and thus, more accurate effective capacitance data can be obtained.
For each frame of original capacitance data, a corresponding first variation is calculated, and a corresponding temperature compensation coefficient is determined according to a magnitude relation between the calculated first variation and a first variation corresponding to a previous frame of original capacitance data.
In one possible embodiment, k (n) may be obtained by solving a minimum mean square error for the following objective function, e.g., calculating the minimum mean square error for P frame data.
Figure BDA0003268061940000121
Wherein, rawdata (n) represents the n-th frame of original capacitance data when J (n) is the minimum value, k (n) represents the temperature compensation coefficient corresponding to the n-th frame of original capacitance data, δ ref (n) represents the second variation corresponding to the n-th frame of original capacitance data, and S 0 And (n) represents a first variation corresponding to the n-th frame of original capacitance data.
Solving the minimum mean square error for the objective function essentially means substituting different values of k (n) into the above formula so that the mean square error of data from (n-P) frame to n frame is minimum, the different values of k (n) correspond to different values of J (n), that is, when J (n) is minimum, the corresponding value of k (n) is the temperature compensation coefficient corresponding to Rawdata (n).
Alternatively, the objective function may be solved by a least square method commonly used in signal processing.
By solving the objective function, the error of obtaining the temperature compensation coefficient can be reduced.
In another possible embodiment, in a case that a first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) th frame of original capacitance data, determining a temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the n-th frame of original capacitance data, a second variation corresponding to the n-th frame of original capacitance data, and the first variation corresponding to the n-th frame of original capacitance data, includes: when the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data, determining a temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the following formula:
Figure BDA0003268061940000131
wherein k (n) represents a temperature compensation coefficient corresponding to the nth frame of original capacitance data, rawdata (n) represents the nth frame of original capacitance data, and S 0 (n) represents the first variation corresponding to the n-th frame of original capacitance data, and δ ref (n) represents the second variation corresponding to the n-th frame of original capacitance data. P represents the number of frames that need to be accumulated.
Since the solution process of the objective function may need a large computation capability, and in practical applications, the computation capability of the processor often does not meet the requirement of solving the objective function, the embodiment adopts a linear solution process, which can simplify the computation requirement.
Alternatively, in the present embodiment, P may be equal to 0, that is, k (n) = (Rawdata (n) -S 0 (n))/(Refdata(n)-Refdata(1))。
Optionally, in this embodiment of the present application, P may be greater than 1, that is, a ratio of a sum of third variations (i.e., a difference between the original capacitance data and a first variation corresponding to the original capacitance data) corresponding to consecutive multiple frames of original capacitance data to a sum of second variations corresponding to the multiple frames of original capacitance data may be calculated. The value of P can be set according to the data storage range and the application of the environmental temperature change. For example, if the processor can obtain the current frame original capacitance data and the current reference capacitance data by 5 frames and 5 frames from the memory at most, P may be equal to 5, or may be less than 5, for example, P is equal to 3. For another example, if the ambient temperature changes faster, a smaller P value may be set; if the ambient temperature changes slowly, a large P value is set.
Optionally, in this embodiment of the present application, determining, according to a difference between an nth frame of original capacitance data output by a detection channel in the capacitance detection apparatus and an (n-M) th frame of original capacitance data, a first variation corresponding to an nth frame of time includes: and determining the temperature compensation coefficient corresponding to the (n-1) th frame time as the temperature compensation coefficient corresponding to the nth frame time under the condition that the absolute value of the difference between the nth frame original capacitance data and the (n-M) th frame original capacitance data is less than or equal to a fluctuation threshold value.
That is, if the absolute value of Diffchange (n) is less than or equal to the fluctuation threshold, S 0 (n)=son-1。
At S 0 When (n) is updated, k (n) may not be updated, so as to avoid causing a large calculation error. In other words, when the effective behavior exists, the k value corresponding to the Rawdata in the last frame before the effective behavior occurs can be adopted to perform temperature compensation on the Rawdata output when the effective behavior occurs.
In another embodiment, the processor may not be based on S 0 (n), k (n) can be determined. Specifically, the processor may determine k (n) based on a magnitude relationship between an absolute value of Diffchange (n) and a fluctuation threshold. For example, if the absolute value of Diffchange (n) is greater than the fluctuation threshold, k (n-1) may be determined as k (n), and if the absolute value of Diffchange (n) is less than or equal to the fluctuation threshold, k (n) may be determined using the various embodiments described above. That is, in the case where the absolute value of Diffchange (n) is larger than the fluctuation threshold, S is determined 0 (n) and the determination of k (n) may be performed simultaneously or sequentially without any order, in which case the determined S 0 (n) is used primarily to determine subsequent temperature compensation coefficients. In the case where the absolute value of Diffchange (n) is less than or equal to the fluctuation threshold, S needs to be determined first 0 (n) and S at this time 0 (n)=S 0 (n-1), and then based on the above-mentioned various entitiesExamples k (n) was determined.
Optionally, in this embodiment, the processor may determine M according to a detection period of the capacitance detection device and/or a change rate of the ambient temperature. For example, the larger the detection period of the capacitance detection device, the smaller M; the smaller the detection period of the capacitance detection device, the larger M. As another example, the faster the change in ambient temperature, the smaller M; the slower the change in ambient temperature, the larger M. It should be understood that M may be adaptively adjusted according to the detection period of the capacitance detection device and/or the change rate of the ambient temperature, or may be fixed, which is not limited in this embodiment of the application.
And M is adaptively adjusted according to the detection period of the capacitance detection device and/or the change rate of the environmental temperature, so that a proper temperature compensation coefficient can be obtained, and more accurate effective capacitance data can be obtained.
Optionally, in this embodiment of the present application, the determining, according to the temperature compensation coefficient corresponding to the n-th frame of original capacitance data and the n-th frame of original capacitance data, effective capacitance data in the n-th frame of original capacitance data includes: determining effective capacitance data in the n-th frame of original capacitance data according to the following formula:
Rawdatanew(n)=Rawdata(n)-k(n)*δref(n)),
here, rawdatanew (n) represents effective capacitance data in the nth frame of raw capacitance data, that is, the nth frame of effective capacitance data, rawdata (n) represents the nth frame of raw capacitance data, k (n) represents the temperature compensation coefficient corresponding to the nth frame of raw capacitance data, and δ ref (n) represents a difference between the nth frame of reference capacitance data output by the reference channel in the capacitance detection device and the initial reference capacitance data, that is, δ ref (n) = Refdata (n) -Refdata (1).
That is, after k (n) is obtained through the various embodiments, rawdatanew (n) is obtained by using the formula provided in the embodiments, and effective capacitance data is extracted by performing temperature compensation on the original capacitance data, which can be better applied to various applications based on capacitance detection.
Optionally, in this embodiment, the valid capacitance data in the nth frame of raw capacitance data is used to determine whether a target object is close to the capacitance detection device.
In other words, after obtaining the Rawdatanew (n), it can be further determined whether there is a target object approaching the capacitance detection device according to the comparison result of the Rawdatanew (n) and the approach threshold.
When the approach detection is carried out, the temperature compensation coefficient obtained by the embodiment of the application is adopted to carry out temperature compensation on the original capacitance data, so that the misjudgment probability of the approach identification is favorably reduced, the influence of temperature drift is favorably reduced when a human body approaches the capacitance detection device, and the signal-to-noise ratio of the detected capacitance signal is improved.
It should be understood that the fluctuation threshold and the proximity threshold in the above various embodiments are empirical thresholds, the fluctuation threshold refers to a threshold of fluctuation of the capacitance change amount, and the proximity threshold refers to a threshold of capacitance change amount caused by proximity.
In practical applications, the temperature change of the external environment is nonlinear and uncertain, and as shown in fig. 6 and 7, the reference capacitance data Refdata is a process of first raising the temperature and then lowering the temperature. If the fixed temperature compensation coefficient k is adopted for temperature compensation in the scene with complex temperature change, the original capacitance data Rawdata in the middle section cannot accurately eliminate the environmental temperature change, namely, the temperature compensation performed by the fixed temperature compensation coefficient is not accurate, the fluctuation of the effective capacitance data Rawdatanew obtained after compensation is large, and the effective capacitance data Rawdatanew is misjudged to be close to or far away from the threshold value when the fluctuation reaches the close threshold value, so that the final detection result is wrong.
The effective capacitance data Rawdatanew in fig. 6 is obtained by using a fixed temperature compensation coefficient, and the effective capacitance data Rawdatanew in fig. 7 is obtained by using a dynamically adjusted temperature compensation coefficient as mentioned in the embodiment of the present application. Likewise, the abscissa in fig. 6 and 7 represents the number of frames, and the ordinate represents the amplitude. As can be seen from fig. 6 and 7, by using the dynamically adjusted temperature compensation coefficient of the embodiment of the present application, the ambient temperature change can be more accurately eliminated, the obtained effective capacitance data is smoother, and compared with a preset approach threshold, the approach or the distance can be more accurately identified, and the influence of the ambient temperature change on the original capacitance data is obviously optimized.
It should be understood that in the embodiments of the present application, whether "equal to" in the written description or "=" in the formula may be understood as approximately equal.
The method for detecting capacitance according to the embodiment of the present application is described above in detail, and the capacitance detection device according to the embodiment of the present application will be described below with reference to fig. 8, and the technical features described in the method embodiment are applicable to the following device embodiments.
Fig. 8 shows a schematic block diagram of a capacitance detection apparatus 200 according to an embodiment of the present application, and as shown in fig. 8, the apparatus 200 includes:
a first determining unit 210, configured to determine a first variation corresponding to an nth frame of original capacitance data output by a detection channel in the capacitance detection apparatus according to a difference between the nth frame of original capacitance data and an (n-M) th frame of original capacitance data, where n is a positive integer greater than M and M is a positive integer greater than or equal to 1;
a second determining unit 220, configured to determine a temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variation corresponding to the n-th frame of original capacitance data;
a third determining unit 230, configured to determine the effective capacitance data in the n-th frame of original capacitance data according to the temperature compensation coefficient corresponding to the n-th frame of original capacitance data and the n-th frame of original capacitance data.
Therefore, the capacitance detection device provided by the embodiment of the application can more accurately reject the ambient temperature change by dynamically adjusting the temperature compensation coefficient, optimizes the influence of the ambient temperature change on the original capacitance data output by the detection channel, and can obtain more accurate effective capacitance data. So as to be better suited for various applications based on capacitive detection, such as wear detection, SRA, pressure detection, touch gesture operation, etc. For example, when the approach detection is performed, the method is favorable for reducing the misjudgment probability of the approach identification, and when a human body approaches the capacitance detection device, the influence of temperature drift is also favorably reduced, and the signal-to-noise ratio of the detected capacitance signal is improved. For another example, in a headset wearing scene, the headset wearing state can be accurately identified, so that the user experience can be improved.
Optionally, as shown in fig. 9, in the embodiment of the present application, the capacitance detection apparatus 200 further includes: a fourth determining unit 240, configured to determine a difference between an nth frame of reference capacitance data output by a reference channel in the capacitance detecting apparatus and the initial reference capacitance data as a second variation corresponding to the nth frame of original capacitance data, where the second variation is used to represent noise capacitance data output by the reference channel and caused by an ambient temperature change; the second determining unit 220 is specifically configured to: and under the condition that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the n-th frame of original capacitance data, the first variation corresponding to the n-th frame of original capacitance data and the second variation corresponding to the n-th frame of original capacitance data.
Optionally, in this embodiment of the application, the second determining unit 220 is specifically configured to: determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the following formula under the condition that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data:
Figure BDA0003268061940000171
wherein k (n) represents the temperature compensation coefficient corresponding to the n-th frame of original capacitance data, rawdata (n) represents the n-th frame of original capacitance data, and S 0 (n) represents the first variation corresponding to the n-th frame of original capacitance data, δ ref (n) represents the second variation corresponding to the n-th frame of original capacitance data, P is an integer greater than or equal to 0 and P is less than n.
Optionally, in this embodiment of the application, the second determining unit 220 is specifically configured to: determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data by solving a minimum mean square error for the following objective function under the condition that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data:
Figure BDA0003268061940000172
wherein k (n) represents the temperature compensation coefficient corresponding to the n-th frame of original capacitance data, rawdata (n) represents the n-th frame of original capacitance data, and S 0 (n) represents the first variation corresponding to the n-th frame of original capacitance data, δ ref (n) represents the second variation corresponding to the n-th frame of original capacitance data, P is an integer greater than or equal to 0 and P is less than n.
Wherein k (n) represents the temperature compensation coefficient corresponding to the n-th frame of original capacitance data when J (n) is the minimum value, rawdata (n) represents the n-th frame of original capacitance data, and S 0 (n) represents the first variation corresponding to the n-th frame of original capacitance data, δ ref (n) represents the second variation corresponding to the n-th frame of original capacitance data, P is an integer greater than or equal to 0 and P is less than n.
Optionally, in this embodiment of the application, the second determining unit 220 is specifically configured to: and determining the temperature compensation coefficient corresponding to the (n-1) th frame of original capacitance data as the temperature compensation coefficient corresponding to the n-th frame of original capacitance data when the first variation corresponding to the n-th frame of original capacitance data is not equal to the first variation corresponding to the (n-1) th frame of original capacitance data.
Optionally, in this embodiment of the application, the first determining unit 210 is specifically configured to: determining the first variation corresponding to the n-th frame of original capacitance data according to the following formula when the absolute value of the difference between the n-th frame of original capacitance data and the (n-M) -th frame of original capacitance data is greater than a fluctuation threshold:
S 0 (n)=S 0 (n-1)+Diffchange(n),
wherein S is 0 (n) the first variation, S, corresponding to the n-th frame of original capacitance data 0 (n-1) represents the first variation corresponding to the original capacitance data of the (n-1) th frame, diffchange (n) represents the original capacitance data of the n-th frame and the original capacitance data of the (n-M) th frameThe difference between the capacitance data.
Optionally, in this embodiment of the application, the first determining unit 210 is specifically configured to: determining the first variation corresponding to the (n-1) th frame of original capacitance data as the first variation corresponding to the nth frame of original capacitance data when the absolute value of the difference between the nth frame of original capacitance data and the (n-M) th frame of original capacitance data is less than or equal to a fluctuation threshold.
Optionally, as shown in fig. 9, in this embodiment of the application, the third determining unit is specifically configured to: determining the effective capacitance data in the n-th frame of raw capacitance data according to the following formula:
Rawdatanew(n)=Rawdata(n)-k(n)*δref(n)),
wherein, rawdatanew (n) represents the effective capacitance data in the nth frame of original capacitance data, rawdata (n) represents the nth frame of original capacitance data, k (n) represents the temperature compensation coefficient corresponding to the nth frame of original capacitance data, and δ ref (n) represents the difference between the nth frame of reference capacitance data and the original reference capacitance data output by the reference channel in the capacitance detection device.
Optionally, in this embodiment, the valid capacitance data in the nth frame of raw capacitance data is used to determine whether a target object is close to the capacitance detection device.
Optionally, in the embodiment of the present application, M is determined based on a detection period of the capacitance detection device and/or a change rate of an ambient temperature.
Fig. 10 is a schematic structural diagram of a capacitance detection device 300 according to an embodiment of the present application. The capacitance detection apparatus 300 shown in fig. 10 includes a processor 310, and the processor 310 may call and execute a computer program from a memory to implement the method in the embodiment of the present application.
Optionally, as shown in fig. 10, the capacitance detection apparatus 300 may further include a memory 320. From the memory 320, the processor 310 may call and run a computer program to implement the method in the embodiment of the present application.
The memory 320 may be a separate device from the processor 310, or may be integrated in the processor 310.
Optionally, the capacitance detection device 300 may specifically be the capacitance detection device in the embodiment of the present application, and specifically, the capacitance detection device 300 may implement a corresponding process implemented by the capacitance detection device in each method in the embodiment of the present application, and for brevity, details are not described here again.
The embodiment of the application also provides electronic equipment, and the electronic equipment comprises the capacitance detection device in the various embodiments.
The embodiment of the present application further provides a chip, where the chip includes a processor, and the processor can call and run a computer program from a memory to implement the method in the embodiment of the present application.
Optionally, the chip may be applied to the capacitance detection device in the embodiment of the present application, and the chip may implement a corresponding process implemented by the capacitance detection device in each method in the embodiment of the present application, and for brevity, details are not described here again.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip or a system-on-chip.
Optionally, the present application further provides a computer-readable medium for storing a computer program to implement the method in the present application.
It should be understood that the processor of the embodiments of the present application may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method embodiments may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
It will be appreciated that the memory in the embodiments of the subject application can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of example, but not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), dynamic Random Access Memory (DRAM), synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), double Data Rate Synchronous Dynamic random access memory (DDR SDRAM), enhanced Synchronous SDRAM (ESDRAM), synchronous link SDRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
It should be understood that the above memories are exemplary but not limiting, for example, the memories in the embodiments of the present application may also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), direct Rambus RAM (DR RAM), and the like. That is, the memory in the embodiments of the present application is intended to comprise, without being limited to, these and any other suitable types of memory.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (24)

1. A method for capacitance detection, the method being applied to a capacitance detection device, the method comprising:
determining a first variation corresponding to an nth frame of original capacitance data according to a difference between the nth frame of original capacitance data output by a detection channel in the capacitance detection device and an (n-M) th frame of original capacitance data, wherein n is a positive integer greater than M and M is a positive integer greater than or equal to 1;
determining a temperature compensation coefficient corresponding to the n frame of original capacitance data according to the first variable quantity corresponding to the n frame of original capacitance data;
and determining the effective capacitance data in the n-th frame of original capacitance data according to the temperature compensation coefficient corresponding to the n-th frame of original capacitance data and the n-th frame of original capacitance data.
2. The method of claim 1, further comprising:
determining a difference value between an nth frame of reference capacitance data and initial reference capacitance data output by a reference channel in the capacitance detection device as a second variation corresponding to the nth frame of original capacitance data, wherein the second variation is used for representing noise capacitance data output by the reference channel and caused by environmental temperature change;
determining a temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variation corresponding to the n-th frame of original capacitance data, including:
and under the condition that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variation corresponding to the n-th frame of original capacitance data, the second variation corresponding to the n-th frame of original capacitance data and the n-th frame of original capacitance data.
3. The method according to claim 2, wherein in a case that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variation corresponding to the n-th frame of original capacitance data, the second variation corresponding to the n-th frame of original capacitance data, and the n-th frame of original capacitance data comprises:
determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the following formula when the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data:
Figure FDA0003268061930000021
wherein k (n) represents the temperature compensation coefficient corresponding to the n-th frame of original capacitance data, rawdata (n) represents the n-th frame of original capacitance data, and S 0 (n) represents the first variation corresponding to the n-th frame of original capacitance data, δ ref (n) represents the second variation corresponding to the n-th frame of original capacitance data, P is an integer greater than or equal to 0 and P is less than n.
4. The method according to claim 2, wherein in a case that the first variation corresponding to the n-th frame of original capacitance data is not equal to the first variation corresponding to the (n-1) th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variation corresponding to the n-th frame of original capacitance data, the second variation corresponding to the n-th frame of original capacitance data, and the n-th frame of original capacitance data comprises:
determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data by solving a minimum mean square error for the following objective function under the condition that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data:
Figure FDA0003268061930000022
wherein k (n) represents the temperature compensation coefficient corresponding to the n-th frame of original capacitance data when J (n) is the minimum value, rawdata (n) represents the n-th frame of original capacitance data, and S 0 (n) represents the first variation corresponding to the n-th frame of original capacitance data, δ ref (n) represents the second variation corresponding to the n-th frame of original capacitance data, P is an integer greater than or equal to 0 and P is less than n.
5. The method of claim 1, wherein the determining the temperature compensation coefficient corresponding to the n-th frame of raw capacitance data according to the first variation corresponding to the n-th frame of raw capacitance data comprises:
and under the condition that the first variation corresponding to the n-th frame of original capacitance data is not equal to the first variation corresponding to the (n-1) th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the (n-1) th frame of original capacitance data as the temperature compensation coefficient corresponding to the n-th frame of original capacitance data.
6. The method according to claim 1, wherein the determining a first variation corresponding to an nth frame of raw capacitance data according to a difference between the nth frame of raw capacitance data and an (n-M) th frame of raw capacitance data output by a detection channel in the capacitance detection apparatus comprises:
determining the first variation corresponding to the n-th frame of original capacitance data according to the following formula when the absolute value of the difference between the n-th frame of original capacitance data and the (n-M) -th frame of original capacitance data is greater than a fluctuation threshold:
S 0 (n)=S 0 (n-1)+Diffchange(n),
wherein S is 0 (n) represents the first variation, S, corresponding to the n-th frame of raw capacitance data 0 (n-1) represents the first variation corresponding to the (n-1) th frame of original capacitance data, and Diffchange (n) represents the difference between the n-th frame of original capacitance data and the (n-M) th frame of original capacitance data.
7. The method according to claim 1, wherein the determining a first variation corresponding to the nth frame time according to a difference between an nth frame raw capacitance data and an (n-M) th frame raw capacitance data output by a detection channel in the capacitance detection apparatus comprises:
determining the first variation corresponding to the (n-1) th frame of original capacitance data as the first variation corresponding to the nth frame of original capacitance data when an absolute value of a difference between the nth frame of original capacitance data and the (n-M) th frame of original capacitance data is less than or equal to a fluctuation threshold.
8. The method according to any one of claims 1 to 7, wherein the determining the effective capacitance data in the n-th frame of raw capacitance data according to the temperature compensation coefficient corresponding to the n-th frame of raw capacitance data and the n-th frame of raw capacitance data comprises:
determining the effective capacitance data in the n-th frame of raw capacitance data according to the following formula:
Rawdatanew(n)=Rawdata(n)-k(n)*δref(n)),
wherein, rawdatanew (n) represents the effective capacitance data in the nth frame of original capacitance data, rawdata (n) represents the nth frame of original capacitance data, k (n) represents the temperature compensation coefficient corresponding to the nth frame of original capacitance data, and δ ref (n) represents the difference between the nth frame of reference capacitance data and the initial reference capacitance data output by the reference channel in the capacitance detection device.
9. The method according to any one of claims 1 to 7, wherein the effective capacitance data in the n-th frame of raw capacitance data is used to determine whether a target object is in proximity to the capacitance detection device.
10. The method of any one of claims 1 to 7, wherein M is determined based on a detection period of the capacitive detection device and/or a rate of change of an ambient temperature.
11. A capacitance detection device, comprising:
a first determining unit, configured to determine a first variation corresponding to an nth frame of original capacitance data output by a detection channel in the capacitance detection device according to a difference between the nth frame of original capacitance data and an (n-M) th frame of original capacitance data, where n is a positive integer greater than M and M is a positive integer greater than or equal to 1;
the second determining unit is used for determining a temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the first variable quantity corresponding to the n-th frame of original capacitance data;
a third determining unit, configured to determine the effective capacitance data in the nth frame of original capacitance data according to the temperature compensation coefficient corresponding to the nth frame of original capacitance data and the nth frame of original capacitance data.
12. The capacitance detection device according to claim 11, further comprising:
a fourth determining unit, configured to determine a difference between an nth frame of reference capacitance data output by a reference channel in the capacitance detection apparatus and an initial reference capacitance data as a second variation corresponding to the nth frame of original capacitance data, where the second variation is used to represent noise capacitance data output by the reference channel and caused by an ambient temperature change;
the second determining unit is specifically configured to:
and under the condition that the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the n-th frame of original capacitance data, the first variation corresponding to the n-th frame of original capacitance data and the second variation corresponding to the n-th frame of original capacitance data.
13. The capacitance detection device according to claim 12, wherein the second determination unit is specifically configured to:
determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data according to the following formula when the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data:
Figure FDA0003268061930000041
wherein k (n) represents the temperature compensation coefficient corresponding to the n-th frame of original capacitance data, rawdata (n) represents the n-th frame of original capacitance data, and S 0 (n) represents the first variation corresponding to the n-th frame of original capacitance data, δ ref (n) represents the second variation corresponding to the n-th frame of original capacitance data, P is an integer greater than or equal to 0 and P is less than n.
14. The capacitance detection device according to claim 12, wherein the second determination unit is specifically configured to:
determining the temperature compensation coefficient corresponding to the n-th frame of original capacitance data by solving a minimum mean square error for the following objective function when the first variation corresponding to the n-th frame of original capacitance data is equal to the first variation corresponding to the (n-1) -th frame of original capacitance data:
Figure FDA0003268061930000042
wherein k (n) represents the temperature compensation coefficient corresponding to the n-th frame of original capacitance data when J (n) is the minimum value, rawdata (n) represents the n-th frame of original capacitance data, and S 0 (n) represents the first variation corresponding to the n-th frame of original capacitance data, δ ref (n) represents the second variation corresponding to the n-th frame of original capacitance data, and P is largeAn integer equal to or greater than 0 and P is less than n.
15. The capacitance detection device according to claim 11, wherein the second determination unit is specifically configured to:
and under the condition that the first variation corresponding to the n-th frame of original capacitance data is not equal to the first variation corresponding to the (n-1) th frame of original capacitance data, determining the temperature compensation coefficient corresponding to the (n-1) th frame of original capacitance data as the temperature compensation coefficient corresponding to the n-th frame of original capacitance data.
16. The capacitance detection device according to claim 11, wherein the first determination unit is specifically configured to:
determining the first variation corresponding to the n-th frame of original capacitance data according to the following formula when the absolute value of the difference between the n-th frame of original capacitance data and the (n-M) -th frame of original capacitance data is greater than a fluctuation threshold:
S 0 (n)=S 0 (n-1)+Diffchange(n),
wherein S is 0 (n) represents the first variation, S, corresponding to the n-th frame of raw capacitance data 0 (n-1) represents the first variation corresponding to the (n-1) th frame of original capacitance data, and Diffchange (n) represents the difference between the n-th frame of original capacitance data and the (n-M) th frame of original capacitance data.
17. The capacitance detection device according to claim 11, wherein the first determination unit is specifically configured to:
determining the first variation corresponding to the (n-1) th frame of original capacitance data as the first variation corresponding to the nth frame of original capacitance data when an absolute value of a difference between the nth frame of original capacitance data and the (n-M) th frame of original capacitance data is less than or equal to a fluctuation threshold.
18. The capacitance detection device according to any one of claims 11 to 17, wherein the third determination unit is specifically configured to:
determining the effective capacitance data in the n-th frame of raw capacitance data according to the following formula:
Rawdatanew(n)=Rawdata(n)-k(n)*δref(n)),
wherein, rawdatanew (n) represents the effective capacitance data in the nth frame of original capacitance data, rawdata (n) represents the nth frame of original capacitance data, k (n) represents the temperature compensation coefficient corresponding to the nth frame of original capacitance data, and δ ref (n) represents the difference between the nth frame of reference capacitance data and the initial reference capacitance data output by the reference channel in the capacitance detection device.
19. The capacitance detection device according to any one of claims 11 to 17, wherein the valid capacitance data in the n-th frame of raw capacitance data is used to determine whether a target object is in proximity to the capacitance detection device.
20. A capacitance detection device according to any one of claims 11 to 17, wherein M is determined based on the detection period of the capacitance detection device and/or the rate of change of the ambient temperature.
21. A capacitance detection device, comprising: a processor and a memory for storing a computer program, the processor for invoking and executing the computer program stored in the memory, performing the method of any one of claims 1 to 10.
22. An electronic device characterized by comprising the capacitance detection device according to any one of claims 11 to 20.
23. A chip, comprising: a processor for calling and running a computer program from a memory so that a device on which the chip is installed performs the method of any one of claims 1 to 10.
24. A computer-readable storage medium for storing a computer program which causes a computer to perform the method of any one of claims 1 to 10.
CN202111092492.8A 2021-09-17 2021-09-17 Capacitance detection method, capacitance detection device and electronic equipment Pending CN115824271A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111092492.8A CN115824271A (en) 2021-09-17 2021-09-17 Capacitance detection method, capacitance detection device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111092492.8A CN115824271A (en) 2021-09-17 2021-09-17 Capacitance detection method, capacitance detection device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115824271A true CN115824271A (en) 2023-03-21

Family

ID=85515237

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111092492.8A Pending CN115824271A (en) 2021-09-17 2021-09-17 Capacitance detection method, capacitance detection device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115824271A (en)

Similar Documents

Publication Publication Date Title
CN107636686B (en) Fingerprint acquisition method, device, chip and terminal equipment
EP3402073B1 (en) Drift suppression filter proximity detector and method
CN112533102B (en) Method for determining capacitance reference, and device and equipment for determining capacitance reference
CN106792799B (en) Bayesian network-based mobile sensor network noise reduction and calibration method
US20160139734A1 (en) Input device
WO2022170590A1 (en) Method for determining capacitance reference, apparatus for determining capacitance reference, and device
CN115824271A (en) Capacitance detection method, capacitance detection device and electronic equipment
CN112986693B (en) Capacitor baseline updating method, chip and capacitor detection device
CN108287621B (en) Touch screen calibration method and system
US20220260393A1 (en) Method for updating capacitance reference, chip, and capacitance detection apparatus
TWI451303B (en) Method for sensing touch points
CN115656640A (en) Capacitance detection method and capacitance detection device
CN111596379A (en) Method and device for recognizing abnormality of seismic observation system
CN115221471B (en) Abnormal data identification method and device, storage medium and computer equipment
CN112990163B (en) Fingerprint calibration method, electronic device and storage medium
CN115639410A (en) Capacitance detection method and capacitance detection device
US11499844B2 (en) Environmental compensation method in proximity sensor and proximity sensor having improved environmental compensation performance
CN112200037B (en) Weak signal detection method, terminal and computer readable storage medium
CN113420699A (en) Face matching method and device and electronic equipment
CN114002525A (en) Baseline determining circuit and method, state detecting chip and electronic equipment
CN109857973B (en) Infrared data filtering method and device
CN106375686A (en) Method and device for reducing fixed pattern noise of image sensor in digital domain
US10203805B2 (en) Touch detection method of a touch detection device for obtaining a calibrated variation for determining whether a touch event has been triggered
CN111161225A (en) Image difference detection method and device, electronic equipment and storage medium
US20230194369A1 (en) Force sensing method, force sensing system and force sensor calibration method

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