Capacitance detection method, capacitance detection device, and electronic equipment
By dynamically adjusting the temperature compensation coefficient, and calculating the effective capacitance data based on the original and reference channel data changes of the capacitance detection device, the problem of misjudgment of the capacitance detection device during temperature changes is solved, and the detection accuracy and signal-to-noise ratio are improved.
Patent Information
- Application Number
- CN202111092492.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-17
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2041-09-17
AI Technical Summary
The original capacitance data output by the capacitance detection device when the ambient temperature changes are susceptible to interference, resulting in inaccurate functions, such as misjudgment of proximity recognition.
By dynamically adjusting the temperature compensation coefficient, the effective capacitance data is calculated based on the change in the original capacitance data of the detection channel and the change in the noise capacitance data of the reference channel, and the impact of ambient temperature changes is eliminated.
It improves the accuracy of capacitance detection, reduces the probability of misjudgment of proximity recognition, improves the signal-to-noise ratio, and improves the user experience.
Smart Images

Figure CN115824271B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of sensors, and more specifically, to a capacitance detection method, a capacitance detection device, and an electronic device. Background Art
[0002] Capacitance detection devices can typically be used to identify the presence of a person. Approach is determined by comparing the raw capacitance data output by the device with a preset threshold. For example, if the raw capacitance data is greater than the proximity threshold, the device is considered to be approaching a person; if the raw capacitance data is less than or equal to the proximity threshold, the device is considered to be unapproachable.
[0003] In practical applications, such as capacitive in-ear detection and specific absorption rate (SAR) applications, the raw capacitance data output by the capacitance detection device may drift due to changes in ambient temperature. If the raw capacitance data is not subjected to temperature drift processing, the raw capacitance data output by the capacitance detection device may contain temperature interference without disturbing it, which may cause inaccurate functions applied based on the raw capacitance data, such as misjudgment of proximity recognition. Summary of the Invention
[0004] Embodiments of the present application provide a capacitance detection method, a capacitance detection device, and an electronic device to reduce the interference of temperature drift on raw capacitance data output by the capacitance detection device, so as to obtain more accurate effective capacitance data.
[0005] In a first aspect, a capacitance detection method is provided, which is applied to a capacitance detection device, and the method includes: determining a first change corresponding to the n-th frame of raw capacitance data based on a difference between the n-th frame of raw capacitance data and the (nM)-th frame of raw 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 raw capacitance data based on the first change corresponding to the n-th frame of raw capacitance data; and determining the effective capacitance data in the n-th frame of raw capacitance data based on the temperature compensation coefficient corresponding to the n-th frame of raw capacitance data and the n-th frame of raw capacitance data.
[0006] By dynamically adjusting the temperature compensation coefficient, the ambient temperature changes can be more accurately eliminated, and the impact of ambient temperature changes on the original capacitance data output by the detection channel can be optimized, that is, more accurate effective capacitance data can be obtained. So that it can be better applied to various applications based on capacitance detection, such as wearing detection, SRA, pressure detection, touch gesture operation, etc. For example, in proximity detection, it is beneficial to reduce the probability of misjudgment of proximity recognition. When a human body is close to the capacitance detection device, it is also beneficial to reduce the impact of temperature drift and improve the signal-to-noise ratio of the detected capacitance signal. For another example, in the headphone wearing scenario, it is beneficial to accurately identify the wearing status of the headphone, thereby improving the user experience.
[0007] In one possible implementation, the method further includes: determining the difference between the n-th frame reference capacitance data output by the reference channel in the capacitance detection device and the initial reference capacitance data as a second change corresponding to the n-th frame original capacitance data, the second change being used to represent the noise capacitance data output by the reference channel caused by changes in ambient temperature; and determining the temperature compensation coefficient corresponding to the n-th frame original capacitance data based on the first change corresponding to the n-th frame original capacitance data, including: when the first change corresponding to the n-th frame original capacitance data is equal to the first change corresponding to the (n-1)-th frame original capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame original capacitance data based on the first change corresponding to the n-th frame original capacitance data, the second change corresponding to the n-th frame original capacitance data, and the n-th frame original capacitance data.
[0008] When the first change corresponding to the original capacitance data is not updated, or when the first change corresponding to the current original capacitance data is equal to the first change corresponding to the original capacitance data of the previous frame, it indicates that the change in the current original capacitance data is simply caused by the change in ambient temperature. At this time, based on the determined original capacitance data and its corresponding first change and second change, the corresponding temperature compensation coefficient is updated, which can accurately eliminate the noise capacitance data caused by the ambient temperature change in the original capacitance data, thereby obtaining more accurate effective capacitance data.
[0009] In a possible implementation, when the first change corresponding to the n-th frame raw capacitance data is equal to the first change corresponding to the (n-1)-th frame raw capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame raw capacitance data according to the first change corresponding to the n-th frame raw capacitance data, the second change corresponding to the n-th frame raw capacitance data, and the n-th frame raw capacitance data, including: when the first change corresponding to the n-th frame raw capacitance data is not equal to the first change corresponding to the (n-1)-th frame raw capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame raw capacitance data according to the following formula:
[0010]
[0011] Wherein, k(n) represents the temperature compensation coefficient corresponding to the raw capacitance data of the nth frame, Rawdata(n) represents the raw capacitance data of the nth frame, S0(n) represents the first change corresponding to the raw capacitance data of the nth frame, δref(n) represents the second change corresponding to the raw capacitance data of the nth frame, and P is an integer greater than or equal to 0 and P is less than n.
[0012] Using a linear solution process can simplify the computational requirements.
[0013] In a possible implementation, when the first change corresponding to the n-th frame raw capacitance data is equal to the first change corresponding to the (n-1)-th frame raw capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame raw capacitance data according to the first change corresponding to the n-th frame raw capacitance data, the second change corresponding to the n-th frame raw capacitance data, and the n-th frame raw capacitance data, including: when the first change corresponding to the n-th frame raw capacitance data is equal to the first change corresponding to the (n-1)-th frame raw capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame raw capacitance data by solving the minimum mean square error for the following objective function:
[0014]
[0015] Wherein, k(n) represents the temperature compensation coefficient corresponding to the raw capacitance data of the nth frame when J(n) is the minimum value, Rawdata(n) represents the raw capacitance data of the nth frame, S0(n) represents the first change corresponding to the raw capacitance data of the nth frame, δref(n) represents the second change corresponding to the raw capacitance data of the nth frame, and P is an integer greater than or equal to 0 and P is less than n.
[0016] By solving the minimum mean square error of the objective function, the error in obtaining the temperature compensation coefficient can be reduced.
[0017] In one possible implementation, the temperature compensation coefficient corresponding to the n-th frame original capacitance data is determined based on the first change corresponding to the n-th frame original capacitance data, including: when the first change corresponding to the n-th frame original capacitance data is not equal to the first change corresponding to the (n-1)-th frame original capacitance data, the temperature compensation coefficient corresponding to the (n-1)-th frame original capacitance data is determined as the temperature compensation coefficient corresponding to the n-th frame original capacitance data.
[0018] When the first variation is updated, that is, when the first variation corresponding to the current frame original capacitance data is not equal to the first variation corresponding to the previous frame original capacitance data, the temperature compensation coefficient may not be updated to avoid causing a large calculation error.
[0019] In one possible implementation, determining, based on a difference between the nth frame of raw capacitance data and the (nM)th frame of raw capacitance data output by a detection channel in the capacitance detection device, a first variation corresponding to the nth frame of raw capacitance data includes: when an absolute value of the difference between the nth frame of raw capacitance data and the (nM)th frame of raw capacitance data is greater than a fluctuation threshold, determining the first variation corresponding to the nth frame of raw capacitance data according to the following formula:
[0020] S0(n)=S0(n-1)+Diffchange(n),
[0021] Among them, S0(n) represents the first change corresponding to the original capacitance data of the nth frame, S0(n-1) represents the first change corresponding to the original capacitance data of the (n-1)th frame, and Diffchange(n) represents the difference between the original capacitance data of the nth frame and the original capacitance data of the (nM)th frame.
[0022] In one possible implementation, the first change corresponding to the n-th frame moment is determined based on the difference between the n-th frame original capacitance data and the (nM)-th frame original capacitance data output by the detection channel in the capacitance detection device, including: when the absolute value of the difference between the n-th frame original capacitance data and the (nM)-th frame original capacitance data is less than or equal to the fluctuation threshold, the first change corresponding to the (n-1)-th frame original capacitance data is determined as the first change corresponding to the n-th frame original capacitance data.
[0023] By comparing the size relationship between the differential capacitance data and the fluctuation threshold, the estimated value of the effective capacitance data can be determined more accurately, which is conducive to obtaining a more appropriate temperature compensation coefficient, thereby making better temperature compensation for the original capacitance data, so as to better suit various applications based on capacitance detection.
[0024] In one possible implementation, 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 includes: determining the effective capacitance data in the n-th frame of raw capacitance data according to the following formula:
[0025] Rawdatanew(n)=Rawdata(n)-k(n)*δref(n)),
[0026] Among them, Rawdatanew(n) represents the effective capacitance data in the n-th frame raw capacitance data, Rawdata(n) represents the n-th frame raw capacitance data, k(n) represents the temperature compensation coefficient corresponding to the n-th frame raw capacitance data, and δref(n) represents the difference between the n-th frame reference capacitance data output by the reference channel in the capacitance detection device and the initial reference capacitance data.
[0027] By performing temperature compensation on the original capacitance data and extracting effective capacitance data, it can be better applied to various applications based on capacitance detection.
[0028] In a possible implementation, the effective capacitance data in the n-th frame of original capacitance data is used to determine whether a target object is approaching the capacitance detection device.
[0029] During proximity detection, the temperature compensation coefficient obtained in the embodiment of the present application is used to perform temperature compensation on the original capacitance data, which is beneficial to reducing the probability of misjudgment of proximity recognition. When a human body approaches the capacitance detection device, it is also beneficial to reduce the impact of temperature drift and improve the signal-to-noise ratio of the detected capacitance signal.
[0030] In a possible implementation, M is determined based on a detection period of the capacitance detection device and / or a rate of change of the ambient temperature.
[0031] Adaptively adjusting M according to the detection period of the capacitance detection device and / or the rate of change of the ambient temperature is beneficial to obtaining a suitable temperature compensation coefficient to obtain more accurate effective capacitance data.
[0032] In a second aspect, a capacitance detection device is provided, including: a first determination unit, used to determine a first change corresponding to the n-th frame raw capacitance data based on a difference between the n-th frame raw capacitance data and the (nM)-th frame raw 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; a second determination unit, used to determine a temperature compensation coefficient corresponding to the n-th frame raw capacitance data based on the first change corresponding to the n-th frame raw capacitance data; and a third determination unit, used to determine the effective capacitance data in the n-th frame raw capacitance data based on the temperature compensation coefficient corresponding to the n-th frame raw capacitance data and the n-th frame raw capacitance data.
[0033] In one possible implementation, the capacitance detection device also includes: a fourth determination unit, used to determine the difference between the n-th frame reference capacitance data output by the reference channel in the capacitance detection device and the initial reference capacitance data as a second change corresponding to the n-th frame original capacitance data, and the second change is used to represent the noise capacitance data output by the reference channel caused by the ambient temperature change; the second determination unit is specifically used to: when the first change corresponding to the n-th frame original capacitance data is equal to the first change corresponding to the (n-1)-th frame original capacitance data, determine the temperature compensation coefficient corresponding to the n-th frame original capacitance data according to the n-th frame original capacitance data, the first change corresponding to the n-th frame original capacitance data, and the second change corresponding to the n-th frame original capacitance data.
[0034] In one possible implementation, the second determining unit is specifically configured to: when the first change corresponding to the nth frame of raw capacitance data is not equal to the first change corresponding to the (n-1)th frame of raw capacitance data, determine the temperature compensation coefficient corresponding to the nth frame of raw capacitance data according to the following formula:
[0035]
[0036] Wherein, k(n) represents the temperature compensation coefficient corresponding to the raw capacitance data of the nth frame, Rawdata(n) represents the raw capacitance data of the nth frame, S0(n) represents the first change corresponding to the raw capacitance data of the nth frame, δref(n) represents the second change corresponding to the raw capacitance data of the nth frame, and P is an integer greater than or equal to 0 and P is less than n.
[0037] In one possible implementation, the second determining unit is specifically configured to: determine the temperature compensation coefficient corresponding to the nth frame of raw capacitance data by solving the minimum mean square error for the following objective function when the first change corresponding to the nth frame of raw capacitance data is equal to the first change corresponding to the (n-1)th frame of raw capacitance data:
[0038]
[0039] Wherein, k(n) represents the temperature compensation coefficient corresponding to the raw capacitance data of the nth frame when J(n) is the minimum value, Rawdata(n) represents the raw capacitance data of the nth frame, S0(n) represents the first change corresponding to the raw capacitance data of the nth frame, δref(n) represents the second change corresponding to the raw capacitance data of the nth frame, and P is an integer greater than or equal to 0 and P is less than n.
[0040] In one possible implementation, the second determination unit is specifically used to: when the first change corresponding to the original capacitance data of the nth frame is not equal to the first change corresponding to the original capacitance data of the (n-1)th frame, determine the temperature compensation coefficient corresponding to the original capacitance data of the (n-1)th frame as the temperature compensation coefficient corresponding to the original capacitance data of the nth frame.
[0041] In one possible implementation, the first determining unit is specifically configured to: when an absolute value of a difference between the n-th frame raw capacitance data and the (nM)-th frame raw capacitance data is greater than a fluctuation threshold, determine the first variation corresponding to the n-th frame raw capacitance data according to the following formula:
[0042] S0(n)=S0(n-1)+Diffchange(n),
[0043] Among them, S0(n) represents the first change corresponding to the original capacitance data of the nth frame, S0(n-1) represents the first change corresponding to the original capacitance data of the (n-1)th frame, and Diffchange(n) represents the difference between the original capacitance data of the nth frame and the original capacitance data of the (nM)th frame.
[0044] In one possible implementation, the first determination unit is specifically used to: when the absolute value of the difference between the original capacitance data of the nth frame and the original capacitance data of the (nM)th frame is less than or equal to the fluctuation threshold, determine the first change corresponding to the original capacitance data of the (n-1)th frame as the first change corresponding to the original capacitance data of the nth frame.
[0045] In a possible implementation, the third determining unit is specifically configured to determine the effective capacitance data in the n-th frame of original capacitance data according to the following formula:
[0046] Rawdatanew(n)=Rawdata(n)-k(n)*δref(n)),
[0047] Among them, Rawdatanew(n) represents the effective capacitance data in the n-th frame raw capacitance data, Rawdata(n) represents the n-th frame raw capacitance data, k(n) represents the temperature compensation coefficient corresponding to the n-th frame raw capacitance data, and δref(n) represents the difference between the n-th frame reference capacitance data output by the reference channel in the capacitance detection device and the initial reference capacitance data.
[0048] In a possible implementation, the effective capacitance data in the n-th frame of original capacitance data is used to determine whether a target object is approaching the capacitance detection device.
[0049] In a possible implementation, M is determined based on a detection period of the capacitance detection device and / or a rate of change of the ambient temperature.
[0050] In a third aspect, a capacitance detection device is provided, comprising: a processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory to execute the method in the above-mentioned first aspect or its various implementations.
[0051] In a fourth aspect, an electronic device is provided, comprising the capacitance detection device according to the second aspect or its respective implementations.
[0052] In a fifth aspect, a chip is provided, comprising: a processor for calling and running a computer program from a memory, so that a device equipped with the chip executes the method in the above-mentioned first aspect or its various implementations.
[0053] In a sixth aspect, a computer-readable storage medium is provided for storing a computer program, which enables a computer to execute the method in the above-mentioned first aspect or its various implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 This is an application scenario diagram of an embodiment of the present application.
[0055] Figure 2 This is a schematic diagram of how the original capacitance data and the reference capacitance data change as the ambient temperature changes and as the human body approaches.
[0056] Figure 3 It is a schematic block diagram of the capacitance detection method according to an embodiment of the present application.
[0057] Figure 4 It is a schematic diagram of the change of the original capacitance data when a human body approaches and the temperature changes, and a schematic diagram of the change of the differential capacitance data when M=1 and M=5.
[0058] Figure 5 It is a schematic diagram of the change of the original capacitance data when there is no human body nearby and only the temperature changes, and a schematic diagram of the change of the differential capacitance data when M=1 and M=5.
[0059] Figure 6 A schematic diagram showing the results of temperature compensation using a fixed temperature compensation coefficient is shown.
[0060] Figure 7 A schematic diagram showing the results of temperature compensation by dynamically adjusting the temperature compensation coefficient.
[0061] Figure 8 It is a schematic block diagram of a capacitance detection device according to an embodiment of the present application.
[0062] Figure 9 is another schematic block diagram of the capacitance detection device according to an embodiment of the present application.
[0063] Figure 10 It is a schematic block diagram of another capacitance detection device according to an embodiment of the present application. DETAILED DESCRIPTION
[0064] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0065] Figure 1 An application scenario diagram of an embodiment of the present application is shown. Figure 1 As shown, the capacitance detection device includes a detection channel for sensing the proximity of a conductor (e.g., a human body) and a reference channel for sensing changes in ambient temperature. The detection channel includes a sensor and a sensing capacitor Cs, and the reference channel includes a sensing capacitor Cr. Both the detection channel and the reference channel include an analog front end (AFE) that can detect the capacitance change on the sensing capacitor Cs and the sensing capacitor Cr, including an operational amplifier (AMP) and an analog-to-digital converter (ADC). When the ambient temperature changes and the human body approaches the capacitance detection device simultaneously, the raw capacitance data Rawdata output by the detection channel includes the capacitance change caused by the proximity and the capacitance change caused by the ambient temperature change, while the reference capacitance data Refdata output by the reference channel only includes the capacitance change caused by the ambient temperature change. The digital processing unit (DPU) performs computational processing on Rawdata and Refdata to identify whether a human body is approaching the capacitance detection device.
[0066] In an embodiment of the present application, the capacitance change caused by proximity can also be called effective capacitance data, and the capacitance change caused by ambient temperature change can also be called noise capacitance data. That is, the original capacitance data output by the detection channel includes effective capacitance data and noise capacitance data.
[0067] Figure 2A schematic diagram shows how the raw capacitance data and reference capacitance data change as the ambient temperature changes and as a person approaches. Typically, without considering the influence of ambient temperature, the raw capacitance data is compared with a proximity threshold. If the raw capacitance data is greater than the proximity threshold, it is determined that a person is approaching the capacitance detection device; if the raw capacitance data is less than or equal to the proximity threshold, it is determined that no person is approaching the capacitance detection device. However, because the ambient temperature typically changes slowly, when the ambient temperature rises above the proximity threshold, the capacitance detection device may be mistakenly detected as a person approaching even if no person is approaching. Therefore, the raw capacitance data needs to be processed to reduce the impact of temperature drift.
[0068] Typically, when the reference channel and the detection channel can be fully matched under the premise of constrained structural design, that is, the reference capacitance data can fully reflect the influence of ambient temperature changes on the original capacitance data, then the influence of ambient temperature changes can be subtracted from the original capacitance data to obtain the effective capacitance data Rawdatanew, that is, Rawdatanew = Rawdata-Refdata. By comparing the effective capacitance data Rawdatanew with the proximity threshold, it can be determined whether there is a human body approaching the capacitance detection device. When the reference channel and the detection channel are well matched, in a scenario where the environmental changes are relatively stable, the relative change in ambient temperature can be subtracted using a fixed coefficient to roughly subtract the environmental impact, as shown in Formula 1:
[0069] Rawdatanew(n)=Rawdata(n)-k*(Refdata(n)-Refdata(1))(1)
[0070] Here, n represents the number of frames, k is the temperature compensation coefficient, that is, Rawdata(n) represents the raw capacitance data of the nth frame, Refdata(n) represents the reference capacitance data of the nth frame, Refdata(1) represents the initial reference capacitance data output by the reference channel when the capacitance detection device is powered on, and Rawdatanew(n) represents the effective capacitance data of the nth frame, which can also be called the effective capacitance data in the raw capacitance data of the nth frame.
[0071] However, in actual applications, due to structural design and inherent capacitance deviations between the reference and detection channels, the matching degree may be poor. In scenarios with drastic temperature fluctuations, such as targeted cycling temperature tests, sudden temperature differences between indoors and outdoors, and large temperature fluctuations in power amplifiers in mobile applications, this fixed temperature compensation coefficient approach can present numerous problems. For example, if the temperature effect is not sufficiently reduced, a person may be mistakenly identified as approaching; or if the temperature effect is excessively reduced, a person approaching may be mistakenly identified as no one. This misjudgment can have significant consequences in specific applications. For example, in-ear detection can misjudgment that a device is being worn or removed. In SAR applications, this misjudgment can affect the adjustment of antenna transmit power, impacting the overall functionality of the device.
[0072] Figure 3 FIG1 shows a schematic block diagram of a method 100 for detecting capacitance according to an embodiment of the present application. The method 100 may be executed by a processor, for example, Figure 1 The DPU execution shown is as follows Figure 3 As shown, the method 100 includes some or all of the following:
[0073] S110, determining a first variation corresponding to the n-th frame of raw capacitance data based on a difference between the n-th frame of raw capacitance data and the (nM)-th frame of raw capacitance data output by a detection channel in a capacitance detection device, where n is a positive integer greater than M and M is a positive integer greater than or equal to 1;
[0074] S120, 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;
[0075] S130 , determining 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.
[0076] First, for the convenience of description, the original capacitance data of the nth frame is represented as Rawdata(n), the original capacitance data of the (nM)th frame is represented as Rawdata(nM), the first change corresponding to the original capacitance data of the nth frame is represented as S0(n), the temperature compensation coefficient corresponding to the original capacitance data of the nth frame is represented as k(n), the effective capacitance data in the original capacitance data of the nth frame is represented as Rawdatanew(n), and the difference between the original capacitance data of the nth frame and the original capacitance data of the (nM)th frame is represented as Diffchange(n), where n represents the nth frame.
[0077] Specifically, the processor can first obtain Rawdata(n) and Rawdata(nM); and calculate Diffchange(n), that is, Diffchange(n) = Rawdata(n) - Rawdata(nM); secondly, determine S0(n) based on Diffchange(n); thirdly, determine k(n) based on S0(n); and finally determine Rawdatanew(n) based on k(n) and Rawdata(n). It should be noted that this method is applicable when n is greater than M. If n is less than or equal to M, the fixed temperature compensation coefficient k in Formula 1 can be used.
[0078] For example, M=3, and the technical solution provided by this application is executed starting from n=4. First, calculate Diffchange(4)=Rawdata(4)-Rawdata(1); according to Diffchange(4), determine S0(4); according to S0(4), determine k(4); according to k(4) and Rawdata(4), determine Rawdatanew(4). When Rawdata(5) is obtained, Diffchange(5)=Rawdata(5)-Rawdata(2); according to Diffchange(5), determine S0(5); according to S0(5), determine k(5); according to k(5) and Rawdata(5), determine Rawdatanew(5). ..., each time a Rawdata is obtained, the above steps can be executed in sequence to obtain the corresponding Rawdatanew.
[0079] Therefore, the capacitance detection method of the embodiment of the present application can more accurately eliminate ambient temperature changes by dynamically adjusting the temperature compensation coefficient, optimize the impact of ambient temperature changes on the original capacitance data output by the detection channel, that is, more accurate effective capacitance data can be obtained. So that it can be better applied to various applications based on capacitance detection, such as wearing detection, SRA, pressure detection, touch gesture operation, etc. For example, in proximity detection, it is beneficial to reduce the probability of misjudgment of proximity recognition, and when a human body is close to the capacitance detection device, it is also beneficial to reduce the influence of temperature drift and improve the signal-to-noise ratio of the detected capacitance signal. For another example, in the headphone wearing scenario, it is beneficial to accurately identify the wearing status of the headphone, thereby improving the user experience.
[0080] Optionally, in an embodiment of the present application, determining a first variation corresponding to the n-th frame of raw capacitance data based on a difference between the n-th frame of raw capacitance data and the (nM)-th frame of raw capacitance data output by a detection channel in the capacitance detection device includes: when the absolute value of the difference between the n-th frame of raw capacitance data and the (nM)-th frame of raw capacitance data is greater than a fluctuation threshold, determining the first variation corresponding to the n-th frame of raw capacitance data according to the following formula:
[0081] S0(n)=S0(n-1)+Diffchange(n),
[0082] Among them, S0(n) represents the first change corresponding to the original capacitance data of the nth frame, S0(n-1) represents the first change corresponding to the original capacitance data of the (n-1)th frame, and Diffchange(n) represents the difference between the original capacitance data of the nth frame and the original capacitance data of the (nM)th frame.
[0083] Optionally, in an embodiment of the present application, determining the first variation corresponding to the n-th frame of raw capacitance data based on the difference between the n-th frame of raw capacitance data and the (nM)-th frame of raw capacitance data output by the detection channel in the capacitance detection device includes: when the absolute value of the difference between the n-th frame of raw capacitance data and the (nM)-th frame of raw capacitance data is less than or equal to the fluctuation threshold, determining the first variation corresponding to the (n-1)-th frame of raw capacitance data as the first variation corresponding to the n-th frame of raw capacitance data. That is, S0(n)=S0(n-1).
[0084] Specifically, if the absolute value of Diffchange(n) is greater than the fluctuation threshold, it can be considered that the change in Rawdata(n) is mainly caused by valid behavior, such as approach and distance behavior; if the absolute value of Diffchange(n) is less than or equal to the fluctuation threshold, it can be considered that the change in Rawdata(n) is simply caused by changes in ambient temperature. In other words, by comparing Diffchange(n) with the fluctuation threshold, it is possible to roughly determine the location where the valid behavior occurs, that is, it is possible to determine at which frame times the valid behavior occurs. Taking the proximity detection scenario as an example, Figure 4 Shown are a schematic diagram of the change of the raw capacitance data Rawdata when a human body approaches and the temperature changes, and a schematic diagram of the change of the differential capacitance data Diffchange when M=1 and M=5. Figure 5The following diagram shows the change in raw capacitance data (Rawdata) when there is no human nearby and only temperature changes, as well as the change in differential capacitance data (Diffchange) when M = 1 and M = 5. The horizontal axis represents the number of frames, and the vertical axis represents the amplitude. As can be seen from the figure, when M is greater than 1, the differential capacitance data (Diffchange) can partially eliminate the impact of ambient temperature changes.
[0085] For each Diffchange, once its absolute value is determined to be greater than the fluctuation threshold, its corresponding S0 is updated to the sum of the previously acquired S0 and the currently acquired Diffchange. For example, if the absolute value of Diffchange(n) is greater than the fluctuation threshold, then S0(n) = S0(n-1) + Diffchange(n). If the absolute value of Diffchange is determined to be less than or equal to the fluctuation threshold, S0 is not updated, and the previously acquired S0 is determined to be the S0 corresponding to the current Diffchange. For example, if the absolute value of Diffchange(n) is less than or equal to the fluctuation threshold, then S0(n) = S0(n-1).
[0086] The first variation is used to estimate the effective capacitance data in the original 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 original capacitance data output by the detection channel.
[0087] It should be noted that when the capacitance detection device is powered on, the initial value of S0 can be the initial value Rawdata(1) of the raw capacitance data output by the detection channel. When there is no valid behavior, the S0 corresponding to each frame of Rawdata output by the detection channel is fixed to the initial value of S0, that is, Rawdata(1). When the valid behavior occurs for the first time, the S0 corresponding to each frame of Rawdata output by the detection channel will be updated, that is, the Diffchange during this period will be superimposed on the initial value of S0. When the valid behavior disappears, the S0 corresponding to each frame of Rawdata output by the detection channel will not be updated, that is, it will remain the S0 last updated when the valid behavior exists. Similarly, when the valid behavior occurs for the second time, the S0 corresponding to each frame of Rawdata output by the detection channel will be updated, that is, the Diffchange during the second valid behavior will be superimposed on the S0 last updated when the valid behavior occurs for the first time, and so on.
[0088] By comparing the size relationship between the differential capacitance data and the fluctuation threshold, the estimated value of the effective capacitance data can be determined more accurately, which is conducive to obtaining a more appropriate temperature compensation coefficient, thereby making better temperature compensation for the original capacitance data, so as to better suit various applications based on capacitance detection.
[0089] Optionally, in an embodiment of the present application, the method 100 also includes: determining the difference between the n-th frame reference capacitance data output by the reference channel in the capacitance detection device and the initial reference capacitance data as a second change corresponding to the n-th frame original capacitance data, the second change being used to represent the noise capacitance data output by the reference channel caused by changes in ambient temperature; determining the temperature compensation coefficient corresponding to the n-th frame original capacitance data based on the first change corresponding to the n-th frame original capacitance data, including: when the first change corresponding to the n-th frame original capacitance data is equal to the first change corresponding to the (n-1)-th frame original capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame original capacitance data based on the first change corresponding to the n-th frame original capacitance data, the second change corresponding to the n-th frame original capacitance data, and the n-th frame original capacitance data.
[0090] For ease of description, the second variation corresponding to the nth frame of raw capacitance data can be expressed as δref(n), where δref(n) = Refdata(n) - Refdata(1). Refdata(n) represents the nth frame of reference capacitance data, and Refdata(1) represents the initial reference capacitance data when the capacitance detection device is powered on, i.e., the first frame of reference capacitance data output by the reference channel after the capacitance detection device is powered on.
[0091] When the first change corresponding to the original capacitance data is not updated, that is, when the first change corresponding to the original capacitance data of the current frame is equal to the first change corresponding to the original capacitance data of the previous frame, it means that the change in the current original capacitance data is simply caused by the change in ambient temperature. At this time, based on the determined original capacitance data and its corresponding first change and second change, the corresponding temperature compensation coefficient is updated, which can accurately eliminate the noise capacitance data caused by the ambient temperature change in the original capacitance data, thereby obtaining more accurate effective capacitance data.
[0092] For each frame of raw capacitance data, its corresponding first variation needs to be calculated, and its corresponding temperature compensation coefficient is determined based on the magnitude relationship between the calculated first variation and the first variation corresponding to the previous frame of raw capacitance data.
[0093] In a possible embodiment, k(n) may be obtained by solving the minimum mean square error for the following objective function, for example, calculating the minimum mean square error for P frame data.
[0094]
[0095] Wherein, Rawdata(n) represents the raw capacitance data of the nth frame when J(n) is the minimum value, k(n) represents the temperature compensation coefficient corresponding to the raw capacitance data of the nth frame, δref(n) represents the second change corresponding to the raw capacitance data of the nth frame, and S0(n) represents the first change corresponding to the raw capacitance data of the nth frame.
[0096] Solving the minimum mean square error for the above objective function essentially means substituting different k(n) values into the above formula so that the mean square error of the data from (nP) frame to n frame is minimized. Different k(n) values correspond to different J(n) values. That is to say, when J(n) is the minimum value, the corresponding k(n) is the temperature compensation coefficient corresponding to Rawdata(n).
[0097] Alternatively, the least square method commonly used in signal processing may be used to solve the above objective function.
[0098] By solving the above objective function, the error in obtaining the temperature compensation coefficient can be reduced.
[0099] In another possible embodiment, when the first change amount corresponding to the n-th frame raw capacitance data is equal to the first change amount corresponding to the (n-1)-th frame raw capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame raw capacitance data according to the n-th frame raw capacitance data, the second change amount corresponding to the n-th frame raw capacitance data, and the first change amount corresponding to the n-th frame raw capacitance data includes: when the first change amount corresponding to the n-th frame raw capacitance data is equal to the first change amount corresponding to the (n-1)-th frame raw capacitance data, determining the temperature compensation coefficient corresponding to the n-th frame raw capacitance data according to the following formula:
[0100]
[0101] Wherein, k(n) represents the temperature compensation coefficient corresponding to the raw capacitance data of the nth frame, Rawdata(n) represents the raw capacitance data of the nth frame, S0(n) represents the first change corresponding to the raw capacitance data of the nth frame, δref(n) represents the second change corresponding to the raw capacitance data of the nth frame, and P represents the number of frames to be accumulated.
[0102] Since the process of solving the above-mentioned objective function may require a large amount of computing power, and in actual applications, the computing power of the processor often cannot meet the requirements for solving the above-mentioned objective function, this embodiment adopts a linear solution process to simplify the computing requirements.
[0103] Optionally, in the embodiment of the present application, P may be equal to 0, that is, k(n)=(Rawdata(n)-S0(n)) / (Refdata(n)-Refdata(1)).
[0104] Optionally, in an embodiment of the present application, P may be greater than 1, that is, the ratio of the sum of the third variation corresponding to multiple frames of raw capacitance data (i.e., the difference between the raw capacitance data and the first variation corresponding to the raw capacitance data) to the sum of the second variation corresponding to the multiple frames of raw capacitance data may be calculated. Regarding the value of P, it can be set according to the application of the data storage range and the ambient temperature change. For example, the processor can obtain at most the current frame raw capacitance data and the 5 frames of raw capacitance data and 5 frames of reference capacitance data before the current reference capacitance data from the memory, then P can be equal to 5, or it can be less than 5, for example, P is equal to 3. For another example, if the ambient temperature changes rapidly, a smaller P value can be set; if the ambient temperature changes slowly, a larger P value is set.
[0105] Optionally, in an embodiment of the present application, the first change corresponding to the n-th frame moment is determined based on the difference between the original capacitance data of the n-th frame and the original capacitance data of the (nM)-th frame output by the detection channel in the capacitance detection device, including: when the absolute value of the difference between the original capacitance data of the n-th frame and the original capacitance data of the (nM)-th frame is less than or equal to the fluctuation threshold, the temperature compensation coefficient corresponding to the (n-1)-th frame moment is determined as the temperature compensation coefficient corresponding to the n-th frame moment.
[0106] That is, if the absolute value of Diffchange(n) is less than or equal to the fluctuation threshold, S0(n)=son-1.
[0107] When S0(n) is updated, k(n) does not need to be updated to avoid large calculation errors. In other words, when a valid behavior occurs, the k value corresponding to the last frame of Rawdata before the valid behavior occurs can be used to perform temperature compensation on the Rawdata output when the valid behavior occurs.
[0108] In another embodiment, the processor may determine k(n) without using S0(n). Specifically, the processor may determine k(n) based on the relationship between the absolute value of Diffchange(n) and the 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). If the absolute value of Diffchange(n) is less than or equal to the fluctuation threshold, k(n) may be determined using the above-mentioned various embodiments. That is, when the absolute value of Diffchange(n) is greater than the fluctuation threshold, determining S0(n) and determining k(n) may be performed simultaneously, or in any order. In this case, the determined S0(n) is mainly used to determine the subsequent temperature compensation coefficient. In the case where the absolute value of Diffchange(n) is less than or equal to the fluctuation threshold, S0(n) needs to be determined first, and at this time, S0(n) = S0(n-1), and then k(n) is determined based on the above-mentioned various embodiments.
[0109] Optionally, in an embodiment of the present application, the processor may determine M based on the detection period of the capacitance detection device and / or the rate of change of the ambient temperature. For example, the longer the detection period of the capacitance detection device, the smaller M; the shorter the detection period of the capacitance detection device, the larger M. For another example, the faster the ambient temperature changes, the smaller M; the slower the ambient temperature changes, the larger M. It should be understood that M can be adaptively adjusted based on the detection period of the capacitance detection device and / or the rate of change of the ambient temperature, or it can be fixed, and this embodiment of the present application is not limited to this.
[0110] Adaptively adjusting M according to the detection period of the capacitance detection device and / or the rate of change of the ambient temperature is beneficial to obtaining a suitable temperature compensation coefficient to obtain more accurate effective capacitance data.
[0111] Optionally, in an embodiment of the present application, determining 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 includes: determining the effective capacitance data in the n-th frame of raw capacitance data according to the following formula:
[0112] Rawdatanew(n)=Rawdata(n)-k(n)*δref(n)),
[0113] Among them, Rawdatanew(n) represents the effective capacitance data in the n-th frame raw capacitance data, that is, the n-th frame effective capacitance data, Rawdata(n) represents the n-th frame raw capacitance data, k(n) represents the temperature compensation coefficient corresponding to the n-th frame raw capacitance data, δref(n) represents the difference between the n-th frame 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).
[0114] That is to say, after obtaining k(n) through the various embodiments described above, the formula provided in this embodiment is used to obtain Rawdatanew(n). By performing temperature compensation on the raw capacitance data and extracting effective capacitance data, it can be better suited for various applications based on capacitance detection.
[0115] Optionally, in an embodiment of the present application, the effective capacitance data in the n-th frame of original capacitance data is used to determine whether a target object is approaching the capacitance detection device.
[0116] In other words, after Rawdatanew(n) is acquired, it is possible to further determine whether a target object is approaching the capacitance detection device based on a comparison result between Rawdatanew(n) and a proximity threshold.
[0117] During proximity detection, the temperature compensation coefficient obtained in the embodiment of the present application is used to perform temperature compensation on the original capacitance data, which is beneficial to reducing the probability of misjudgment of proximity recognition. When a human body approaches the capacitance detection device, it is also beneficial to reduce the impact of temperature drift and improve the signal-to-noise ratio of the detected capacitance signal.
[0118] It should be understood that the fluctuation threshold and proximity threshold in the above various embodiments are both empirical thresholds. The fluctuation threshold refers to the threshold of the fluctuation of the capacitance change, and the proximity threshold refers to the threshold of the capacitance change caused by proximity.
[0119] In practical applications, the temperature change of the external environment is nonlinear and uncertain, such as Figure 6 and Figure 7 As shown, the reference capacitance data Refdata first heats up and then cools down. If a fixed temperature compensation coefficient k is used for temperature compensation in such a complex temperature scenario, the intermediate raw capacitance data Rawdata cannot accurately eliminate the ambient temperature fluctuation. In other words, the temperature compensation performed by the fixed temperature compensation coefficient is inaccurate, and the effective capacitance data Rawdatanew obtained after compensation fluctuates greatly. When the fluctuation approaches the threshold, it will be misjudged as approaching or moving away, resulting in an erroneous final detection result.
[0120] Figure 6The effective capacitance data Rawdatanew in is obtained by using a fixed temperature compensation coefficient, and Figure 7 The effective capacitance data Rawdatanew in the embodiment of the present application adopts the dynamically adjusted temperature compensation coefficient. Similarly, Figure 6 and Figure 7 The horizontal axis represents the number of frames, and the vertical axis represents the amplitude. Figure 6 and Figure 7 It can be seen that the dynamically adjusted temperature compensation coefficient of the embodiment of the present application can more accurately eliminate the ambient temperature changes, and the effective capacitance data obtained is smoother. Compared with the preset proximity threshold, it can more accurately identify approaching or moving away, and significantly optimize the impact of ambient temperature changes on the original capacitance data.
[0121] It should be understood that in the embodiments of the present application, whether it is "equal to" in a text description or "=" in a formula, it can be understood as approximately equal to.
[0122] The above describes in detail the method for detecting capacitance according to the embodiment of the present application. Figure 8 , describing a capacitance detection device according to an embodiment of the present application, the technical features described in the method embodiment are applicable to the following device embodiments.
[0123] Figure 8 Schematic block diagram of a capacitance detection device 200 according to an embodiment of the present application is shown. Figure 8 As shown, the device 200 includes:
[0124] a first determining unit 210 configured to determine a first variation corresponding to the n-th frame of raw capacitance data based on a difference between the n-th frame of raw capacitance data and the (nM)-th frame of raw capacitance data output by a detection channel in the capacitance detection device, where n is a positive integer greater than M and M is a positive integer greater than or equal to 1;
[0125] A second determining unit 220 is 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;
[0126] The third determining unit 230 is 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.
[0127] Therefore, the capacitance detection device of the embodiment of the present application can more accurately eliminate the ambient temperature changes by dynamically adjusting the temperature compensation coefficient, and optimize the impact of ambient temperature changes on the original capacitance data output by the detection channel, that is, more accurate effective capacitance data can be obtained. So that it can be better applied to various applications based on capacitance detection, such as wearing detection, SRA, pressure detection, touch gesture operation, etc. For example, in proximity detection, it is beneficial to reduce the probability of misjudgment of proximity recognition, and when a human body is close to the capacitance detection device, it is also beneficial to reduce the influence of temperature drift and improve the signal-to-noise ratio of the detected capacitance signal. For another example, in the headphone wearing scenario, it is beneficial to accurately identify the wearing status of the headphone, thereby improving the user experience.
[0128] Alternatively, as Figure 9 As shown, in an embodiment of the present application, the capacitance detection device 200 also includes: a fourth determination unit 240, which is used to determine the difference between the n-th frame reference capacitance data output by the reference channel in the capacitance detection device and the initial reference capacitance data as a second change corresponding to the n-th frame original capacitance data, and the second change is used to represent the noise capacitance data output by the reference channel caused by the ambient temperature change; the second determination unit 220 is specifically used to: when the first change corresponding to the n-th frame original capacitance data is equal to the first change corresponding to the (n-1)-th frame original capacitance data, determine the temperature compensation coefficient corresponding to the n-th frame original capacitance data according to the n-th frame original capacitance data, the first change corresponding to the n-th frame original capacitance data, and the second change corresponding to the n-th frame original capacitance data.
[0129] Optionally, in an embodiment of the present application, the second determining unit 220 is specifically configured to: determine the temperature compensation coefficient corresponding to the n-th frame of raw capacitance data according to the following formula when the first change corresponding to the n-th frame of raw capacitance data is equal to the first change corresponding to the (n-1)-th frame of raw capacitance data:
[0130]
[0131] Wherein, k(n) represents the temperature compensation coefficient corresponding to the raw capacitance data of the nth frame, Rawdata(n) represents the raw capacitance data of the nth frame, S0(n) represents the first change corresponding to the raw capacitance data of the nth frame, δref(n) represents the second change corresponding to the raw capacitance data of the nth frame, and P is an integer greater than or equal to 0 and P is less than n.
[0132] Optionally, in an embodiment of the present application, the second determining unit 220 is specifically configured to: determine the temperature compensation coefficient corresponding to the n-th frame of raw capacitance data by solving the minimum mean square error for the following objective function when the first change corresponding to the n-th frame of raw capacitance data is equal to the first change corresponding to the (n-1)-th frame of raw capacitance data:
[0133]
[0134] Wherein, k(n) represents the temperature compensation coefficient corresponding to the original capacitance data of the nth frame, Rawdata(n) represents the original capacitance data of the nth frame, S0(n) represents the first change corresponding to the original capacitance data of the nth frame, δref(n) represents the second change corresponding to the original capacitance data of the nth frame, and P is an integer greater than or equal to 0 and P is less than n.
[0135] Wherein, k(n) represents the temperature compensation coefficient corresponding to the raw capacitance data of the nth frame when J(n) is the minimum value, Rawdata(n) represents the raw capacitance data of the nth frame, S0(n) represents the first change corresponding to the raw capacitance data of the nth frame, δref(n) represents the second change corresponding to the raw capacitance data of the nth frame, and P is an integer greater than or equal to 0 and P is less than n.
[0136] Optionally, in an embodiment of the present application, the second determination unit 220 is specifically used to: when the first change corresponding to the original capacitance data of the nth frame is not equal to the first change corresponding to the original capacitance data of the (n-1)th frame, determine the temperature compensation coefficient corresponding to the original capacitance data of the (n-1)th frame as the temperature compensation coefficient corresponding to the original capacitance data of the nth frame.
[0137] Optionally, in an embodiment of the present application, the first determining unit 210 is specifically configured to: when the absolute value of the difference between the n-th frame raw capacitance data and the (nM)-th frame raw capacitance data is greater than the fluctuation threshold, determine the first variation corresponding to the n-th frame raw capacitance data according to the following formula:
[0138] S0(n)=S0(n-1)+Diffchange(n),
[0139] Among them, S0(n) represents the first change corresponding to the original capacitance data of the nth frame, S0(n-1) represents the first change corresponding to the original capacitance data of the (n-1)th frame, and Diffchange(n) represents the difference between the original capacitance data of the nth frame and the original capacitance data of the (nM)th frame.
[0140] Optionally, in an embodiment of the present application, the first determination unit 210 is specifically used to: when the absolute value of the difference between the original capacitance data of the nth frame and the original capacitance data of the (nM)th frame is less than or equal to the fluctuation threshold, determine the first change corresponding to the original capacitance data of the (n-1)th frame as the first change corresponding to the original capacitance data of the nth frame.
[0141] Alternatively, as Figure 9 As shown, in the embodiment of the present application, the third determining unit is specifically configured to determine the effective capacitance data in the n-th frame of original capacitance data according to the following formula:
[0142] Rawdatanew(n)=Rawdata(n)-k(n)*δref(n)),
[0143] Among them, Rawdatanew(n) represents the effective capacitance data in the n-th frame raw capacitance data, Rawdata(n) represents the n-th frame raw capacitance data, k(n) represents the temperature compensation coefficient corresponding to the n-th frame raw capacitance data, and δref(n) represents the difference between the n-th frame reference capacitance data output by the reference channel in the capacitance detection device and the initial reference capacitance data.
[0144] Optionally, in an embodiment of the present application, the effective capacitance data in the nth frame of original capacitance data is used to determine whether a target object is approaching the capacitance detection device.
[0145] Optionally, in an embodiment of the present application, M is determined based on the detection period of the capacitance detection device and / or the rate of change of the ambient temperature.
[0146] Figure 10 3 is a schematic structural diagram of a capacitance detection device 300 provided in an embodiment of the present application. Figure 10 The capacitance detection device 300 shown includes a processor 310, which can call and run a computer program from a memory to implement the method in the embodiment of the present application.
[0147] Alternatively, as Figure 10 As shown, the capacitance detection device 300 may further include a memory 320. The processor 310 may call and run a computer program from the memory 320 to implement the method in the embodiment of the present application.
[0148] The memory 320 may be a separate device independent of the processor 310 , or may be integrated into the processor 310 .
[0149] Optionally, the capacitance detection device 300 may specifically be the capacitance detection device of the embodiment of the present application. Specifically, the capacitance detection device 300 may implement the corresponding processes implemented by the capacitance detection device in each method of the embodiment of the present application. For the sake of brevity, they will not be repeated here.
[0150] An embodiment of the present application further provides an electronic device, which includes the capacitance detection device in the various embodiments described above.
[0151] An embodiment of the present application further provides a chip, which includes a processor. The processor can call and run a computer program from a memory to implement the method in the embodiment of the present application.
[0152] Optionally, the chip can be applied to the capacitance detection device in the embodiment of the present application, and the chip can implement the corresponding processes implemented by the capacitance detection device in each method of the embodiment of the present application. For the sake of brevity, it will not be repeated here.
[0153] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0154] Optionally, an embodiment of the present application further provides a computer-readable medium for storing a computer program to implement the method in the embodiment of the present application.
[0155] It should be understood that the processor of the embodiments of the present application may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiment can be completed by hardware integrated logic circuits in the processor or software instructions. The above processor can 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 devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly implemented as a hardware decoding processor, or can be implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0156] It is understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0157] It should be understood that the above-mentioned memories are exemplary but not restrictive. For example, the memories in the embodiments of the present application may also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM RAM (DR RAM), etc. In other words, the memories in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.
[0158] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0159] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0160] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0161] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0162] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0163] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0164] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A capacitance detection method, characterized in that: The method is applied to a capacitance detection device, and the method includes: determining a first variation corresponding to the n-th frame of raw capacitance data based on a difference between the n-th frame of raw capacitance data and the (nM)-th frame of raw capacitance data output by a detection channel in the capacitance detection device, where n is a positive integer greater than M and M is a positive integer greater than or equal to 1; If the first change amount corresponding to the n-th frame of raw capacitance data is not equal to the first change amount corresponding to the (n-1)-th frame of raw capacitance data, determining the temperature compensation coefficient corresponding to the (n-1)-th frame of raw capacitance data as the temperature compensation coefficient corresponding to the n-th frame of raw capacitance data; The effective capacitance data in the n-th frame of original capacitance data is determined according to the following formula: Rawdatanew(n)=Rawdata(n)-k(n)*δref(n), Wherein, Rawdatanew(n) represents the effective capacitance data in the n-th frame of raw capacitance data, Rawdata(n) represents the n-th frame of raw capacitance data, k(n) represents the temperature compensation coefficient corresponding to the n-th frame of raw capacitance data, and δref(n) represents the difference between the n-th frame of reference capacitance data output by the reference channel in the capacitance detection device and the initial reference capacitance data; The determining, based on a difference between the n-th frame of raw capacitance data and the (nM)-th frame of raw capacitance data output by a detection channel in the capacitance detection device, of a first variation corresponding to the n-th frame of raw capacitance data includes: When the absolute value of the difference between the n-th frame raw capacitance data and the (nM)-th frame raw capacitance data is greater than the fluctuation threshold, the first variation corresponding to the n-th frame raw capacitance data is determined according to the following formula: S0(n)=S0(n-1)+Diffchange(n), Among them, S0(n) represents the first change corresponding to the original capacitance data of the nth frame, S0(n-1) represents the first change corresponding to the original capacitance data of the (n-1)th frame, Diffchange(n) represents the difference between the original capacitance data of the nth frame and the original capacitance data of the (nM)th frame, and the first change corresponding to the original capacitance data of the first frame is the original capacitance data of the first frame.
2. The method according to claim 1, characterized in that The method further comprises: determining a difference between the n-th frame reference capacitance data output by a reference channel in the capacitance detection device and the initial reference capacitance data as a second variation corresponding to the n-th frame original capacitance data, the second variation being used to represent noise capacitance data output by the reference channel caused by a change in ambient temperature; When the first change corresponding to the nth frame original capacitance data is equal to the first change corresponding to the (n-1)th frame original capacitance data, the temperature compensation coefficient corresponding to the nth frame original capacitance data is determined based on the first change corresponding to the nth frame original capacitance data, the second change corresponding to the nth frame original capacitance data, and the nth frame original capacitance data.
3. The method according to claim 2, characterized in that The method further comprises: determining, when the first change corresponding to the n-th frame of raw capacitance data is equal to the first change corresponding to the (n-1)-th frame of raw capacitance data, the temperature compensation coefficient corresponding to the n-th frame of raw capacitance data according to the first change corresponding to the n-th frame of raw capacitance data, the second change corresponding to the n-th frame of raw capacitance data, and the n-th frame of raw capacitance data, including: When the first variation corresponding to the n-th frame of raw capacitance data is equal to the first variation corresponding to the (n-1)-th frame of raw capacitance data, the temperature compensation coefficient corresponding to the n-th frame of raw capacitance data is determined according to the following formula: Wherein, k(n) represents the temperature compensation coefficient corresponding to the n-th frame raw capacitance data, Rawdata(n) represents the n-th frame raw capacitance data, S0(n) represents the first change corresponding to the n-th frame raw capacitance data, δref(n) represents the second change corresponding to the n-th frame raw capacitance data, and P is an integer greater than or equal to 0 and P is less than n.
4. The method according to claim 2, characterized in that The method further comprises: determining, when the first change corresponding to the n-th frame of raw capacitance data is equal to the first change corresponding to the (n-1)-th frame of raw capacitance data, the temperature compensation coefficient corresponding to the n-th frame of raw capacitance data according to the first change corresponding to the n-th frame of raw capacitance data, the second change corresponding to the n-th frame of raw capacitance data, and the n-th frame of raw capacitance data, including: When the first change corresponding to the nth frame of raw capacitance data is equal to the first change corresponding to the (n-1)th frame of raw capacitance data, the temperature compensation coefficient corresponding to the nth frame of raw capacitance data is determined by solving the minimum mean square error for the following objective function: Wherein, k(n) represents the temperature compensation coefficient corresponding to the n-th frame raw capacitance data when J(n) is the minimum value, Rawdata(n) represents the n-th frame raw capacitance data, S0(n) represents the first change corresponding to the n-th frame raw capacitance data, δref(n) represents the second change corresponding to the n-th frame raw capacitance data, and P is an integer greater than or equal to 0 and P is less than n.
5. The method according to claim 1, characterized in that The determining of the first variation corresponding to the n-th frame time according to the difference between the n-th frame original capacitance data and the (nM)-th frame original capacitance data output by the detection channel in the capacitance detection device further includes: When the absolute value of the difference between the original capacitance data of the nth frame and the original capacitance data of the (nM)th frame is less than or equal to the fluctuation threshold, the first change corresponding to the original capacitance data of the (n-1)th frame is determined as the first change corresponding to the original capacitance data of the nth frame.
6. The method according to any one of claims 1 to 5, characterized in that The effective capacitance data in the n-th frame of raw capacitance data is used to determine whether a target object is approaching the capacitance detection device.
7. The method according to any one of claims 1 to 5, characterized in that M is determined based on a detection period of the capacitance detection device and / or a rate of change of the ambient temperature.
8. A capacitance detection device, characterized in that: The capacitance detection device comprises: The first determining unit is configured to determine, when an absolute value of a difference between the n-th frame raw capacitance data and the (nM)-th frame raw capacitance data output by the detection channel in the capacitance detection device is greater than a fluctuation threshold, a first variation corresponding to the n-th frame raw capacitance data according to the following formula: S0(n)=S0(n-1)+Diffchange(n), Wherein, S0(n) represents the first change corresponding to the n-th frame raw capacitance data, S0(n-1) represents the first change corresponding to the (n-1)-th frame raw capacitance data, Diffchange(n) represents the difference between the n-th frame raw capacitance data and the (nM)-th frame raw capacitance data, and the first change corresponding to the first frame raw capacitance data is the first frame raw capacitance data, wherein n is a positive integer greater than M and M is a positive integer greater than or equal to 1; a second determining unit, configured to, when the first change amount corresponding to the n-th frame raw capacitance data is not equal to the first change amount corresponding to the (n-1)-th frame raw capacitance data, determine the temperature compensation coefficient corresponding to the (n-1)-th frame raw capacitance data as the temperature compensation coefficient corresponding to the n-th frame raw capacitance data; The third determining unit is configured to determine 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), Among them, Rawdatanew(n) represents the effective capacitance data in the n-th frame raw capacitance data, Rawdata(n) represents the n-th frame raw capacitance data, k(n) represents the temperature compensation coefficient corresponding to the n-th frame raw capacitance data, δref(n) represents the difference between the n-th frame reference capacitance data output by the reference channel in the capacitance detection device and the initial reference capacitance data, and the first change corresponding to the first frame raw capacitance data is the first frame raw capacitance data.
9. The capacitance detection device according to claim 8, characterized in that: The capacitance detection device further includes: a fourth determining unit, configured to determine a difference between the n-th frame of reference capacitance data output by a reference channel in the capacitance detection device and the initial reference capacitance data as a second variation corresponding to the n-th frame of original capacitance data, the second variation being used to represent noise capacitance data output by the reference channel caused by a change in ambient temperature; The second determination unit is specifically used to: when the first change corresponding to the original capacitance data of the nth frame is equal to the first change corresponding to the original capacitance data of the (n-1)th frame, determine the temperature compensation coefficient corresponding to the original capacitance data of the nth frame according to the original capacitance data of the nth frame, the first change corresponding to the original capacitance data of the nth frame, and the second change corresponding to the original capacitance data of the nth frame.
10. The capacitance detection device according to claim 9, characterized in that: The second determining unit is specifically configured to: When the first variation corresponding to the n-th frame of raw capacitance data is equal to the first variation corresponding to the (n-1)-th frame of raw capacitance data, the temperature compensation coefficient corresponding to the n-th frame of raw capacitance data is determined according to the following formula: Wherein, k(n) represents the temperature compensation coefficient corresponding to the n-th frame raw capacitance data, Rawdata(n) represents the n-th frame raw capacitance data, S0(n) represents the first change corresponding to the n-th frame raw capacitance data, δref(n) represents the second change corresponding to the n-th frame raw capacitance data, and P is an integer greater than or equal to 0 and P is less than n.
11. The capacitance detection device according to claim 9, characterized in that: The second determining unit is specifically configured to: When the first change corresponding to the nth frame of raw capacitance data is equal to the first change corresponding to the (n-1)th frame of raw capacitance data, the temperature compensation coefficient corresponding to the nth frame of raw capacitance data is determined by solving the minimum mean square error for the following objective function: Wherein, k(n) represents the temperature compensation coefficient corresponding to the n-th frame raw capacitance data when J(n) is the minimum value, Rawdata(n) represents the n-th frame raw capacitance data, S0(n) represents the first change corresponding to the n-th frame raw capacitance data, δref(n) represents the second change corresponding to the n-th frame raw capacitance data, and P is an integer greater than or equal to 0 and P is less than n.
12. The capacitance detection device according to claim 8, characterized in that: The first determining unit is further configured to: When the absolute value of the difference between the original capacitance data of the nth frame and the original capacitance data of the (nM)th frame is less than or equal to the fluctuation threshold, the first change corresponding to the original capacitance data of the (n-1)th frame is determined as the first change corresponding to the original capacitance data of the nth frame.
13. The capacitance detection device according to any one of claims 8 to 12, characterized in that: The effective capacitance data in the n-th frame of raw capacitance data is used to determine whether a target object is approaching the capacitance detection device.
14. The capacitance detection device according to any one of claims 8 to 12, characterized in that: M is determined based on a detection period of the capacitance detection device and / or a rate of change of the ambient temperature.
15. A capacitance detection device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 7.
16. An electronic device, characterized in that: The device comprises the capacitance detection device according to any one of claims 8 to 14.
17. A chip, characterized in that: include: A processor, configured to call and run a computer program from a memory, so that a device equipped with the chip executes the method according to any one of claims 1 to 7.
18. A computer-readable storage medium, characterized in that Used to store a computer program, wherein the computer program causes a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Proximity sensor calibration method and device, mobile terminal and readable storage medium
CN107504994A
Detection method and device for proximity sensing
CN109238314A