Spectrogram clustering processing method and device and baseline correction method and device
By detecting the peak position and width of the spectrum for clustering and baseline correction, the problem of peak overlap in the spectrum is solved and the accuracy and calculation efficiency of peak clustering are improved.
Patent Information
- Application Number
- CN202310197315.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-03
- Publication Date
- 2024-09-03
AI Technical Summary
In spectral analysis, overlapping spectral peaks are difficult to cluster accurately, affecting the accuracy of subsequent analysis.
By detecting the peak position of the spectrum and the peak width corresponding to the preset height, the peaks are clustered to generate peak clusters, and baseline correction processing is performed on each peak cluster.
It improves the accuracy of spectral peak clustering results, simplifies the calculation process, facilitates software and hardware implementation, and reduces the time delay of baseline correction.
Smart Images

Figure CN118587463A
Abstract
Description
Technical Field
[0001] The present application relates to the field of signal processing, and in particular to a method and device for clustering spectrum and a method and device for baseline correction. Background Art
[0002] With the development of science and technology, spectrum analysis has been widely used in the fields of medicine, biology, production, etc. In current spectrum analysis, it is usually necessary to detect the peaks of the spectrum so as to perform subsequent analysis or processing on each peak.
[0003] It should be noted that the above introduction to the technical background is only for the convenience of providing a clear and complete description of the technical solutions of the present application and for the convenience of understanding by those skilled in the art. It cannot be considered that the above technical solutions are well known to those skilled in the art simply because they are described in the background technology section of the present application. Summary of the invention
[0004] The inventors have found that in a spectrum, multiple overlapping spectrum peaks usually have the same or similar characteristics. When performing spectrum analysis, it is necessary to cluster the multiple overlapping spectrum peaks.
[0005] In response to at least one of the above problems or other similar problems, the present application provides a method and device for clustering a spectrum and a method and device for baseline correction, which can improve the accuracy of the clustering results of the spectrum and are simple to calculate.
[0006] According to one aspect of an embodiment of the present application, a method for clustering a spectrum is provided, the method comprising: detecting a spectral peak of the spectrum, obtaining a spectral peak position of the spectral peak and a spectral peak width corresponding to a preset height; and clustering the spectral peaks according to the spectral peak position and the spectral peak width to generate a spectral peak cluster including at least one spectral peak.
[0007] According to another aspect of an embodiment of the present application, a method for baseline correction of a spectrum is provided, the method comprising: detecting a spectral peak of the spectrum, obtaining a spectral peak position of the spectral peak and a spectral peak width corresponding to a preset height; clustering the spectral peaks according to the spectral peak position and the spectral peak width to generate a spectral peak cluster including at least one spectral peak; and performing baseline correction processing on each spectral peak cluster respectively.
[0008] According to another aspect of an embodiment of the present application, a device for clustering a spectrum is provided, the device comprising: a detection unit, which detects a spectral peak of the spectrum, obtains a spectral peak position of the spectral peak and a spectral peak width corresponding to a preset height; and a clustering unit, which clusters the spectral peaks according to the spectral peak position and the spectral peak width, and generates a spectral peak cluster including at least one spectral peak.
[0009] According to another aspect of an embodiment of the present application, a baseline correction device for a spectrum is provided, the device comprising: a detection unit, which detects a spectral peak of the spectrum, obtains a spectral peak position of the spectral peak and a spectral peak width corresponding to a preset height; a clustering unit, which clusters the spectral peaks according to the spectral peak position and the spectral peak width, and generates a spectral peak cluster including at least one spectral peak; and a correction unit, which performs baseline correction processing on each spectral peak cluster respectively.
[0010] According to another aspect of the embodiments of the present application, an electronic device is provided, comprising the device for clustering processing of spectra or the device for baseline correction of spectra described in any of the embodiments of the aforementioned aspects.
[0011] One of the beneficial effects of the embodiments of the present application is that by clustering the spectral peaks of the spectrum graph according to the spectral peak positions and spectral peak widths, the accuracy of the clustering results can be improved and the calculation is simple.
[0012] With reference to the following description and accompanying drawings, the embodiments of the present application are disclosed in detail. It should be understood that the embodiments of the present application are not limited in scope. Within the spirit and scope of the appended claims, the embodiments of the present application include many changes, modifications and equivalents. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Elements and features described in one figure or one embodiment of the present application can be combined with elements and features shown in one or more other figures or embodiments. In addition, in the drawings, similar reference numerals represent corresponding components in several figures and can be used to indicate corresponding components used in more than one embodiment. Moreover, the drawings are not drawn to scale, but are only for illustrating various embodiments of the present application.
[0014] The included drawings are used to provide a further understanding of the embodiments of the present application, which constitute a part of the specification, are used to illustrate the implementation methods of the present application, and together with the text description, explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0015] Figure 1 It is a schematic diagram of a method for clustering a spectrum according to an embodiment of the present application;
[0016] Figure 2 is a schematic diagram of the peak position of the spectrum in the embodiment of the present application;
[0017] Figure 3 is another schematic diagram of the spectral peak position of an embodiment of the present application;
[0018] Figure 4 is another schematic diagram of the spectral peak position of an embodiment of the present application;
[0019] Figure 5 is another schematic diagram of the spectral peak position of an embodiment of the present application;
[0020] Figure 6 is a schematic diagram of the spectrum peak width of an embodiment of the present application;
[0021] Figure 7 is another schematic diagram of the spectrum peak width of an embodiment of the present application;
[0022] Figure 8 is a schematic diagram of the process of calculating the spectrum peak width in an embodiment of the present application;
[0023] Fig. 9 is a schematic diagram of the spectrum peaks of the embodiment of the present application;
[0024] Fig.10 is a schematic diagram of the process of spectral peak clustering in an embodiment of the present application;
[0025] Fig.11 is a schematic diagram of the spectral peak clusters after clustering in an embodiment of the present application;
[0026] Fig.12 is a schematic diagram of a spectrum after smoothing processing in an embodiment of the present application;
[0027] Fig.13 is a schematic diagram of the process of operation 104 of an embodiment of the present application;
[0028] Fig.14 is a schematic diagram of a spectral point sequence and a first baseline in an embodiment of the present application;
[0029] Fig.15 is a schematic diagram of a spectrum with the first baseline removed according to an embodiment of the present application;
[0030] Fig.16 is a schematic diagram of a baseline correction method for a spectrum in an embodiment of the present application;
[0031] Fig.17 is a schematic diagram of a device for clustering a spectrum according to an embodiment of the present application;
[0032] Fig.18 is a schematic diagram of a device for baseline correction of a spectrum in an embodiment of the present application;
[0033] Fig.19 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0034] With reference to the accompanying drawings, the above and other features of the present application will become apparent through the following description. In the description and the accompanying drawings, specific embodiments of the present application are specifically disclosed, which show some embodiments in which the principles of the present application can be adopted, and it should be understood that the present application is not limited to the described embodiments, but includes all modifications and equivalents falling within the scope of the attached claims.
[0035] In the embodiments of the present application, the terms "first", "second", "upper", "lower", etc. are used to distinguish different elements in terms of title, but do not indicate the spatial arrangement or time order of these elements, etc., and these elements should not be limited by these terms. The term "and / or" includes any one and all combinations of one or more of the associated listed terms. The terms "comprising", "including", "having", etc. refer to the presence of the stated features, elements, components or components, but do not exclude the presence or addition of one or more other features, elements, components or components.
[0036] In the embodiments of the present application, the singular forms "a", "the", etc. include plural forms and should be broadly understood as "a kind" or "a type" rather than being limited to the meaning of "one"; in addition, the term "said" should be understood to include both singular and plural forms, unless the context clearly indicates otherwise. In addition, the term "according to" should be understood as "at least in part according to...", and the term "based on" should be understood as "at least in part based on...", unless the context clearly indicates otherwise.
[0037] Features described and / or shown for one embodiment may be used in one or more other embodiments in the same or similar manner, combined with features in other embodiments, or replace features in other embodiments. The term "includes / comprising" when used herein refers to the presence of a feature, an entirety, a step, or a component, but does not exclude the presence or addition of one or more other features, entireties, steps, or components.
[0038] In the embodiment of the present application, the baseline of the spectrum can be replaced by the background line of the spectrum, the baseline drift can be replaced by the background drift, and the baseline correction can be replaced by the background line correction or the background drift correction. The spectrum peak obtained by the spectrum peak detection includes the spectrum points from the peak starting point (including the peak starting point) to the peak end point (including the peak end point).
[0039] The embodiments of the present application are described below with reference to the accompanying drawings.
[0040] Embodiments of the first aspect
[0041] The present application provides a method for clustering a spectrum graph. Figure 1 is a schematic diagram of a method for clustering a spectrum according to an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0042] Operation 101, detecting a spectrum peak of a spectrum graph, obtaining a spectrum peak position of the spectrum peak and a spectrum peak width corresponding to a preset height; and
[0043] In operation 102, the spectrum peaks are clustered according to the spectrum peak positions and the spectrum peak widths to generate a spectrum peak cluster including at least one spectrum peak.
[0044] According to the above embodiment, the peak position of the peak and the peak width corresponding to the preset height are obtained through peak detection, and the detected peaks are clustered according to the obtained peak positions and peak widths to generate a peak cluster including at least one peak. This can improve the accuracy of the peak clustering results, and the calculations involved in the clustering process are simple, which is convenient for software and hardware implementation.
[0045] It is worth noting that the above Figure 1 The embodiments of the present application are only schematically described, but the present application is not limited thereto. For example, the execution order of the various operations can be appropriately adjusted, and other operations can be added or some operations can be reduced. Those skilled in the art can make appropriate modifications based on the above content, and are not limited to the above appended Figure 1 Records of.
[0046] In some embodiments, the spectrum can be various types of spectrum, for example, the spectrum can be any one of a chromatogram, a light spectrum, a mass spectrum or a wave spectrum.
[0047] In some embodiments, the spectrum can be obtained in various ways. For example, the spectrum can be a spectrum obtained by ICP (Inductively Coupled Plasma), LC-MS (Liquid Chromatograph Mass Spectrometer), GC-MS (Gas Chromatograph Mass Spectrometer), etc.
[0048] In some embodiments, the spectrogram may include a spectrum point sequence, and the spectrum point sequence may include one or more spectrum points. The spectrogram may be represented based on various coordinate systems. Taking the Cartesian coordinate system as an example, the horizontal axis coordinate (X coordinate) and the vertical axis coordinate (Y coordinate) of the coordinate system may be used to represent each spectrum point in the spectrogram. Among them, the right side of the origin of the coordinate system may be a positive value of the horizontal axis (X), and the top of the origin may be a positive value of the vertical axis (Y axis).
[0049] In some embodiments, the X-axis coordinate and the Y-axis coordinate of the coordinate system can be used to represent the corresponding physical quantity of the signal (spectral point). For example, in the coordinate system of the chromatogram, the X-axis can correspond to time, and the Y-axis can correspond to the amplitude (intensity) of the signal (spectral point); in the coordinate system of the infrared spectrum, the X-axis can correspond to the physical quantity related to the wavelength, and the Y-axis can correspond to the amplitude (intensity) of the signal (spectral point). The coordinate value of the X-axis coordinate can be used to represent the position of the spectrum point (also referred to as the position corresponding to the spectrum point), and the coordinate value of the Y-axis coordinate can be used to represent the height of the spectrum point (also referred to as the height corresponding to the spectrum point).
[0050] In some embodiments, in operation 101, the spectrum peak of the spectrum graph can be detected in various ways. For example, amplitude method (threshold method), first-order derivative method, second-order derivative method, pseudo-derivative method, or slope increase detection method, etc. Through spectrum peak detection, information such as the position and height of spectrum points such as peak apex, peak starting point or peak end point can be obtained. For the specific method of detecting the spectrum peak, reference can be made to the relevant technology, which will not be described in detail here.
[0051] In some embodiments, in operation 101, a spectrum peak position of a spectrum peak may be acquired through spectrum peak detection. Figures 2 to 5 is a schematic diagram of the peak position of the embodiment of the present application, Figures 2 to 5 Taking the peak peak in FIG. 1 as an example, the peak position of the peak peak is exemplarily described. It can be understood that the following description of the peak position is also applicable to other peaks in the spectrum.
[0052] like Figure 2 As shown, the spectrum peak position may be a position x1 corresponding to the peak vertex T of the spectrum peak peak (ie, the abscissa value of the peak vertex T), wherein the peak vertex is, for example, a spectrum point with the highest height in the spectrum peak peak;
[0053] Or, if Figure 3 As shown, the spectrum peak position may be a position x2 corresponding to the centroid C of the spectrum peak peak (ie, the abscissa value of the centroid), wherein the centroid C of the spectrum peak peak is, for example, the geometric center of the spectrum peak peak;
[0054] Or, if Figure 4 As shown, the spectrum peak position may be a position x3 corresponding to an area bisector L of the spectrum peak peak, wherein the area bisector L is, for example, a straight line parallel to the Y axis of the coordinate system, and the area of the spectrum peak peak on the left side of the area bisector L is equal to the area of the spectrum peak peak on the right side of the area bisector L;
[0055] Or, if Figure 5As shown, the peak position may be half of the sum of the position xstart corresponding to the peak start point start of the peak peak (i.e., the horizontal coordinate value of the peak start point start) and the position xend corresponding to the peak end point end (i.e., the horizontal coordinate value of the peak end point end), i.e., (xstart+xend) / 2. The present application is not limited to this, and the peak position may also be other positions.
[0056] In some embodiments, the spectrum peak height can be the height of the spectrum at the spectrum peak position, that is, the ordinate value of the spectrum point whose abscissa value is the spectrum peak position in the spectrum. For example, the spectrum peak height can be the height of the peak vertex, or the ordinate value of the spectrum point whose abscissa value is the abscissa value of the centroid of the spectrum peak, or the ordinate value of the spectrum point that intersects the area bisector, or the ordinate value of the spectrum point whose abscissa value is (xstart+xend) / 2, and so on.
[0057] In some embodiments, in operation 101, a spectrum peak width corresponding to a preset height may be obtained through spectrum peak detection. The preset height may be less than or equal to the spectrum peak height, for example, the preset height may be half of the spectrum peak height, etc. The present application is not limited thereto, and the specific value of the preset height may be adjusted according to the requirements for the compactness of each spectrum peak in the same spectrum peak cluster.
[0058] In some embodiments, the spectrum peak width corresponding to the preset height may be the absolute value of the difference between the first value and the second value. The first value may be the following value: when there is no first spectrum point with a preset height from the peak start point to the peak apex, the first value may be the position corresponding to the peak start point; when there is a first spectrum point with a preset height from the peak start point to the peak apex, the first value may be the position corresponding to the first spectrum point.
[0059] The second value may be as follows: when there is no second spectrum point with a preset height from the peak apex to the peak end point, the second value may be the position corresponding to the peak end point; when there is a second spectrum point with a preset height from the peak apex to the peak end point, the second value may be the position corresponding to the second spectrum point.
[0060] Through the above method, the spectral peak width corresponding to the preset height can be accurately determined for spectral peaks of various shapes, which has high universality.
[0061] In some embodiments, when there are first spectrum points, the number of the first spectrum points may be 1 or more than 1; when there are second spectrum points, the number of the second spectrum points may be 1 or more than 1.
[0062] In the case where the number of first spectrum points is 1, the position corresponding to the first spectrum point may be the position of the first spectrum point, that is, the horizontal coordinate of the first spectrum point. In the case where the number of first spectrum points is more than 1, the position corresponding to the first spectrum point may be a position determined according to the position of the more than 1 first spectrum points. For example, the position corresponding to the first spectrum point may be the minimum value among the positions (horizontal coordinates) of the more than 1 first spectrum points. In other words, the position corresponding to the first spectrum point may be the horizontal coordinate value of the leftmost first spectrum point among the more than 1 first spectrum points. The present application is not limited to this, and the position corresponding to the first spectrum point may also be other values. For example, the position corresponding to the first spectrum point may be the average value of the positions (horizontal coordinates) of the more than 1 first spectrum points, or the position corresponding to the first spectrum point may be the maximum value among the positions (horizontal coordinates) of the more than 1 first spectrum points, that is, the horizontal coordinate value of the rightmost first spectrum point among the more than 1 first spectrum points, or the first value may also be the horizontal coordinate value of other first spectrum points, and so on.
[0063] In the case where the number of second spectrum points is 1, the position corresponding to the second spectrum point may be the position of the second spectrum point, that is, the horizontal coordinate of the second spectrum point. In the case where the number of second spectrum points is more than 1, the position corresponding to the second spectrum point may be a position determined according to the position of the more than 1 second spectrum point. For example, the position corresponding to the second spectrum point may be the maximum value among the positions (horizontal coordinates) of the more than 1 second spectrum points. In other words, the position corresponding to the second spectrum point may be the horizontal coordinate value of the rightmost second spectrum point among the more than 1 second spectrum points. The present application is not limited to this, and the position corresponding to the second spectrum point may also be other values. For example, the position corresponding to the second spectrum point may be the average value of the positions (horizontal coordinates) of the more than 1 second spectrum points, or the position corresponding to the second spectrum point may be the minimum value among the positions (horizontal coordinates) of the more than 1 second spectrum points, that is, the horizontal coordinate value of the leftmost second spectrum point among the more than 1 second spectrum points, or the second value may also be the horizontal coordinate value of other second spectrum points, and so on.
[0064] Figure 6 to Figure 7 is a schematic diagram of the peak width of the embodiment of the present application, Figure 6 to Figure 7 Taking the peak peak in FIG. 1 as an example, the peak width of the peak peak corresponding to the preset height is exemplarily described. It can be understood that the following description of the peak width is also applicable to other peaks in the spectrum.
[0065] like Figure 6As shown, the peak starting point of the spectrum peak peak is start, the peak end point is end, and the peak apex is top. When the preset height is H1, there is a first spectrum point P1 with a ordinate value of H1 between the peak starting point start and the peak apex top, so the first value is the abscissa xp1 of the first spectrum point P1; there is a second spectrum point P2 with a ordinate value of H1 between the peak apex top and the peak end end, so the second value is the abscissa xp2 of the second spectrum point P2. In this case, the spectrum peak width corresponding to the preset height H1 is the value of (xp2-xp1).
[0066] like Figure 7 As shown, the peak starting point of the spectrum peak peak is start, the peak end point is end, and the peak apex is top. When the preset height is H2, there is no first spectrum point with a ordinate value of H2 between the peak starting point start and the peak apex top, so the first value is the abscissa xstart of the peak starting point start; there is a second spectrum point P2 with a ordinate value of H2 between the peak apex top and the peak end end, so the second value is the abscissa xp2 of the second spectrum point P2. In this case, the spectrum peak width corresponding to the preset height H2 is the value of (xp2-xstart).
[0067] like Figure 7 As shown in the figure, when the preset height is H3, the spectrum peak peak does not have the first spectrum point and the second spectrum point, so the spectrum peak width corresponding to the preset height H3 is the difference between the abscissa xend of the peak end end and the abscissa xstart of the peak start start. Similarly, for the preset height, if the spectrum peak does not have the first spectrum point and has the second spectrum point, the spectrum peak width corresponding to the preset height is the difference between the abscissa xend of the peak end end and the abscissa xstart of the peak start start.
[0068] Figure 8 FIG. 1 is a schematic diagram of the process of calculating the spectrum peak width in an embodiment of the present application. Taking the preset height as 1 / 2 of the peak vertex height Hi as an example, the calculation process of the spectrum peak width is exemplarily described. Figure 8 As shown in the figure, the calculation process of the peak width includes:
[0069] Operation 801, sequentially connecting the spectrum points (also called discrete points) from the peak start point to the peak end point to form an upper curve Ci of the spectrum peak;
[0070] Operation 802, when the peak starting point of the spectrum peak is not on the X-axis, draw a vertical line segment Vs from the peak starting point to the X-axis to form the left sideline of the spectrum peak;
[0071] Operation 803, when the end point of the spectrum peak is not on the X-axis, a vertical line segment Ve is drawn from the end point of the peak to the X-axis to form the right sideline of the spectrum peak, wherein the upper curve Ci, the left sideline Vs, and the right sideline Ve of the spectrum peak form the outer shape curve of the spectrum peak;
[0072] Operation 804, according to the equation of the half-height line of the spectrum peak y=Hi / 2, determine two intersection points of the half-height line and the profile curve of the spectrum peak;
[0073] Operation 805 : Calculate the half-height width (spectrum peak width) according to the abscissas of the two intersection points, that is, the absolute value of the difference between the abscissas of the two intersection points is the half-height width of the spectrum peak.
[0074] In some embodiments, in operation 102, when clustering the spectrum peaks, it can be determined whether two adjacent spectrum peaks overlap. If so, the two adjacent spectrum peaks are classified into one spectrum peak cluster; if not, the two adjacent spectrum peaks do not belong to one spectrum peak cluster.
[0075] In some embodiments, it is possible to determine whether two adjacent spectrum peaks overlap by using the spectrum peak position and spectrum peak width of each spectrum peak, and then cluster the spectrum peaks to generate a spectrum peak cluster including at least one spectrum peak. For example, when the sum of the spectrum peak position of the current spectrum peak and the spectrum peak width of the current spectrum peak is greater than the difference between the spectrum peak position of the adjacent spectrum peak in the positive direction of the coordinate system of the current spectrum peak and the spectrum peak width of the adjacent spectrum peak, it can be considered that the current spectrum peak overlaps with the adjacent spectrum peak, and the current spectrum peak and the adjacent spectrum peak belong to the same spectrum peak cluster; when the sum of the spectrum peak position of the current spectrum peak and the spectrum peak width of the current spectrum peak is less than or equal to the difference between the spectrum peak position of the adjacent spectrum peak in the positive direction of the coordinate system of the current spectrum peak and the spectrum peak width of the adjacent spectrum peak, it can be considered that the current spectrum peak does not overlap with the adjacent spectrum peak, and the current spectrum peak and the adjacent spectrum peak belong to different spectrum peak clusters.
[0076] Through the above method, the spectrum peaks in the spectrum graph can be clustered accurately, and the calculation involved in the clustering process is simple, which helps to improve the clustering efficiency and is easy to implement in software and hardware.
[0077] In some embodiments, the positive direction of the coordinate system is, for example, the direction along the horizontal axis of the coordinate system, in which the horizontal axis coordinate gradually increases, that is, the direction from left to right of the spectrum. Correspondingly, the negative direction of the coordinate system is, for example, the direction along the horizontal axis of the coordinate system, in which the horizontal axis coordinate gradually decreases, that is, the direction from right to left of the spectrum.
[0078] Fig. 9 is a schematic diagram of the spectrum peak of the embodiment of the present application. Taking the spectrum peak position as the peak vertex position, the preset height as 1 / 2 of the peak vertex height Hi, and the spectrum peak width corresponding to the preset height as the half-height width as an example, the clustering method is exemplarily described. Fig. 9As shown, for peak peak1, the sum of the abscissa of the peak apex and the half-width is the abscissa coordinate value xa1, and for peak peak2 adjacent to the right side of peak peak1, the difference between the abscissa of the peak apex and the half-width is the abscissa coordinate value xb2. Since xa1 is less than xb2, peak peak1 and peak peak2 belong to different peak clusters.
[0079] like Fig. 9 As shown, for peak peak2, the sum of the abscissa of the peak apex and the half-width is the horizontal axis coordinate value xa2, and for peak peak3 adjacent to the right side of peak peak2, the difference between the abscissa of the peak apex and the half-width is the horizontal axis coordinate value xb3. Since xa2 is greater than xb3, peaks peak2 and peak3 belong to the same peak cluster.
[0080] In some embodiments, when clustering the spectrum peaks, clustering can be performed from left to right, or from right to left, or from the middle of the spectrum to the left and right at the same time, and so on.
[0081] Fig.10 1 is a schematic diagram of the process of spectral peak clustering in the embodiment of the present application. Taking the preset height as 1 / 2 of the peak vertex height Hi, the spectral peak width corresponding to the preset height as the half-height width, and clustering from left to right as an example, the process of spectral peak clustering is exemplarily described. Fig.10 As shown in the figure, the process of peak clustering includes:
[0082] Operation 1001, selecting the first spectrum peak on the left as the current peak;
[0083] Operation 1002, taking the spectrum peak cluster where the current peak is located as the current spectrum peak cluster;
[0084] Operation 1003, determining whether the current peak is the first peak of the current spectrum peak cluster, if the determination result is yes, executing operation 1004, otherwise executing operation 1005;
[0085] Operation 1004, using the peak start point and peak end point of the current peak as the start point and end point of the current spectrum peak cluster;
[0086] Operation 1005, determining whether there is a peak adjacent to the right side of the current peak, if the determination result is yes, executing operation 1006, otherwise executing operation 1011;
[0087] Operation 1006, calculating the sum SumC of the spectrum peak position and the half-height width of the current peak;
[0088] Operation 1007, calculating the difference DifS between the peak position and the half-height width of the peak adjacent to the right side of the current peak;
[0089] Operation 1008, determining whether the sum SumC of the peak position and the half-height width of the current peak is less than or equal to the difference DifS between the peak position and the half-height width of the adjacent peak on the right side of the current peak. If the determination result is yes, executing operation 1009, otherwise executing operation 1010;
[0090] Operation 1009, recording the start and end points of the current spectrum peak cluster, the clustering of the current spectrum peak cluster is finished, the peak of the adjacent peak on the right is taken as the current peak, and the process returns to operation 1002;
[0091] Operation 1010, taking the peak end point of the right adjacent peak as the end point of the current cluster, taking the peak of the right adjacent peak as the current peak, and returning to operation 1002;
[0092] Operation 1011, returning the spectrum peak cluster information.
[0093] In some embodiments, the spectrum peak cluster information may include, for example, the starting point information and the ending point information of each spectrum peak cluster. The starting point information is, for example, the horizontal coordinate value of the peak starting point of the first spectrum peak in the spectrum peak cluster, and the ending point information is, for example, the horizontal coordinate value of the peak ending point of the last spectrum peak in the spectrum peak cluster. When only one spectrum peak is included in the spectrum peak cluster, the spectrum peak cluster information may include the horizontal coordinate value of the peak starting point and the horizontal coordinate value of the peak ending point of the spectrum peak. The present application is not limited to this, and the spectrum peak cluster information may also include other information.
[0094] Fig.11 FIG. 1 is a schematic diagram of the spectral peak clusters after clustering in the embodiment of the present application. Fig.11 As shown in the figure, the peaks of the spectrum are clustered into 8 peak clusters. The higher the compactness of adjacent peaks, the easier it is to cluster them into one peak cluster; the lower the compactness of adjacent peaks, the less likely they are to cluster into one peak cluster. The distance between the peak positions of two adjacent peaks can be used to represent the compactness of the two adjacent peaks. For example, the larger the distance between the adjacent peak positions, the smaller the compactness; the smaller the distance between the adjacent peak positions, the greater the compactness.
[0095] In some embodiments, the parameters of the clustering process can be appropriately adjusted according to the requirements for the compactness of each spectral peak in the same spectral peak cluster, so that the spectral peak cluster generated by the clustering process can better adapt to subsequent analysis or processing. Among them, the maximum distance between the spectral peak positions of two adjacent spectral peaks in the same spectral peak cluster can be used to represent the requirements for the compactness of each spectral peak in the same spectral peak cluster. For example, the larger the maximum distance between adjacent spectral peak positions, the lower the requirements for the compactness of each spectral peak clustered into the same spectral peak cluster; the smaller the maximum distance between adjacent spectral peak positions, the higher the requirements for the compactness of each spectral peak clustered into the same spectral peak cluster.
[0096] In some embodiments, the preset height can be adjusted according to the requirement for compactness of the peaks in the same peak cluster, that is, the preset height can be adjusted according to the maximum distance between the peak positions of two adjacent peaks in the same peak cluster.
[0097] For example, the higher the preset height, the smaller the spectral peak width corresponding to the preset height, and the greater the possibility that the sum of the spectral peak position and spectral peak width of the current peak is less than or equal to the difference between the spectral peak position and spectral peak width of the adjacent peak on the right. Therefore, the two adjacent spectral peaks are less likely to be clustered into the same spectral peak cluster, and thus, the higher the demand for the compactness of each spectral peak in the same spectral peak cluster.
[0098] On the contrary, the lower the preset height is, the larger the spectral peak width corresponding to the preset height is, and the greater the possibility that the sum of the spectral peak position and spectral peak width of the current peak is greater than the difference between the spectral peak position and spectral peak width of the adjacent peak on the right. Therefore, the two adjacent spectral peaks are more likely to be clustered into the same spectral peak cluster, and thus, the requirement for the compactness of each spectral peak in the same spectral peak cluster is lower.
[0099] Therefore, the lower the requirement for the compactness of each spectral peak in the same spectral peak cluster (the larger the maximum distance), the lower the preset height can be set; the higher the requirement for the compactness of each spectral peak in the same spectral peak cluster (the smaller the maximum distance), the higher the preset height can be set.
[0100] In some embodiments, the spectral peak width used for clustering processing may be a width adjusted by an adjustment coefficient. The adjustment coefficient may be set according to the requirement for the compactness of each spectral peak in the same spectral peak cluster, that is, the adjustment coefficient may be set according to the maximum distance between the spectral peak positions of two adjacent spectral peaks in the same spectral peak cluster.
[0101] For example, the smaller the adjustment coefficient is, the smaller the spectral peak width is after adjustment, and the greater the possibility that the sum of the spectral peak position and spectral peak width of the current peak is less than or equal to the difference between the spectral peak position and spectral peak width of the adjacent peak on the right. Therefore, the two adjacent spectral peaks are less likely to be clustered into the same spectral peak cluster, and thus, the higher the demand for the compactness of each spectral peak in the same spectral peak cluster.
[0102] On the contrary, the larger the adjustment coefficient is, the larger the spectral peak width after adjustment is, and the greater the possibility that the sum of the spectral peak position and spectral peak width of the current peak is greater than the difference between the spectral peak position and spectral peak width of the adjacent peak on the right. Therefore, the two adjacent spectral peaks are more likely to be clustered into the same spectral peak cluster, and thus, the requirement for the compactness of each spectral peak in the same spectral peak cluster is lower.
[0103] Therefore, the lower the requirement for the compactness of each spectral peak in the same spectral peak cluster (the larger the maximum distance), the larger the adjustment coefficient can be set; the higher the requirement for the compactness of each spectral peak in the same spectral peak cluster (the smaller the maximum distance), the smaller the adjustment coefficient can be set.
[0104] In some embodiments, the adjustment coefficient may be a value greater than 0. For example, the adjustment coefficient may be greater than or equal to 0.5 and less than or equal to 2. For example, the adjustment coefficient may be set to 1, in which case the spectrum peak width is not adjusted.
[0105] In some embodiments, Figure 1 As shown, the method for clustering the spectrum graph may also include:
[0106] Operation 103: smoothing the spectrum.
[0107] Fig.12 is a schematic diagram of a spectrum after smoothing processing in an embodiment of the present application. Fig.12 As shown, by smoothing the spectrum, noise components such as burrs in the spectrum can be eliminated, which helps to improve the accuracy of clustering processing.
[0108] In some embodiments, smoothing can be performed in various ways. For example, the smoothing can include multi-point average smoothing or Savitzky-Golay smoothing. The specific method of smoothing can be referred to the relevant technology, which will not be described here. In addition, the present application is not limited to this. For example, the method of clustering the spectrum may not include smoothing the spectrum, or the noise component of the spectrum may be eliminated in other ways.
[0109] In some embodiments, Figure 1 As shown, the clustering processing method of the spectrum graph may also include:
[0110] In operation 104, a first baseline of the spectrum is removed.
[0111] By removing the first baseline of the spectrum, the baseline drift of the spectrum can be reduced, which helps to improve the accuracy of clustering processing.
[0112] In some embodiments, before clustering, operation 104 may be performed to remove the first baseline of the spectrum, that is, to perform preliminary baseline correction, for example, taking the entire spectrum as a unit, calculating the first baseline of the spectrum, and performing baseline correction based on the first baseline; after clustering, the second baseline of the spectrum may be further removed, for example, according to the result of clustering, taking each spectrum peak cluster as a unit, calculating the baseline of the spectrum peak cluster respectively, and combining the baselines of all spectrum peak clusters in the spectrum to form the second baseline of the entire spectrum, thereby enabling further baseline correction. Two baseline corrections help improve the accuracy of subsequent processing and analysis.
[0113] Fig.13 is a schematic diagram of the process of operation 104 of an embodiment of the present application, Fig.14 is a schematic diagram of the spectral point sequence and the first baseline of an embodiment of the present application, Fig.15 is a schematic diagram of a spectrum with the first baseline removed in an embodiment of the present application. Fig.13 As shown, operation 104 may include:
[0114] Operation 1041, generating an initial baseline C0 for the spectrum point sequence P1 of the spectrum graph;
[0115] like Fig.14 As shown, the spectral point sequence P1 may be a spectral point sequence obtained by smoothing the original spectral point sequence;
[0116] Operation 1042, interpolating the initial baseline C0 to obtain the first baseline C1 ( Fig.14 )
[0117] In some embodiments, the initial baseline C0 may be interpolated in various ways. For specific interpolation methods, reference may be made to related technologies.
[0118] Operation 1043, the first baseline C1 is subtracted from the spectrum point sequence P1 of the spectrogram to obtain a preliminary baseline-corrected spectrum point sequence P2 ( Fig.15 In the subsequent clustering process, for example, in the above operation 101, operations such as spectrum peak detection may be performed on the spectrum point sequence P2 of the spectrum graph.
[0119] In some embodiments, the first baseline of the spectrogram can be determined in various ways. For example, the background formation method based on the minimum slope, the adaptive iterative weighted penalty least squares background subtraction method (airPLS algorithm), the fully automatic background subtraction method (FABC algorithm), the progressive least squares background subtraction method (ALS algorithm), or the quantile regression background subtraction method, etc. The specific method for determining the first baseline can refer to the relevant technology, which will not be described here. In addition, the application is not limited to this. For example, the method of clustering the spectrogram may not remove the first baseline of the spectrogram, or the first baseline of the spectrogram may be removed in other ways.
[0120] The above only describes the steps or processes related to the present application, but the present application is not limited thereto. The method of clustering the spectrum graph may also include other steps or processes, and the specific contents of these steps or processes may refer to the relevant technology.
[0121] The above embodiments are merely exemplary of the embodiments of the present application, but the present application is not limited thereto, and appropriate modifications may be made based on the above embodiments. For example, the above embodiments may be used alone, or one or more of the above embodiments may be combined.
[0122] It can be seen from the above embodiments that the peak position of the peak and the peak width corresponding to the preset height are obtained through peak detection, and the detected peaks are clustered according to the acquired peak position and peak width to generate a peak cluster including at least one peak. This can improve the accuracy of the peak clustering results, and the calculations involved in the clustering process are simple, which is convenient for software and hardware implementation.
[0123] Embodiments of the second aspect
[0124] The present application provides a method for baseline correction of a spectrum, and the contents that are the same as those in the embodiment of the first aspect will not be repeated. Fig.16 is a schematic diagram of a baseline correction method for a spectrum in an embodiment of the present application, such as Fig.16 As shown, the method includes:
[0125] Operation 1601, detecting a spectrum peak of a spectrum graph, obtaining a spectrum peak position of the spectrum peak and a spectrum peak width corresponding to a preset height;
[0126] Operation 1602, clustering the spectrum peaks according to the spectrum peak positions and the spectrum peak widths to generate a spectrum peak cluster including at least one spectrum peak; and
[0127] In operation 1603, baseline correction is performed on each spectral peak cluster.
[0128] According to the above embodiment, the peak position of the peak and the peak width corresponding to the preset height are obtained through peak detection, and the detected peaks are clustered according to the obtained peak position and peak width to generate a peak cluster including at least one peak, which can improve the accuracy of the peak clustering result. The calculation involved in the clustering process is simple, which is convenient for software and hardware implementation; and, by performing baseline correction processing on each peak cluster generated by clustering, it is beneficial to use the local baseline characteristics of each peak cluster itself to perform targeted baseline correction on each peak cluster, avoid mutual influence between different peak clusters, thereby improving the accuracy of baseline correction processing. In addition, by performing baseline correction processing on each peak cluster generated by clustering, it is helpful to reduce the delay of baseline correction processing, which can be applied to real-time processing. For example, after each peak cluster flows out, the peak cluster can be baseline corrected immediately without waiting for the entire spectrum.
[0129] It is worth noting that the above Fig.16 The embodiments of the present application are only schematically described, but the present application is not limited thereto. For example, the execution order of the various operations can be appropriately adjusted, and other operations can be added or some operations can be reduced. Those skilled in the art can make appropriate modifications based on the above content, and are not limited to the above appended Fig.16 Records of.
[0130] In some embodiments, operation 1601 and operation 1602 may be operation 101 and operation 102 of the embodiment of the first aspect.
[0131] In some embodiments, the baseline correction method of the spectrum may further include: smoothing the spectrum, and / or removing the first baseline of the spectrum. The smoothing operation and the removal of the first baseline of the spectrum may be operations 103 and 104 of the embodiment of the first aspect.
[0132] In some embodiments, in operation 1603, the baseline of each spectrum peak cluster may be calculated separately in the spectrum peak cluster, and the baselines of all spectrum peak clusters may be combined to form the baseline of the entire spectrum.
[0133] In some embodiments, in operation 1603, when calculating the baseline of each spectral peak cluster respectively, the baseline calculation method used by each spectral peak cluster may be different. Thus, it is possible to adopt a suitable calculation method for each spectral peak cluster in a targeted manner, which helps to improve the accuracy of baseline correction. The present application is not limited to this, and the baseline calculation method used by each spectral peak cluster may also be the same.
[0134] In some embodiments, the baseline of the spectral peak cluster can be determined in various ways. For example, a background formation method based on minimum slope, an adaptive iterative weighted penalty least squares background subtraction method (airPLS algorithm), a fully automatic background subtraction method (FABC algorithm), a progressive least squares background subtraction method (ALS algorithm), or a quantile regression background subtraction method, etc. For the specific method of determining the baseline, reference can be made to the relevant technology, which will not be described in detail here.
[0135] In some embodiments, Fig.16 As shown, after the spectral peaks of the spectrum are clustered to generate spectral peak clusters, baseline correction processing can be performed based on the spectral peak clusters. The present application is not limited to this. For example, after the spectral peaks of the spectrum are clustered to generate spectral peak clusters, other subsequent processing or analysis can also be performed based on the spectral peak clusters, such as component analysis.
[0136] The above only describes the steps or processes related to the present application, but the present application is not limited thereto. The method of clustering the spectrum graph may also include other steps or processes, and the specific contents of these steps or processes may refer to the relevant technology.
[0137] The above embodiments are merely exemplary of the embodiments of the present application, but the present application is not limited thereto, and appropriate modifications may be made based on the above embodiments. For example, the above embodiments may be used alone, or one or more of the above embodiments may be combined.
[0138] It can be seen from the above embodiments that by obtaining the peak position of the peak and the peak width corresponding to the preset height through peak detection, clustering the detected peaks according to the obtained peak position and peak width, and generating a peak cluster including at least one peak, the accuracy of the peak clustering result can be improved, and the calculation involved in the clustering process is simple, which is convenient for software and hardware implementation; and, by performing baseline correction processing on each peak cluster generated by clustering, it is beneficial to utilize the local baseline characteristics of each peak cluster itself, perform targeted baseline correction on each peak cluster, avoid mutual influence between different peak clusters, and thus improve the accuracy of baseline correction processing. In addition, by performing baseline correction processing on each peak cluster generated by clustering, it is helpful to reduce the delay of baseline correction processing, and it can be suitable for real-time processing. For example, after each peak cluster flows out, the peak cluster can be baseline corrected immediately without waiting for the entire spectrum.
[0139] Embodiments of the third aspect
[0140] The present application provides a device for clustering a spectrogram, and the contents that are the same as those in the embodiment of the first aspect will not be repeated here.
[0141] Fig.17is a schematic diagram of a device for clustering a spectrum according to an embodiment of the present application, such as Fig.17 As shown, the device 1700 for clustering the spectrum graph includes:
[0142] A detection unit 1701 detects a spectrum peak of the spectrum graph, and obtains a spectrum peak position of the spectrum peak and a spectrum peak width corresponding to a preset height; and
[0143] The clustering unit 1702 clusters the spectrum peaks according to the spectrum peak positions and the spectrum peak widths to generate a spectrum peak cluster including at least one spectrum peak.
[0144] In some embodiments, the spectral peak position includes: a position corresponding to the peak apex of the spectral peak; or a position corresponding to the centroid of the spectral peak; or a position corresponding to the area bisector of the spectral peak; or half of the sum of the positions corresponding to the peak start point and the peak end point of the spectral peak.
[0145] In some embodiments, the spectrum peak width is the absolute value of the difference between the first value and the second value, wherein the first value and the second value are as follows:
[0146] In the case where there is no first spectrum point with the preset height from the peak starting point to the peak apex of the spectrum peak, the first value is the position corresponding to the peak starting point; in the case where there is a first spectrum point with the preset height from the peak starting point to the peak apex of the spectrum peak, the first value is the position corresponding to the first spectrum point;
[0147] When there is no second spectrum point with the preset height from the peak apex to the peak end point of the spectrum peak, the second value is the position corresponding to the peak end point. When there is a second spectrum point with the preset height from the peak apex to the peak end point of the spectrum peak, the second value is the position corresponding to the second spectrum point.
[0148] In some embodiments, when the sum of the peak position of a current spectrum peak and the peak width of the current spectrum peak is greater than the difference between the peak position of an adjacent spectrum peak in the positive direction of the coordinate system of the current spectrum peak and the peak width of the adjacent spectrum peak, the current spectrum peak and the adjacent spectrum peak belong to the same spectrum peak cluster; when the sum of the peak position of the current spectrum peak and the peak width of the current spectrum peak is less than or equal to the difference between the peak position of an adjacent spectrum peak in the positive direction of the coordinate system of the current spectrum peak and the peak width of the adjacent spectrum peak, the current spectrum peak and the adjacent spectrum peak belong to different spectrum peak clusters.
[0149] In some embodiments, the preset height is adjusted according to the requirement for the compactness of the spectral peaks in the same spectral peak cluster.
[0150] In some embodiments, the preset height is half of the height of the spectrum at the peak position.
[0151] In some embodiments, the spectral peak width is the width adjusted by an adjustment coefficient.
[0152] In some embodiments, the adjustment coefficient is set according to the requirement for the compactness of each spectral peak in the same spectral peak cluster.
[0153] In some embodiments, the adjustment coefficient is greater than or equal to 0.5 and less than or equal to 2.
[0154] In some embodiments, the apparatus further includes: a smoothing unit 1703 for smoothing the spectrum; and / or a first correction unit 1704 for removing a first baseline of the spectrum.
[0155] It is worth noting that the above only describes the components or modules related to the present application, but the present application is not limited thereto. The device 1700 for clustering spectrum graphs may also include other components or modules, and the specific contents of these components or modules may refer to the relevant technology.
[0156] To keep it simple, Fig.17 The connection relationship or signal direction between various components or modules is only exemplified, but it should be clear to those skilled in the art that various related technologies such as bus connection can be used. The above-mentioned various components or modules can be implemented by hardware facilities such as processors and memories; the embodiments of the present application are not limited to this.
[0157] The above embodiments are merely exemplary of the embodiments of the present application, but the present application is not limited thereto, and appropriate modifications may be made based on the above embodiments. For example, the above embodiments may be used alone, or one or more of the above embodiments may be combined.
[0158] It can be seen from the above embodiments that the peak position of the peak and the peak width corresponding to the preset height are obtained through peak detection, and the detected peaks are clustered according to the acquired peak position and peak width to generate a peak cluster including at least one peak. This can improve the accuracy of the peak clustering results, and the calculations involved in the clustering process are simple, which is convenient for software and hardware implementation.
[0159] Embodiments of the fourth aspect
[0160] The present application provides a device for baseline correction of a spectrum, and the contents that are the same as those of the embodiments of the first to third aspects will not be repeated.
[0161] Fig.18 is a schematic diagram of a device for baseline correction of a spectrum in an embodiment of the present application, such as Fig.18As shown, the apparatus 1800 for baseline correction of the spectrum includes:
[0162] A detection unit 1801 detects a spectrum peak of the spectrum graph, and obtains a spectrum peak position of the spectrum peak and a spectrum peak width corresponding to a preset height;
[0163] a clustering unit 1802, which clusters the spectrum peaks according to the spectrum peak positions and the spectrum peak widths to generate a spectrum peak cluster including at least one spectrum peak; and
[0164] The correction unit 1803 performs baseline correction processing on each spectral peak cluster.
[0165] In some embodiments, the detection unit 1801 and the clustering unit 1802 may be the detection unit 1701 and the clustering unit 1702 of the embodiment of the third aspect.
[0166] In some embodiments, Fig.18 As shown, the apparatus 1800 for baseline correction of a spectrum may further include: a smoothing unit 1804, which performs smoothing processing on the spectrum, and / or a first correction unit 1805, which removes the first baseline of the spectrum. The smoothing unit 1804 and the first correction unit 1805 may be the smoothing unit 1703 and the first correction unit 1704 of the embodiment of the third aspect.
[0167] In some embodiments, the baseline of each spectrum peak cluster may be calculated separately in the spectrum peak cluster, and the baselines of all spectrum peak clusters may be combined to form the baseline of the entire spectrum.
[0168] In some embodiments, when calculating the baseline of each spectral peak cluster respectively, the baseline calculation method used by each spectral peak cluster may be different. Thus, it is possible to adopt a suitable calculation method for each spectral peak cluster in a targeted manner, which helps to improve the accuracy of baseline correction. The present application is not limited to this, and the baseline calculation method used by each spectral peak cluster may also be the same.
[0169] In some embodiments, the baseline of the spectrogram can be determined in various ways. For example, a background formation method based on minimum slope, an adaptive iterative weighted penalty least squares background subtraction method (airPLS algorithm), a fully automatic background subtraction method (FABC algorithm), a progressive least squares background subtraction method (ALS algorithm), or a quantile regression background subtraction method. The specific method for determining the baseline can be referred to the relevant technology, which will not be described here.
[0170] It is worth noting that the above only describes the components or modules related to the present application, but the present application is not limited thereto. The apparatus 1800 for baseline correction of a spectrum may also include other components or modules, and the specific contents of these components or modules may refer to the relevant technology.
[0171] To keep it simple, Fig.18 The connection relationship or signal direction between various components or modules is only exemplified, but it should be clear to those skilled in the art that various related technologies such as bus connection can be used. The above-mentioned various components or modules can be implemented by hardware facilities such as processors and memories; the embodiments of the present application are not limited to this.
[0172] The above embodiments are merely exemplary of the embodiments of the present application, but the present application is not limited thereto, and appropriate modifications may be made based on the above embodiments. For example, the above embodiments may be used alone, or one or more of the above embodiments may be combined.
[0173] It can be seen from the above embodiments that by obtaining the peak position of the peak and the peak width corresponding to the preset height through peak detection, clustering the detected peaks according to the obtained peak position and peak width, and generating a peak cluster including at least one peak, the accuracy of the peak clustering result can be improved, and the calculation involved in the clustering process is simple, which is convenient for software and hardware implementation; and, by performing baseline correction processing on each peak cluster generated by clustering, it is beneficial to utilize the local baseline characteristics of each peak cluster itself, perform targeted baseline correction on each peak cluster, avoid mutual influence between different peak clusters, and thus improve the accuracy of baseline correction processing. In addition, by performing baseline correction processing on each peak cluster generated by clustering, it is helpful to reduce the delay of baseline correction processing, and it can be suitable for real-time processing. For example, after each peak cluster flows out, the peak cluster can be baseline corrected immediately without waiting for the entire spectrum.
[0174] Embodiments of the fifth aspect
[0175] The present application provides an electronic device, including a device for clustering a spectrum as described in the embodiment of the third aspect or a device for baseline correction of a spectrum as described in the embodiment of the fourth aspect, the contents of which are incorporated herein. The electronic device may be, for example, a spectrum analyzer, a computer, a server, a workstation, a laptop computer, a smart phone, and the like.
[0176] Fig.19 Schematic diagram of the electronic device of the present application embodiment. Fig.19 As shown, the electronic device 1900 may include: a processor 1901 (such as a central processing unit CPU) and a memory 1902; the memory 1902 is coupled to the processor 1901. The memory 1902 can store various data; in addition, it also stores information processing programs, and executes the programs under the control of the processor 1901.
[0177] For example, the processor 1901 may be configured to execute a program to implement the method described in the first aspect or the second aspect. For example, the processor 1901 may be configured to perform the following control: detecting the spectral peak of the spectrogram, obtaining the spectral peak position of the spectral peak and the spectral peak width corresponding to the preset height; and clustering the spectral peaks according to the spectral peak position and the spectral peak width to generate a spectral peak cluster including at least one spectral peak; or, detecting the spectral peak of the spectrogram, obtaining the spectral peak position of the spectral peak and the spectral peak width corresponding to the preset height; clustering the spectral peaks according to the spectral peak position and the spectral peak width to generate a spectral peak cluster including at least one spectral peak; and performing baseline correction processing on each spectral peak cluster.
[0178] In addition, if Fig.19 As shown, the electronic device 1900 may also include: a transceiver 1903 and an antenna 1904, etc.; wherein the functions of the above components are similar to those of the prior art and are not described in detail here. It is worth noting that the electronic device 1900 does not necessarily have to include Fig.19 In addition, the electronic device 1900 may also include Fig.19 For components not shown in the figure, reference may be made to the related art.
[0179] An embodiment of the present application also provides a computer-readable program, wherein when the program is executed in an electronic device, the program causes a computer to perform the method for clustering processing of spectrograms as described in the embodiment of the first aspect in the electronic device.
[0180] An embodiment of the present application also provides a computer-readable program, wherein when the program is executed in an electronic device, the program causes a computer to execute the method for baseline correction of a spectrum as described in the embodiment of the second aspect in the electronic device.
[0181] An embodiment of the present application also provides a storage medium storing a computer-readable program, wherein the computer-readable program enables a computer to execute the method for clustering a spectrogram as described in the embodiment of the first aspect in an electronic device.
[0182] An embodiment of the present application also provides a storage medium storing a computer-readable program, wherein the computer-readable program enables a computer to execute the method for baseline correction of a spectrum as described in the embodiment of the third aspect in an electronic device.
[0183] The above devices and methods of the present application can be implemented by hardware, or by hardware combined with software. The present application relates to such a computer-readable program, which, when executed by a logic component, enables the logic component to implement the above-mentioned devices or components, or enables the logic component to implement the various methods or steps described above. The present application also relates to a storage medium for storing the above program, such as a hard disk, a magnetic disk, an optical disk, a DVD, a flash memory, etc.
[0184] The method / device described in conjunction with the embodiments of the present application may be directly embodied as hardware, a software module executed by a processor, or a combination of the two. For example, one or more of the functional block diagrams shown in the figure and / or one or more combinations of the functional block diagrams may correspond to various software modules of the computer program flow or to various hardware modules. These software modules may correspond to the various steps shown in the figure, respectively. These hardware modules may be implemented by solidifying these software modules, for example, using a field programmable gate array (FPGA).
[0185] The software module may be located in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. A storage medium may be coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium; or the storage medium may be an integral part of the processor. The processor and the storage medium may be located in an ASIC. The software module may be stored in a memory of a mobile terminal or in a memory card that can be inserted into the mobile terminal. For example, if a device (such as a mobile terminal) uses a large-capacity MEGA-SIM card or a large-capacity flash memory device, the software module may be stored in the MEGA-SIM card or the large-capacity flash memory device.
[0186] For one or more of the functional blocks described in the drawings and / or one or more combinations of functional blocks, it can be implemented as a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component or any appropriate combination thereof for performing the functions described in the present application. For one or more of the functional blocks described in the drawings and / or one or more combinations of functional blocks, it can also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in communication with a DSP, or any other such configuration.
[0187] The present application is described above in conjunction with specific implementation methods, but it should be clear to those skilled in the art that these descriptions are exemplary and are not intended to limit the scope of protection of the present application. Those skilled in the art can make various modifications and variations to the present application based on the principles of the present application, and these modifications and variations are also within the scope of the present application.
Claims
1. A method for clustering a spectrum, characterized in that: The method comprises: Detecting a peak of the spectrum graph, obtaining a peak position of the peak and a peak width corresponding to a preset height; and The spectral peaks are clustered according to the spectral peak positions and the spectral peak widths to generate a spectral peak cluster including at least one spectral peak.
2. The method according to claim 1, characterized in that: The peak positions include: The position corresponding to the peak apex of the spectral peak; or The position corresponding to the centroid of the spectral peak; or The position corresponding to the area bisector of the spectrum peak; or One half of the sum of the positions corresponding to the peak start point and the peak end point of the spectrum peak.
3. The method according to claim 1, characterized in that The peak width is the absolute value of the difference between the first value and the second value, wherein the first value and the second value are as follows: In the case where there is no first spectrum point with the preset height from the peak starting point to the peak apex of the spectrum peak, the first value is the position corresponding to the peak starting point; in the case where there is a first spectrum point with the preset height from the peak starting point to the peak apex of the spectrum peak, the first value is the position corresponding to the first spectrum point; When there is no second spectrum point with the preset height from the peak apex to the peak end point of the spectrum peak, the second value is the position corresponding to the peak end point. When there is a second spectrum point with the preset height from the peak apex to the peak end point of the spectrum peak, the second value is the position corresponding to the second spectrum point.
4. The method according to claim 3, characterized in that When the number of the first spectrum points is more than one, the position corresponding to the first spectrum point is a minimum value among the positions of the more than one first spectrum points; When the number of the second spectrum points is greater than one, the position corresponding to the second spectrum point is the maximum value among the positions of the greater than one second spectrum point.
5. The method according to claim 1, characterized in that Clustering the spectrum peaks according to the spectrum peak positions and the spectrum peak widths to generate a spectrum peak cluster including at least one spectrum peak comprises: When the sum of the peak position of the current peak and the peak width of the current peak is greater than the difference between the peak position of an adjacent peak in the positive direction of the coordinate system of the current peak and the peak width of the adjacent peak, the current peak and the adjacent peak belong to the same peak cluster; When the sum of the peak position of a current peak and the peak width of the current peak is less than or equal to the difference between the peak position of an adjacent peak in the positive direction of the coordinate system of the current peak and the peak width of the adjacent peak, the current peak and the adjacent peak belong to different peak clusters.
6. The method according to claim 1, characterized in that The preset height is adjusted according to the requirement for the compactness of each spectral peak in the same spectral peak cluster.
7. The method according to claim 1, characterized in that The preset height is half of the height of the spectrum at the peak position.
8. The method according to claim 1, characterized in that The spectral peak width is the width adjusted by the adjustment coefficient.
9. The method according to claim 8, characterized in that The adjustment coefficient is set according to the requirement on the compactness of each spectral peak in the same spectral peak cluster.
10. The method according to claim 8, characterized in that The adjustment coefficient is greater than or equal to 0.5 and less than or equal to 2.
11. The method according to claim 1, characterized in that: The method further comprises: Smoothing the spectrum; and / or The first baseline of the spectrum was removed.
12. A method for baseline correction of a spectrum, characterized in that: The method comprises: Detecting a peak of the spectrum graph, and obtaining a peak position of the peak and a peak width corresponding to a preset height; Clustering the spectrum peaks according to the spectrum peak positions and the spectrum peak widths to generate a spectrum peak cluster including at least one spectrum peak; and Baseline correction was performed on each spectral peak cluster.
Citation Information
Patent Citations
Systems and methods to process and group chromatographic peaks
CN104053989A
Method for identifying Raman spectrogram
CN108241846A
Technique for peak width determination and baseline offset estimation in acquisition stage
CN115136140A
Toner for developing electrostatic charge image
JP1996334920A
Peak identifying method based on peak gravity center
JP2018096723A
Cited By
Clustering algorithm-based peak detection method and system, and medium
CN122332995A
A peak detection method, system and medium based on a clustering algorithm
CN122332995B
