Data processing method, storage medium, and computer program product

CN122551934APending Publication Date: 2026-08-11CHINA INSTITUTE OF ATOMIC ENERGY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-13
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

这种干扰信号剔除的方式通用性较差、自动化程度低

Benefits of technology

[0016]本申请实施例提供的数据处理方法、存储介质及计算机程序产品,通过对待测样品的谱图数据进行傅里叶变换,使待测样品的谱图数据转换到频域,得到待测样品的频谱数据,从而降低降噪处理对原始谱图数据的特征峰以及分辨率的影响,在保留谱图数据的分辨率以及原始形状的情况下进行降噪处理。通过频谱数据的变化趋势,确定频率截止阈值,该频率截止阈值用于区分噪声频段与有用信号频段,从而在无需人工干预的情况下,自适应地确定区分有用信号与干扰信号的频率截止阈值。通过频率截止阈值将频谱数据中噪声频段的频谱数据设置为第一值,实现降噪处理,得到降噪处理后的频谱数据,再对降噪处理后的频谱数据进行傅里叶逆变换,得到降噪后的谱图数据。如此,提高了干扰信号剔除的自适应能力和通用性,节省人工成本,满足不同样品的分析需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122551934A_ABST
    Figure CN122551934A_ABST
Patent Text Reader

Abstract

This application provides a data processing method, storage medium, and computer program product. The method includes: acquiring spectral data of a sample to be tested; performing a Fourier transform on the spectral data to obtain spectral data; determining a frequency cutoff threshold based on the changing trend of the spectral data, the frequency cutoff threshold being used to distinguish between useful signal frequency bands and noise frequency bands in the spectral data; setting the spectral data of the noise frequency band in the spectral data to a first value to obtain noise-reduced spectral data, wherein the frequency of the noise frequency band is greater than the frequency cutoff threshold; and performing an inverse Fourier transform on the noise-reduced spectral data to obtain noise-reduced spectral data. The solution of this application can improve the adaptive capability and versatility of interference signal removal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data analysis technology, and in particular to a data processing method, storage medium, and computer program product. Background Technology

[0002] X-ray fluorescence (XRF) analysis is a non-destructive method for analyzing the elemental composition and content of substances. Since different elements emit different X-ray fluorescence spectra, XRF analysis uses a detector to acquire the X-ray fluorescence spectrum of a substance, and then uses this spectrum to perform qualitative and quantitative analysis of its elemental composition.

[0003] In actual detection processes, the raw data acquired by the detector inevitably includes background signals, random noise, and other interference signals in addition to the useful signals reflecting elemental characteristics. These interference signals are superimposed on the useful signals, resulting in numerous spikes in the measured X-ray fluorescence spectra, which seriously affects the accuracy and stability of the analytical results.

[0004] To reduce the impact of interference signals on analysis results, manual intervention is often required to remove these signals. However, this method of interference removal has poor versatility and low automation. Summary of the Invention

[0005] To address the related technical problems, embodiments of this application provide a data processing method, a storage medium, and a computer program product.

[0006] The technical solution of this application embodiment is implemented as follows: This application provides a data processing method, the method comprising: Acquire spectral data of the sample to be tested, wherein the spectral data represents the X-ray fluorescence spectrum of the sample to be tested; Perform a Fourier transform on the spectral data to obtain the spectrum data; Based on the changing trend of the spectrum data, a frequency cutoff threshold is determined, wherein the frequency cutoff threshold is used to distinguish between useful signal frequency bands and noise frequency bands in the spectrum data; The spectrum data of the noise frequency band in the spectrum data is set to a first value to obtain the spectrum data after noise reduction, wherein the frequency of the noise frequency band is greater than the frequency cutoff threshold. Perform an inverse Fourier transform on the denoised spectral data to obtain the denoised spectral data.

[0007] In the above scheme, determining the frequency cutoff threshold based on the changing trend of the spectrum data includes: Determine a trend curve for the spectrum data, wherein the trend curve is used to characterize the changing trend of the spectrum data; Determine the rate of change of the trend curve; The frequency cutoff threshold is determined based on the rate of change of the trend curve.

[0008] In the above scheme, determining the trend curve of the spectrum data includes: Identify multiple local maxima points in the spectrum data; Based on the multiple local maxima, a trend curve for the spectral data is determined.

[0009] In the above scheme, determining the rate of change of the trend curve includes: Differentiate the trend curve to obtain the differential curve of the trend curve; Determining the frequency cutoff threshold based on the rate of change of the trend curve includes: Identify the inflection point in the differential curve of the trend curve; The frequency corresponding to the inflection point is determined as the frequency cutoff threshold.

[0010] In the above scheme, before identifying the inflection point in the differential curve of the trend curve, the method further includes: The differential curve of the trend curve is smoothed to obtain a smoothed differential curve. The step of identifying inflection points in the differential curve of the trend curve includes: Identify inflection points in the smoothed differential curve.

