Spectral signal noise reduction method and device, computer equipment and readable storage medium
By introducing a new threshold function and gray wolf optimization algorithm in LIBS technology, the decomposition number of layers and signal-to-noise ratio is solved, and the problem of unsatisfactory denoising effect in the existing technology is achieved, and more efficient spectral signal denoising is achieved.
Patent Information
- Application Number
- CN202411830661.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-11
AI Technical Summary
The existing laser induced breakdown spectroscopy (LIBS) denoising technology has oscillation phenomena caused by hard threshold functions and signal deviations caused by soft threshold functions, and the optimal decomposition layer determination of the wavelet algorithm is not perfect enough, resulting in unsatisfactory denoising effect.
The new threshold function and gray wolf optimization algorithm are used to optimize the decomposition layer number and signal-to-noise ratio, and iteratively optimize the denoising process to achieve more effective spectral signal denoising.
It greatly shortens the denoising time, enhances the denoising effect, reduces signal oscillation and deviation, and improves the signal-to-noise ratio.
Smart Images

Figure CN119807612A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of spectrum analysis technology, and in particular to a spectrum signal noise reduction method, device, computer equipment and readable storage medium. Background Art
[0002] Existing denoising technologies for Laser-induced Breakdown Spectroscopy (LIBS) are mostly based on wavelet domain denoising with traditional soft and hard threshold functions, that is, by utilizing the differences between spectral signals and noise, different thresholds and threshold functions (soft threshold functions and hard threshold functions) are artificially set to remove noise. After determining the signal corresponding to the wavelet coefficients that need to be retained, the spectral signal is reconstructed to obtain a relatively pure and useful signal.
[0003] The hard threshold function in the existing scheme has discontinuity, which will cause serious oscillation during the denoising process, also known as the "pseudo-Gibbs phenomenon". The soft threshold function in the existing scheme has discontinuous derivatives, and the signal after denoising by this method will have a constant deviation, which will seriously cause signal distortion and loss of some useful information. When these two traditional denoising methods are used in reality, the denoising effect is not ideal due to reasons such as continuity and differentiability. In addition, the optimal number of decomposition layers of the wavelet algorithm in the existing scheme is determined by experience or multiple comparisons of the signal-to-noise ratio or mean square error. The algorithm is not perfect, time-consuming and has low calculation accuracy. Summary of the invention
[0004] In view of this, an object of the present invention is to overcome the deficiencies in the prior art and to provide a spectral signal denoising method, apparatus, computer equipment and readable storage medium.
[0005] The present invention provides the following technical solutions:
[0006] In a first aspect, an embodiment of the present disclosure provides a method for reducing noise of a spectral signal, the method comprising:
[0007] Obtain the original spectral signal, set the parameters of the objective function, the new threshold function and the gray wolf optimization algorithm;
[0008] The original spectral signal is calculated for the first time according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm to obtain an initial optimal decomposition layer number and an initial optimal signal-to-noise ratio;
[0009] The original spectral signal is iterated according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm, and when the number of iterations reaches the iteration number threshold, the iteration is stopped to obtain the final optimal decomposition layer number, the final optimal signal-to-noise ratio and the final denoised spectral signal.
[0010] Optionally, the objective function is a signal-to-noise ratio; the parameters of the gray wolf optimization algorithm include the population size and the iteration number threshold; and the optimization variable of the gray wolf optimization algorithm is the number of decomposition layers.
[0011] Optionally, the first calculation of the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm to obtain an initial optimal number of decomposition layers and an initial optimal signal-to-noise ratio includes:
[0012] According to the initial decomposition layer number of each gray wolf, the original spectral signal is subjected to wavelet transformation to obtain a plurality of wavelet coefficients, each of the wavelet coefficients is subjected to threshold processing by applying the novel threshold function to obtain a plurality of denoised wavelet coefficients, and each of the denoised wavelet coefficients is subjected to inverse transformation and reconstruction to obtain an initial denoised spectral signal;
[0013] Calculate the initial signal-to-noise ratio of all gray wolves using a preset signal-to-noise ratio formula according to the initial denoised spectral signal and the original spectral signal;
[0014] The initial decomposition layer numbers are sorted according to the signal-to-noise ratio, the initial decomposition layer number with the highest signal-to-noise ratio is used as the initial optimal decomposition layer number, and the signal-to-noise ratio corresponding to the initial optimal decomposition layer number is used as the initial optimal signal-to-noise ratio.
[0015] Optionally, the new threshold function is:
[0016]
[0017] In the formula, α and β are adjustable parameters. is the wavelet coefficient after denoising, w j,k is the wavelet coefficient, λ is the preset wavelet coefficient threshold, and t is a constant.
[0018] Optionally, the preset signal-to-noise ratio formula is:
[0019]
[0020] Where SNR is the signal-to-noise ratio, is the signal power in the spectral signal, y i is the noise power in the spectral signal.
[0021] Optionally, the iterating the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm, and stopping the iteration when the number of iterations reaches an iteration number threshold, to obtain the final optimal decomposition layer number, the final optimal signal-to-noise ratio and the final denoised spectral signal, including:
[0022] Updating the initial number of decomposition layers to obtain an updated number of decomposition layers, and determining an updated optimal number of decomposition layers and an updated optimal signal-to-noise ratio;
[0023] Compare the updated optimal signal-to-noise ratio with the previous optimal signal-to-noise ratio. If the updated optimal signal-to-noise ratio is greater than the previous optimal signal-to-noise ratio, update the records of the optimal number of decomposition layers and the optimal signal-to-noise ratio to the latest optimal number of decomposition layers and the latest optimal signal-to-noise ratio.
[0024] When the number of iterations reaches the iteration number threshold, the iteration ends, and the final optimal decomposition layer number, the final optimal signal-to-noise ratio and the final denoised spectral signal are output.
[0025] Optionally, after comparing the updated optimal signal-to-noise ratio with the previous optimal signal-to-noise ratio, the method further includes:
[0026] If the updated optimal signal-to-noise ratio is less than the previous optimal signal-to-noise ratio, the current optimal number of decomposition layers and the current optimal signal-to-noise ratio are kept unchanged, and the iteration step is re-executed.
[0027] In a second aspect, an embodiment of the present disclosure provides a spectral signal noise reduction device, the device comprising:
[0028] The setting module is used to obtain the original spectral signal and set the parameters of the objective function, the new threshold function and the gray wolf optimization algorithm;
[0029] A calculation module, used for performing a first calculation on the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm to obtain an initial optimal decomposition layer number and an initial optimal signal-to-noise ratio;
[0030] The iteration module is used to iterate the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm, and stop iterating when the number of iterations reaches the iteration number threshold, so as to obtain the final optimal decomposition layer number, the final optimal signal-to-noise ratio and the final denoised spectral signal.
[0031] In a third aspect, a computer device is provided in an embodiment of the present disclosure, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the spectral signal denoising method described in the first aspect when executing the computer program.
[0032] In a fourth aspect, a computer-readable storage medium is provided in an embodiment of the present disclosure, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the spectral signal denoising method described in the first aspect are implemented.
[0033] Beneficial effects of this application:
[0034] The spectral signal denoising method provided in the embodiment of the present application comprises: obtaining the original spectral signal, setting the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm; performing the first calculation on the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm to obtain the initial optimal number of decomposition layers and the initial optimal signal-to-noise ratio; iterating the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm, and stopping the iteration when the number of iterations reaches the iteration number threshold, to obtain the final optimal number of decomposition layers, the final optimal signal-to-noise ratio and the final denoised spectral signal. The present application uses the new threshold function and the gray wolf optimization algorithm for denoising, which greatly shortens the denoising time and enhances the denoising effect.
[0035] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work. In each of the drawings, similar components are numbered similarly.
[0037] Figure 1 A flow chart of a spectral signal noise reduction method provided in an embodiment of the present application is shown;
[0038] Figure 2 A schematic structural diagram of a spectral signal noise reduction device provided in an embodiment of the present application is shown;
[0039] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0040] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0041] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. In contrast, when an element is referred to as being "directly on" another element, there is no intermediate element. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0042] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0043] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of the template are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0045] Example 1
[0046] like Figure 1 , which is a flow chart of a spectral signal denoising method in an embodiment of the present application, the spectral signal denoising method provided in an embodiment of the present application comprises the following steps:
[0047] Step S110, obtaining the original spectral signal, setting the parameters of the objective function, the new threshold function and the gray wolf optimization algorithm.
[0048] In this embodiment, an original spectral signal is obtained from a LIBS spectrometer or other data acquisition equipment, and the original spectral signal usually contains a signal and noise.
[0049] Next, we need to define related functions and parameters. Specifically, we first define the objective function as the signal-to-noise ratio (SNR), which is used to measure the quality of the denoised signal. The SNR is defined as the logarithm of the ratio of the signal power to the noise power. The preset signal-to-noise ratio formula is as follows:
[0050]
[0051] Where SNR is the signal-to-noise ratio, is the signal power in the spectral signal, y i is the noise power in the spectral signal.
[0052] Then the universal threshold is selected as the basis for threshold selection, sym2 is selected as the wavelet basis function, and the original decomposition layer number range of the wavelet transform is defined as [1, 10], which is one of the parameters that the subsequent gray wolf optimization algorithm needs to search.
[0053] Furthermore, the threshold function is defined as the new threshold function proposed in this application:
[0054]
[0055] Wherein, α and β are adjustable parameters. The value range of α is a real number greater than zero, which affects the deviation of the new threshold function. The value range of β is (0, 1), which affects the linearity of the new threshold function curve. is the wavelet coefficient after denoising, w j,k is the wavelet coefficient, λ is the preset wavelet coefficient threshold, and t is a constant.
[0056] Finally, the parameters of the gray wolf optimization algorithm include the population size and the iteration number threshold, and the optimization variable of the gray wolf optimization algorithm is the decomposition level k. In this embodiment, the population size is 5, indicating that 5 gray wolves participate in the search process, and the iteration number threshold is 50 times, indicating that the algorithm will perform 50 rounds of iterations to find the optimal decomposition level, and determine that the prey searched by the gray wolf is the decomposition level k, and its value range is set to an integer between 1 and 10. Within the range of 1 to 10, an initial decomposition level k is randomly generated for each gray wolf, and these initial positions represent the candidate solutions when the gray wolf optimization algorithm starts searching.
[0057] In the above method, the signal-to-noise ratio is defined as the objective function, which can quantify the quality of the signal after denoising and provide a clear direction for the optimization process. At the same time, the range of decomposition layers, threshold types, new threshold functions, wavelet basis functions, etc. are defined to provide specific mathematical tools and models for denoising. By setting parameters such as population size, iteration threshold and optimization variables, the necessary initial conditions are provided for the operation of the gray wolf optimization algorithm. The selection of these parameters has an important impact on the convergence speed and performance of the algorithm.
[0058] Step S120, performing a first calculation on the original spectral signal according to the objective function, the new threshold function and the parameters of the grey wolf optimization algorithm to obtain an initial optimal decomposition layer number and an initial optimal signal-to-noise ratio.
[0059] Understandably, according to the current initial decomposition level k of each gray wolf, the original spectral signal is subjected to discrete wavelet transform (DWT) using the defined wavelet basis function (sym2). The original spectral signal containing noise is decomposed into multiple wavelet coefficients, including an approximate coefficient cA k and a series of detail coefficients cD1-cD k , where cA k Represents the low-frequency information (i.e. useful information) of the original spectral signal, cD1-cD k It represents the high-frequency information (i.e. noise) and part of the low-frequency information of the original spectral signal.
[0060] Furthermore, using the novel threshold function in the above method, each wavelet coefficient (i.e., an approximate coefficient cA k and a series of detail coefficients cD1-cD k ) to perform corresponding operations, and substitute the wavelet coefficients that are less than the preset wavelet coefficient threshold into the following formula:
[0061]
[0062] Substitute the wavelet coefficients that are greater than or equal to the preset wavelet coefficient threshold into the following formula:
[0063]
[0064] After the above operations, multiple denoised wavelet coefficients are obtained. Each denoised wavelet coefficient is further inversely transformed and reconstructed to obtain an initial denoised spectral signal.
[0065] According to the initial denoised spectral signal and the original spectral signal, the preset signal-to-noise ratio formula is used to calculate the initial signal-to-noise ratio of each gray wolf, and the initial decomposition layers are sorted according to the signal-to-noise ratio. The initial decomposition layer with the highest signal-to-noise ratio is used as the initial optimal decomposition layer (leader), the initial decomposition layer with the second highest signal-to-noise ratio is used as the initial best decomposition layer (follower), and the signal-to-noise ratio corresponding to the initial optimal decomposition layer is used as the initial optimal signal-to-noise ratio.
[0066] Understandably, the process of first calculating and determining the initial optimal number of decomposition layers is mainly achieved by evaluating the initial randomly generated number of decomposition layers (grey wolf positions) and sorting them according to the size of the signal-to-noise ratio. The initial optimal number of decomposition layers and the initial optimal signal-to-noise ratio will serve as the benchmark and reference in the subsequent iterative process to guide the update and optimization of the number of decomposition layers.
[0067] In view of the shortcomings of the traditional soft and hard threshold functions, such as constant deviation and "pseudo-Gibbs phenomenon", in order to improve the denoising effect and reduce signal oscillation, the new threshold function denoising proposed by the above method has a flexible mathematical model and provides two adjustable factors for adjustment. It pays more attention to the deviation effect and continuity of the function. At the same time, the function is composed of elementary functions and is high-order differentiable. It ensures the stability of the signal during denoising and reduces the possible deviation, thereby improving the performance of the denoising algorithm. In addition, for the determination of the number of decomposition layers of the denoising algorithm, the traditional experience or multiple manual comparison methods are abandoned. By introducing the gray wolf optimization algorithm, the denoising algorithm can adaptively adjust the number of decomposition layers and optimize according to different signal types, thereby improving the signal-to-noise ratio of denoising, greatly shortening the denoising time, and enhancing the denoising effect.
[0068] Step S130, iterating the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm, and stopping the iteration when the number of iterations reaches the iteration number threshold, to obtain the final optimal decomposition layer number, the final optimal signal-to-noise ratio and the final denoised spectral signal.
[0069] Understandably, in the first calculation, since no iteration has been performed, the iteration end condition (such as the signal-to-noise ratio reaches the maximum or the number of iterations reaches the iteration number threshold) will not be met. Therefore, the next round of iterative calculation will begin.
[0070] Specifically, according to the update rules of the gray wolf optimization algorithm (such as based on the position and speed of the leader and follower, etc.), the position of each gray wolf is updated, that is, the initial decomposition layer number is updated to obtain the updated decomposition layer number.
[0071] Furthermore, the evaluation steps of the first calculation process in step S120 are repeated for each gray wolf's updated decomposition level, including wavelet transform, threshold processing, inverse transform reconstruction and signal-to-noise ratio calculation, and the updated optimal decomposition level and the updated optimal signal-to-noise ratio are determined according to the newly calculated signal-to-noise ratio.
[0072] Then compare the updated optimal signal-to-noise ratio with the previous optimal signal-to-noise ratio (if it is the first iteration, compare it with the result calculated for the first time). If the updated optimal signal-to-noise ratio is greater than the previous optimal signal-to-noise ratio, update the records of the optimal number of decomposition layers and the optimal signal-to-noise ratio. When performing the next iteration, compare the result after the next iteration with the updated record.
[0073] It should be noted that if the updated optimal signal-to-noise ratio is less than or equal to the previous optimal signal-to-noise ratio, the records of the current optimal number of decomposition layers and the optimal signal-to-noise ratio are kept unchanged, and the iteration step is re-executed.
[0074] Finally, check whether the current number of iterations has reached the preset iteration threshold (such as 50 times). If not, continue to perform the iteration steps; if it has been reached, the iteration ends and the final optimal decomposition layer number, the final optimal signal-to-noise ratio and the final denoised spectral signal are output.
[0075] The entire method continuously iterates and searches for the optimal number of decomposition layers through the Gray Wolf Optimization Algorithm to maximize the signal-to-noise ratio between the denoised signal and the original signal, thereby achieving effective denoising processing.
[0076] The spectral signal denoising method provided in the embodiment of the present application obtains the original spectral signal, sets the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm; performs the first calculation on the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm to obtain the initial optimal decomposition layer number and the initial optimal signal-to-noise ratio; iterates the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm, and stops the iteration when the number of iterations reaches the iteration number threshold, to obtain the final optimal decomposition layer number, the final optimal signal-to-noise ratio and the final denoised spectral signal. The present application uses the new threshold function and the gray wolf optimization algorithm for denoising, which greatly shortens the denoising time and enhances the denoising effect.
[0077] Example 2
[0078] like Figure 2 FIG. 2 is a schematic diagram of a spectral signal noise reduction device 200 in an embodiment of the present application, wherein the device comprises:
[0079] A setting module 210 is used to obtain the original spectral signal and set the parameters of the objective function, the new threshold function and the gray wolf optimization algorithm;
[0080] A calculation module 220 is used to perform a first calculation on the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm to obtain an initial optimal decomposition layer number and an initial optimal signal-to-noise ratio;
[0081] The iteration module 230 is used to iterate the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm, and stop iterating when the number of iterations reaches the iteration number threshold, so as to obtain the final optimal decomposition layer number, the final optimal signal-to-noise ratio and the final denoised spectral signal.
[0082] The spectral signal denoising device provided in the embodiment of the present application performs denoising through a new threshold function and a grey wolf optimization algorithm, which greatly shortens the denoising time and enhances the denoising effect.
[0083] Example 3
[0084] The present application also provides a computer device. Figure 3 , Figure 3 This is a basic structural block diagram of the computer device in this embodiment.
[0085] The computer device 3 includes a memory 31, a processor 32, and a network interface 33 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 3 with a memory 31, a processor 32, and a network interface 33, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc.
[0086] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0087] The memory 31 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or D slot compatibility test memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 31 can be an internal storage unit of the computer device 3, such as a hard disk or memory of the computer device 3. In other embodiments, the memory 31 can also be an external storage device of the computer device 3, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 3. Of course, the memory 31 can also include both the internal storage unit of the computer device 3 and its external storage device. In this embodiment, the memory 31 is generally used to store the operating system and various application software installed on the computer device 3, such as computer-readable instructions of the slot compatibility test method, etc. In addition, the memory 31 can also be used to temporarily store various types of data that have been output or are to be output.
[0088] The processor 32 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other spectral signal noise reduction chip in some embodiments. The processor 32 is generally used to control the overall operation of the computer device 3. In this embodiment, the processor 32 is used to run computer-readable instructions or process data stored in the memory 31, such as computer-readable instructions for running the slot compatibility test method.
[0089] The network interface 33 may include a wireless network interface or a wired network interface. The network interface 33 is generally used to establish a communication connection between the computer device 3 and other electronic devices.
[0090] The computer device provided in this embodiment can execute the above-mentioned spectral signal denoising method. Here, the spectral signal denoising method can be the spectral signal denoising method of each of the above-mentioned embodiments.
[0091] Example 4
[0092] This embodiment further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the spectral signal noise reduction method in the embodiment are implemented.
[0093] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, referred to as SMC), a secure digital (Secure Digital, referred to as SD) card, a flash card, etc. Of course, the computer-readable storage medium can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or are to be output.
[0094] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow chart, and the combination of boxes in the structure diagram and / or the flow chart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0095] In addition, the functional modules or units in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0096] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or partly contributed to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium can be a non-volatile storage medium or a volatile storage medium. For example, the storage medium can be: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes.
[0097] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A spectral signal noise reduction method, characterized in that: The method comprises: Obtain the original spectral signal, set the parameters of the objective function, the new threshold function and the gray wolf optimization algorithm; The original spectral signal is calculated for the first time according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm to obtain an initial optimal decomposition layer number and an initial optimal signal-to-noise ratio; The original spectral signal is iterated according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm, and when the number of iterations reaches the iteration number threshold, the iteration is stopped to obtain the final optimal decomposition layer number, the final optimal signal-to-noise ratio and the final denoised spectral signal.
2. The spectral signal denoising method according to claim 1, characterized in that: The objective function is the signal-to-noise ratio; the parameters of the gray wolf optimization algorithm include the population size and the iteration number threshold; the optimization variable of the gray wolf optimization algorithm is the number of decomposition layers.
3. The spectral signal denoising method according to claim 2, characterized in that: The first calculation of the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm to obtain the initial optimal decomposition layer number and the initial optimal signal-to-noise ratio includes: According to the initial decomposition layer number of each gray wolf, the original spectral signal is subjected to wavelet transformation to obtain a plurality of wavelet coefficients, each of the wavelet coefficients is subjected to threshold processing by applying the novel threshold function to obtain a plurality of denoised wavelet coefficients, and each of the denoised wavelet coefficients is subjected to inverse transformation and reconstruction to obtain an initial denoised spectral signal; Calculate the initial signal-to-noise ratio of all gray wolves using a preset signal-to-noise ratio formula according to the initial denoised spectral signal and the original spectral signal; The initial decomposition layer numbers are sorted according to the signal-to-noise ratio, the initial decomposition layer number with the highest signal-to-noise ratio is used as the initial optimal decomposition layer number, and the signal-to-noise ratio corresponding to the initial optimal decomposition layer number is used as the initial optimal signal-to-noise ratio.
4. The spectral signal denoising method according to claim 3, characterized in that: The new threshold function is: In the formula, α and β are adjustable parameters. is the wavelet coefficient after denoising, w j,k is the wavelet coefficient, λ is the preset wavelet coefficient threshold, and t is a constant.
5. The spectral signal denoising method according to claim 3, characterized in that: The preset signal-to-noise ratio formula is: Where SNR is the signal-to-noise ratio, is the signal power in the spectral signal, y i is the noise power in the spectral signal.
6. The spectral signal denoising method according to claim 3, characterized in that: The original spectral signal is iterated according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm, and when the number of iterations reaches the iteration number threshold, the iteration is stopped to obtain the final optimal decomposition layer number, the final optimal signal-to-noise ratio and the final denoised spectral signal, including: Updating the initial number of decomposition layers to obtain an updated number of decomposition layers, and determining an updated optimal number of decomposition layers and an updated optimal signal-to-noise ratio; Compare the updated optimal signal-to-noise ratio with the previous optimal signal-to-noise ratio. If the updated optimal signal-to-noise ratio is greater than the previous optimal signal-to-noise ratio, update the records of the optimal number of decomposition layers and the optimal signal-to-noise ratio to the latest optimal number of decomposition layers and the latest optimal signal-to-noise ratio. When the number of iterations reaches the iteration number threshold, the iteration ends, and the final optimal decomposition layer number, the final optimal signal-to-noise ratio and the final denoised spectral signal are output.
7. The spectral signal denoising method according to claim 6, characterized in that: After comparing the updated optimal signal-to-noise ratio with the previous optimal signal-to-noise ratio, the method further includes: If the updated optimal signal-to-noise ratio is less than the previous optimal signal-to-noise ratio, the current optimal number of decomposition layers and the current optimal signal-to-noise ratio are kept unchanged, and the iteration step is re-executed.
8. A spectral signal noise reduction device, characterized in that: The device comprises: The setting module is used to obtain the original spectral signal and set the parameters of the objective function, the new threshold function and the gray wolf optimization algorithm; A calculation module, used for performing a first calculation on the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm to obtain an initial optimal decomposition layer number and an initial optimal signal-to-noise ratio; The iteration module is used to iterate the original spectral signal according to the objective function, the new threshold function and the parameters of the gray wolf optimization algorithm, and stop iterating when the number of iterations reaches the iteration number threshold, so as to obtain the final optimal decomposition layer number, the final optimal signal-to-noise ratio and the final denoised spectral signal.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the spectral signal denoising method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the spectral signal denoising method according to any one of claims 1 to 7 are implemented.