Research on Kalman Spectral Filtering Method Using Improved PSO Adaptive Optimization
摘要
针对传统卡尔曼滤波在处理光谱滤波信号时,需要手动调参,且常出现稳定性差、适应性弱及滤波失真等问题,提出一种结合改进粒子群自适应寻优的卡尔曼滤波方法,该方法构建了均方误差和反平滑度相结合的适应度函数以适用于光谱滤波要求,可实现过程激励噪声与测量噪声协方差矩阵的自适应寻优,解决了传统卡尔曼滤波方法需要人工调参的低效率问题,并保证滤波有效性且留存更多波形细节特征.建立了均方误差、信噪比和反平滑度作为滤波方法量化评价指标,分别选取两组模拟光谱数据、无水乙醇和聚丙烯的实测拉曼数据,对所研究方法滤波效果的有效性和适用性进行验证.最后,引入中值滤波、滑动平均滤波和传统卡尔曼滤波与所研究方法的滤波效果进行比较.结果表明,所提出方法的综合性能更优:模拟光谱数据中,研究方法得出的均方误差分别为87.424、3.814,高低噪声场景的信噪比分别达39.03 dB、23.2 dB,反平滑度贴近原始信号;乙醇与聚丙烯实测数据的均方误差分别为7.789与0.027、信噪比达45.33 dB与72.35 dB,能有效抑噪且保留光谱细节特征.该方法摆脱了人工调节参数的依赖,提升了光谱滤波的鲁棒性与自动化水平,为光谱数据处理提供了新方案.
Spectral filtering algorithms constitute a core component of spectral detection technology.Traditional spectral filtering methods,however,suffer from various shortcomings:median filtering lacks accuracy for complex dynamic signals,moving average filtering has limited noise adaptability,and Kalman filtering is difficult to tune manually.Few adaptive Kalman filtering methods can be directly applied to spectral filtering.To overcome these issues,this study proposes a Kalman spectral filtering method that employs improved Particle Swarm Optimization(PSO)for adaptive parameter optimization.This method aims to overcome the parameter tuning difficulty,insufficient accuracy,and poor stability of traditional Kalman filtering in spectral filtering.It also targets higher accuracy than other traditional filters.
In this method,a Kalman filter is integrated with PSO-based adaptive optimization.The particle swarm algorithm innovatively adopts a weighted fitness function that combines Mean Square Error(MSE)and anti-smoothness.This function is specifically designed for spectral filtering.This allows adaptive optimization of the process noise and measurement noise covariance matrices.Such optimization overcomes the inefficiency of manual parameter tuning in traditional Kalman filtering.As a result,effective filtering is achieved while more detailed waveform features are preserved.The effectiveness and applicability of the proposed algorithm are validated using four datasets:two sets of simulated spectral data,a measured Raman spectrum of anhydrous ethanol,and a measured Raman spectrum of polypropylene.Meanwhile,to clearly demonstrate its advantages,the proposed method is compared with three traditional methods.Mean square error,signal-to-noise ratio,and anti-smoothness are used as evaluation indicators.
Simulation and experimental results demonstrate that the proposed method achieves superior overall performance.For the two simulated datasets under low-noise and high-noise conditions,the proposed algorithm achieves MSE values of 3.814 and 87.424,respectively.This indicates that the filtering error is greatly reduced,and the algorithm can effectively eliminate noise interference while significantly improving signal quality.In terms of SNR,the proposed method reaches 39.03 dB in the low-noise scenario and 23.2 dB in the high-noise scenario,exhibiting excellent noise suppression capability,far exceeding those of the three traditional methods.In terms of anti-smoothness,the proposed method is the closest to the original spectral signal among all compared methods.This indicates that the algorithm can effectively retain the detailed characteristics of the original spectral signal while suppressing noise.The experimental results of the measured ethanol and polypropylene Raman spectra further demonstrate that the proposed algorithm is practical and reliable.For the filtered data,the MSE values are 7.789 and 0.027,respectively.This demonstrates the high accuracy of the proposed algorithm in practical spectral filtering.The SNR values of the filtered data reach 45.33 dB and 72.35 dB,respectively,both being the highest among all compared methods.This shows that the algorithm has strong adaptability and noise suppression ability in actual measurement scenarios.In addition,the anti-smoothness of the proposed algorithm is also the best among the four filtering methods.This further confirms that the algorithm can well balance two core requirements:strong noise suppression and detailed feature preservation.
Therefore,the proposed method has three main advantages.First,it significantly reduces the reliance on manual parameter tuning,solving the associated problems of high tuning difficulty and poor consistency in traditional Kalman filtering.Second,it greatly improves the accuracy and robustness of spectral filtering.Meanwhile,its good performance in anti-smoothness shows that this method balances strong noise suppression and detailed feature preservation well.This addresses the key challenge of traditional filtering methods:balancing noise suppression and detail preservation.In summary,the proposed Kalman spectral filtering algorithm using improved PSO adaptive optimization provides a new and effective method for spectral filtering in various fields.It also offers significant theoretical reference value and promising practical application prospects for the advancement of spectral detection technology.