[0011] The method in the above scheme further includes: Based on the noise-reduced spectral data, the elemental content of the sample to be tested is determined.

[0012] In the above scheme, the sample to be tested includes nuclear materials, which include one or more elements selected from uranium, plutonium, and neptunium.

[0013] In the above scheme, determining the elemental content of the sample to be tested based on the denoised spectral data includes: Based on the denoised spectral data, the elemental contents of uranium, plutonium, and neptunium in the sample to be tested are determined respectively.

[0014] This application also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the above-described method.

[0015] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.

[0016] The data processing method, storage medium, and computer program product provided in this application embodiment transform the spectral data of the sample under test into the frequency domain by performing a Fourier transform on the spectral data of the sample under test, thereby obtaining the spectral data of the sample under test. This reduces the impact of noise reduction processing on the characteristic peaks and resolution of the original spectral data, and performs noise reduction processing while preserving the resolution and original shape of the spectral data. A frequency cutoff threshold is determined based on the changing trend of the spectral data. This frequency cutoff threshold is used to distinguish between noise frequency bands and useful signal frequency bands, thus adaptively determining the frequency cutoff threshold for distinguishing useful signals from interference signals without manual intervention. The spectral data of the noise frequency band in the spectral data is set to a first value using the frequency cutoff threshold to achieve noise reduction processing, obtaining the noise-reduced spectral data. Then, an inverse Fourier transform is performed on the noise-reduced spectral data to obtain the noise-reduced spectral data. This improves the adaptive capability and versatility of interference signal removal, saves labor costs, and meets the analytical needs of different samples. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of this application; Figure 2 This is a schematic diagram of an untreated X-ray fluorescence spectrum provided in an embodiment of this application; Figure 3 This is a schematic diagram of a frequency domain spectrum provided in an embodiment of this application; Figure 4 This is a partially enlarged schematic diagram of a frequency domain spectrum provided in an embodiment of this application; Figure 5 This is a schematic diagram of the upper envelope of a frequency domain spectrum provided in an embodiment of this application; Figure 6 This is a schematic diagram of a differential curve provided in an embodiment of this application; Figure 7 This is a schematic diagram of a smoothed differential curve provided in an embodiment of this application; Figure 8 This is a schematic diagram of a noise-reduced X-ray fluorescence spectrum provided in an embodiment of this application; Figure 9 This is a schematic diagram comparing the X-ray fluorescence spectrum before and after noise reduction, provided in an embodiment of this application. Figure 10 This is a flowchart illustrating an application example of a data processing method provided in an embodiment of this application; Figure 11This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application. Detailed Implementation

[0018] The present application will now be described in further detail with reference to the accompanying drawings.

[0019] XRF analysis primarily uses X-rays to irradiate matter. Under the influence of X-rays, inner-shell electrons break free from their atomic bonds, becoming free electrons and creating vacancies in their original positions. In this state, the atoms are unstable. Outer-shell electrons then fill these vacancies through transitions, restoring the atoms to a stable state. During these transitions, outer-shell electrons release energy, which is emitted as X-ray fluorescence. Different elements emit different amounts of X-rays. By measuring the X-ray fluorescence and its intensity, the elemental composition and abundance of the substance can be determined.

[0020] Given its advantages such as non-destructive nature, rapid response, and ease of operation, XRF analysis is widely used in the process control and research of nuclear material reprocessing. XRF analysis offers a broad detection range for elemental content. For example, the concentration detection range for nuclear materials such as uranium, plutonium, and neptunium can range from milligrams per liter (mg / L) to tens of grams per liter (g / L), meeting the requirements of most process points in the reprocessing flow and playing a crucial role in the elemental composition analysis of nuclear materials.

[0021] In XRF analysis, the XRF analysis technology collects X-ray fluorescence spectrum data through a detector, and then uses the X-ray fluorescence spectrum to perform qualitative and quantitative analysis of the elemental composition of the substance. For example, the concentration of the element to be measured can be obtained by using the functional relationship between the X-ray fluorescence spectrum and the element concentration.

[0022] Since the raw data collected by the detector includes not only useful signals reflecting elemental characteristics, but also background signals and random noise interference signals, it is essential to perform noise reduction processing on the raw spectral data to obtain high-quality analysis results.

[0023] In related technologies, methods such as seven-point cubic smoothing, five-point quadratic smoothing, Savitsky-Gorye smoothing (SG smoothing), and Fourier transform are commonly used to remove noise (i.e., interference signals) from the original spectral data.

[0024] Besides the Fourier transform method, the seven-point cubic smoothing, five-point quadratic smoothing, and SG smoothing methods mentioned above are essentially data weighted averaging algorithms. These algorithms suppress noise by performing polynomial fitting or weighted averaging on adjacent data points. However, while removing noise, this noise reduction method often leads to broadening of characteristic peaks and reduction in peak height in X-ray fluorescence spectra, thus degrading the resolution of X-ray fluorescence spectra. Furthermore, the resolution loss becomes more severe with increasing smoothing iterations, making it difficult to obtain high-quality analytical results.

