1. Introduction
Fiber Bragg grating (FBG) serves as a novel optical sensing core element, enabling high-precision measurements through the linear relationship between the Bragg wavelength shift and external physical parameters, such as temperature and strain [
1,
2,
3,
4]. Beyond conventional sensing, FBG technologies enable revolutionary advances across interdisciplinary fields: in biomedical diagnostics, the reconstruction of porcine arterial morphology through real-time strain mapping [
5] and detection of malaria cells via refractive index sensitivity to Plasmodium biomarkers in blood [
6]; in microwave photonics (MWP), enhanced frequency stability and spectral purity in radio-over-fiber systems by leveraging unique dispersion and reflection properties of chirped FBGs [
7]; and in composite material engineering, quantitative identification of carbon-fiber-reinforced polymer (CFRP) damage levels for aerospace structural health monitoring (SHM) [
8]. These cutting-edge applications impose extreme demands on demodulation precision, where environmental noise is the main obstacle to reaching theoretical performance limits.
To overcome this challenge, this study proposes the self-adaptive K-SVD (SAK-SVD) algorithm, which establishes a dual-iteration feedback mechanism between dictionary learning and differential feature-guided window optimization. Our approach fundamentally resolves the trade-off between noise suppression and feature preservation in FBG spectral denoising, enabling unprecedented wavelength demodulation accuracy.
The core contributions of this paper are threefold:
(1) A closed-loop adaptive mechanism—proposing a dual-iteration feedback framework between dictionary learning and differential feature-guided window optimization, eliminating empirical parameter dependence for non-stationary FBG spectra.
(2) Mathematical based window adaptation—establishing a window size adjustment model through statistical analysis of spectral gradient sign changes, which improves feature preservation metrics compared to fixed window K-SVD.
(3) First demonstration of adaptive sparse coding in FBG demodulation—validating subpicometer MAE (0.300 pm) under distortion, outperforming state-of-the-art techniques by >60% error reduction.
2. Literature Review
The accuracy of wavelength demodulation directly affects the performance of the sensing system, as the efficacy of the peak detection algorithm is contingent upon the signal-to-noise ratio (SNR) of the spectral signal. Current mainstream techniques, including direct detection [
9,
10], classical fitting [
11,
12], and their enhanced algorithms [
13], face challenges with waveform distortion caused by noise interference, which significantly impacts peak positioning accuracy. For spectral noise suppression, numerous innovative studies have been conducted in academia. Lv et al. [
14] proposed an accurate multipeak detection algorithm based on wavelet packet decomposition (WPD) denoising and Hilbert transform (HT). WPD and wavelet thresholding methods are employed to denoise the high-frequency portion of the spectrum. Chen et al. [
15] introduced a precise self-adaptive multipeak detection algorithm for processing the spectral signals of a distributed FBG sensor system using the wavelet threshold denoising method for the original spectral signals. Chen et al. [
16] proposed a new wavelet adaptive thresholding algorithm. Wang et al. [
17] designed FIR low-pass filters to filter the obtained optical power signals according to the characteristics of the noise. Liu et al. [
18] utilized empirical mode decomposition (EMD) and Savitzky–Golay (SG) filters to denoise the reflection spectra of a pair of FBG-based Fabry–Pérot interferometers (FBG-FP) for high static strain resolution. Shang et al. [
19] introduced a noise reduction algorithm that applies SG filtering to each intrinsic mode function component of the CEEMDAN decomposition and then reconstructs the signal from the filtered components. The studies mentioned above primarily focus on the application of traditional filtering algorithms (FIR, SG) and wavelet thresholding methods. However, several key limitations exist: (1) FIR filters can inadvertently attenuate useful signals while effectively suppressing high-frequency noise; (2) SG filtering [
20] may introduce errors in the presence of localized abrupt changes or areas with significant slope variations in the signal, which can blur important high-frequency details; (3) Wavelet thresholding methods are limited by a strong empirical dependence on the selection of basis functions and the determination of thresholds.
In contrast to the aforementioned methods, the K-means Singular Value Decomposition (K-SVD) algorithm addresses the limitations of a priori assumptions, such as those imposed by traditional wavelet basis functions, by employing a data-driven approach to construct an over-complete dictionary. This algorithm utilizes sparse representation theory within the context of redundant systems, achieving a sparse characterization of the signal’s essential features through a joint optimization process that iteratively updates both dictionary atoms and sparse coefficients. Compared to FIR and SG filtering methods, K-SVD offers distinctive advantages in suppressing noise-induced redundant high-frequency components by reconstructing the signal through the adaptive linear combination of atoms, effectively preventing signal waveform distortion that can occur due to fixed phase responses or improper polynomial order selection in traditional filtering methods. With its sparse representation and adaptive dictionary learning, the algorithm demonstrates strong detail preservation and adaptability across multiple scenes in denoising and feature extraction. It has been widely utilized for denoising vibration signals of mechanical rolling bearings [
21,
22,
23,
24], data denoising for ground probing [
25,
26], feature extraction of ECG signals for medical research [
27], image denoising [
28], and multispectral sensor data feature extraction [
29]. However, it remains less explored in the realm of fiber Bragg grating demodulation. Consequently, this paper proposes the application of the K-SVD algorithm in reflectance spectrum denoising for fiber Bragg demodulation.
When the K-SVD algorithm is used to denoise one-dimensional time series data, it is typically necessary to convert the one-dimensional data into a suitable matrix. Zeng et al. [
30] segmented the rolling bearing signals based on the size of
L to construct the matrix, with adjacent signal segments having
overlapping points, resulting in the Hankel matrix. They used the regularity statistics of approximate entropy as a reference index to select the appropriate segment size and ultimately determined that the segment size under
L is 25. Meng et al. [
31] converted the original one-dimensional rolling bearing signal matrix into a two-dimensional Hankel matrix with dimensions
, where
n represents the number of dictionary atoms and
N denotes the length of the original data. They finally set
n to 100 based on empirical values. Li et al. [
32] transformed the one-dimensional original rolling bearing signal into a Hankel matrix, the size of which is
, where
n is the length of the original data and
, with
being the sampling frequency of the data and
the frequency of the error pulse. In their experimental design,
was set to 12,000 and
to 50, leading to
. Zhang et al. [
33] converted the original rolling bearing signal into a two-dimensional Hankel matrix by applying a sliding window of length
m. Based on practical experience,
m was set to 100 to balance efficiency and performance.
All of the above literature converts a one-dimensional signal into a Hankel matrix, where each matrix column is sliding intercepted using a fixed window size. The performance of the K-SVD denoising algorithm is sensitive to the size of the window. A small window helps to preserve the original signal with low computational complexity, but also produces undesirable residual noise. On the contrary, a larger window effectively suppresses the residual noise but loses some key features of the original signal while the computational complexity is larger. Ref. [
32] calculated the window size under the premise of specifying the data sampling frequency and fault pulse frequency, relying on the specific frequency parameter calculation, while other research used empirical values of 25–100 based on experiments combined with evaluation indexes; however, in practice, with the change of input signals and noises, the fixed window size is not applicable, and the traditional method lacks the adaptive matching to the non-smooth characteristics of FBG spectral signals. The traditional method lacks an adaptive matching mechanism for the non-stationary characteristics of FBG spectral signals, and there is a dilemma of balancing noise suppression and feature retention. In this paper, we propose a denoising algorithm for FBG spectral signals based on self-adaptive window size K-SVD, which can adaptively adjust the window size according to the denoising results of different spectral signals to improve the denoising effect.
In summary, this study proposes a self-adaptive K-SVD algorithm (SAK-SVD) grounded in sparse representation theory. By establishing a dual adaptive mechanism that incorporates data-driven dictionary learning and differential feature-guided window optimization, SAK-SVD effectively overcomes the performance limitations of traditional methods and addresses the trade-off between noise residuals and feature loss that arises from the use of fixed windows.
The rest of the paper is organized as follows.
Section 3 introduces the FBG spectral model;
Section 4 systematically elaborates the theoretical framework of sparse representation and the mechanism of the classical K-SVD algorithm;
Section 5 proposes the SAK-SVD algorithm based on adaptive window optimization and gives a detailed introduction;
Section 6 verifies the algorithm performance through three sets of comparative experiments;
Section 7 summarizes the research results.
5. K-SVD Denoising Algorithm Based on Adaptive Window Optimization
Let the ideal noise-free FBG spectral signal be
, where the central wavelength
satisfies the unimodality condition as shown in Equation (
9):
Within the neighborhood
around the peak, the number of derivative sign changes
characterizes the signal smoothness as Equation (
10):
where
and
is the indicator function. This condition serves as a necessary and sufficient criterion for the unimodal smoothness of the signal.
The noisy spectral signal can be modeled as Equation (
11):
where
represents noise. Its first derivative becomes oscillatory due to noise interference as shown in Equation (
12):
The noisy derivative leads to . By suppressing , the K-SVD denoising process ensures , where is the denoised estimate.
As shown in
Figure 2, the number of derivative sign changes
of the denoised noisy simulated signal (SNR = 15 dB, central wavelength = 1560.000 nm) processed by the K-SVD algorithm with varying window sizes
L is analyzed. When
L is too small, incomplete signal segmentation results in insufficient dictionary representation capability, leading to
. As
L increases, the signal blocks contain more complete waveform features, enabling the dictionary to learn more accurate sparse representations and effectively separate noise. At
,
is achieved. Further increases in
L maintain
.
Figure 3 illustrates the denoising performance of the K-SVD algorithm on the same noisy signal with different
L, At
, poor denoising performance is observed: significant fluctuations near the peak (
) result in a measured peak wavelength of 1559.989 nm, deviating substantially from the central wavelength. As
L increases to 52 (critical point where
), the denoised peak wavelength matches the central wavelength (1559.000 nm). Beyond
, although
, excessive window sizes cause waveform distortion and peak shift. Thus, the critical window size
L at
(e.g.,
) ensures optimal performance for the K-SVD algorithm: effective noise suppression while preserving original peak characteristics.
To determine the critical window size, this paper proposes an adaptive window size-based K-SVD algorithm with the following steps:
Initialize:
Set initial window size , step size .
Construct the Hankel matrix .
Apply K-SVD denoising: .
Compute the number of derivative sign changes .
Update window size:
If : .
Else if : .
Adjust step size and iterate:
Update .
If : set .
Terminate if and .
Otherwise, reconstruct the Hankel matrix with updated L and repeat steps 2–5.
The algorithm aims to rapidly search for an optimal window size
L that smooths spectral peaks while eliminating noise-induced spikes. By introducing a variable step size
combined with a binary search strategy, the search efficiency is significantly improved.
Figure 4 displays the boxplot distribution of window sizes
L obtained from 50 consecutive experiments under different SNR conditions. Results show that all optimal
L values are below 80. Consequently,
is set to 128 (a power of 2) to ensure computational efficiency.
The pseudocode for the SAK-SVD algorithm is presented in Algorithm 1:
Algorithm 1 SAK-SVD algorithm |
- Require:
FBG reflectance spectral signal y. - Ensure:
Optimal window size L, denoised signal . - 1:
Initialization: - 2:
Set window size L, step size , dictionary atoms K, max iterations MaxIter. - 3:
Construct Hankel matrix by segmenting y with window size L. - 4:
Initialize dictionary by randomly selecting K columns from . - 5:
while or do ▹ Main loop - 6:
for to MaxIter do ▹ Sparse coding and dictionary update - 7:
Sparse coding: - 8:
Update column-wise via SVD. - 9:
end for - 10:
Denoising: ▹ Compute denoised signal - 11:
Calculate (derivative sign changes) using Equation ( 10). - 12:
if then ▹ Adaptive window adjustment - 13:
- 14:
else if then - 15:
- 16:
end if - 17:
▹ Halve step size - 18:
if then - 19:
▹ Clamp minimum step size - 20:
end if - 21:
Rebuild and with new L. ▹ Matrix reconstruction - 22:
end while - 23:
return L,
|
6. Simulation and Discussion
6.1. Experimental Parameter Design
For the K-SVD algorithm, the dictionary size (defined as
, where
L corresponds to the window size of the data and
K is the number of atoms in the dictionary) is critical. An excessively large dictionary may introduce redundant atoms, while an overly small dictionary may fail to adequately represent signal features. Thus, the dictionary size must be carefully selected based on signal characteristics and application requirements.
Figure 5 compares denoising results under different
K. As
K increases, the denoised signal exhibits more spurious spikes (glitches). As can be seen from
Figure 5, as
K gets larger, more noise appears in each spectrum, due to the fact that each iteration of sparse coding in K-SVD denoising fits the residual error. When
K exceeds the intrinsic sparsity of the true signal
, subsequent atoms inevitably model the noise structure. The experimental results suggest that the FBG spectral signal may exhibit relatively simple structural characteristics, which could be sufficiently represented with a single atom in the sparse domain.
Figure 6 shows the SNR between the denoised signal and the original signal for varying
K. Larger
K values lead to lower SNR. When
K is minimized, the denoised signal achieves the highest SNR and minimal waveform distortion, indicating superior denoising efficacy. Consequently, increasing
K beyond unity introduces redundant pseudofeatures that degrade denoising performance. Based on this empirical validation, we fix
to enforce maximal sparsity while preserving signal fidelity.
In sparse representation, the sparsity level is defined as the number of non-zero coefficients required to represent a signal under a given dictionary. Low sparsity (fewer non-zero coefficients) suppresses noise through strong constraints but may sacrifice fine signal details. High sparsity (more non-zero coefficients) improves reconstruction accuracy. However, an overcomplete dictionary may introduce overfitting due to excessive degrees of freedom. In this experiment, the dictionary size is fixed at , thereby constraining the sparsity level to 1.
The K-SVD algorithm iteratively optimizes the solution by alternately updating the dictionary and sparse coefficients. Increasing the number of iterations enhances the convergence of the solution but significantly raises the computational cost, necessitating a trade-off between convergence speed and efficiency. Observing the denoising results by varying the number of iterations, it is experimentally found that as the number of iterations increases from 1, the denoising effect does not improve significantly, and the SNR after denoising remains constant. This may be due to the high sparsity or simple structure of the FBG spectral signal, which is already close to optimum after the first iteration, leading to limited gain in subsequent iterations. Based on these findings, we empirically set the number of iterations to 1 to maximize computational efficiency without compromising accuracy.
6.2. Performance Verification of SAK-SVD with Adaptive L-Parameter for Spectral Signal Denoising
To verify the performance improvement of SAK-SVD over the original algorithm in spectral signal denoising, a controlled experiment is conducted comparing the SAK-SVD algorithm with adaptive
L parameter adjustment against the K-SVD algorithm using fixed
L parameters. Five control groups with fixed
L values (40, 45, 50, 55, 60) are established. The spectral signals are configured with sharpness randomly sampled from 2 to 4, skewness from 1 to 3, central wavelengths spanning 1559–1561 nm, and a fixed SNR of 5 dB. The denoising performance is evaluated using four metrics defined in Equations (
13)–(
16): the SNR, root mean square error (RMSE), smoothness, cross-correlation, and the peak detection absolute error computed via the direct peak-search method. SNR measures the ratio of effective signal components to noise, where higher values indicate better noise suppression effects. RMSE quantifies the global deviation between the denoised signal and the original noise-free signal, with smaller values reflecting closer alignment to the true signal. Smoothness evaluates the roughness of the denoised signal by averaging the squared differences between adjacent data points. Smaller differences yield lower smoothness values, indicating smoother signals, while larger differences result in higher smoothness values, signifying increased fluctuations. Cross-correlation assesses the structural similarity in the time domain between the denoised and original signals, where values closer to 1 denote stronger trend consistency. All experimental results are averaged over 20 consecutive simulation trials.
where
x denotes the noisy spectral signal and
y represents the denoised spectral signal.
The experimental results are summarized in
Table 1. Under the denoising evaluation metric of SNR, the proposed adaptive algorithm achieves the highest SNR of 21.36902 dB, indicating optimal noise suppression capability. For the RMSE metric, the adaptive algorithm yields the lowest RMSE value of 0.010312, demonstrating superior global approximation accuracy to the true signal. In terms of smoothness, the proposed method attains the lowest value of 3.16778 × 10
−6, confirming a smoother denoised signal. The cross-correlation coefficient of the adaptive algorithm reaches 0.996404427 (closest to 1), reflecting the highest consistency in trend between the denoised and original signals. Furthermore, the peak detection absolute error of the adaptive algorithm is minimized at 0.0071 nm, validating the dynamic matching capability between window parameters and signal features. Quantitative analysis reveals that the SAK-SVD algorithm, through dynamic window adjustment, achieves improvements of 1.28% in SNR, 3.05% in RMSE, and 12.35% in peak error compared to the best fixed parameter configuration (
). These results demonstrate that SAK-SVD effectively balances noise suppression, signal fidelity, and detail preservation while significantly enhancing the denoising performance of the original K-SVD algorithm on spectral signals.
6.3. Comparative Analysis of Adaptive SAK-SVD with FIR, TI-IM, and CEEMDAN-SG for Spectral Signal Denoising
To verify the reliability of SAK-SVD, a comparative simulation experiment was conducted between the SAK-SVD denoising algorithm proposed in this paper and the FIR denoising method, TI-IM denoising method, and CEEMDAN-SG denoising method. These methods were utilized to process random spectral signals with SNR ranging from 5 dB to 35 dB, with a noise increase step of 5 dB. The results of the different methods processing noise at various SNR levels are averaged over 20 consecutive simulation trials. The sharpness
of the spectral signals is randomized within the range of 2–4, the skewness
is randomized within the range of 1–3, and the central wavelength range is 1559–1561 nm. For the FIR denoising method [
17], the sampling frequency is set to 4 MHz, the cutoff frequency of the ideal low-pass filter is 5 kHz, and the filter order is 32. For the TI-IM denoising method [
14], sym5 is chosen as the wavelet basis, and six layers of wavelet decomposition are selected. For the CEEMDAN-SG denoising method [
19], the noise standard deviation
is set at 0.2, the number of realizations
is 500, the maximum allowable filtering iterations MaxIter are 5000, the width of the noise filtering sliding window
w is 21, and the polynomial fitting order
q is 5. The experimental evaluation metrics, consistent with Experiment B, include the SNR, RMSE, smoothness, and cross-correlation.
Figure 7 compares the denoising performance of different methods. As shown in
Figure 7a, the proposed method achieves the highest SNR after denoising under different noise levels, outperforming all other methods. In
Figure 7b, the proposed method yields the lowest RMSE under varying noise levels.
Figure 7c demonstrates that the proposed method attains the smallest smoothness value, while
Figure 7d shows the cross-correlation coefficient between the denoised signal and the original noise-free signal closest to 1. This result validates exceptional preservation of temporal waveform structures (as defined in Equation (
16)). In conclusion, SAK-SVD dominates all metrics—maximizing SNR, minimizing RMSE and smoothness, and achieving cross-correlation coefficients closest to 1—which validates its robustness and comprehensive denoising performance advantages.
6.4. Comparative Analysis of Denoising Algorithms for FBG Wavelength Demodulation Under Noisy and Distorted Conditions
To validate the performance of the proposed method in FBG wavelength demodulation, the simulation waveforms in this experiment were divided into two groups: Group 1 (Undistorted Noisy Waveforms), where distortion parameters are fixed at and , and Group 2 (Randomly Distorted Noisy Waveforms), where was randomly sampled from [1, 3] and was sampled from [2, 4]. Both groups were contaminated with white noise at random SNR levels ranging from 5 dB to 35 dB, with 20 waveforms per group. Four denoising methods (SAK-SVD, FIR, TI-IM, CEEMDAN-SG) were applied to process the waveforms. Subsequently, four demodulation algorithms were implemented on the denoised signals: Direct Peak-searching Method, Centroid Method, Gaussian Fitting Algorithm, and Levenberg–Marquardt (LM) Fitting Algorithm. The absolute wavelength demodulation errors were calculated for each combination, and the final results were averaged over 20 independent trials.
The experimental results are shown in
Table 2. From the table, it can be seen that in the undistorted waveform experiments, for each demodulation algorithm, the use of the SAK-SVD algorithm for waveform denoising reduced the absolute demodulation errors. Specifically, under undistorted conditions, SAK-SVD achieved an LM fitting error of 0.3 pm, representing a 25% reduction compared to the suboptimal method (CEEMDAN-SG), and an average error reduction of 32.5% across all demodulation algorithms. In the distorted waveform experiments, the demodulation errors of all algorithms increased, but the errors using the SAK-SVD denoising algorithm remained relatively lower. Notably, for the direct peak-searching method, SAK-SVD reduced the error from 10.650 pm (suboptimal method: CEEMDAN-SG) to 3.900 pm under distorted conditions—an optimization of 63.38%, proving its strong adaptability to waveform distortion. The error escalation factor of SAK-SVD under distorted conditions averaged 11.66 times, significantly lower than other methods (FIR: 24.7 times, TI-IM: 18.2 times, CEEMDAN-SG: 15.4 times), validating the effectiveness of its dynamic parameter adaptation mechanism.
The experiments conducted clearly demonstrate that the proposed denoising algorithm effectively preserves original features while simultaneously suppressing noise, thereby enhancing demodulation accuracy. The optimal mean absolute error for denoising undistorted waveforms is 0.300 pm, while for distorted waveforms, it reaches 3.9 pm.
7. Conclusions
This paper proposes a self-adaptive K-SVD algorithm to enhance the denoising performance of the K-SVD algorithm on spectral signals. The proposed algorithm dynamically adjusts the window size based on the denoising results of different spectral signals to achieve optimal performance. Experimental results demonstrate that compared to FIR filtering, CEEMDAN-SG, and wavelet threshold denoising, the improved SAK-SVD method achieves superior performance across all four evaluation metrics: SNR, RMSE, smoothness, and cross-correlation coefficient. Furthermore, the proposed algorithm enhances the demodulation accuracy of direct peak-searching, centroid method, Gaussian fitting, and LM fitting algorithms. For undistorted waveforms, it achieves a minimum mean absolute error of 0.3 pm, while for distorted waveforms, the MAE is 3.9 pm—the lowest among all four denoising methods. Critically, these advancements directly enhance FBG sensing systems in key industrial applications: structural health monitoring (SHM) of infrastructure (e.g., bridges, dams), enabling subpicometer strain resolution for early crack detection; real-time equipment diagnostics in high-precision manufacturing (e.g., turbine blade deformation tracking); and aerospace structural integrity monitoring. Beyond optics, the SAK-SVD framework provides a novel solution for one-dimensional signal denoising, with potential extensions to acoustic emission analysis in mechanical systems, biomedical signal processing (e.g., ECG/EEG artifact removal), and vibration signature extraction from rotating machinery. Notably, three limitations of the current SAK-SVD algorithm should be acknowledged: (1) Suboptimal asymmetric distortion handling: When processing spectra with severe asymmetric distortion (e.g., non-uniform strain fields in composite materials or near structural discontinuities), the model shows limited ability in peak-shape recovery, constraining further improvements in demodulation accuracy beyond the observed 3.9 pm MAE; (2) Single-peak spectral constraint: This method is currently ineffective for multipeak FBG spectra (e.g., overlapping sensor arrays or complex gratings), as its dictionary learning framework relies on localized single-peak priors; (3) Increased computational cost: The dual-iteration mechanism (alternating between window-size optimization and dictionary learning) significantly increases the computational time compared to simpler denoising methods, potentially limiting its applicability in scenarios demanding real-time, high-frequency demodulation (e.g., vibration monitoring > 1 kHz) or resource-constrained embedded systems. Future work will focus on adapting SAK-SVD to multipeak FBG spectra and deploying it on real-time embedded systems.