Capacitance touch switch judgment method and system based on time-frequency domain calculus processing
The capacitive touch switch detection method using time-frequency domain calculus and integration solves the environmental dependence and interference recognition problems of capacitive touch detection technology by utilizing dimensionless parameters and an adaptive channel allocation mechanism, thus achieving stable and reliable touch detection.
Patent Information
- Application Number
- CN202511868211.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-05-15
AI Technical Summary
Existing capacitive touch detection technology is susceptible to changes in environmental factors, which can lead to drift of the reference capacitance, false triggering, or failure. It is difficult to distinguish between high-frequency transient interference and real touch actions, and the high dependence on hardware parameters limits the versatility and portability of the detection solution.
By employing time-frequency domain calculus processing, dimensionless parameters are constructed by calculating the time-domain impulse coefficient, frequency-domain impulse coefficient, and signal-to-noise ratio. Interference signals are eliminated, and response channels are adaptively allocated. Combined with hardware monitoring, calibration-free anti-interference detection is achieved.
It maintains stability and reliability in complex environments, provides an instant feedback experience, reduces the probability of false triggers, and improves the versatility and adaptability of the detection solution.
Smart Images

Figure CN122052764A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of human-computer interaction technology, and in particular to a capacitive touch switch judgment method and system based on time-frequency domain calculus processing. Background Technology
[0002] Capacitive touch sensing technology has been widely used in consumer electronics, home appliances, and industrial control equipment due to its advantages such as simple structure, no mechanical wear, and ease of waterproofing and dustproofing. Existing capacitive touch detection technologies typically rely on measuring the absolute value of the capacitance of the sensing electrodes. The system establishes a benchmark value by monitoring the capacitance value or its equivalent oscillation frequency, charging time, and other parameters, and compares the real-time detection value with this benchmark value. When the difference between the two exceeds a preset fixed threshold, the system determines it as a valid touch.
[0003] However, this traditional technique based on absolute value comparison has significant limitations in practical applications:
[0004] First, the reference capacitance value of the sensing electrode is highly sensitive to environmental factors. Changes in temperature and humidity alter the dielectric constant of the touch panel material and the dielectric properties of the surrounding air, causing a slow but significant drift in the reference capacitance. If the algorithm fails to compensate in time, the failure of the reference value will directly lead to false triggering or unresponsive buttons. Although existing technologies attempt to employ baseline tracking algorithms, they often struggle to balance stability and response speed when faced with drastic environmental changes.
[0005] Secondly, traditional solutions struggle to effectively handle various electromagnetic interferences and complex noise environments. On one hand, transient interference signals such as electrical fast transient pulses and electrostatic discharges often have enormous amplitudes and change rapidly, making them highly susceptible to misinterpretation as touch actions by threshold-based logic. On the other hand, in noisy environments or on surfaces covered by water films, the intensity of effective touch signals is significantly attenuated, resulting in a marked decrease in the signal-to-noise ratio. This causes the signal to be submerged in background noise, making it difficult for traditional algorithms to accurately identify the effective signal.
[0006] Furthermore, existing absolute value detection mechanisms are highly dependent on hardware parameters. Because the judgment logic is tightly bound to specific capacitance values, any slight change in the product's structural design (such as panel thickness and material), circuit layout, or production batch will render the original capacitance reference and threshold invalid. R&D personnel must perform tedious testing and calibration for each parameter change, which not only significantly extends the product development cycle but also limits the versatility and portability of the detection solution across different application scenarios. Summary of the Invention
[0007] The purpose of this invention is to provide a capacitive touch switch judgment method and system based on time-frequency domain calculus processing. It at least solves the problems of existing capacitive touch detection technology relying on the absolute value of capacitance as a reference, which is easily affected by changes in ambient temperature and humidity, causing reference drift and resulting in false touches or malfunctions, and the difficulty in effectively distinguishing high-frequency transient interference from real touch actions based on a single threshold. It also solves the technical problem of how to adaptively balance response speed and trigger stability under different signal quality conditions and achieve calibration-free anti-interference detection.
[0008] This invention provides the following solution:
[0009] The first aspect of the present invention provides a capacitive touch switch judgment method based on time-frequency domain calculus processing.
[0010] This method first acquires the capacitive touch sensing signal, then performs parallel time-domain and frequency-domain analyses on the acquired signal to calculate three characteristic parameters: time-domain impulse coefficient, frequency-domain impulse coefficient, and signal-to-noise ratio (SNR). The time-domain impulse coefficient is obtained by calculating the ratio of the derivative of the capacitive touch sensing signal with respect to time to the integral of the signal with respect to time. This parameter characterizes the rate of change of capacitance per unit energy and reflects the instantaneous pulse characteristics of the signal. The frequency-domain impulse coefficient is obtained by calculating the ratio of the derivative of the amplitude of the capacitive signal spectrum with respect to frequency to the integral of the amplitude of the spectrum spectrum with respect to frequency. This parameter characterizes the rate of change of the spectrum per unit total energy and reflects the energy distribution characteristics of the signal. The signal-to-noise ratio (SNR) is obtained by calculating the ratio of the current signal power to the reference noise power in the non-touch state.
[0011] Based on this, the method uses the calculated impulse coefficient to perform interference filtering logic. Specifically, the system compares the time-domain impulse coefficient with a first preset threshold. If the coefficient is greater than the threshold, it indicates that the signal change rate is extremely high and the energy accumulation is insufficient, thus identifying it as a transient interference signal and eliminating it. Simultaneously, the system compares the frequency-domain impulse coefficient with a second preset threshold. If the coefficient is less than the threshold, it indicates that the signal spectrum changes gradually, thus identifying it as an environmental drift signal and eliminating it. This process utilizes the dimensionless parameter characteristics, eliminating the dependence on the absolute value of capacitance as a reference.
[0012] For signals that pass the interference filter, this method performs adaptive channel allocation based on the signal-to-noise ratio (SNR) value. If the SNR is greater than or equal to the first SNR threshold, it indicates high signal quality and is allocated to the fast response channel; if the SNR is between the lower second SNR threshold and the first SNR threshold, it indicates medium signal quality and is allocated to the standard response channel; if the SNR is too low, it is considered an invalid signal.
[0013] Finally, a time-window-based acknowledgment mechanism is executed within each response channel. The fast response channel sets a shorter first time threshold (e.g., 3 to 10 milliseconds) to monitor whether the signal-to-noise ratio (SNR) remains consistently above the first SNR threshold; the standard response channel sets a longer second time threshold (e.g., 30 to 60 milliseconds) to monitor whether the SNR remains consistently above the second SNR threshold. The system outputs a touch trigger signal only when the signal continuously meets the condition for the preset duration of the corresponding channel. Furthermore, this method may include a hardware-level auxiliary monitoring process, utilizing an independent analog differentiating circuit to monitor the hardware rate of change of the signal in real time. Once this rate of change exceeds a hardware safety threshold, the trigger signal output is directly blocked through hardware logic.
[0014] A second aspect of the present invention provides a capacitive touch switch detection system based on time-frequency domain calculus processing.
[0015] The system includes a signal acquisition module, a feature extraction module, a decision output module, and an auxiliary monitoring module. The signal acquisition module is equipped with a charge transfer circuit, responsible for acquiring capacitance data and converting analog signals into digital signals. The feature extraction module receives the digital signals and calculates the aforementioned time-domain impulse coefficient, frequency-domain impulse coefficient, and signal-to-noise ratio.
[0016] The decision output module performs logical judgments based on the calculation results of the feature extraction module: first, it removes interference based on the impulse coefficients in the time and frequency domains; then, it diverts the signal to the fast response channel or the standard response channel according to the signal-to-noise ratio; finally, it monitors the signal stability within the preset duration of each channel and outputs a trigger command when the conditions are met.
[0017] The auxiliary monitoring module consists of an analog differentiating circuit and a hardware comparator. This module is physically independent of the digital processing logic. The analog differentiating circuit is connected to the analog signal path before analog-to-digital conversion, monitoring the analog rate of change of the signal in real time. When an abnormal rate of change is detected, the comparator flips and outputs a lock signal, forcibly preventing the decision output module from issuing a touch trigger signal, thus forming a dual hardware and software protection mechanism.
[0018] The above solution achieves the following beneficial technical effects:
[0019] This application replaces the traditional method of judging based on the absolute value of capacitance by constructing two dimensionless parameters: a time-domain impulse coefficient and a frequency-domain impulse coefficient. The time-domain impulse coefficient, using the ratio of the signal's rate of change to its accumulated amount, can effectively distinguish transient interference with low energy and rapid changes (such as electrostatic discharge); the frequency-domain impulse coefficient, using the ratio of the spectrum's rate of change to its total energy, can accurately identify low-frequency environmental drift with a smooth spectrum (such as changes in temperature and humidity). This judgment mechanism based on signal morphology rather than absolute value eliminates the dependence on reference capacitance calibration, enabling the product to maintain high stability and reliability even when facing complex external environments such as electromagnetic interference and climate change.
[0020] This application introduces a dual-threshold channel allocation mechanism based on signal-to-noise ratio (SNR), which splits the signal into a fast response channel and a standard response channel. For situations with good signal quality, such as dry, bare hands, the system uses an extremely short time window for confirmation, ensuring a smooth and immediate feedback experience. For harsh conditions such as wet hands or gloves, where the signal is weak or noise is high, the system automatically switches to a longer time window for stable confirmation. This adaptive strategy, trading time for space, cleverly resolves the contradiction between sensitivity and stability inherent in a single threshold scheme, ensuring optimal user experience across various application scenarios.
[0021] This application employs a combined software and hardware defense-in-depth mechanism. At the software level, signals undergo a dual funnel-like filtering process using both time and frequency domain impulse coefficients to eliminate interference signals with abnormal physical characteristics before proceeding to subsequent logical judgments. At the hardware level, an analog differentiating circuit, independent of the main processor, monitors the rate of change of the input signal in real time. Upon detecting a strong transient pulse exceeding a hardware threshold, it can lock the output directly at the physical layer as quickly as possible, preventing any slippage due to processor response delays. This multi-layered protection design, combining software and hardware, constitutes comprehensive protection from the front-end physical layer to the back-end logic layer, thereby minimizing the probability of false triggering. Attached Figure Description
[0022] Figure 1 This is a flowchart of the capacitive touch switch judgment method provided in the embodiment of the present invention.
[0023] Figure 2 This is a functional module architecture diagram of the capacitive touch switch judgment system provided in an embodiment of the present invention.
[0024] Figure 3 This is a schematic diagram of the circuit principle of the signal acquisition front-end and hardware-level auxiliary monitoring module provided in an embodiment of the present invention.
[0025] Figure 4 This is a schematic diagram of the dual-channel allocation and time window confirmation logic based on signal-to-noise ratio provided in an embodiment of the present invention. Detailed Implementation
[0026] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] See attached document Figure 1 This embodiment discloses a capacitive touch switch detection method based on time-frequency domain calculus and integration processing. This method is executed by a microprocessor or digital signal processing unit and is used to identify valid touch actions and eliminate interference signals without requiring reference calibration of the absolute value of the capacitance. The method specifically includes the following steps:
[0028] Step S1: Acquire capacitive touch sensing signals. The system first acquires physical-level capacitance change data through a hardware acquisition front-end. Specifically, the touch sensing electrodes are connected to the analog front-end via a charge transfer circuit or a relaxation oscillation circuit, converting the physical quantity of capacitance on the sensing electrodes into an analog voltage signal or frequency signal. This analog signal is then transmitted to an analog-to-digital converter (ADC) after anti-aliasing filtering. The ADC discretizes the analog signal at a preset sampling frequency, generating a digitized capacitive touch sensing signal sequence. This sequence reflects the capacitance changes of the sensing electrodes over a continuous time segment, serving as the input data source for subsequent signal processing algorithms.
[0029] Step S2: Calculate multi-dimensional feature parameters. The microprocessor receives the above-mentioned digitized capacitive touch sensing signal and performs time-domain analysis, frequency-domain analysis and power analysis in parallel within the same processing cycle to calculate the feature parameters in three dimensions: time-domain impulse coefficient, frequency-domain impulse coefficient and signal-to-noise ratio.
[0030] The time-domain impulse coefficient is obtained by calculating the ratio of the rate of change of the capacitive touch sensing signal in the time domain to the accumulated amount. This parameter characterizes the instantaneous drastic change of the signal under unit energy and is used to reflect the time-domain pulse characteristics of the signal.
[0031] The frequency domain impulse coefficient is obtained by performing a Fourier transform on the capacitive touch sensing signal to obtain spectral data and calculating the ratio of the rate of change of spectral amplitude to the total energy in the frequency domain. This parameter characterizes the frequency selectivity or spectral sharpness of the signal per unit of total energy and is used to reflect the frequency domain distribution characteristics of the signal.
[0032] The signal-to-noise ratio (SNR) is obtained by calculating the ratio of the signal power in the current detection period to the reference noise power in a preset no-touch state. This parameter characterizes the intensity level of the current signal relative to the background noise.
[0033] Step S3: Interference filtering based on impulse coefficient. The system performs a first-level validity verification of the capacitive touch sensing signal based on the time-domain and frequency-domain impulse coefficients calculated in step S2, aiming to eliminate abnormal interference caused by non-human touch. This step specifically includes two parallel logical judgment processes:
[0034] First, transient interference identification. The system compares the calculated time-domain impulse coefficient with a preset first threshold (upper limit threshold). If the time-domain impulse coefficient is greater than the first threshold, it indicates that the current signal has an extremely high rate of change and insufficient energy accumulation, which is consistent with the characteristics of electrostatic discharge or electromagnetic transient pulse. The system determines that the signal is a transient interference signal and removes it, resetting the current detection cycle.
[0035] Secondly, environmental drift identification. The system compares the calculated frequency domain impulse coefficient with a preset second threshold (lower threshold). If the frequency domain impulse coefficient is less than the second threshold, it indicates that the current signal's spectrum changes gradually and its energy distribution is broad, which conforms to the reference drift characteristics caused by slow changes in temperature or humidity. The system determines that the signal is an environmental drift signal and discards it, resetting the current detection cycle.
[0036] The system determines that the current signal has passed the interference filter and enters the next processing stage only when the time domain impulse coefficient is less than or equal to the first threshold and the frequency domain impulse coefficient is greater than or equal to the second threshold.
[0037] Step S4: Channel allocation based on signal-to-noise ratio (SNR). For capacitive touch sensing signals that have passed the interference filtering in step S3, the system allocates them to different processing logic channels according to their SNR values to adapt to different touch conditions. The system presets two SNR thresholds: a first SNR threshold and a second SNR threshold, wherein the first SNR threshold value is greater than the second SNR threshold value.
[0038] If the current signal-to-noise ratio (SNR) value is greater than or equal to the first SNR threshold, it indicates that the signal strength is high and the background noise has little impact. Corresponding to the standard touch conditions in a dry environment, the system allocates the signal to the fast response channel.
[0039] If the current signal-to-noise ratio (SNR) value is less than the first SNR threshold but greater than or equal to the second SNR threshold, it indicates that the signal strength is moderate or the background noise is strong. This corresponds to working conditions such as humid environments, wearing gloves, or touching non-central areas. The system will then allocate the signal to the standard response channel.
[0040] If the current signal-to-noise ratio (SNR) value is less than the second SNR threshold, it indicates that the signal is buried in noise or its strength is insufficient to constitute a valid trigger. The system determines it as an invalid signal and discards it.
[0041] Step S5: Signal confirmation and output based on time window. The system monitors the continuity of the signal in the fast response channel or standard response channel, and only outputs the trigger command when the signal remains stable within a specific time length.
[0042] In the fast response channel, the system sets a relatively short first time threshold. The system monitors whether the signal-to-noise ratio (SNR) remains above the first SNR threshold for a continuous period of the first time threshold. If this condition is met, the system determines it as a valid fast touch and immediately outputs a touch trigger signal; if the SNR drops below the first SNR threshold during the timing process, the timer is reset.
[0043] In the standard response channel, the system sets a longer second time threshold, the duration of which is greater than the first time threshold. The system monitors whether the signal-to-noise ratio (SNR) remains above the second SNR threshold for a continuous period of the second time threshold. If this condition is met, the system determines it as a valid standard touch and outputs a touch trigger signal; if the SNR drops below the second SNR threshold during the timing process, the timer is reset.
[0044] In this embodiment, a time-domain impulse coefficient is introduced. As a key feature parameter for identifying transient interference, traditional capacitive touch detection typically relies on the absolute value of the capacitance change. This makes the decision logic highly susceptible to changes in the environmental dielectric constant or drift in the reference capacitance. To eliminate this dependence, this invention constructs a dimensionless parametric model, namely the time-domain impulse coefficient. Time-domain impulse coefficient Defined as the ratio of the rate of change of capacitance to the accumulated capacitance. In the continuous time domain, its mathematical expression is:
[0045] ;
[0046] in, This represents the capacitive sensing signal that varies over time. It represents the derivative of the capacitance signal with respect to time, that is, the instantaneous rate of change of the signal; It represents the integral of the capacitance signal over time, that is, the total amount of energy or charge accumulated by the signal over a period of time.
[0047] Numerator This reflects the steepness of the signal waveform. For transient interferences such as electrostatic discharge (ESD) or electromagnetic pulse (EMC), the signal characteristics are usually manifested as a sharp jump in amplitude within a very short time, therefore its derivative value... Maximum. Denominator term This reflects the sustained energy of the signal. Although transient interference has a high amplitude, its duration is usually on the order of nanoseconds or microseconds, so its integral area on the time axis (i.e., energy accumulation) is very small.
[0048] In contrast, while normal human hand touch also causes capacitance changes, the rising edge of its signal waveform is relatively flat due to the physical limitations of human movement speed, and the touch action typically lasts from tens to hundreds of milliseconds. Therefore, its integral value... Larger.
[0049] By dividing the differential term by the integral term, the capacitance unit (farad F) in the formula cancels out in the numerator and denominator, thus improving the calculation result. This becomes a dimensionless value that depends only on time. This means the parameter is no longer affected by the absolute size of the capacitance, thus eliminating the reference drift problem caused by changes in the dielectric constant due to variations in ambient temperature and humidity, achieving calibration-free characteristics. On the other hand, for transient disturbances, because the numerator is extremely large and the denominator is extremely small, the calculated... The value will be much greater than that of a normal touch signal. Numerical value. Therefore, by setting an upper limit threshold. It can accurately distinguish between high-frequency transient interference and valid touch signals.
[0050] In digital signal processing systems, the above continuous formula is implemented using a discretization method. Assume the sampling period is... The sampling point sequence is ,but The discrete calculation formula can be approximated as:
[0051] ;
[0052] in, This is the length of the sliding window used to calculate the cumulative amount. The value of needs to be determined by balancing sensitivity to transient interference and stability to normal touch signals. If Too small, the denominator is too small, which may cause normal touch signals to be... The value is too high and therefore misjudged; if If the value is too large, the sensitivity to short-term interference will decrease. In this embodiment, combined with a sampling rate of 1kHz, the optimal value of m ranges from 5 to 20, corresponding to an integration duration of 5ms to 20ms. This duration is sufficient to accumulate enough energy for normal touch signals while ensuring that the integral value of transient interference remains at an extremely low level. Approximately represents the differential term. Approximate representation of the integral term, This is the length of the integration window. The system calculates this in real time. The value is used to perform interference removal logic.
[0053] In parallel with time-domain analysis, this embodiment introduces frequency-domain impulse coefficients. As a key characteristic parameter for identifying environmental drift (such as changes in capacitance reference caused by variations in temperature and humidity), environmental drift typically manifests as a slowly changing low-frequency signal. Its time-domain characteristics are sometimes difficult to distinguish from long-press operations, but it exhibits significant characteristics in its frequency-domain energy distribution. Frequency-domain impulse coefficient. Defined as the ratio of the rate of change of the amplitude of the capacitance signal spectrum to the total energy in the frequency domain. In the continuous frequency domain, its mathematical expression is:
[0054] ;
[0055] in, This represents the frequency spectrum function obtained after the capacitive touch sensing signal undergoes frequency domain transformation (such as Fourier transform), and its amplitude spectrum is usually taken. It represents the derivative of the spectral amplitude with respect to frequency, reflecting the degree of fluctuation or rate of change of the spectral curve on the frequency axis; It represents the integral of the spectral amplitude with respect to frequency, that is, the total energy of the signal within the entire analysis frequency band.
[0056] Environmental drift signals (such as a slow rise in capacitance reference value caused by temperature increase) mainly exhibit extremely low-frequency or even DC components in the frequency domain. Their spectral energy is highly concentrated near zero frequency and decays extremely rapidly with increasing frequency. The spectral curves of these signals are relatively smooth, lacking high-frequency components; therefore, their spectral change rate is... The overall level is low.
[0057] Conversely, effective human hand touch signals typically contain abundant mid-to-low frequency components (corresponding to finger pressing and lifting movements). Their spectral distribution is relatively broad and includes certain harmonic components, resulting in noticeable fluctuations and variations in the spectral curve. Relatively large.
[0058] Meanwhile, although environmental drift changes slowly, it often lasts for a long time and has a wide range of effects. Therefore, the total energy accumulated within the observation window (denominator term) is relatively large. It is usually quite large.
[0059] By calculating the ratio Similarly, dimensionless processing was achieved. For environmental drift signals, due to the small numerator (gentle spectral change) and large denominator (large total energy), the calculated... The value will be lower than a normal touch signal. Therefore, a lower threshold is set. If the calculated The system can then determine that the current signal is mainly caused by environmental factors and filter it accordingly. This effectively solves the problem of accidental touches or reference malfunctions caused by changes in temperature and humidity in traditional solutions.
[0060] In actual microprocessor implementations, this step typically includes the following process: First, the acquired time series data is processed... Performing a Fast Fourier Transform (FFT) yields a discrete spectrum sequence. Then on Perform difference operations to approximate and to Perform a summation operation to approximate Finally, the ratio of the two is calculated to obtain the discrete frequency domain impulse coefficient.
[0061] Signal-to-noise ratio (SNR), as the third core characteristic parameter, is not used as the sole triggering criterion in this embodiment, unlike traditional schemes (i.e., not just triggering when the signal exceeds a threshold). Instead, it primarily serves the functions of load balancing and signal quality assessment. By calculating the SNR, the system can quantify the relative strength of the current signal, thereby determining whether to activate a fast response mechanism or enter a highly stable standard response process.
[0062] The signal-to-noise ratio (SNR) is calculated based on the ratio of signal power to noise power. Its physical definition and calculation method are as follows:
[0063] ;
[0064] in, This represents the power value of the capacitive touch sensing signal within the current cycle; This represents the reference noise power value. In practical implementation, to obtain accurate... The system extracts the amplitude (or pre-processed signal envelope) of the capacitance signal within the current detection window and calculates its root mean square value or peak power. For example, it could be the current sampling point. The square of the difference between the dynamic baseline and the baseline.
[0065] for To acquire this information, the system typically performs statistical analysis on the background signal on the sensing electrodes during the initialization phase or in an idle state determined to be without touch. For example, it collects an idle signal of a preset length (e.g., 100ms) and calculates its variance or average power as the current reference noise power. To adapt to environmental changes, this... The values can be updated dynamically, for example, by using a moving average algorithm to track the background noise level.
[0066] The signal-to-noise ratio (SNR) parameter plays a crucial role in subsequent channel allocation logic. Traditional capacitive touch solutions often set a single... Trigger threshold (e.g.) >5), which leads to a dilemma: if the threshold is set too high, the signal will be weak in situations such as when hands are wet or gloves are worn ( If only 3-4 are detected, the system cannot recognize them, resulting in missed touches; if the threshold is set low, although the sensitivity is improved, it is easily affected by environmental noise, causing false touches.
[0067] This invention solves this problem by introducing dual threshold logic: when At a high level (e.g.) When the signal quality is excellent (e.g., touched by a dry, bare hand), the system determines that the signal is highly reliable and therefore allows it to enter the fast response channel, triggering the signal with an extremely short confirmation time (e.g., 5ms) to provide a smooth user experience.
[0068] when At a low to medium level (e.g.) When the signal is weak or noisy (e.g., due to wet hands, water film, or electromagnetic interference), the system does not discard the signal directly but instead directs it to the standard response channel. In this channel, the system repeatedly verifies the signal by extending the acknowledgment time (e.g., 45ms). Although this sacrifices a slight increase in response speed, it buys time and ensures stable triggering and malfunction-free operation even under harsh conditions.
[0069] Only when Extremely low ( Only when this condition is met is it considered pure noise and ignored. This is based on... The hierarchical processing strategy improves the robustness of the system in complex real-world application scenarios.
[0070] To ensure the capacitive touch system maintains extremely high reliability under complex electromagnetic environments and variable weather conditions, this embodiment designs a funnel-shaped multi-level interference filtering mechanism based on characteristic parameters. This mechanism, located after signal acquisition and before logical decision-making, aims to directly eliminate non-human touch signals at the physical characteristic level, thereby preventing invalid data from entering the subsequent channel allocation process. The specific filtering strategy consists of two parallel dimensions: upper limit fusing for transient changes and lower limit interception for slow drift.
[0071] Perform dual filtering based on feature parameters after signal acquisition:
[0072] Level 1 (Upper Limit Circuit Breaker): Targets transient interference such as ESD or RFI. These types of interference exhibit extremely high time-domain variability, leading to... An abnormally high level has been detected. The system is monitoring this in real time. ,like (First preset threshold) The frame data is directly discarded and the state is reset without triggering subsequent logic.
[0073] Level 2 (Lower Limit Interception): Targets environmental drift caused by changes in temperature and humidity. This type of interference has a low frequency domain change rate, leading to... Abnormal decrease. System monitoring. ,like (Second preset threshold) is used to determine reference drift and the signal is discarded. Only when the signal simultaneously meets the following conditions... and Only when this time is it considered a valid signal to proceed to the next step. The process of diverting patients.
[0074] After the capacitive touch sensing signal passes through multi-level interference filtering, the system confirms that it is a potentially valid touch signal in terms of physical characteristics. However, the signal quality of a valid touch signal varies under different operating conditions (e.g., a strong press in a dry environment versus a gentle touch in a humid environment). To achieve a balance between response speed and trigger stability, this embodiment designs an adaptive channel allocation logic based on signal-to-noise ratio (SNR) to divert the processing flow to either a fast response channel or a standard response channel. The core of this allocation logic lies in setting two key SNR determination thresholds: the first SNR threshold (denoted as...) ) and the second signal-to-noise ratio threshold (denoted as ),in These two thresholds divide the signal-to-noise ratio space into three regions, each corresponding to a different processing strategy:
[0075] Conditions for allocation to the fast response channel: If the currently calculated signal-to-noise ratio The system then assigns the signal to the fast response channel.
[0076] Physical meaning: It is set to a relatively high value, such as 8 or 10. When Reaching or exceeding this threshold indicates that the signal strength is significantly greater than the background noise, signifying excellent signal quality. This typically corresponds to ideal touch conditions, such as a dry, clean panel and a user pressing the center area with bare fingertips. Under these high-confidence signal conditions, the system can employ a more aggressive and rapid confirmation strategy.
[0077] Implementation details: The microprocessor internally maintains a status flag. When this condition is met, the processor sets the flag to the fast channel standby state and prepares to start the corresponding timer.
[0078] Conditions for allocation to the standard response channel: if the current signal-to-noise ratio and The system then assigns the signal to the standard response channel.
[0079] Physical meaning: It is set to a low value, such as 3 or 4, as the minimum threshold for a valid signal. When fall into When the signal strength falls within a certain range, it indicates that while the signal strength exceeds the minimum effective noise level, it does not meet the high-quality standard. This typically corresponds to complex or non-ideal touch conditions, such as: the presence of water droplets or a thin water film on the panel surface; the user wearing thin gloves; the touch position being off-center from the sensing electrode, resulting in a small coupling capacitance; or the presence of moderate-intensity persistent background electromagnetic interference. Under these moderate signal quality conditions, to avoid misjudgments caused by signal fluctuations, the system chooses to enter a more conservative standard verification process.
[0080] Implementation details: When this condition is met, the processor sets the status flag to the standard channel standby state and prepares to start another independent timer.
[0081] Conditions for determining an invalid signal: If the current signal-to-noise ratio is... The system determines that the current signal is invalid and discards it.
[0082] Physical meaning: When the signal strength is equal to or lower than the noise level, it is impossible to reliably distinguish between a valid touch and random noise fluctuations. Discarding such signals as invalid can prevent false triggering of the system under extremely low signal-to-noise ratio conditions.
[0083] Implementation details: The processor directly resets the current processing state without entering any timing process, and waits for the arrival of the next valid frame signal.
[0084] Through the aforementioned signal-to-noise ratio partitioning based on dual thresholds, the system can perform secondary quality assessment on signals filtered by physical features and guide them to the processing flow most suitable for their current quality level, providing a decision basis for the subsequent adaptive time window confirmation mechanism.
[0085] When a capacitive touch sensing signal has a signal-to-noise ratio (SNR) ) is greater than or equal to the first signal-to-noise ratio threshold ( The system assigns it to the fast response channel. This channel is designed to minimize the delay from signal recognition to trigger output while ensuring high reliability, thus providing users with immediate feedback under ideal operating conditions. To this end, the core mechanism of this channel is a continuous verification process based on a short time window. This process specifically includes the following steps:
[0086] Start Timer: Once a signal enters the fast-response channel, the microprocessor immediately starts a dedicated hardware or software timer for that channel. This timer is set to a short initial time threshold (…). The duration of this first time threshold can be set between 3 and 10 milliseconds. In a preferred embodiment, this value is set to 5 milliseconds. This choice of duration is based on the analysis of the physical process of normal human hand touch actions: even with rapid clicking actions, the contact time between the finger and the sensing electrode usually lasts for tens of milliseconds. Therefore, 5 milliseconds is sufficient as an effective criterion for determining the shortest contact time, while also filtering out some spurious signals with extremely short durations.
[0087] Continuous Monitoring and Condition Maintenance: Within a 5-millisecond time window (using the preferred value as an example), when the timer starts counting from 0, the system does not simply wait for the time to end, but enters a high-frequency continuous monitoring state. In each subsequent sampling period (e.g., monitoring every 1ms if the sampling rate is 1kHz), the system repeatedly performs the following judgment:
[0088] Interference check: Recalculate the temporal impulse coefficient of the current sampling point. and frequency domain impulse coefficient .like or This indicates that new interference has occurred during the confirmation process. The system immediately stops the timing, resets the state machine, and determines that the touch is invalid.
[0089] Signal-to-noise ratio check: Recalculate the signal-to-noise ratio of the current sampling point. The system determines that Is it still greater than or equal to the first signal-to-noise ratio threshold? This is the core condition for maintaining this channel.
[0090] Timing Abort and Reset: If, during the 5-millisecond timing process, the monitoring result at any sampling point fails to meet the above maintenance conditions (e.g., a finger rapidly sliding across the screen causes a decrease in signal strength, thus...), the timing is interrupted and reset. Fall to If the following occurs, the system will immediately terminate the process. The timer will be forcibly reset to zero, the processing flow will exit the fast response channel, and it will wait for the next signal frame that meets the entry conditions. This mechanism of exiting if the conditions are not met ensures that only touches with consistently high signal quality throughout the entire time window will be considered valid, greatly preventing false triggers caused by brief signal jitter or instantaneous high signal-to-noise ratio.
[0091] Trigger Confirmation and Output: Only when the timer successfully and without interruption completes its full 5-millisecond count will the system ultimately determine that the touch was a valid fast touch. At this point, the decision output module generates a touch trigger signal, which is output to an external actuator (such as a relay, backlight controller, etc.) via an interface such as GPIO. After the trigger signal is output, the system completes a full judgment cycle and prepares to receive the next touch signal.
[0092] Through the above mechanism, the fast response channel achieves response latency as low as milliseconds while ensuring signal quality, meeting the needs of application scenarios with high requirements for real-time feedback.
[0093] When a capacitive touch sensor signal has a signal-to-noise ratio (SNR) ) is located at the second signal-to-noise ratio threshold ( ) and the first signal-to-noise ratio threshold ( Between ) The system assigns it to the standard response channel. This channel's design philosophy differs significantly from the fast response channel: it no longer pursues extreme response speed, but instead uses a time-for-space strategy to achieve extremely high judgment accuracy under conditions of less-than-ideal signal quality (moderate intensity or high background noise). This aims to address stability issues in humid environments, with wet hands, or under weak contact. The specific execution logic of this channel is as follows:
[0094] Start a long-cycle timer: After the signal is shunted to the standard response channel, the microprocessor starts a dedicated long-cycle timer. This timer is set to a relatively long second time threshold (…). This second time threshold is significantly larger than the first time threshold of the fast response channel. The duration of this second time threshold can be set between 30 and 60 milliseconds. In a preferred embodiment, this value is set to 45 milliseconds. This time length (approximately 45 ms) is chosen based on the following considerations:
[0095] Distinguishing between water film and finger pressure: When water droplets or films slide on a panel under the influence of gravity or airflow, the resulting capacitance changes are often fluctuating and difficult to maintain stably above the effective threshold over a long time window. In contrast, even a slight finger press, if intentionally triggered by the user, typically provides a stable pressure signal that lasts for more than 50ms.
[0096] Noise smoothing: In high background noise environments, The value may be in Nearby fluctuations. A longer observation window allows the system to smoothly confirm the signal over time; only consistently stable signal components can withstand the test of time.
[0097] Continuous monitoring and condition maintenance: Within a 45ms time window (taking the preferred value as an example) from which the timer starts counting from 0, the system also performs high-frequency frame-by-frame monitoring. Within each monitoring cycle:
[0098] Interference check: The system continuously calculates and Once detected (Sudden interference) or (In case of sudden environmental changes) immediately stop the timer and reset it.
[0099] Signal-to-noise ratio check: The system determines the signal-to-noise ratio of the current sampling point. Is it still greater than or equal to the second signal-to-noise ratio threshold? Note that the maintenance conditions here are more lenient than those for the fast channel; the signal only needs to not fall into the invalid region (i.e., less than...). The system allows the timing to continue even when the signal is in use. and There may be slight fluctuations, but as long as the price does not fall below the bottom line, the confirmation process remains valid.
[0100] Timing Abort and Reset: If the signal is interrupted during the lengthy 45ms acknowledgment process (e.g., a water droplet causes the signal to disappear momentarily), or the signal-to-noise ratio drops to a certain level... The system then determines that this is an unstable spurious trigger or random noise. At this point, the timer immediately resets to zero and no output is generated. This mechanism effectively filters out random signals that may briefly pass interference detection but lack duration.
[0101] Through this differentiated dual-channel design, this invention cleverly resolves the contradictions inherent in traditional single-threshold algorithms: for high-quality signals, the system exhibits extremely high sensitivity and response speed (5ms trigger); for low-quality signals, the system demonstrates strong robustness and anti-interference capability (45ms trigger). This adaptive mechanism ensures that the capacitive touch switch provides a consistent and reliable operating experience, whether in a dry living room or a damp bathroom.
[0102] It is worth noting that the aforementioned signal-to-noise ratio (SNR) The accuracy of the calculations is highly dependent on a reliable reference noise power. Therefore, this embodiment also includes a set of... Mechanism for initialization and adaptive updates:
[0103] Initialization: Upon initial power-up, the system enters a mandatory initialization phase. During this phase (e.g., the first 200 milliseconds), the system disables touch-triggered output, continuously acquires signals, and calculates their average power, using this value as the initial reference noise power. And store it in memory.
[0104] Dynamic update trigger condition: During normal system operation, when continuous Each sampling period (e.g.) If no signal meeting the conditions for entering the fast or standard response channel is detected within 500ms (=500), the system determines that it is currently in a defined long-term no-touch state and triggers a baseline update process.
[0105] Update Algorithm: After an update is triggered, the system uses a first-order low-pass filtering algorithm to fuse the newly acquired noise power with the old reference noise power for a smooth update. Value. For example:
[0106] ,
[0107] in It is a small update coefficient (e.g., 0.1). This algorithm ensures that the baseline value does not change drastically due to a single noise fluctuation, thus guaranteeing the long-term stability of SNR calculation.
[0108] Before detailing the hardware system, it is necessary to explain that the preset thresholds mentioned in the method of this invention (such as the time-domain impact coefficient threshold) Frequency domain impulse coefficient threshold Signal-to-noise ratio threshold and Time window threshold and It can be determined in one or more of the following ways:
[0109] Empirical value solidification: By conducting offline analysis and statistics on a large amount of sample data under different working conditions (such as ESD, water spray, wet hands, dry hands, gloves, etc.), the boundary point that best distinguishes different signal types is found and burned into the firmware as the default constant value. This is the simplest and most direct implementation method.
[0110] Production Line Calibration Mode: The system can provide a special engineering mode or production line calibration mode. In this mode, the operator can apply standard interference sources and standard touch actions according to standard test procedures. The system automatically collects data and calculates the optimized threshold suitable for the current hardware batch and product structure, and stores it in non-volatile memory (such as EEPROM or Flash).
[0111] Partially adaptive thresholds: For certain thresholds, such as The system can statistically analyze the frequency domain impulse coefficient fluctuation range of normal background noise during confirmed long periods of no touch, and dynamically fine-tune based on this range. The value is adjusted to better adapt to the current environment and further improve robustness.
[0112] See attached document Figure 2 This system materializes the aforementioned methods into specific hardware modules and software functional units, with the design goal of achieving highly reliable, calibration-free, and adaptive capacitive touch detection. Physically and functionally, the system is mainly divided into four cooperating modules: a signal acquisition module, a feature extraction module, a decision output module, and an auxiliary monitoring module.
[0113] Signal acquisition module: includes charge transfer circuit, filter network and ADC, which converts touch capacitance changes into digital sequences;
[0114] Feature extraction module: Parallel calculation of temporal impulse coefficients in the MCU Frequency domain impulse coefficient And signal-to-noise ratio (SNR);
[0115] Decision output module: based on Filtering interference, channel splitting based on SNR, and management. The timing is ultimately triggered by outputting instructions via GPIO;
[0116] Auxiliary monitoring module: a pure hardware circuit, independent of the MCU, used to detect the rate of change of analog signals and force the output to be locked.
[0117] like Figure 3 As shown: Front-end data acquisition is achieved by the MCU controlling switches S1 / S2 to sense the capacitor. and integrating capacitor Perform charging and discharging. Output voltage. The signal is buffered by an operational amplifier and filtered by a low-pass filter (cutoff frequency lower than half the ADC sampling rate) consisting of R2-R3-C3 before being fed into the ADC. Digital processing involves the MCU acquiring digital signals through the ADC and executing feature extraction and decision-making algorithms. Power management uses an LDO to provide an independent AVDD for the analog section, with a single-point ground connection to the digital power supply DVDD, and decoupling capacitors are configured to reduce noise interference.
[0118] The hardware-level auxiliary monitoring module consists of an analog differentiating circuit and a comparator. Differentiating circuit Connected in parallel to the ADC input, output voltage Proportional to The comparator will Hardware threshold Comparison. When a strong transient disturbance occurs, leading to... The time comparator flips to output a lock signal. This signal acts directly on the system output through a hardware logic gate (such as an AND gate), physically blocking the MCU's trigger signal.
[0119] The system's operating timing is divided into:
[0120] Idle phase: Collect background noise and update dynamically. Benchmark.
[0121] Transient interference: caused by sudden spikes The circuit breaker is triggered, the system is reset, and no output is generated.
[0122] Fast touch (ideal condition): The signal meets the filtering conditions and Enter the fast lane. Timing... (5ms) period Maintain the target and immediately output a trigger signal after the timer ends.
[0123] Standard touch (harsh conditions): The signal meets the filtering conditions and Enter the standard lane. Timing begins. (45ms) period Maintain at Above, a trigger signal is output after the timing ends.
[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A capacitive touch switch judgment method based on time-frequency domain calculus and integration processing, characterized in that, Includes the following steps: Step S1: Acquire capacitive touch sensing signal; Step S2: Perform time-domain analysis and frequency-domain analysis on the capacitive touch sensing signal to calculate the time-domain impulse coefficient, frequency-domain impulse coefficient, and signal-to-noise ratio respectively; wherein, the time-domain impulse coefficient represents the capacitance change rate under unit energy, the frequency-domain impulse coefficient represents the spectrum change rate under unit total energy, and the signal-to-noise ratio represents the ratio of the current capacitive touch sensing signal power to the reference noise power. Step S3: Based on the time-domain impulse coefficient and the frequency-domain impulse coefficient, perform interference filtering on the capacitive touch sensing signal. If the capacitive touch sensing signal is determined to be a transient interference signal or an environmental drift signal, it is rejected. Step S4: If the capacitive touch sensing signal is not eliminated, the capacitive touch sensing signal is allocated to the fast response channel or the standard response channel according to the signal-to-noise ratio. Step S5: Within the fast response channel or the standard response channel, monitor whether the signal-to-noise ratio continuously meets the preset condition within the corresponding preset duration. If so, output a touch trigger signal.
2. The capacitive touch switch judgment method based on time-frequency domain calculus and integration processing according to claim 1, characterized in that, In step S3, the step of filtering interference from the capacitive touch sensing signal based on the time-domain impulse coefficient and the frequency-domain impulse coefficient includes: The time-domain impulse coefficient is compared with a first preset threshold. If the time-domain impulse coefficient is greater than the first preset threshold, the current signal is determined to be a transient interference signal and is eliminated. The frequency domain impulse coefficient is compared with a second preset threshold. If the frequency domain impulse coefficient is less than the second preset threshold, the current signal is determined to be an environmental drift signal and is removed.
3. The capacitive touch switch judgment method based on time-frequency domain calculus and integration processing according to claim 1, characterized in that, The step S4, which involves allocating the capacitive touch sensing signal to either the fast response channel or the standard response channel based on the signal-to-noise ratio, includes: A first signal-to-noise ratio (SNR) threshold and a second SNR threshold are set, wherein the first SNR threshold is greater than the second SNR threshold; If the signal-to-noise ratio is greater than or equal to the first signal-to-noise ratio threshold, then the capacitive touch sensing signal is allocated to the fast response channel; If the signal-to-noise ratio is less than the first signal-to-noise ratio threshold and greater than or equal to the second signal-to-noise ratio threshold, then the capacitive touch sensing signal is assigned to the standard response channel; If the signal-to-noise ratio is less than the second signal-to-noise ratio threshold, the current signal is determined to be an invalid signal and is discarded.
4. The capacitive touch switch judgment method based on time-frequency domain calculus and integration processing according to claim 3, characterized in that, Step S5, which involves monitoring whether the signal-to-noise ratio continuously meets the preset condition within the corresponding preset duration in the fast response channel or the standard response channel, includes: In the fast response channel, a first time threshold is set; if the signal-to-noise ratio remains above the first signal-to-noise ratio threshold within the first time threshold, then output control is executed; In the standard response channel, a second time threshold is set; if the signal-to-noise ratio remains above the second signal-to-noise ratio threshold within the second time threshold, output control is executed; Wherein, the duration of the second time threshold is greater than the duration of the first time threshold.
5. The capacitive touch switch judgment method based on time-frequency domain calculus and integration processing according to claim 1, characterized in that, The calculation method for the time-domain impulse coefficient in step S2 is as follows: The rate of change of capacitance is obtained by calculating the derivative of the capacitive touch sensing signal with respect to time. The capacitance accumulation is obtained by integrating the capacitive touch sensing signal over time. Calculate the ratio of the capacitance change rate to the capacitance accumulation, and use the ratio as the time-domain impulse coefficient.
6. The capacitive touch switch judgment method based on time-frequency domain calculus and integration processing according to claim 1, characterized in that, The frequency domain impulse coefficient in step S2 is calculated as follows: The frequency domain transformation of the capacitive touch sensing signal is performed to obtain the capacitive signal spectrum; Calculate the derivative of the amplitude of the capacitance signal spectrum with respect to frequency to obtain the rate of spectral change; The total frequency domain energy is obtained by integrating the amplitude of the capacitance signal spectrum with respect to frequency. Calculate the ratio of the spectral change rate to the total energy in the frequency domain, and use the ratio as the frequency domain impulse coefficient.
7. The capacitive touch switch judgment method based on time-frequency domain calculus and integration processing according to claim 1, characterized in that, The signal-to-noise ratio is calculated in step S2 as follows: The power value of the reference capacitance signal in the non-touch state is obtained as the noise power; The power value of the capacitive touch sensing signal during the reference period is obtained as the noise power; The signal-to-noise ratio is obtained by calculating the ratio of the signal power to the noise power.
8. The capacitive touch switch judgment method based on time-frequency domain calculus and integration processing according to claim 1, characterized in that, It also includes hardware-level auxiliary monitoring steps: The capacitive touch sensing signal is shunted to an analog differentiating circuit; The hardware rate of change of the capacitive touch sensing signal is monitored in real time using the analog differentiating circuit. A comparator is used to determine whether the hardware change rate exceeds the hardware safety threshold. If so, a lock signal is output to prevent the output of the touch trigger signal.
9. The capacitive touch switch judgment method based on time-frequency domain calculus and integration processing according to claim 4, characterized in that, The first time threshold is set to 3 to 10 milliseconds; the second time threshold is set to 30 to 60 milliseconds.
10. A capacitive touch switch detection system based on time-frequency domain calculus and integration processing, characterized in that, The capacitive touch switch determination method based on time-frequency domain calculus and integration processing as described in any one of claims 1-9 includes: The signal acquisition module is used to acquire capacitance data through the charge transfer circuit and convert analog signals into digital signals; The feature extraction module is used to receive the digital signal and calculate the time-domain impulse coefficient, frequency-domain impulse coefficient, and signal-to-noise ratio respectively; wherein, the time-domain impulse coefficient represents the capacitance change rate under unit energy, the frequency-domain impulse coefficient represents the spectrum change rate under unit total energy, and the signal-to-noise ratio represents the ratio of the current capacitive touch sensing signal power to the reference noise power. The decision output module is used to filter interference from the capacitive touch sensing signal based on the time-domain impulse coefficient and the frequency-domain impulse coefficient; if the signal is not filtered, the capacitive touch sensing signal is allocated to the fast response channel or the standard response channel according to the signal-to-noise ratio, and the signal-to-noise ratio is monitored for whether it continuously meets the preset condition within the preset duration of the channel; if so, a touch trigger signal is output. An auxiliary monitoring module is provided, which includes an analog differentiating circuit and a hardware comparator. The analog differentiating circuit is connected to the analog signal output terminal before analog-to-digital conversion in the signal acquisition module. It is used to independently monitor the rate of change of the signal outside the feature extraction module and to block the output of the decision output module when the rate of change of the signal is abnormal.