[0025] For denoising using Fourier transform, the difference in frequency distribution between the useful signal and noise is utilized. The original signal is converted to the frequency domain using Fourier transform, and then high-frequency components representing noise are removed from the original signal by applying a set frequency threshold. This method can maintain the resolution of X-ray fluorescence spectra well when the ideal frequency threshold is selected. However, in practical applications, the frequency threshold used for noise removal is closely related to the specific morphology of the X-ray fluorescence spectrum (such as peak width and peak height), requiring manual judgment and adjustment. Once the frequency threshold is fixed, it is difficult to apply to other samples with significant morphological differences, resulting in poor versatility and low automation of this denoising method.

[0026] Based on this, this application provides a data processing scheme. By performing a Fourier transform on the spectral data of the sample under test, the spectral data of the sample under test is converted to the frequency domain, obtaining the spectral data of the sample under test. This reduces the impact of noise reduction processing on the characteristic peaks and resolution of the X-ray fluorescence spectrum, performing noise reduction processing while preserving the resolution and original shape of the X-ray fluorescence spectrum. Then, based on the changing trend of the spectral data, a frequency cutoff threshold is determined. This frequency cutoff threshold is used to distinguish between noise frequency bands and useful signal frequency bands, thus adaptively determining the boundary point between useful signals and interference signals (i.e., the frequency cutoff threshold) without manual intervention. The spectral data of the noise frequency band in the spectral data is set to a first value using the frequency cutoff threshold to achieve noise reduction processing, obtaining the noise-reduced spectral data. Then, an inverse Fourier transform is performed on the noise-reduced spectral data to obtain the noise-reduced spectral data.

[0027] The solution provided in this application removes interference signals from the X-ray fluorescence spectrum of the sample while preserving the original morphology and resolution of the characteristic peaks of the X-ray fluorescence spectrum to the maximum extent. This provides an accurate data foundation for subsequent elemental analysis and improves the accuracy and reliability of the elemental content measurement results of the sample. Furthermore, it enhances the adaptability and versatility of spectral data processing, saves labor costs, and meets the analytical needs of different samples.

[0028] The data processing scheme provided by the embodiments of this application will be described below with reference to the accompanying drawings. First, the embodiments of this application provide a data processing method. For example... Figure 1 As shown, the method includes the following steps: Step 101: Obtain the spectral data of the sample to be tested, which represents the X-ray fluorescence spectrum of the sample to be tested; Step 102: Perform Fourier transform on the spectral data of the sample to be tested to obtain the spectral data; Step 103: Based on the changing trend of the spectrum data, determine the frequency cutoff threshold, which is used to distinguish between the useful signal frequency band and the noise frequency band in the spectrum data; Step 104: Set the spectral data of the noise band in the spectral data to the first value to obtain the spectral data after noise reduction, wherein the frequency of the noise band is greater than the frequency cutoff threshold. Step 105: Perform an inverse Fourier transform on the denoised spectral data to obtain the denoised spectral data.

[0029] The following describes the data processing method provided in the embodiments of this application, using an electronic device as the execution subject. Exemplarily, the electronic device in the embodiments of this application may be a computer, server, or XRF analyzer, etc., and the embodiments of this application do not limit the specific form of the electronic device.

[0030] In this embodiment, the sample to be tested is a sample whose elemental composition and content are to be analyzed by XRF. In some implementations, the sample to be tested includes nuclear materials, that is, the sample to be tested is a nuclear material sample. For example, the sample to be tested includes nuclear material elements such as uranium, plutonium, and neptunium. By performing XRF analysis on the sample to be tested, the elemental content of each nuclear material element such as uranium, plutonium, and neptunium in the sample is determined, thereby achieving non-destructive testing and analysis of nuclear materials.

[0031] In step 101, the spectral data of the sample to be tested acquired by the electronic device represents the X-ray fluorescence spectrum of the sample. That is, the spectral data is the raw spectral data collected from the X-ray fluorescence generated by the sample being irradiated by X-rays. The electronic device can acquire the spectral data by loading the spectral data function loadspec(). Taking x as an example to represent the spectral data, x = loadspec().

[0032] In practical applications, electronic devices can acquire spectral data of the sample from other devices (such as detectors, XRF analyzers, etc.). Alternatively, the electronic device may have an X-ray generator that irradiates the sample with primary X-rays. The electronic device also has a detector that collects the X-ray fluorescence signal generated by the primary X-ray irradiation of the sample and converts the X-ray fluorescence signal into an electrical signal to obtain the spectral data of the sample.

