Weak peak active enhancement and nonlinear decoupling of full-spectrum water quality monitoring method
By employing active enhancement processing and nonlinear decoupling techniques, the problems of weak peak signal enhancement and environmental nonlinear coupling in full-spectrum water quality monitoring have been solved, achieving water quality monitoring with high sensitivity and high robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-03-24
AI Technical Summary
Existing full-spectrum water quality monitoring technologies struggle to effectively enhance weak peak signals under high background interference, and decoupling models have difficulty identifying environmental nonlinearity and cross-sensitivity coupling between components online, resulting in poor monitoring accuracy and robustness.
By acquiring raw multi-source data, baseline normalization and environmental verification are performed, active enhancement processing is carried out to improve the signal-to-noise ratio, and nonlinear decoupling processing is used to decouple environmental nonlinear interference. Combined with quality assessment and closed-loop control, monitoring results and system parameters are generated.
It effectively enhances weak peak signals, robustly decouples environmental nonlinear interference, improves monitoring accuracy and robustness, and possesses adaptive and closed-loop control capabilities.
Smart Images

Figure CN121278246B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of water quality monitoring, and particularly relates to a full-spectrum water quality monitoring method based on weak peak active enhancement and nonlinear decoupling. BACKGROUND
[0002] The full-spectrum water quality monitoring technology is a key technical support for guaranteeing water environment safety and public health. The technology realizes synchronous and rapid identification and quantitative analysis of various pollutants in water by obtaining the fingerprint spectrum of water in a wide waveband (such as ultraviolet to visible light), and has indispensable research significance and application value for pollution tracing, water treatment process optimization and early warning of sudden water pollution events. Therefore, developing a full-spectrum monitoring system with high sensitivity and high stability, especially improving the capturing ability of the system for trace or weak characteristic signal components such as nitrate and specific organic matter under complex interference background, is a research hotspot in the field.
[0003] At present, the data processing methods of the full-spectrum water quality monitoring mainly include multivariate correction technology based on chemometrics and modulation demodulation technology based on signal processing. In the aspect of chemometrics, partial least squares (PLS), principal component analysis (PCA) and the like are widely used in processing spectral data to establish a linear regression model between a spectral matrix and a component concentration. In the aspect of signal processing, in order to improve the signal-to-noise ratio, wavelength modulation spectrum (WMS) or single-frequency digital lock-in amplifier (LIA) and the like are also used in the industry, the light source is modulated at a specific frequency, the signal of the specific frequency is demodulated at the receiving end, and the noise of the non-modulation frequency is suppressed. In addition, in order to process the nonlinear problem of the spectrum, artificial neural network, support vector machine or kernel function method are also used to construct a nonlinear correction model.
[0004] However, the existing technology still faces severe challenges in processing weak peak signals under high background interference and complex environmental nonlinear coupling. This mainly reflects that the modulation signal is easily contaminated by common-mode noise, resulting in limited enhancement effect, and the decoupling model is difficult to identify the coupling of environmental nonlinearity and cross-sensitivity between components. SUMMARY
[0005] The application aims to provide a full-spectrum water quality monitoring method based on weak peak active enhancement and nonlinear decoupling to solve the above problems existing in the prior art.
[0006] The technical scheme is a full-spectrum water quality monitoring method based on weak peak active enhancement and nonlinear decoupling, which comprises the following steps:
[0007] Obtaining original multi-source data, performing baseline normalization and environmental verification on the original multi-source data, and obtaining synchronous data;
[0008] Performing active enhancement processing based on the synchronous data to obtain enhanced spectrum and enhanced quality data;
[0009] Performing nonlinear decoupling processing on the enhanced spectrum, the enhanced quality data and the synchronous data to obtain decoupled quality data;
[0010] Performing quality assessment and closed-loop control based on the decoupled quality data and the enhanced quality data to generate monitoring results and system parameters for feedback control.
[0011] Beneficial effects, the present application can effectively enhance weak peak signals and robustly decouple environmental nonlinear interference, improving the accuracy and robustness of monitoring. BRIEF DESCRIPTION OF DRAWINGS
[0012] Figure 1 A step flowchart of a weak peak active enhancement and nonlinear decoupling full-spectrum water quality monitoring method provided by the embodiment of the present application.
[0013] Figure 2 A step flowchart of obtaining decoupled quality data provided by the embodiment of the present application.
[0014] Figure 3 A step flowchart of obtaining corrected concentrations provided by the embodiment of the present application.
[0015] Figure 4 A step flowchart of online estimating cross-sensitivity matrix provided by the embodiment of the present application. DETAILED DESCRIPTION
[0016] In order to make the personnel in the technical field better understand the present application scheme, the technical solutions in the embodiments of the present application will be described clearly and completely in the following by combining the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by the person skilled in the art without creative labor should belong to the scope of protection of the present application.
[0017] It should be noted that the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units need not be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0018] In the research, it is found that in the process of processing weak peak signals under high background interference and complex environmental nonlinear coupling, in the signal enhancement link, the conventional differential phase locking, such as adjacent frequency difference, although it can suppress part of the baseline drift, but it has insufficient suppression ability for the common mode noise (such as the near-end side lobe derived from 1 / f noise) inside the modulation frequency, which leads to the residual of the common mode noise in the differential signal, and limits the final improvement of the weak peak signal-to-noise ratio. In addition, in the decoupling link, the existing model can only statically process the nonlinear spectral shift caused by environmental factors, but cannot effectively separate the coupling between this nonlinearity and the cross-sensitivity between components; among them, the environmental factors include pH, temperature. When the two effects occur at the same time, the model parameter solving becomes ill-conditioned, leading to decoupling failure. The existing technology lacks an active and online identification mechanism to untie this coupling, and also lacks a closed-loop quality evaluation system to inversely regulate the enhancement parameters of the front end, resulting in poor robustness of the system under complex working conditions.
[0019] Specifically, as an important technical means in the field of environmental monitoring, full-spectrum water quality monitoring faces two major technical challenges in actual application, especially when dealing with complex water bodies such as surface water and industrial wastewater. First, the spectral signals of various pollutants and background substances in water, such as humic acid and suspended solids, are severely overlapped, and the chemical environmental factors of the water body will cause the target component absorption peak to have spectral shift, broadening or intensity scaling, etc. Nonlinear effects, leading to limited accuracy of traditional linear decoupling methods based on the Beer-Lambert law; among them, the chemical environmental factors include pH, temperature T, ion strength I ion Second, for some characteristic pollutants, such as specific phenols or nitrates, their characteristic absorption peaks are often weak and have low signal-to-noise ratio, which are easily overwhelmed by strong background absorption and instrument baseline drift, resulting in poor detection limit or unstable results. The existing technical solutions often focus on one aspect of nonlinear correction or signal denoising, and it is difficult to solve the problem of weak peak signal extraction under strong nonlinear interference.
[0020] As shown in Figure 1 , a full-spectrum water quality monitoring method for weak peak active enhancement and nonlinear decoupling is proposed, including the following steps:
[0021] Obtain the original multi-source data, perform baseline normalization and environmental verification on the original multi-source data, and obtain the synchronous data.
[0022] In other words, obtain the original multi-source data containing the original full-spectrum absorption data, reference channel data, chemical environment parameters, device state data and optical path information, perform baseline normalization and environmental verification, and obtain the synchronous data.
[0023] In this embodiment, the original multi-source data is the basic input required for monitoring, which exemplarily includes, but is not limited to: the original full-spectrum absorption data A raw, e.g. a sequence of absorption spectra continuously acquired by a spectrometer at certain time intervals over a certain wavelength range, e.g. 190-900 nm; reference channel data Ref ch for monitoring light source intensity fluctuations for normalization correction of absorption data; chemical environment parameters Env ctx , referring to the real-time physico-chemical state of the water sample, preferably including pH, ionic strength I ion and temperature T bulk ; equipment status data E state , including light source driving status, detector dark current, integration time, and time stamp of data acquisition, etc.; optical path information L path , i.e. the distance of light traveling in the water sample. Baseline normalization and environment verification are pre-processing steps for raw data. Specifically, it can include dark current subtraction for raw full-spectrum absorption data A raw , and reference normalization using reference channel data Ref ch to obtain baseline-corrected spectrum A base (λ, t). Meanwhile, range consistency check is performed for chemical environment parameters Env ctx to mark invalid or abnormal environment readings, obtaining environment status Env ok . Synchronized data D sync is then a data set formed by packing the pre-processed data, including A base , Ref ch , Env ctx , Env ok , E state , L path , ts, ensuring that the data used in all subsequent calculation steps are time-stamped aligned.
[0024] Active enhancement processing is performed based on synchronized data, obtaining enhanced spectrum and enhanced quality data.
[0025] Specifically, target weak peak signals submerged in noise and strong background are selectively amplified. In this embodiment, the active enhancement processing can be a strategy based on multi-frequency modulation and differential phase locking. For example, for the wavelength range where the target weak peak is located, e.g. 280-320 nm, a group of LED light sources is selected, and specific combination of modulation frequencies is applied to these LEDs. By digitally phase-locked demodulation and specific differential combination for the acquired synchronized data, low-frequency drift and common-mode noise can be effectively suppressed, and only the response corresponding to the target component at the modulation frequency is extracted, thereby obtaining enhanced spectrum A enh (λ, t seg ) with improved signal-to-noise ratio; wherein the synchronized data includes baseline-corrected spectrum A base. In the enhancement process, enhanced quality data is also generated synchronously, characterizing the quality and stability of the current enhancement process. Exemplarily, the enhanced quality data can include: a coherence index Q mod (λ, t seg ) for evaluating the coherence degree of the locked-in signal; and a de-weight mask W mod (λ, f i , t seg ) for marking those frequency points or wavelengths that are unreliable due to phase mismatch or too low signal-to-noise ratio, where λ is the wavelength, f i is the modulation frequency, and t seg is the time period or time segment.
[0026] With the enhanced spectrum, the enhanced quality data, and the synchronous data, a nonlinear decoupling process is performed to obtain decoupling quality data.
[0027] In this embodiment, based on the enhanced spectrum, the concentrations of the components are accurately inverted in combination with environmental factors. Since environmental factors can cause nonlinear changes in the spectrum, such as spectral shift and scale scaling, a nonlinear mixing model F(C, Env ctx ; θ) is preferably established, where C is the component concentration vector, and θ is the model parameter set. The environmental factors include pH, T ctx , and other chemical environmental parameters Env bulk . In solving the model, the enhanced quality data plays a key role. For example, in performing least squares solution, the enhanced quality data can be used to construct a frequency spectrum weight matrix W spec , giving different weights to different wavelength points on the enhanced spectrum A enh . Specifically, high weights are given to wavelength points with high coherence index Q mod and high enhanced gain spectrum Gain map , and vice versa. Through such weighted nonlinear optimization solution, the corrected concentration C corr that takes into account the environmental impact is finally obtained. At the same time, decoupling quality data, such as the reliability Conf nl estimated based on the decoupling residual Res nl and the model Jacobian matrix, are output for evaluating the reliability of the concentration results.
[0028] Based on the decoupling quality data and the enhanced quality data, quality evaluation and closed-loop control are performed to generate monitoring results and system parameters for feedback control.
[0029] It can also be said that based on the decoupling quality data and the enhanced quality data, quality evaluation and strategy closed loop are performed to generate monitoring results and system parameters for feedback control.
[0030] In this embodiment, the system continuously monitors the coherence index Q modand confidence Conf nl ; namely, the quality of enhancement and the quality of decoupling. When the quality is lower than a preset threshold, for example, Conf nl is too low, indicating that the decoupling model converges poorly; or Q mod is too low, indicating that the phase-locked signal is unstable, and the system will trigger closed-loop control. The control is implemented by generating system parameters SYS param for feedback regulation. Specifically, the feedback regulation can include: if the coherence indicator Q mod is too low, adjusting the parameters of the active enhancement process. For example, reselecting the modulation frequency pair {f i , f i + Δf i}, or increasing the low-pass time constant coefficient k i to increase the integration time τ i , so as to improve the phase-locked stability in the next cycle, where Δf i is the fine adjustment increment of the modulation frequency. If the confidence Conf nl is too low, a perturbation queue can be triggered. For example, a small pH or ionic strength perturbation is applied to the water sample, i.e., a titration-type perturbation, to increase the distinguishability of the cross-sensitivity matrix. The corrected concentration C corr , the confidence Conf nl , etc. are packaged as a monitoring result Rep full for release, and the system parameters SYS param are written back to the control interface, completing a monitoring and regulation cycle.
[0031] The embodiment improves the signal-to-noise ratio of the target weak peak by active enhancement, and then processes the environmental disturbance using a nonlinear decoupling model, thereby achieving high-sensitivity and high-robustness water quality monitoring with self-adaptive and closed-loop regulation capabilities.
[0032] In an exemplary embodiment, obtaining the enhanced spectrum and the enhancement quality data includes the following steps:
[0033] Selecting a set of coprime paired modulation frequencies.
[0034] In the embodiment, selecting a set of coprime paired modulation frequencies is the excitation signal planning stage for achieving active enhancement. Specifically, the light source for modulation needs to be determined. Preferably, for the wavelength region where the target weak peak is located, for example, the nitrate or specific organic matter weak peak region of 280-320 nm, a set of light-emitting diodes (LEDs) is selected. The center wavelengths λ c of these LEDs should cover the target region, for example, LEDs with center wavelengths located at {275, 285, 295, 305, 315} nm can be selected, and the full width at half maximum (FWHM) is preferably about 10 nm. Assign a set of paired modulation frequencies {fi , f i + Δf i , where f i is the base modulation frequency, and Δf i is a small frequency difference. By coprime, it is meant that the base frequencies f i selected should be as coprime as possible or have a small common divisor, so as to reduce the harmonic crosstalk between different frequencies. By pairing, it is meant that f i and f i + Δf i are used in pairs. Δf i is preferably a small value, for example between 0.3 Hz and 0.7 Hz. In addition, the selection of all frequencies f i and f i + Δf i should avoid the power frequency and its multiples, so as to avoid power grid noise interference. Before applying the modulation, a linear working zone pre-scan is preferably performed. The linear response interval of the detector is determined by the pre-scan, based on which the modulation amplitude a i of each LED is set, so that the modulation depth m is in a reasonable range, for example 5-10%, and the DC level of the signal received by the detector is maintained at 60-80% of full scale. In this way, the detector can be prevented from being saturated or entering a nonlinear response region, ensuring the accuracy of the phase-locked demodulation.
[0035] The phase-locked demodulation corresponding to the paired modulation frequency set is performed on the synchronous data.
[0036] Specifically, the synchronous data is subjected to digital phase-locked demodulation. Within a processing segment T seg , for each wavelength λ and each modulation frequency f, including f i and f i + Δf i , the quadrature components X f (λ) and Y f (λ) are calculated: X f (λ) = LPF( (1 / T seg ) ∫ A base (λ, t seg ) • W win (t) • R f (t) dt ); Y f (λ) = LPF( (1 / T seg ) ∫ A base (λ, t seg ) • W win (t) • R f90 (t) dt ); where R f (t) and R f90(t) is a quadrature reference sequence corresponding to the frequency f, such as sin and cos sequences; W win (t) is a time-domain window function, such as Blackman window or flattop window, for suppressing spectral leakage; LPF() represents a low-pass filtering operation. T seg The length of the window T min preferably covers at least 20 periods of the lowest frequency f f Based on the quadrature components, the lock-in amplitude M f (λ) and the lock-in phase Φ f (λ) are calculated at the frequency f and the wavelength λ: f (λ) = sqrt(X 2 (λ) f + Y 2 (λ) f ); Φ f (λ) = atan2(Y f (λ), X i (λ)).
[0037] In further embodiments, the lock-in demodulation comprises:
[0038] The low-pass time constant τ i is determined using an adaptive rule, wherein the low-pass time constant τ i is jointly determined by a time constant coefficient k i and the frequency f i .
[0039] A preferred rule is τ i = k i / f i ; wherein k i may be set to an initial value, such as k mod = 10.
[0040] A stability indicator is evaluated, which can be based on Allan variance or a coherence indicator Q y in the enhanced quality data.
[0041] In the present embodiment, the Allan variance σ 2 (τ) can be calculated by segment-averaging the time series data of the lock-in amplitude M f (λ) with an averaging time τ. By analyzing the double-logarithmic curve of σ y (τ) as a function of the averaging time τ, the type of system noise can be identified, such as white noise, flicker noise or random walk noise. 2
[0042] Based on the evaluation result of the stability indicator, the time constant coefficient k i is updated in a subsequent processing cycle.
[0043] For example, if the Allan variance shows significant drift at current τ i , i.e. the curve rises with τ, or the coherence index Q mod is too low, indicating insufficient stability, then k i should be increased to increase τ i , thus strengthening the suppression of low-frequency noise and drift.
[0044] The notch-difference operation is performed on the result of the phase-locked demodulation within the frequency pair in the paired modulation frequency set to obtain a paired difference result.
[0045] In an optional embodiment, obtaining the paired difference result comprises: obtaining two phase-locked amplitudes respectively generated by the phase-locked demodulation for any frequency pair in the paired modulation frequency set; and calculating the difference between the two phase-locked amplitudes to obtain the paired difference result.
[0046] In other words, obtaining the paired difference result comprises: obtaining phase-locked amplitudes M i and M i respectively generated by the phase-locked demodulation for the frequency f i and f fi +Δf fi+Δfi ; and calculating the difference between M fi and M fi+Δfi to obtain the paired difference result.
[0047] Specifically, the difference between the two notch-processed phase-locked amplitudes is calculated to obtain the paired difference result A pair_i (λ). A pair_i (λ) = M fi_filtered (λ) - M fi+Δfi_filtered (λ), where M fi_filtered (λ) is the notch-processed phase-locked amplitude at wavelength λ and modulation frequency f i , and M fi+Δfi_filtered (λ) is the notch-processed phase-locked amplitude at wavelength λ and modulation frequency f i +Δf i . By notch processing before difference, compared with the conventional direct difference, the common-mode noise and phase-locked sidelobe leakage within the frequency pair can be more effectively suppressed, thus obtaining a purer difference signal.
[0048] In a further embodiment, before calculating the difference between the two phase-locked amplitudes, it further comprises:
[0049] determining a common mode center frequency based on the frequency pair; applying a digital notch filter to process the two phase-locked amplitudes, wherein the digital notch filter is configured to suppress the common mode center frequency; wherein the step of calculating a difference between the two phase-locked amplitudes to obtain a pair-wise differential result is performed on the two phase-locked amplitudes after being processed by the digital notch filter.
[0050] In this embodiment, a common mode center frequency f0 is determined based on the frequency pair {f i , f i + Δf i}. The common mode center frequency f0 is preferably calculated as the arithmetic mean of this frequency pair, i.e. f0 = (f i + (f i + Δf i )) / 2. The f0 frequency point is considered to be where the most dominant common mode noise is concentrated for this frequency pair. The two phase-locked amplitudes, i.e. M fi (λ) and M fi+Δfi (λ), are processed by a digital notch filter. The digital notch filter is configured to suppress the common mode center frequency f0. As a preferred implementation, the digital notch filter is a second order IIR (Infinite Impulse Response) notch filter, whose transfer function H notch (z) is defined as: H notch (z) = (1 - 2 cos(ω0) z -1 + z -2 ) / (1 - 2 r cos(ω0) z -1 + r 2 z -2 ); where z -1 is the unit delay operator; z -2 is the second order delay term of the unit delay operator; ω0 is the normalized center frequency corresponding to the common mode center frequency f0, ω0 = 2πf0 / f s , f s is the sampling rate of the phase-locked amplitude M f (λ) data sequence; r is the pole radius that controls the notch bandwidth, r is a positive number close to 1 (e.g. 0.97 - 0.999). The closer r is to 1, the narrower the notch bandwidth BW 3dB is, and the deeper the notch is. The relationship between r and BW 3dB is approximately r ≈ 1 - BW 3dB • π / f s . For example, in a specific reproducible case, if the phase-locked amplitude sequence sampling rate f s = 200 Hz, the target common mode center f0 = 1.5 Hz, and the desired 3dB bandwidth BW 3dB= 0.2 Hz, then r ~ 1 - 0.2•π / 200 ~ 0.99686. In alternative embodiments, the digital notch filter can also be a linear phase FIR (Finite Impulse Response) notch filter.
[0051] The phase coherence gating is implemented based on the phase consistency between frequency pairs, and the enhanced quality data is generated.
[0052] In the present embodiment, the phase information is utilized to evaluate the reliability of the signal. In a preferred implementation, generating the enhanced quality data comprises: obtaining the phase-locked phases respectively generated by the phase-locked demodulation for the frequency pairs; calculating a phase consistency index based on the difference between the phase-locked phases; comparing the phase consistency index with a preset coherence threshold; and updating the de-weighting mask contained in the enhanced quality data when the phase consistency index is lower than the coherence threshold. Specifically, the phase-locked phases Φ i (λ) and Φ i (λ) respectively generated by the phase-locked demodulation for the frequency pairs {f i , f fi + Δf fi+Δfi} are obtained. The phase consistency index C phase_i (λ) is calculated based on the difference between the phase-locked phases. Since Δf i is very small, the phase responses of the real weak peak signal at these two frequencies should be highly consistent. Therefore, the index can be preferably calculated as: C phase_i (λ) = cos(Φ fi (λ) - Φ fi+Δfi (λ)). The closer C phase_i (λ) is to 1, the better the consistency is. The phase consistency index is compared with the coherence threshold. For example, a phase threshold Φ th such as 20 degrees or 30 degrees is set, and the corresponding coherence threshold is cos(Φ th ). When the phase consistency index is lower than the coherence threshold, for example, C phase_i (λ) < cos(20°), it indicates that the signal at the wavelength λ can be interfered, and at this time, the de-weighting mask W mod (λ, f i , t seg ) contained in the enhanced quality data is updated. For example, the mask value is multiplied by a penalty factor, indicating that the data point is unreliable.
[0053] The signal-to-noise ratio is obtained, and based on the signal-to-noise ratio and the enhanced quality data, the concave difference combination is performed on the paired difference results to generate the enhanced spectrum.
[0054] Optionally, the multiple paired difference results are combined by quadratic difference combination, wherein the combination weight is adaptively determined according to the signal-to-noise ratio and phase consistency of each frequency pair. That is, the multiple paired difference results A pair_i (λ) are combined by quadratic difference combination, wherein the combination weight w pair_i (λ) is determined according to the signal-to-noise ratio SNR i (λ) and the enhancement quality data of each paired difference result A mod (λ). Specifically, the signal-to-noise ratio SNR phase_i (λ) is calculated as SNR i (λ) = A i (λ) pair_i (λ) 2 / Var noise_i (λ); wherein the estimation of noise variance Var noise_i (λ) is critical. In the embodiment, Var noise (λ) can be obtained by one or a combination of the following methods: empty code window method: preferably, a short empty code window is inserted within T seg data segment, which window can be realized by stopping modulation, i.e. temporarily setting all LED modulation amplitudes a i to 0; or phase disorder, i.e. applying random phase jumps to the reference sequence R f (t), during which window, the statistical variance of the output of the phase-locked demodulator or the A base signal itself is taken as the background noise variance Var noise_i of the frequency point or wavelength; adjacent non-target band method: selecting a blank band without absorption peak on the spectrum, calculating the local variance of these bands as the noise estimation. After obtaining SNR i (λ), the combination weight w i (λ) can be preferably calculated as: w i (λ) = normalize( SNR i (λ) • max(C phase_i (λ), 0) • W mod_related (λ, f i )); wherein normalize is a normalization operation, max(, 0) ensures that the weight of phase mismatch (C phase_i < 0) is 0; W mod_related is the de-weighting mask related to the frequency point. The combination weight w i (λ) is applied to the paired difference results A pair_i(λ) are weighted and combined, which is called a concave combination (because it combines multiple difference results).A pfndl (λ, t seg ) = Σ i w i (λ) • A pair_i (λ)A pfndl is the final generated enhanced spectrum, denoted as A enh .
[0055] In another possible embodiment, an enhanced quality data, i.e. a coherence indicator Q mod (λ, t seg ) can also be: Q mod (λ, t seg ) = (Σ f M f (λ) 2 ) / (Σ f M f (λ) 2 + Σ f Var noise_f (λ)) • (|Σ f exp(j•Φ f (λ))| / N f ); this formula contains two parts: the first part (Σ f M f (λ) 2 ) / (Σ f M f (λ) 2 + Σ f Var noise_f (λ)) is an energy coherence term, where Σ f M f (λ) 2 is the total energy (power) of the signal at all modulation frequencies f, and Σ f Var noise_f (λ) is the total noise energy at all frequencies. Var noise_f is the noise variance estimated by the empty code window method, etc. The energy coherence term characterizes the proportion of signal energy in the total energy (similar to the generalized signal-to-noise ratio). The second part (|Σ f exp(j•Φ f (λ))| / N f ) is a phase consistency term, where exp(j•Φ f ) is the phase vector of each frequency. |Σ f | is the length of the sum vector of all N f phase vectors. If all phases Φ fHighly consistent, phase consistency term close to 1; if the phase is randomly chaotic, the phase consistency term is close to 0. Coherence index Q mod Combining energy and phase consistency, it is a comprehensive quality index between 0 and 1. Coherence index Q mod Can be used for adaptive update k i . For example, set the coherence threshold Q th = 0.5, the threshold 0.5 is determined based on empirical data, when Q mod < 0.5, it indicates that the signal quality, i.e. signal-to-noise ratio or phase consistency, is severely insufficient, and k i Adjustment needs to be triggered.
[0056] As Figure 2 shown, according to one aspect of the present application, obtaining decoupling quality data includes:
[0057] Based on the synchronization data, a nonlinear mixing model is established.
[0058] In this embodiment, it is no longer assumed that the spectrum is linearly superimposed, but the environmental parameter Env ctx ({pH, I ion , T bulk}) is explicitly introduced into the nonlinear decoupling model (PBLD model, i.e. nonlinear mixing model) to parameterize the influence of environmental factors on the spectrum shape. Preferably, the nonlinear mixing model A model (λ) can be represented as: A model (λ) = Σ k [C k • ε k (λ; Env ctx , θ k ) • L path ] + B(λ; θ b ); wherein C k is the concentration of the kth component to be solved; L path is the optical path; B(λ; θ b ) is a background absorption model, for example a polynomial (a0+a1•λ+...+an•λ n ) described by parameters θ b , wherein the coefficients a0, a1,..., an belong to the parameter set θ b ; n is the order of the polynomial; ε k (λ; Env ctx , θ k ) is a key nonlinear term, representing the effective molar absorption coefficient of the kth component affected by the environment Env ctx and the parameters θ k . ε k can be further expanded as: εk (λ; Env ctx , θ k ) = s k (Env ctx ) • ε k0 (λ + Δ λ_k (Env ctx )) ; wherein ε k0 is the reference absorption template (standard spectrum) of component k; s k (Env ctx ) is the intensity scaling factor to describe the peak height change due to environmental change; Δ λ_k (Env ctx ) is the spectral shift factor to describe the peak position shift due to environmental change. s k and Δ λ_k are parameterized as functions of Env ctx , for example: s k (Env ctx ) = exp(γ k1 •(pH-pH ref ) + γ k2 •(I ion -I ref )) ; Δ λ_k (Env ctx ) = β k1 •(pH-pH ref ) + β k2 •(I ion -I ref ) ; wherein γ and β form part of the model parameters θ k , γ k1 is the sensitivity coefficient of the intensity scaling factor of the kth component to the pH change, γ k2 is the sensitivity coefficient of the intensity scaling factor of the kth component to the ion strength I ion change, β k1 is the sensitivity coefficient of the spectral shift factor of the kth component to the pH change, β k2 is the sensitivity coefficient of the spectral shift factor of the kth component to the ion strength I ion change; pH ref is the reference state value of pH, I ref is the reference state value of ion strength I ion . Therefore, the goal to solve this model is to obtain both the concentrations C k and the model parameters θ = {θ k , θ b} simultaneously.
[0059] Solve the nonlinear mixing model using the enhanced spectrum and enhanced mass data to obtain the intermediate concentrations.
[0060] In preferred implementations, the nonlinear mixed model is solved with a two-layer strategy to avoid being trapped in local optimum when directly solving the complex nonlinear problem. Specifically, intermediate concentrations are obtained, including:
[0061] A convex approximation stage is performed, based on the enhanced quality data, to solve the enhanced spectrum with weighted non-negative least squares to obtain initial concentrations.
[0062] In this embodiment, before solving, the enhanced quality data (Gain map , Q mod , W mod ) and noise estimate σ noise are used to construct a spectrum weight W spec (λ), W spec (λ) = normalize( Gain map (λ) • Q mod (λ) • 1 / (σ noise (λ)+ε) • W mod_agg (λ) ); where ε is a small positive constant, W mod_agg (λ) is the aggregated enhanced quality modulation factor; this weight W spec reflects the output quality of the enhanced quality data: wavelength points with large enhanced gain spectrum Gain map , high coherence index Q mod , and low noise σ noise will have higher weight in the subsequent fitting. In the convex approximation stage, the model is temporarily linearized. For example, a rough estimate of the initial spectrum shift Δ λ_k0 is first estimated by the cross-correlation method, and a dictionary matrix E dict containing multiple shift templates is constructed around this initial value. A weighted non-negative least squares (WNNLS) problem is solved: min Ck(Δ)≥0 || diag(W spec )•( A enh - Σ k,Δ C k (Δ)•E dict (λ, k, Δ)•L path - B poly )||2 2 ; where C k (Δ) is the concentration variable of the kth component under the spectrum shift Δ, B poly is the background absorption term; the solution of this WNNLS problem, after aggregation, obtains the initial concentration C0 k and the refined shift initial value Δ λ_k0_refined .
[0063] In the nonlinear refinement stage, starting from the initial concentration, the nonlinear hybrid model is jointly optimized under the physical prior regularization constraint to obtain the intermediate concentration.
[0064] Specifically, the nonlinear refinement stage uses C0 k and Δ λ_k0_refined Starting with the complete nonlinear model A, solve for the full nonlinear model. model The objective function J(C, θ) is: J(C, θ) = || diag(W spec )•( A enh - A model (C, θ) ) ||2 2 + R phys (θ); where C is the component concentration vector, θ is the set of nonlinear model parameters, and R phys (θ) is the physical prior regularization term, used to impose physical constraints on the optimization. Physical prior regularization R phys Includes at least one or more of the following constraints: template second derivative smoothing constraint; penalty ε. k The drastic bending of the spectrum is kept smooth; soft constraint on transition bandwidth: penalizing the optimized spectral peak width θ. k Deviation from the known physical reasonable range; monotonic response constraint: mandatory requirement for concentration C k Must be non-negative; Background sparsity and smoothness mixing regularization: penalize background model B(λ; θ) b The complexity and curvature of the surface make it tend to be smooth.
[0065] For example, a trust-region algorithm or the Levenberg-Marquardt (LM) algorithm is preferably used to construct a nonlinear optimization problem. This optimization minimizes the objective function J(C, θ) by iteratively updating parameters θ (such as β and γ) and concentration C. The LM algorithm uses a damping factor λ... d Switching between the Gauss-Newton method and the steepest descent method. Trust region radius (or λ) d The update rule is as follows: adjust based on the ratio (ρ) of the actual decrease in the objective function J(C,θ) to the model's predicted decrease; if ρ is close to 1 (accurate prediction), then reduce λ. d (Or expand the trust region) to accelerate convergence; if ρ is very small or negative (prediction fails), then increase λ. d (Or narrow the trust region) to make the iteration more conservative. To avoid getting trapped in local optima, a multi-start strategy is preferred. That is, at C0 k and Δ λ_k0_refined Within the neighborhood of C0, for example k ± 10%, Δ λ_k0_refinedMultiple perturbation-based initial points are generated at ± 0.2 nm, and optimization is performed on each point. Finally, the solution that minimizes J(C, θ) is selected. The output of this refinement stage is the intermediate concentration C. hat .
[0066] Cross-sensitivity correction is performed on the intermediate concentration to obtain the corrected concentration and generate decoupled quality data.
[0067] like Figure 3 As shown, in one possible embodiment, obtaining the corrected concentration includes:
[0068] Actively apply titration perturbations to pre-stored water samples.
[0069] In this embodiment, this step can be triggered by closed-loop control. For example, adding a trace amount of weak acid / weak base to a water sample causes a pH change Δ. pH Alternatively, add an inert electrolyte to cause a change in ionic strength Δ. I_ion The perturbations are short-lived, for example, 2–3 minutes.
[0070] Obtain the response changes induced by titration perturbation.
[0071] Specifically, the system obtains two intermediate concentrations of C before and after the perturbation. hat_before and C hat_after Its response change Δ C_hat It was recorded.
[0072] Based on response changes, the cross-sensitivity matrix is estimated online.
[0073] like Figure 4 As shown, in the preferred implementation, online estimation of the cross-sensitivity matrix includes:
[0074] Construct a design matrix where the response change forms the row vectors and the inter-component coupling terms form the column vectors. In other words, the row vectors of the design matrix can be derived from the response change Δ... C_hat The column vectors are composed of coupling terms between components; the coupling terms can be C. i * C j Or C i * Δ pHThe design matrix is solved by using a sparse regression algorithm, and a regularization parameter is set to balance sparsity and fitting accuracy. Preferably, the Least Absolute Shrinkage and Selection Operator (LASSO) or Elastic Net algorithm is used, because the cross-sensitivity terms are usually sparse, i.e. there is coupling between only a few components. The regularization parameter (balance sparsity and fitting accuracy) in the algorithm can be automatically selected by Akaike Information Criterion (AIC) or Bayesian Information Criterion (BIC) or the like. The cross-sensitivity matrix S is obtained by solving the result analytically. cross .
[0075] The cross-sensitivity matrix is applied to the intermediate concentrations, and the corrected concentrations are obtained iteratively.
[0076] Specifically, the significant cross terms identified in the cross-sensitivity matrix S cross are added to the non-linear model A model as new parameters, so that the cross effect can be described; wherein the significant cross terms can be the influence coefficient of the concentration value C i of the i-th component on the concentration value C j of the j-th component. In the new model supplemented with the cross-sensitivity matrix S cross , the optimized θ hat parameters (i.e. β and γ) are fixed, and only one or a few steps of convex approximation phase (WNNLS solution) are performed on the concentrations C. Since the θ hat parameters are fixed, the calculation is very fast, avoiding expensive non-linear re-optimization. The result of this short iteration is the final corrected concentration C corr .
[0077] Optionally, after obtaining the corrected concentration C corr , the system can also calculate the background spectrum A bg , the final residual Res nl , and generate decoupled quality data. The decoupled quality data preferably includes the confidence Conf nl . Conf nl can be estimated by analyzing the Jacobian matrix J = ΨA model / ΨC and the information matrix H = J T • diag(W spec ) 2 • J, wherein Ψ is the partial derivative, T is the transpose. The covariance matrix Cov c of the concentrations can be approximated as H -1 , and the diagonal elements of Cov c can be used to calculate the confidence Conf nlFor example, a 95% confidence interval.
[0078] According to one aspect of this application, generating monitoring results and system parameters for feedback control includes:
[0079] Compare the decoupled quality data or enhanced quality data with a preset quality judgment threshold.
[0080] In this embodiment, the decoupling quality data preferably corresponds to the decoupling reliability Conf. nl Conf nl This could be the 95% confidence interval width of the target component concentration, or a comprehensive goodness-of-fit index. Enhanced quality data preferably corresponds to the coherence index Q. mod The quality assessment threshold is a preset benchmark used to determine whether the current monitoring cycle is reliable. For example, it could be Q. mod Set the coherence threshold Q th and for Conf nl Set a confidence threshold, for example, requiring the confidence interval width not to exceed 30% of the concentration mean. The comparison process is as follows: if Q mod (λ,t seg ) consistently below Q at the critical wavelength point th If so, it is determined that the enhancement quality is insufficient; or, if Conf nl If the value is below its threshold or the confidence interval is too wide, it is considered that the decoupling quality is insufficient.
[0081] When the quality is determined to be below the quality determination threshold, enhancement processing parameters are generated to adjust the active enhancement processing, or a perturbation queue is generated to trigger the titration perturbation in the nonlinear decoupling processing.
[0082] Specifically, if the enhancement quality is deemed insufficient, it indicates poor phase-locked loop stability or a low signal-to-noise ratio. In this case, the generated enhancement processing parameters may include one or more of the following: Adjusting the time constant coefficient: This will be used to calculate the low-pass time constant τ. i = k i / f i coefficient k i Adjust upwards, for example, updating from an initial value of 10 to 15 or 20, to extend the integration time and suppress more noise in the next monitoring cycle, thus improving stability; adjust the frequency pair: reselect a set of coprime paired modulation frequencies {f i f i +Δf i Avoid unforeseen narrowband interference sources that may exist in the current cycle; update the weighted mask: update or generate W. modIn the subsequent cycle, the contribution weight of the current frequency pair or wavelength point determined as unstable is reduced. If the decoupling quality is determined as insufficient, it indicates that the nonlinear decoupling model (PBLD) may have a pathological solution, or encounters a strong cross-sensitivity effect not covered by the model. At this time, the system generates a perturbation queue for triggering the titration-type perturbation in the nonlinear decoupling process. Exemplarily, the perturbation queue is a task list to be executed, indicating the automatic titration system to execute a titration-type perturbation once. For example, triggering a perturbation of Δf pH about 0.15-0.2, or a perturbation of Δf I_ion about 1-2 mM. By actively introducing an environmental change amount, in the next cycle, the cross-sensitivity matrix S cross can be estimated and corrected online based on the response changes before and after the perturbation, thereby improving the model identifiability and decoupling accuracy.
[0083] The enhanced processing parameters or the perturbation queue are output as system parameters.
[0084] In the present embodiment, the system parameters SYS param are packaged and output. On the one hand, the system parameters SYS param are fed back to the data acquisition and control interface, so that the control instructions can be executed in the next monitoring cycle; wherein the control instructions include new k i values, new frequency pairs, or perturbation triggering instructions. On the other hand, the system parameters SYS param can be archived together with the final monitoring report Rep full for recording the adaptive control history of the system.
[0085] In another alternative embodiment, in addition to the enhanced spectrum and the enhanced quality data, the following can also be obtained:
[0086] A paired frequency notch difference lock-in (PFNDL) branch and an adjacent frequency difference branch are established in parallel for jointly processing the synchronous data; the PFNDL branch generates PFNDL enhanced spectrum and PFNDL quality data; and the adjacent frequency difference branch generates AFD enhanced spectrum and AFD quality data.
[0087] In the present embodiment, the PFNDL branch uses the paired frequency {f i , f i + Δf i} and performs notch difference and concave difference combination. The output is PFNDL enhanced spectrum A enh _pfndl and PFNDL quality data, such as PFNDL coherence modulation index Q mod_pfndl , PFNDL gain spectrum Gain map_pfndlThis branch exhibits strong suppression of common-mode drift and sidelobe leakage, but its performance may degrade when poorly selected at specific frequency points. The Adjacent Frequency Difference (AFD) branch is another processing branch established in parallel. Specifically, the AFD branch establishes a uniform set of adjacent frequency points F... adj For example, F adj The frequencies can be {1.0, 1.3, 1.6, 1.9} Hz, with a fixed adjacent frequency difference Δf (e.g., 0.3 Hz). This branch also synchronizes the data A. base Perform phase-locked demodulation to obtain each f i ∈F adj Amplitude M fi (λ). However, its differential method differs from PFNDL: AFD performs adjacent frequency differential, i.e., ΔM i (λ) = M fi (λ) - M fi+1 (λ) (i=1, 2,...,M-1), where M fi+1 (λ) represents the frequency point f at wavelength λ. i+1 The phase-locked demodulation amplitude value; M is the total number of adjacent frequency points. AFD also applies these differential results ΔM i Weighted combination is performed to generate AFD enhanced spectrum A enh_afd Simultaneously, AFD also employs methods such as evaluating energy and phase consistency to generate its own independent AFD quality data, such as the coherence modulation quality index Q of the AFD branch. mod_afd Gain spectrum of AFD branch map_afd The AFD branch is relatively simple to implement and has a uniform frequency grid, making it an effective supplement or backup solution for the PFNDL branch.
[0088] Based on PFNDL quality data and AFD quality data, the fusion weights are determined; the fusion weights are then used to perform weighted fusion of the PFNDL enhanced spectrum and the AFD enhanced spectrum to generate the enhanced spectrum.
[0089] Specifically, at each wavelength λ level, the optimal results from the two branches are dynamically selected or fused. Preferably, the fusion weight is based on the quality data of the two branches, such as Q. mod* Gain map* These are calculated independently at each wavelength λ. For example, the fusion weight W of the PFNDL branch. fuse_pfndl (λ) can be defined as: W fuse_pfndl (λ) = normalize( Q mod_pfndl (λ) •Gain map_pfndl (λ) • W mod_pfndl_related (λ)); Fusion weight W of AFD branch fuse_afd(λ) can be defined as: W fuse_afd (λ) = normalize( Q mod_afd (λ) • Gain map_afd (λ) • W mod_afd_related (λ) ) ; where normalize is a normalization operation (e.g. making W fuse_pfndl + W fuse_afd = 1); W mod_pfndl_related (λ) is the downweight mask for the PFNDL branch at wavelength λ; W mod_afd_related (λ) is the downweight mask for the AFD branch at wavelength λ. The final output of the enhanced spectrum A enh (λ, t seg ) is obtained by: A enh (λ) = W fuse_pfndl (λ) • A enh_pfndl (λ) + W fuse_afd (λ) • A enh_afd (λ), where A enh_pfndl (λ) is the enhanced spectrum output for the PFNDL branch at wavelength λ, A enh_afd (λ) is the enhanced spectrum output for the AFD branch at wavelength λ. At a certain wavelength λ, if the quality of the PFNDL branch is very high while the quality of the AFD branch is very low, the enhanced spectrum A enh (λ) at that wavelength will be contributed mainly by A enh_pfndl (λ), and vice versa. This provides excellent fault tolerance and robustness for the system, such that when either branch fails or is disturbed, a usable enhanced spectrum can still be provided.
[0090] The PFNDL quality data and the AFD quality data are combined to generate enhanced quality data.
[0091] Specifically, the enhanced quality data is also a weighted average combination of the quality data of the two branches with a determined fusion weight W fuse* . For example, the final Q mod (λ) = W fuse_pfndl (λ) • Q mod_pfndl (λ) + W fuse_afd (λ) • Q mod_afd (λ). The transparent interface to the downstream PBLD decoupling is maintained. When performing the weighted nonlinear decoupling, there is no need to care whether the upstream is a single branch or a dual branch, only the post-fusion outputs A enh and Q mod are used, ensuring the interface consistency to the PBLD decoupling.
[0092] In one possible embodiment, it is assumed that the phase-locked amplitude sequence M f(λ) data sampling rate f s The frequency is 200Hz. Assuming the frequency pair to be processed is {1.4 Hz, 1.6 Hz}, then its common-mode center frequency f0, i.e., the target frequency for notch filtering, is (1.4 + 1.6) / 2 = 1.5Hz. Assuming the desired 3dB notch bandwidth BW... 3dB The chosen bandwidth is 0.2Hz. This bandwidth selection is a trade-off: too narrow a bandwidth is sensitive to frequency drift; too wide a bandwidth may inadvertently suppress nearby valid signals. 0.2Hz is an exemplary value that effectively suppresses common-mode noise and tolerates a certain frequency offset. Calculate the normalized center frequency ω0, where ω0 is the frequency of f0 relative to the sampling rate f. s The digital angular frequency. ω0 = 2π * f0 / f s = 2π * 1.5 / 200 ≈ 0.047124 radians. Calculate the cosine term in the notch filter transfer function: cos(ω0) = cos(0.047124) ≈ 0.998890. The pole radius r controls the notch filter bandwidth; the closer r is to 1, the narrower the bandwidth. r can be determined by BW. 3dB Approximate estimate: r ≈ 1 - BW 3dB * π / f s = 1 - 0.2 * π / 200 ≈ 1 - 0.0031416 ≈ 0.996858. For reference, the quality factor Q at this point is approximately Q ≈ f0 / BW. 3dB = 1.5 / 0.2 = 7.5. The digital notch filter is a second-order IIR notch filter, and its transfer function H... notch (z) is defined as: H notch (z) = (1 - 2 cos(ω0) z -1 + z -2 ) / (1 - 2 r cos(ω0)z -1 + r 2 z -2 ); where z -1 Let ω be the unit delay operator; ω0 be the normalized center frequency corresponding to the common-mode center frequency; and r be the pole radius controlling the notch bandwidth. Substituting the calculation results into this formula: Numerator: 1 - 2 * (0.998890) z -1 + z -2 = 1 - 1.99778 z -1 + z -2 ; Denominator: r 2 ≈ (0.996858) 2≈ 0.993726; 2 * r * cos(ω0) ≈ 2 * 0.996858 * 0.998890 ≈ 1.99092; denominator is 1 - 1.99092 z -1 + 0.993726 z -2 . The final second-order IIR notch filter transfer function is: notch (z) = (1 - 1.99778 z -1 + z -2 ) / (1 - 1.99092 z -1 + 0.993726 z -2 ). In implementation, the transfer function can be implemented as a biquad section, e.g., Direct-Form II Transposed structure. The phase-locked amplitude sequence M fi (λ) and M fi+Δfi (λ) (as time series) are processed through the filter, respectively, to obtain filtered sequences, and then difference operation is performed.
[0093] In another possible embodiment, in some scenarios where phase characteristics are extremely high and nonlinear phase delay is not desired to be introduced, the digital notch filter can preferably be implemented as a linear phase finite impulse response (FIR) notch filter. Specifically, the FIR notch filter implements its transfer function H(z) = Σ n=0 N h[n] z -n . To achieve linear phase, the number of taps N is usually chosen as an odd number, i.e., N = 2L + 1, and the coefficients h[n] satisfy symmetry, where L is the fixed delay of the filter, and n is the tap index. The FIR notch filter can be designed by various algorithms, for example, the Parks-McClellan algorithm (also known as Remez exchange algorithm) can be preferably used to obtain an optimal filter with equal ripple characteristics in passband and stopband; or a weighted window function method can also be used for design. Set f s = 200 Hz, f0 = 1.5 Hz, BW = 0.2 Hz. The choice of the number of taps N is a trade-off between computation and performance. The larger N is, the steeper the notch characteristic is, and the deeper the attenuation is. For example, N can be chosen between 101 and 401. An exemplary value is N = 201. The target attenuation D notch is the minimum attenuation depth expected to be achieved within the notch bandwidth BW, i.e., f0 ± BW / 2. For example, D notch ≥ 50 dB is preferred. In the passband region outside the notch, the ripple is expected to be less than 0.1 dB. Using f s=200 Hz, f0=1.5 Hz, BW=0.2Hz, N=201, and using the Blackman-Harris window method or the Parks-McClellan algorithm, a set of h[n] (n=0, 1, ..., 200) coefficients can be calculated to realize the FIR notch filter. This FIR notch filter has a strictly linear phase or a constant group delay equal to L = (N-1) / 2 sampling points. When comparing Φ... fi (λ) and Φ fi+Δfi When there are two phase values (λ), if the notch filter introduces nonlinear phase distortion, it will interfere with the accuracy of phase consistency gating. However, using the FIR notch filter of this embodiment, the accuracy of M... fi (λ) and M fi+Δfi The delay applied by (λ) is the same and fixed, and does not distort their relative phase relationship, thus making it more friendly to phase gating.
[0094] In a detailed embodiment, preferably, the spectrometer sampling rate f s Set to 200 Hz. This sampling rate is much higher than the highest frequency of subsequent phase-locked loop processing, such as 5-6 Hz, satisfying the Nyquist theorem and providing sufficient margin for digital notch filtering. Processing segment length T seg Preferably, it should at least cover the lowest operating frequency f. min The minimum operating frequency of the cycle coverage N cyc = 20 cycles. For example, if f min = 1.0 Hz, then T seg Preferably ≥20 seconds. Time-domain window function W win Preferably, a Blackman window or a flat-top window is used. The Blackman window has low sidelobes, which helps suppress spectral leakage; the flat-top window has extremely high amplitude accuracy, which is beneficial for accurate extraction of the phase-locked loop amplitude. The center wavelength λ in LED selection... c Preferably, the modulation amplitude is distributed in the range of 275–315 nm, and the FWHM is preferably about 10 nm. Preferably, the modulation amplitude 'a' is set through pre-scanning. i By maintaining the modulation depth m within the range of 5–10% and keeping the detector DC level at 60–80% of full scale, the detector operates in the linear region, avoiding nonlinear distortion. For example, the frequency pair set F... pair It can be set to {(1.0, 1.5), (1.7, 2.2), (2.9, 3.4), (5.1, 5.6)}H. These frequencies have good coprime properties, and Δf i Between 0.4 and 0.5 Hz. Preferably, the phase gate threshold Φ thThe setting is between 20 degrees and 30 degrees. The time constant coefficient k i The initial value is preferably 10, and can be adaptively adjusted to 12-20 according to the quality evaluation result. The frequency set F adj , the exemplary adjacent frequency set can be set to {1.0, 1.3, 1.6, 1.9} Hz, and the fixed frequency difference Δf = 0.3 Hz. The quality threshold Q mod_afd for judging the reliability of the branch can be set to 0.5. In the titration type perturbation, when the perturbation is triggered, the amplitude of Δ pH is preferably controlled between 0.15-0.2; the amplitude of Δ I_ion is preferably controlled between 1-2 mM. The perturbation duration is preferably 2-3 minutes. Sparse regression preferably uses LASSO (L1 regularization) or Elastic Net (L1+L2 regularization) algorithm. In the second order IIR notch filter, the approximate relationship between r and the bandwidth is r ≈ 1 - BW 3dB • π / f s . Examples: f s =200 Hz, f0=1.5 Hz, BW 3dB =0.2 Hz, r ≈ 0.99686. In the FIR notch filter, the number of taps N is preferably between 101-401. Examples: f s =200 Hz, f0=1.5 Hz, BW=0.2 Hz, N =201.
[0095] In an embodiment of the present application, the enhanced spectrum and the enhancement quality data can also be obtained by: reading the baseline correction spectrum A base , the device state E state , the environment state Env ok , establishing a target weak peak region, for example, the LED set corresponding to 280-320 nm (center wavelength λ c ∈{275, 285, 295, 305, 315} nm, FWHM ≈ 10 nm, select 3-5 as needed). Under the premise of avoiding power frequency and harmonics, select the paired frequency set F pair ={ (f i , f i +Δf i )}, let f i ∈{1.0, 1.7, 2.9, 5.1 Hz}, Δf i ∈[0.3, 0.7] Hz, and each pair is relatively prime; initialize k i=10, used for the low-pass time constant. Read the baseline correction spectrum, device status, and selected LED set, and perform a short-time pre-scan: estimate the linear operating region from the reference channel and ADC margin; set the modulation depth m≈5–10% for each LED, and determine the modulation amplitude vector a. i Ensure that the DC level within the segment occupies 60–80% of the full range to avoid saturation. Generate an orthogonal reference for each frequency pair: R f (t)=sin(2πft), R f90 (t)=sin(2πf t+π / 2); To suppress spectral leakage, a time-domain window W is applied within the segment. win (t) (such as a flat-top window or Blackman window), and record W. win Parameters. Formation of composite modulation: s(t) = Σ i a i ·sin(2π f i t)+Σ i a i ·sin(2π (f i +Δf i ) t), assigned to the selected set of LEDs. Digital phase-locked loop is performed on the windowed signal at each λ and each frequency f: X f (λ) = LPF( (1 / T seg ) ∫A base (λ,t seg ) • W win (t) • R f (t) dt );Y f (λ) = LPF( (1 / T seg ) ∫ A base (λ,t seg ) • W win (t)• R f90 (t) dt). Amplitude and phase: M f (λ) = sqrt(X f (λ) 2 + Y f (λ) 2 );Φ f (λ) = atan2(Y f (λ), X f (λ)). The low-pass time constant adopts an adaptive rule: τ f = k i / f; initial k i =10; Using intra-segment Allan variance and phase stability assessment, if the coherence index Q mod If it is judged to be too low, then k will be... i→ 12 - 20 and active in the next paragraph. For each frequency pair (f i , f i + Δf i ) compute notch difference: A pair_i (λ) = M fi (λ) - M fi+Δfi (λ). Compute phase coherence index: C phase_i (λ) = cos(Φ fi (λ) - Φ fi+Δfi (λ)). If C phase_i (λ) < cos(Φ th ) (e.g. Φ th = 20 degrees), then downweight mask W mod (λ, f i , t seg ) and W mod (λ, f i + Δf i , t seg ) at that λ for that pair (e.g. multiply by 0.3), and record a phase mismatch event. Compute in-pair signal-to-noise ratio SNR i (λ) = A pair_i (λ) 2 / Var noise_i (λ), where Var noise_i comes from the de-tuned blanking and non-target band estimates. Construct combined weight: w i (λ) = normalize( SNR i (λ) · max(C phase_i (λ), 0) ). Get paired frequency pair combined output: A pfndl (λ, t seg ) = ∑ i w i (λ) · A pair_i (λ). With local mean of unmodulated reference or baseline correction spectrum A base within the segment as reference power P ref (λ, t seg ), compute final enhanced spectrum A enh (λ, t seg ) = A pfndl (λ, t seg ) / P ref (λ, t seg ), and define enhanced gain map Gain map (λ, t seg ) = A enh (λ, t seg ) / A base (λ, t seg ). Define Qmod (λ,t seg ) = (Σ f M f (λ) 2 ) / (Σ f M f (λ) 2 + Σ f Var noise_f (λ)) • (|Σ f exp(j•Φ f (λ))| / N f This balances energy coherence and phase consistency. If Q mod (λ,t seg ) < Q th (e.g., 0.5), mark the weighted mask of λ and reduce the weight (multiply by 0.5), and increase k in the next segment. i Or adjust Δf i Packed enhancement spectrum, enhancement gain spectrum, coherence index, weighting mask, paired frequency set, low-pass time constant coefficient k. i Set, weight coefficient w i Collection, time period.
[0096] In another embodiment of this application, obtaining decoupling quality data may also involve: reading enhancement spectra, chemical environment Env... ctx The reference absorption templates ε for each target component are extracted from the template library. k0 (λ). The initial spectral shift Δ is estimated in each component window using the cross-correlation method. λ_k0 Δ λ_k0 = argmax Δ corr( A enh (λ), ε k0 (λ+Δ) ). This yields the initial scaling s. k0 That is, fitting A using local least squares. enh With the template after shift. Read the enhanced gain spectrum, coherence index, deweighted mask, and noise estimate σ from the stop-motion window. noise (λ), calculate the spectral weight matrix W spec (λ) = normalize(Gain map (λ) • Q mod (λ) •1 / (σ noise (λ)+ε) • W mod_agg (λ) ); where W mod_agg (λ) is determined by W, the frequency point that contributes the most to λ. mod Synthesis. Linearizing the nonlinear model: sampling the template of each component by small step displacement Δ (around Δ). λ_k0 ), forming a dictionary matrix Edict (λ, k, Δ), and approximating the intensity factor as s k = exp(γ k1 •(pH-pH ref ) + γ k2 •(I ion -I ref ) + γ k3 ·(T bulk -T ref )) of the initial value s k0 , where T bulk is the temperature, and T ref is the initial value of the temperature. Solve the weighted non-negative least squares: min Ck(Δ)≥0 || diag(W spec )•( A enh -∑ k,Δ C k (Δ)•E dict (λ, k, Δ)•L path - B poly )||2 2 ; where the background term B poly (λ) = a0+ a1•λ + a2•λ 2 , a0, a1, a2 are the polynomial coefficients of the background term. Summarize the initial value concentration C0 k =∑ Δ C k (Δ) with the displacement initial value Δ λ_k0_refined , take the Δ with the largest contribution, and obtain the initial value for the background term. Establish the complete model: A model (λ) =∑ k [C k • ε k (λ; Env ctx , θ k )•L path ] + B(λ; θ b ); where ε k (λ; Env ctx , θ k ) = s k (Env ctx )•ε k0 (λ+Δ λ_k (Env ctx )); Δ λ_k (Env ctx ) = β k1 •(pH-pH ref ) + β k2 •(I ion -I ref ) + β k3• (T bulk -T ref ) ; s k (Env ctx )=exp(γ k1 •(pH-pH ref )+γ k2 •(I ion -I ref ) +γ k3 ·(T bulk -T ref )) ; objective function: J(C, θ) = || diag(W spec )•( A enh - A model (C, θ) ) ||2 2 + R phys (θ) ; where physical prior regularizer R phys contains template 2nd derivative smoothing, transition bandwidth soft constraint, response monotonicity constraint, background sparsity / smothing hybrid regularizer. Specifically, at iteration, fix model parameter set θ update component concentration vector C: solve weighted non-negative least square (NNLS) to get component concentration vector C iter at current iteration; fix component concentration vector C update fix model parameter set θ: update model parameter set θ iter at current iteration with trust region Levenberg-Marquardt algorithm within constraint set, i.e. {β k* , γ k* , θ b}, and keep spectral shift factor Δ λ_k consistent with known energy level interval; convergence criterion is: relative drop of objective function < threshold Δ or || parameter change || < threshold ε; if necessary, use multiple starting points (in Δ λ_k0 ± 0.2 nm neighborhood) to avoid local optimum. Trigger small amplitude titration type perturbation: Δ pH ≈ 0.15 - 0.2 or Δ I_ion ≈ 1 - 2 mM, each lasts 2 - 3 min, keep water sample safety margin and stable volume. Construct design matrix: row vector is change of intermediate concentration C hat before and after perturbation, column is component-to-component coupling term, solve cross-sensitivity matrix S cross (using LASSO or Elastic Net, regularizer parameter selected by trade-off AIC / BIC). Substitute cross-sensitivity matrix back to model to do one short iteration (fix θ hat tune C), get corrected concentration C corr . Calculate background spectrum A bg (λ) = A enh -∑ kC corr_k · ε k (λ; Env ctx , θ hat_k ) · L path . Compute final residual Res nl (λ) = A enh - A model (λ, θ corr ). Form information matrix H = J hat · diag(W model ) Ccorr,θha · J with Jacobian J = ΨA spec / ΨC T and weights W spec , estimate concentration covariance Cov 2 ≈ H C H 1 , get confidence Conf nl , which integrates residual statistics, regularity of satisfaction and condition number. Package corrected concentration, final converged model parameter set θ hat , background spectrum, final residual, confidence for quality assessment and strategy closed loop; and record running summary, including paired frequency set, low-pass time constant coefficient k i set, weight coefficient w i set, time period, key values of spectral weight matrix.
[0097] The present application introduces a digital notch filter before performing the difference calculation. The notch filter is precisely configured at the common mode center point of the paired frequency, so that the common mode interference can be filtered out a priori. In this way, the subsequent difference operation is performed on the purified signal, and an enhanced spectrum with higher signal-to-noise ratio is obtained. When the system determines that the decoupling quality is insufficient, a titration type perturbation, such as a small pH or ionic strength change, is actively triggered. By capturing and comparing the response changes before and after the perturbation, the system uses LASSO and other sparse regression algorithms to calculate the cross-sensitivity matrix in real time, which is then substituted back into the model for a short iteration correction. An online identification means is provided to successfully separate the two coupling effects and obtain a robust corrected concentration. Two key quality indicators are calculated in real time during operation: the coherence indicator from the enhancement link and the confidence from the decoupling link. When either indicator is below the threshold, the closed loop mechanism is activated: if the enhancement quality is insufficient, the system will feedback and adjust the front-end phase-locked parameters, such as increasing the time constant coefficient k i ; if the decoupling quality is insufficient, the system will trigger a titration type perturbation mechanism, forming an adaptive closed loop, so that the system can also operate stably under complex working conditions.
[0098] The preferred embodiments of the present application are described in detail above, but the present application is not limited to the specific details of the above-described embodiments, and various equivalent transformations of the technical solutions of the present application can be made within the technical concept of the present application, and these equivalent transformations all belong to the protection scope of the present application.
Claims
1. A method for full-spectrum water quality monitoring with weak peak active enhancement and nonlinear decoupling, characterized in that, The method comprises the following steps: obtaining original multi-source data, performing baseline normalization and environmental verification on the original multi-source data to obtain synchronous data; performing active enhancement processing based on the synchronous data to obtain enhanced spectrum and enhanced quality data; performing nonlinear decoupling processing on the enhanced spectrum, the enhanced quality data and the synchronous data to obtain decoupled quality data; performing quality evaluation and closed-loop control based on the decoupled quality data and the enhanced quality data to generate monitoring results and system parameters for feedback control; obtaining the decoupled quality data comprises: establishing a nonlinear mixing model based on the synchronous data; solving the nonlinear mixing model by using the enhanced spectrum and the enhanced quality data to obtain intermediate concentrations; performing cross-sensitivity correction on the intermediate concentrations to obtain corrected concentrations and generate the decoupled quality data; obtaining the enhanced spectrum and the enhanced quality data comprises: selecting a set of coprime paired modulation frequencies; performing phase-locked demodulation on the synchronous data corresponding to the set of paired modulation frequencies; performing notch difference operation on the phase-locked demodulation results in the frequency pairs in the set of paired modulation frequencies to obtain paired difference results; implementing phase consistency gating based on the phase consistency between the frequency pairs to generate the enhanced quality data; obtaining the enhanced spectrum comprises:
2. The method of claim 1, wherein, combining the signal-to-noise ratio and the enhanced quality data to determine the combination weight for any paired difference result. obtaining the corrected concentrations comprises: actively applying a titration-type perturbation to the pre-stored water sample; obtaining response changes caused by the titration-type perturbation; online estimating a cross-sensitivity matrix based on the response changes; 3. The method of claim 2, wherein, applying the cross-sensitivity matrix to the intermediate concentrations to iteratively obtain the corrected concentrations. online estimating the cross-sensitivity matrix comprises: constructing a design matrix, wherein the response changes constitute the row vectors of the design matrix, and the coupling terms between components constitute the column vectors; solving the design matrix by using a sparse regression algorithm, and setting a regularization parameter to balance sparsity and fitting accuracy; 4. The method of claim 1, wherein, analytically solving the result to obtain the cross-sensitivity matrix. obtaining the intermediate concentrations comprises: performing a convex approximation stage, and solving the enhanced spectrum by using a weighted non-negative least squares method based on the enhanced quality data to obtain initial concentrations; 5. The method of claim 4, wherein, performing a nonlinear refinement stage, and jointly optimizing the nonlinear mixing model under physical prior regularization constraints to obtain the intermediate concentrations, starting from the initial concentrations.
6. The method of claim 1, wherein, The physical prior regularization at least comprises one or more combinations of the following constraints: template second derivative smoothing constraint, transition bandwidth soft constraint, response monotonicity constraint, or background sparsity and smoothing mixed regularization. obtaining the paired difference results comprises: obtaining two phase-locked amplitudes respectively generated by the phase-locked demodulation for any frequency pair in the set of paired modulation frequencies; 7. The method of claim 1, wherein, calculating the difference between the two phase-locked amplitudes to obtain the paired difference results. generating the enhanced quality data comprises: obtaining the phase-locked phases respectively generated by the phase-locked demodulation for the frequency pairs; calculating a phase consistency index based on the difference between the phase-locked phases; comparing the phase consistency index with a preset coherence threshold; 8. The method of claim 1, wherein, when the phase consistency index is lower than the coherence threshold, updating the de-weighting mask contained in the enhanced quality data. generating the enhanced spectrum comprises: combining the signal-to-noise ratio and the enhanced quality data to determine the combination weight for any paired difference result; The pairing difference results are combined by using a combination weight to generate an enhanced spectrum.
Citation Information
Patent Citations
Water quality on-line monitoring system based on full spectrum analysis
CN120293874A
Transformer equipment state real-time monitoring method and system based on multi-source data fusion
CN120847528A