[0033] In some implementations, the spectral data acquired by the electronic device can be one-dimensional data. For example, the spectral data is a one-dimensional array representing the intensity corresponding to different energies. For example, the horizontal axis of the X-ray fluorescence spectrum represented by the spectral data can be represented by the channel number (i.e., channel address), where the channel number corresponds to the X-ray energy; a higher channel number indicates a greater X-ray energy. The vertical axis of the X-ray fluorescence spectrum can be represented by a count, where the count corresponds to the X-ray intensity; a higher count indicates a greater number of X-ray photons and a greater intensity.

[0034] For example, the X-ray fluorescence spectrum corresponding to the spectral data acquired by the electronic device is as follows: Figure 2 As shown, without preprocessing (i.e., noise reduction), the X-ray fluorescence spectrum of the sample under test has many spikes due to the influence of interference signals, affecting the accuracy of the measurement results of the elemental content of the sample.

[0035] To reduce the impact of preprocessing on the original shape and resolution of the X-ray fluorescence spectrum, this embodiment employs Fourier transform to denoise the spectral data. In step 102, the electronic device performs a Fourier transform on the spectral data of the sample under test, converting it to the frequency domain to obtain the spectral data of the sample. The electronic device can transform the spectral data to the frequency domain using the Fourier transform function fft(). Taking y as an example to represent the spectral data, y = fft(x).

[0036] A corresponding frequency domain spectrum can be generated based on the spectral data of the sample under test. The horizontal axis of the frequency domain spectrum represents frequency, which can be represented by the number of channels. The vertical axis of the frequency domain spectrum represents amplitude. For example, the frequency domain spectrum corresponding to the spectral data of the sample under test is as follows: Figure 3 As shown, since the useful signal and the interfering signal in the X-ray fluorescence signal have different frequencies, the useful signal and the interfering signal can be separated by transforming the spectral data of the X-ray fluorescence signal to the frequency domain using Fourier transform. The low-frequency oscillating curve in the frequency domain spectrum represents the frequency domain spectrum of the useful signal, while the relatively flat part and the high-frequency oscillating curve in the frequency domain spectrum represent the frequency domain spectrum of the interfering signal.

[0037] After obtaining the spectral data of the sample to be tested, in step 103, the electronic device determines the frequency cutoff threshold that distinguishes the useful signal frequency band from the noise frequency band based on the changing trend of the spectral data. The electronic device can determine the frequency cutoff threshold using the threshold function threshold(). For example, if e represents the changing trend of the spectral data and b represents the frequency cutoff threshold, then b = threshold(e).

[0038] The frequency cutoff threshold is used to distinguish between the useful signal frequency band and the noise frequency band where interfering signals reside; it marks the boundary between the two. The frequency band less than or equal to the cutoff threshold is the useful signal band. The frequency band greater than the cutoff threshold is the noise band. A magnified view of the frequency domain spectrum is shown below. Figure 4 As shown, the frequency cutoff threshold is approximately 150. Since the spectral data of different samples vary, the frequency cutoff threshold also differs. In this embodiment, the frequency cutoff threshold is automatically calculated to improve the versatility of interference signal removal.

[0039] Since useful signals are mainly concentrated in the low-frequency band and show a decreasing trend with increasing frequency, in some implementations, electronic devices can determine the critical point in the spectrum data that shows a decreasing trend with increasing frequency. This critical point can be used as the frequency cutoff threshold to distinguish between the useful signal frequency band and the noise frequency band.

[0040] To more accurately identify the frequency cutoff threshold and reduce the impact of frequency domain spectral oscillations on its identification, some implementations involve electronic devices determining a trend curve characterizing the changing trend of the spectral data. For example, the electronic device generates this trend curve using methods such as polynomial fitting and maxima calculation. Based on this trend curve, the electronic device determines the frequency cutoff threshold. For instance, it identifies the inflection point of the trend curve and determines the frequency corresponding to that inflection point as the frequency cutoff threshold.

[0041] By identifying a trend curve to characterize the changing trend of spectral data and using the trend curve to identify the frequency cutoff threshold, the impact of frequency domain spectral oscillations on the identification of the frequency cutoff threshold can be reduced, thereby improving the accuracy of the identification of the frequency cutoff threshold.

[0042] In some implementations, when determining a trend curve to characterize the changing trend of spectral data, the electronic device can identify multiple local maxima points of the spectral data and generate a trend curve based on these local maxima points. For example, the electronic device can differentiate the spectral data and identify multiple local maxima points among points where the derivative is zero. After identifying these local maxima points, the electronic device can use interpolation or fitting algorithms to generate a continuous upper envelope from these local maxima points. This upper envelope can then serve as the trend curve characterizing the changing trend of the spectral data.

[0043] For example, the upper envelope (i.e., trend curve) of the frequency domain spectrum is as follows: Figure 5 As shown in the figure, the curve reflects the trend of the frequency domain spectrum. In the oscillating portion of the frequency domain spectrum, it appears as a continuously decreasing curve. The inflection point of this curve can be used as the frequency cutoff threshold. This reduces the impact of frequency domain spectrum oscillations on the identification of the frequency cutoff threshold.

[0044] To reduce the difficulty of frequency cutoff threshold identification, some implementations, after determining the trend curve representing the changing trend of the spectrum data, can also determine the rate of change of the trend curve and determine the frequency cutoff threshold based on the rate of change. For example, the electronic device compares the rate of change of the trend curve with a preset rate of change threshold in ascending order of frequency. If the rate of change of the trend curve is detected to be greater than or equal to the preset rate of change threshold for the first time, the frequency corresponding to that rate of change is determined as the frequency cutoff threshold.

[0045] By determining the rate of change of the trend curve and identifying the frequency cutoff threshold based on the rate of change of the trend curve, the difficulty of frequency cutoff threshold identification can be reduced and the efficiency of frequency cutoff frequency identification can be improved.

[0046] For example, the rate of change of a trend curve can be represented by a differential curve (i.e., a differential spectrum). After obtaining the trend curve of the spectral data, the electronic device performs differentiation processing on the trend curve to obtain the differential curve of the trend curve. The differential curve of the trend curve is as follows: Figure 6 As shown, the differential curve obtained after differentiation has a clear inflection point. The electronic device identifies the inflection point from the differential curve of the trend curve and determines the frequency corresponding to the inflection point as the frequency cutoff threshold used to distinguish between the useful signal frequency band and the noise frequency band.

[0047] By differentiating the trend curve, a differential curve with a more obvious inflection point is obtained. The frequency cutoff threshold is determined based on the differential curve of the trend curve, thereby reducing the difficulty of identifying the frequency cutoff threshold and improving the identification efficiency of the frequency cutoff threshold.

[0048] Since the differential curve obtained after differentiation may contain jumps or irregular fluctuations, in order to improve the accuracy of frequency cutoff threshold identification, some implementations involve smoothing the differential curve of the trend curve after obtaining it, resulting in a smoothed differential curve. Smoothing the differential curve suppresses the impact of random fluctuations on frequency cutoff threshold identification while preserving its overall trend, thus improving the accuracy of frequency cutoff threshold identification.

[0049] For example, the electronic device performs a moving average processing on the differential curve of the trend curve. That is, the electronic device replaces each data point in the differential curve with the average of that data point and its adjacent data points, resulting in a smoothed differential curve. The smoothed differential curve is shown below. Figure 7 As shown in the image, the smoothed differential curve eliminates some of the jump data points, making the inflection points clearer and more distinct.

[0050] After obtaining the smoothed differential curve, the electronic device identifies inflection points within the curve and determines the frequency corresponding to those inflection points as the frequency cutoff threshold. For example, the electronic device searches for each data point in the differential curve sequentially, in ascending order of frequency. In each search, the electronic device compares the differential value of the data point with a preset rate of change threshold. If the differential value of a data point is greater than or equal to the preset rate of change threshold, the frequency corresponding to that data point is determined as the frequency cutoff threshold.

[0051] Understandably, the preset rate of change threshold can be set according to actual application needs. For example, the preset rate of change threshold can be set to values ​​such as 30 or 50.

[0052] In some implementations, the electronic device can also set a preset rate of change threshold based on the minimum value of the differential curve. For example, the preset rate of change threshold is equal to the product of the minimum value of the differential curve and a preset rate of change coefficient. Alternatively, the preset rate of change threshold is equal to the product of the absolute value of the minimum value of the differential curve and the preset rate of change coefficient. The preset rate of change coefficient can be set according to actual application requirements, such as setting it to values ​​like 0.01 or 0.001. In this way, the preset rate of change threshold is related to the minimum value of the differential curve, thus allowing the preset rate of change threshold to be adaptively adjusted according to different test samples, improving the accuracy of frequency cutoff threshold identification.

[0053] Because the spectral data of different test samples vary, the corresponding frequency cutoff thresholds differ for each sample. To determine a more accurate frequency cutoff threshold for each test sample, some implementations, after determining the frequency cutoff threshold, can also calculate one or more noise metrics for the noise frequency band. For example, the electronic device can calculate one or more noise metrics such as the average amplitude, maximum amplitude, and amplitude standard deviation of the noise frequency band.

[0054] Electronic devices determine whether one or more noise parameters within a noise frequency band meet corresponding preset noise conditions to determine whether the noise frequency band, determined based on a frequency cutoff threshold, is a true noise frequency band. For example, taking the maximum amplitude as an example, the preset noise condition corresponding to the maximum amplitude is that the maximum amplitude of the noise frequency band is less than a preset amplitude. The electronic device then compares the maximum amplitude of the noise frequency band with the preset amplitude to determine whether the maximum amplitude of the noise frequency band is less than the preset amplitude. If the maximum amplitude of the noise frequency band is less than the preset amplitude, it is confirmed that the maximum amplitude of the noise frequency band meets the corresponding preset noise condition.

[0055] If one or more noise indicators meet the corresponding preset noise conditions, it means that the noise frequency band determined based on the frequency cutoff threshold is a true noise frequency band and the frequency cutoff threshold is set reasonably.

[0056] If any noise metric fails to meet the corresponding preset noise condition, it indicates that the noise frequency band determined based on the frequency cutoff threshold is not a true noise frequency band, and the frequency cutoff threshold setting is inappropriate. In this case, the electronic device adjusts the frequency cutoff threshold, for example, by increasing the frequency cutoff threshold. Then, the electronic device redetermines the noise frequency band based on the adjusted frequency cutoff threshold and repeatedly checks whether one or more noise metrics of the noise frequency band meet the corresponding preset noise condition, until one or more noise metrics of the noise frequency band meet the corresponding preset noise condition, or until the number of repeated checks reaches the preset maximum number of iterations.

[0057] The rationality of the frequency cutoff threshold can be verified by one or more noise indicators. If the frequency cutoff threshold is unreasonable, it can be adaptively adjusted to improve the accuracy of the frequency cutoff threshold, thus making it applicable to different types of test samples and improving the versatility of the frequency cutoff threshold determination.

[0058] After determining the frequency cutoff threshold, in step 104, the electronic device performs noise reduction processing on the spectrum data according to the frequency cutoff threshold. That is, the electronic device sets the spectrum data corresponding to the noise frequency bands greater than the frequency cutoff threshold to a first value, such as setting it to zero, thereby eliminating the noise data corresponding to the noise frequency bands in the spectrum data and obtaining the noise-reduced spectrum data. For example, the electronic device can remove the noise data in the spectrum data using the noise removal function rmv(). Taking y' as the denoised spectrum data and y as the spectrum data before noise reduction, y'=rmv(y).

[0059] After obtaining the denoised spectrum data, in step 105, the electronic device converts the denoised spectrum data back to the original domain using an inverse Fourier transform, obtaining the denoised spectrum data. For example, the electronic device can perform an inverse Fourier transform on the denoised spectrum data using the inverse Fourier transform function ifft() to restore the spectrum data. Taking newx as the denoised spectrum data and y' as the denoised spectrum data, newx = ifft(y').

[0060] For example, the X-ray fluorescence spectrum corresponding to the denoised spectral data is as follows: Figure 8 As shown, the X-ray fluorescence spectrum is smoother after noise reduction. Figure 9 The comparison between the X-ray fluorescence spectra before and after noise reduction is shown. It can be seen that the X-ray fluorescence spectra after noise reduction are smoother than those before noise reduction, and the shape of the characteristic peaks is almost unchanged. The interference signals are almost completely eliminated, providing a high-quality data foundation for subsequent quantitative analysis of elements.

[0061] In some implementations, the electronic device determines the elemental content of the sample based on the denoised spectral data. For example, the electronic device determines the elemental content of the sample based on the denoised spectral data by using the functional relationship between spectral data and elemental concentration. Another example is that the electronic device inputs the denoised spectral data into a pre-trained machine learning model, which predicts the element types and content in the sample based on the spectral data, and then outputs the element types and content of the sample.

[0062] This application embodiment adaptively determines the frequency cutoff threshold by using Fourier transform and combining it with the transformation trend of the spectral data. This frequency cutoff threshold distinguishes between useful signal frequency bands and noise frequency bands, thereby achieving noise reduction processing of the spectral data of the sample to be tested and obtaining smooth net spectral data (i.e., noise-reduced spectral data). This improves the preprocessing quality of spectral data in XRF analysis and provides a high-quality data foundation for subsequent quantitative analysis of the sample to be tested.

[0063] The data processing method provided in this application embodiment will be further described below through an application example. In this example, the upper envelope represents the changing trend of the spectral data, and the differential curve represents the rate of change of the upper envelope. Figure 10 As shown, this application example includes the following steps: Step 1001: The electronic device acquires the spectral data of the sample to be tested; Electronic equipment acquires the raw X-ray fluorescence spectrum data of the sample to be tested.

[0064] The spectral data is a one-dimensional array used to record the counts for each channel address. The horizontal axis of the X-ray fluorescence spectrum represents the channel address, corresponding to the X-ray energy; the vertical axis represents the count, corresponding to the number of X-ray photons. In addition to the useful signal data of elemental characteristic peaks, the spectral data acquired by electronic equipment also includes data on interference signals such as random noise and background.

[0065] Step 1002: The electronic device performs a Fourier transform on the spectral data to obtain the spectrum data; Electronic devices perform a Fourier transform on the spectral data, converting it to the frequency domain to obtain spectrum data. In the spectrum data, the low-frequency region corresponds to the data of the useful signal, and the high-frequency region corresponds to the data of the interference signal.

[0066] Step 1003: The electronic device acquires the upper envelope of the spectrum data; To automatically calculate the frequency cutoff threshold, the electronic device processes the spectral data to highlight inflection points in the frequency domain. The electronic device identifies multiple local maxima in the spectral data. It then interpolates these local maxima to obtain the upper envelope of the spectral data. This upper envelope is a continuous, smooth curve. It reflects the overall trend of the spectral data amplitude as frequency increases and eliminates local oscillations in the spectral data.

[0067] Step 1004: The electronic device performs differentiation processing on the upper envelope of the spectrum data to obtain the differential curve; The inflection point of the upper envelope may not be obvious enough. Electronic devices perform differentiation processing on the upper envelope of the spectral data, such as first-order central difference processing, to obtain a differential curve, making the inflection point more obvious. The differential curve reflects the rate of change of the upper envelope. That is, the differential curve reflects the rate at which the amplitude of the spectral data changes with increasing frequency. In the useful signal frequency band (i.e., the low-frequency part), the upper envelope continuously decreases and tends to flatten out, and the differential curve gradually increases from a negative value; in the noise frequency band, the upper envelope tends to be stable, and the differential curve approaches zero.

[0068] Step 1005: The electronic device smooths the differential curve; Electronic devices smooth differential curves, such as by performing moving average processing, to eliminate potentially amplified local fluctuations in the differential curve, resulting in a smooth differential curve and effectively suppressing spikes and jumps on the differential curve.

[0069] Step 1006: The electronic device determines the inflection point of the smoothed differential curve and determines the frequency corresponding to the inflection point as the frequency cutoff threshold. The electronic device compares the derivative values ​​of the data points on the differential curve sequentially from lowest to highest frequency with a preset rate of change threshold, finding data points whose derivative values ​​are greater than the preset rate of change threshold. The electronic device identifies the first data point with a derivative value greater than the preset rate of change threshold as an inflection point and uses the frequency corresponding to the inflection point as the frequency cutoff threshold.

[0070] The frequency cutoff threshold is the boundary between useful signal frequency bands and noise frequency bands. Electronic devices identify frequency bands in the spectrum data that are below or equal to the frequency cutoff threshold as useful signal frequency bands, and identify frequency bands in the spectrum data that are above the frequency cutoff threshold as noise frequency bands.

[0071] Step 1007: The electronic device sets the spectral data of the noise band to zero; The electronic device sets the spectral data (i.e., noise data) of the noise band above the frequency cutoff threshold to zero according to the determined frequency cutoff threshold, and retains the original value of the spectral data of the useful signal band, thus obtaining the spectral data after noise reduction.

[0072] Step 1008: The electronic device performs an inverse Fourier transform on the denoised spectral data to obtain the denoised spectral data; The electronic device performs an inverse Fourier transform on the denoised spectral data, converting it from the frequency domain back to the original domain to obtain the denoised spectrum data. Compared with the spectrum data before denoising, the denoised spectrum data retains the removed interference signals, as well as the position, shape, and resolution of the characteristic peaks.

[0073] After acquiring the denoised spectral data, the electronic device can also perform elemental content analysis based on the denoised spectral data. Taking a sample containing nuclear materials as an example, the electronic device extracts the characteristic peak intensities of nuclear material elements (such as uranium, plutonium, neptunium, etc.) from the denoised spectral data. Based on a pre-established correspondence between characteristic peak intensities and elemental concentrations, the electronic device calculates the content of nuclear material elements in the sample.

[0074] In this application example, inverse Fourier transform is used to remove noise, reducing the probability of problems such as characteristic peak broadening and peak height reduction. Combined with envelope, differential curve and moving average processing, the frequency cutoff threshold is automatically determined without manual intervention. It is applicable to spectral data of different samples and under different measurement conditions, and realizes adaptive, high-fidelity and highly versatile preprocessing of X-ray fluorescence spectra.

[0075] To implement the data processing method provided in the embodiments of this application, the embodiments of this application also provide a data processing apparatus, such as... Figure 11 As shown, the data processing device includes: The acquisition module 1101 is used to acquire the spectral data of the sample to be tested, wherein the spectral data represents the X-ray fluorescence spectrum of the sample to be tested; The determining module 1102 is used to perform a Fourier transform on the spectrum data to obtain spectrum data; and to determine a frequency cutoff threshold based on the changing trend of the spectrum data, wherein the frequency cutoff threshold is used to distinguish between useful signal frequency bands and noise frequency bands in the spectrum data. The noise reduction module 1103 is used to set the spectral data of the noise frequency band in the spectral data to a first value to obtain the noise-reduced spectral data, wherein the frequency of the noise frequency band is greater than the frequency cutoff threshold; and to perform an inverse Fourier transform on the noise-reduced spectral data to obtain the noise-reduced spectral data.

[0076] In some optional implementations, the determining module 1102 is specifically used for: Determine a trend curve for the spectrum data, wherein the trend curve is used to characterize the changing trend of the spectrum data; Determine the rate of change of the trend curve; The frequency cutoff threshold is determined based on the rate of change of the trend curve.

[0077] In some optional implementations, the determining module 1102 is specifically used for: Identify multiple local maxima points in the spectrum data; Based on the multiple local maxima, a trend curve for the spectral data is determined.

[0078] In some optional implementations, the determining module 1102 is specifically used for: Differentiate the trend curve to obtain the differential curve of the trend curve; Identify the inflection point in the differential curve of the trend curve; The frequency corresponding to the inflection point is determined as the frequency cutoff threshold.

[0079] In some optional implementations, the determining module 1102 is specifically used for: The differential curve of the trend curve is smoothed to obtain a smoothed differential curve. Identify inflection points in the smoothed differential curve.

[0080] In some alternative implementations, the determining module 1102 is further configured to: Based on the noise-reduced spectral data, the elemental content of the sample to be tested is determined.

[0081] In some alternative implementations, the sample to be tested includes nuclear material, which includes one or more elements selected from uranium, plutonium, and neptunium.

[0082] In some alternative implementations, the determining module 1102 is further configured to: Based on the denoised spectral data, the elemental contents of uranium, plutonium, and neptunium in the sample to be tested are determined respectively.

[0083] In practical applications, the acquisition module 1101 can be implemented by a processor in the data processing device combined with a communication interface, and the determination module 1102 and the noise reduction module 1103 can be implemented by a processor in the data processing device.

[0084] It should be noted that the data processing apparatus provided in this application embodiment is only illustrated by the above-described division of program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the apparatus can be divided into different program modules to complete all or part of the processing described above. Furthermore, the data processing apparatus and data processing method provided in this application embodiment belong to the same concept, and their specific implementation process is detailed in the method embodiment, and will not be repeated here.

[0085] The methods disclosed in the embodiments of this application can be applied to a processor, or implemented by the processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules can be located in a storage medium, which is located in a memory. The processor reads information from the memory and, in conjunction with its hardware, completes the steps of the aforementioned method.

[0086] In an exemplary embodiment, the electronic device may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.

[0087] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memories.

[0088] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory that stores a computer program, which can be executed by a processor to complete the steps described in the aforementioned method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.

[0089] In an exemplary embodiment, this application also provides a computer program product, including a computer program that can be executed by a processor to perform the steps described in the foregoing method.

[0090] It should be noted that terms such as "first" and "second" are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0091] Furthermore, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.

[0092] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application.

Claims

1. A data processing method, characterized in that, The method includes: Acquire spectral data of the sample to be tested, wherein the spectral data represents the X-ray fluorescence spectrum of the sample to be tested; Perform a Fourier transform on the spectral data to obtain the spectrum data; Based on the changing trend of the spectrum data, a frequency cutoff threshold is determined, wherein the frequency cutoff threshold is used to distinguish between useful signal frequency bands and noise frequency bands in the spectrum data; The spectrum data of the noise frequency band in the spectrum data is set to a first value to obtain the spectrum data after noise reduction, wherein the frequency of the noise frequency band is greater than the frequency cutoff threshold. Perform an inverse Fourier transform on the denoised spectral data to obtain the denoised spectral data.

2. The method according to claim 1, characterized in that, Determining the frequency cutoff threshold based on the changing trend of the spectrum data includes: Determine a trend curve for the spectrum data, wherein the trend curve is used to characterize the changing trend of the spectrum data; Determine the rate of change of the trend curve; The frequency cutoff threshold is determined based on the rate of change of the trend curve.

3. The method according to claim 2, characterized in that, Determining the trend curve of the spectrum data includes: Identify multiple local maxima points in the spectrum data; Based on the multiple local maxima, a trend curve for the spectral data is determined.

4. The method according to claim 2, characterized in that, Determining the rate of change of the trend curve includes: Differentiate the trend curve to obtain the differential curve of the trend curve; Determining the frequency cutoff threshold based on the rate of change of the trend curve includes: Identify the inflection point in the differential curve of the trend curve; The frequency corresponding to the inflection point is determined as the frequency cutoff threshold.

5. The method according to claim 4, characterized in that, Before identifying inflection points in the differential curve of the trend curve, the method further includes: The differential curve of the trend curve is smoothed to obtain a smoothed differential curve. The step of identifying inflection points in the differential curve of the trend curve includes: Identify inflection points in the smoothed differential curve.

6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Based on the noise-reduced spectral data, the elemental content of the sample to be tested is determined.

7. The method according to claim 6, characterized in that, The sample to be tested includes nuclear materials, which include one or more elements selected from uranium, plutonium, and neptunium.

8. The method according to claim 7, characterized in that, Determining the elemental content of the sample to be tested based on the denoised spectral data includes: Based on the denoised spectral data, the elemental contents of uranium, plutonium, and neptunium in the sample to be tested are determined respectively.

9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.