A near infrared spectroscopy data correction method based on median matrix coefficients
By using a near-infrared spectral data correction method based on median matrix coefficients, the problems of unstable spectral data and low accuracy in miniaturized near-infrared detection are solved, thereby improving detection accuracy and stability.
Patent Information
- Application Number
- CN202210656860.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-10
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-06-10
AI Technical Summary
Miniaturized near-infrared spectrometers have weak spectral data stability and low precision, which affects detection accuracy.
A near-infrared spectral data correction method based on median matrix coefficients is adopted. By obtaining the median point as a reference, the median matrix coefficients are calculated to correct the spectral data.
It improves the data stability and detection accuracy of miniaturized near-infrared detection technology and solves the problem of easy shift in spectral data.
Smart Images

Figure CN114878512B_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the technical field of spectral data correction, and in particular to a near-infrared spectral data correction method based on median matrix coefficients. Background Art
[0002] Miniaturized near-infrared spectrometers are small and inexpensive, but due to the limitations of their own hardware conditions, the stability of their spectral data is weak and the accuracy is low. Especially in the actual application of miniaturized near-infrared detection, the spectral data acquisition process requires extremely precise, irregular acquisition process, uneven contact between equipment and samples during acquisition, changes in the acquisition environment and other factors can easily cause spectral data deviation, thereby affecting the prediction ability of the spectral model and reducing the detection accuracy of sample detection. Therefore, solving the problem of unstable spectral data and low accuracy in miniaturized near-infrared detection technology has become an urgent problem to be solved. Summary of the invention
[0003] The technical problems to be solved by the present invention are:
[0004] The invention provides a near infrared spectrum data correction method based on median matrix coefficients to solve the problems of unstable spectrum data and low precision existing in miniaturized near infrared detection technology.
[0005] The technical solution adopted by the present invention to solve the above technical problems is as follows:
[0006] A near infrared spectrum data correction method based on median matrix coefficients comprises the following steps:
[0007] Step 1: Obtain the median point of the near-infrared spectrometer band range and set the median point as the reference correction point;
[0008] Step 2: Arrange the wavelength points according to the number of wavelength points and the number of median points of the spectrometer;
[0009] Step 3: Reorganize the wavelength point matrix according to the wavelength point arrangement of the spectrometer to obtain the median matrix;
[0010] Step 4: Use the spectrometer to collect sample spectrum data, write the light intensity value of the reference correction point into the median matrix, and calculate the light intensity values of the remaining wavelength points in the median matrix;
[0011] Step 5: Calculate the matrix coefficients of the median matrix after writing the light intensity value;
[0012] Step 6: Obtain the median matrix of the sample spectrum to be corrected, and correct the sample spectrum to be corrected in combination with the matrix coefficients obtained in step 5.
[0013] Furthermore, the specific arrangement of the wavelength points in step 2 is as follows: if the selected wavelength range is λ1 to λ2, the number of wavelength points M is calculated according to the resolution of the spectrometer, and after deducting 4 median points and 2 extreme points, the remaining number of wavelength points is M1, and the wavelength difference S between each two adjacent wavelength points is calculated as (λ2-λ1) / (M1+1), and the specific wavelength value H of each wavelength point is obtained respectively. n =λ1+n*S; n≤M1, where n is the number of wavelength points arranged in sequence, and the remaining M1 wavelength points after deducting the median point and the extreme point are arranged in ascending order of wavelength as H1nm, H2nm, ...H n nm.
[0014] Furthermore, the M wavelength points are reorganized into a matrix. If an m*m square matrix can be formed, the method for implementing step 3 is as follows: the four median points are placed at the four diagonals of the matrix respectively, and the wavelength points other than the median point are placed into the matrix in the order of wavelength from small to large in step 2, starting from the first row and the second column. After the first row is full, the second row is arranged in the same way until all the wavelength points are placed into the matrix to form an m*m median matrix.
[0015] Further, the M wavelength points are reorganized into a matrix. When the M wavelength points cannot form an m*m matrix, there are three cases for implementing step 3. If M<(m+1)*m, it is necessary to add a row or a column to the m*m square matrix, and the reorganized median matrix is an m*(m+1) or (m+1)*m matrix. The wavelength points except the median point are placed in the matrix in sequence according to the arrangement method in step 2. The positions where there are no wavelength points are filled with null values, and the median points are adjusted in order. The four median points are located at the four diagonal points of the m*m square matrix. If M=(m+1)*m, it is necessary to add a row or a column to the m*m square matrix for arrangement, and the reorganized median matrix is an m* A square matrix of (m+1) or (m+1)*m, the four median points are located at the four diagonal points of the m*(m+1) or (m+1)*m square matrix, and the wavelength points other than the median point are placed in the matrix in the order of arrangement in step 2; if M>(m+1)*m, it is necessary to add a row and a column to the square matrix exceeding the m*m to arrange it, and the wavelength points other than the median point are placed in the matrix in the order of arrangement in step 2, and the reorganized median matrix is a (m+1)*(m+1) matrix, and the positions where no wavelength points are arranged are filled with null values, and the median points are adjusted in order, and the four median points are located at the four diagonal points of the m*(m+1) or (m+1)*m square matrix.
[0016] Furthermore, if the M wavelength points can just form an m*m square matrix, the method for implementing step 4 is: write the light intensity values of the four median points into the median matrix respectively, where P1 is the light intensity value of the median point in the upper left corner of the median matrix, P2 is the light intensity value of the median point in the upper right corner of the median matrix, P3 is the light intensity value of the median point in the lower left corner of the median matrix, and P4 is the light intensity value of the median point in the lower right corner of the median matrix. The light intensity values A of each wavelength point excluding the median point in the first row of the matrix are a The light intensity C is calculated for each wavelength point except the median point in the mth row. c The calculation methods are:
[0017]
[0018] Where a is the ath wavelength point in the first row of the median matrix excluding the median point; c is the cth wavelength point in the mth row of the median matrix excluding the median point; then use the light intensity value A obtained from the first and mth rows a And light intensity C c Calculate the light intensity values at all wavelength points in the matrix.
[0019] Furthermore, if the M wavelength points cannot form an m*m square matrix, the method for implementing step 4 is as follows: the calculation method of the light intensity values of the wavelength points in the first m rows and m columns is to write the light intensity values of the four median points into the median matrix respectively, where P1 is the light intensity value of the median point in the upper left corner of the median matrix, P2 is the light intensity value of the median point in the upper right corner of the median matrix, P3 is the light intensity value of the median point in the lower left corner of the median matrix, and P4 is the light intensity value of the median point in the lower right corner of the median matrix. The light intensity values A of the wavelength points in the first row of the matrix except the median point are a The light intensity C is calculated for each wavelength point except the median point in the mth row. c The calculation methods are:
[0020]
[0021] Where a is the ath wavelength point in the first row of the median matrix excluding the median point; c is the cth wavelength point in the mth row of the median matrix excluding the median point; then use the light intensity value A obtained from the first and mth rows a And light intensity C c Calculate the light intensity values of all wavelength points in the matrix except row m+1;
[0022] The calculation method of the light intensity value F1 of the first wavelength point in the m+1th row from left to right and the light intensity value F2 of the mth wavelength point in the m+1th row is:
[0023]
[0024] We can further calculate all the light intensity values of the m+1th row from left to right except the first and mth wavelength points:
[0025]
[0026] Here, j is the jth wavelength point in the m+1th row excluding the 1st and mth wavelength points.
[0027] Furthermore, the method for calculating the median matrix coefficients described in step 5 is: first calculate the mean value P of the light intensity values of the four median points mean =(P1+P2+P3+P4) / 4, then add the light intensity values of the wavelength points other than the median point to the mean light intensity value of the median point P mean The quotient operation is performed, and the obtained quotient value is the matrix coefficient of the wavelength point; the median matrix coefficient of the null value item is also a null value.
[0028] Furthermore, the specific implementation method of step 6 is: obtain the spectral median matrix of the sample to be corrected, and write the light intensity value into the median matrix, perform a quotient operation on the light intensity value of the sample to be corrected and the obtained median matrix coefficient to obtain the corrected light intensity value, and then arrange the corrected light intensity value in order from left to right in ascending order and reorganize it into a single row matrix.
[0029] Beneficial effects of the present invention:
[0030] A near-infrared spectral data correction method based on median matrix coefficients is provided. The method corrects the near-infrared sample spectral data through multiple median points, which solves the problems of easy deviation, weak stability and low accuracy of spectral data in practical applications of miniaturized near-infrared detection, and can effectively improve the data stability and detection accuracy of miniaturized near-infrared rapid detection technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a schematic diagram of the steps of a near-infrared spectral data correction method based on median matrix coefficients described in the present invention.
[0032] Figure 2 It is the arrangement diagram of wavelength points when the median matrix is M=m*m.
[0033] Figure 3 It is the arrangement diagram of wavelength points in the median matrix when M<(m+1)*m.
[0034] Figure 4 It is the arrangement diagram of wavelength points when the median matrix is M=(m+1)*m.
[0035] Figure 5 It is the arrangement diagram of wavelength points when the median matrix is M>(m+1)*m. DETAILED DESCRIPTION
[0036] A method for correcting distiller's grains near infrared spectroscopy data based on median matrix coefficients is provided. Figure 1 As shown, the method first calculates the median point of the band range of the miniaturized near-infrared spectrometer, and sets the median point as the reference correction point, arranges the wavelength points according to the number of wavelength points and the number of median points of the spectrometer, and then reorganizes the wavelength point matrix according to the wavelength point arrangement of the spectrometer to obtain the median matrix, uses the spectrometer to collect sample spectral data, writes the light intensity value of the reference correction point into the median matrix, calculates the median matrix coefficient, and finally corrects the sample spectral data to be corrected in combination with the median matrix coefficient.
[0037] Example
[0038] This embodiment specifically introduces the near-infrared spectral data correction method based on median matrix coefficients described in the present invention in combination with the detection of wine lees samples.
[0039] The absorption peak of the moisture content of the lees sample collected by the miniaturized near-infrared spectrometer is around 1900nm. The band range of the miniaturized near-infrared spectrometer is selected to be 1700nm~2100nm, and the median point of the band range is 1900nm.
[0040] Because the resolution of the miniaturized near-infrared spectrometer is different, the number of wavelength points it contains is also different. The number of wavelength points it contains can be adjusted by adjusting the resolution. According to the specific number of wavelength points of the miniaturized near-infrared spectrometer, the number of extreme points and median points required for correcting the spectral data are deducted. The remaining number of wavelength points is the wavelength points to be corrected. The collected wine lees spectral data is corrected using 4 median points. If the specific number of wavelengths of the miniaturized near-infrared spectrometer is set to M (M>35), the number of wavelength points remaining after deducting the number of median points and the two wavelength points of extreme wavelengths 1700nm and 2100nm is M1=(M-6). The remaining wavelength points are arranged using a wavelength equal distribution method. The specific method is:
[0041] The band range difference S between every two adjacent wavelength points is calculated as:
[0042] S=(2100-1700) / (M1+1)=400 / (M1+1)
[0043] Arrange the remaining M1 wavelength points from small to large wavelengths, and obtain the specific wavelength value H of each wavelength point. n for:
[0044] H n =1700+n*S; n≤M1
[0045] Where n is the number of wavelength points arranged in sequence. The remaining M1 wavelength points after deducting the number of median points and the two extreme wavelength points of 1700nm and 2100nm are arranged in ascending order of wavelength as H1nm, H2nm, ...H n nm.
[0046] Combined with the number and arrangement of wavelength points of the miniaturized near-infrared spectrometer, the matrix is reorganized, and the median point is fixed at the four diagonal points of the square matrix. If the number of wavelength points of the spectrometer is not enough to fill the square matrix, null values are used to fill the position, and the median point is adjusted to always keep the median point at the four diagonal points of the square matrix. The wavelength point matrix is reorganized, and the matrix obtained is the median matrix. The specific square matrix reorganization method is:
[0047] Since each lees sample spectrum data contains M wavelength points, to reorganize the M wavelength points into a square matrix, it is necessary to first perform a square root operation on the wavelength points to obtain its square root value If m is an integer, such as Figure 2 As shown, the reorganized median matrix is an m*m square matrix, and the four median points are located at the four diagonal points of the square matrix. The wavelength points other than the median point are arranged from left to right in order from small to large according to the wavelength value; if m is not an integer, as shown, it is divided into three cases. If M<(m+1)*m, such as Figure 3 As shown, it is necessary to add a row or a column to arrange the wavelength points that exceed the (m*m) square matrix. The reorganized median matrix is a [m*(m+1)] or [(m+1)*m] square matrix, and the positions where there are no wavelength points are filled with null values. Since the corresponding null value points are generated, the median points are adjusted in order, and the four median points are located at the four diagonal points of the (m*m) square matrix; if M = (m+1)*m, as Figure 4 As shown, it is necessary to add a row or a column to the (m*m) square matrix for arrangement. The reorganized median matrix is a [m*m+1)] or [(m+1)*m] square matrix. Since the number of wavelength points and the matrix position are exactly the same, there is no null point. The four median points are at the four diagonal points of the [m*(m+1)] or [(m+1)*m] square matrix. If M>(m+1)*m, as Figure 5As shown, it is necessary to add a row and a column to arrange the wavelength points that exceed the (m*m) square matrix. The reorganized median matrix is a [(m+1)*(m+1)] square matrix, and the positions where no wavelength points are arranged are filled with null values. Since corresponding null value points are generated, the median points are adjusted in order, and the four median points are located at the four diagonal points of the [m*(m+1)] or [(m+1)*m] square matrix; similarly, for the above three cases, the wavelength points except the median points are arranged from left to right in order from small to large according to the wavelength values.
[0048] The spectral data of the wine lees samples at the four median benchmark correction points are written in separately, and then the spectral data corresponding to the wavelength points other than the median point are calculated based on these median benchmark correction points. The weight coefficients corresponding to each wavelength point in the median matrix are calculated by combining these spectral data with the median benchmark point spectral data. These weight coefficients are the median matrix coefficients.
[0049] In this embodiment, when m is an integer, the light intensity values of the four median points are written into the median matrix, and the light intensity values of the four median points are set to P1, P2, P3, and P4, respectively, where P1 is the light intensity value of the median point in the upper left corner of the median matrix, P2 is the light intensity value of the median point in the upper right corner of the median matrix, P3 is the light intensity value of the median point in the lower left corner of the median matrix, and P4 is the light intensity value of the median point in the lower right corner of the median matrix. The light intensity values of each wavelength point in the first row of the median matrix except the median point are calculated, and the light intensity values are obtained as follows:
[0050]
[0051] Where a is the ath wavelength point in the first row of the median matrix excluding the median point.
[0052] Similarly, the light intensity values of each wavelength point except the median point in the mth row of the median matrix are calculated, and the light intensity values are obtained as follows:
[0053]
[0054] Where c is the cth wavelength point in the mth row of the median matrix excluding the median point.
[0055] Similarly, the light intensity values of each wavelength point except the two light intensity value points A1 and C1 in the second column of the median matrix are calculated, and the light intensity values are obtained as follows:
[0056]
[0057] Where e is the e-th wavelength point in the second column of the median matrix excluding the two light intensity value points A1 and C1.
[0058] Similarly, the same calculation method is used for the remaining [(m-2) 2 -m] wavelength point light intensity values are calculated, each wavelength point in the median matrix is matched with its light intensity value one by one and the light intensity value is written into the median matrix.
[0059] In this embodiment, the light intensity values of the first and mth rows of the matrix are used to calculate the light intensity values of the remaining wavelength points in the matrix; similarly, the light intensity values of the remaining wavelength points in the matrix can also be calculated using the first and mth columns of the matrix.
[0060] When calculating the median matrix coefficient, you need to first calculate the mean value P of the light intensity values of the four median points mean =(P1+P2+P3+P4) / 4, and then calculate the median matrix coefficients for each wavelength point in the median matrix one by one. Taking the m wavelength points in the first row of the median matrix as an example, the corresponding median matrix coefficients are:
[0061]
[0062] Among them, (α1, α2,…α m-1 , α m ) are the median matrix coefficients corresponding to the m wavelength points in the first row of the median matrix.
[0063] Similarly, the median matrix coefficients corresponding to all wavelength points in the (m*m) median matrix can be calculated.
[0064] When m is not an integer, except for the median matrix coefficient calculation method of the m+1th row, there is a certain difference. The calculation method of the median matrix coefficient corresponding to each wavelength point of the remaining m*m is the same as when m is an integer. The specific method of calculating the median matrix coefficient for each wavelength point in the m+1th row is:
[0065] First, calculate the light intensity corresponding to the first wavelength point from left to right in the m+1th row:
[0066]
[0067] Further calculation of the light intensity value corresponding to the mth wavelength point from left to right in the m+1th row is:
[0068]
[0069] We can further calculate the light intensity values of each wavelength point in the m+1th row from left to right except the 1st and mth wavelength points:
[0070]
[0071] Wherein j is the jth wavelength point in the m+1th row excluding the 1st and mth wavelength points.
[0072] When calculating the median matrix coefficients of each wavelength point in the m+1th row, it is necessary to first calculate the mean value P of the light intensity values of the four median points. mean =(P1+P2+P3+P4) / 4, and then calculate the median matrix coefficients for each wavelength point in the m+1th row one by one, and the corresponding median matrix coefficients are:
[0073]
[0074] Among them, (β1, β2,…β m-1 , β m ) are the median matrix coefficients corresponding to the m wavelength points in the m+1th row in the median matrix. In this step, since there is a null value in the m+1th row of the median matrix, when the calculated median matrix coefficients are matched one by one with each wavelength point in the m+1th row, the null value items are ignored, that is, the median matrix coefficients of the null value items are also null values, and the null value items are not used in the actual calculation.
[0075] The light intensity value at each wavelength point in the spectral data of the wine lees sample collected by the miniaturized near-infrared spectrometer and the corresponding wavelength point coefficient are processed one by one to obtain a new light intensity value, and then these light intensity values are horizontally reorganized in a sequential manner. The spectral data after the reorganization is the spectral data corrected by the median matrix coefficient, and the correction of the spectral data of the wine lees sample in the miniaturized near-infrared wine lees analysis technology is completed. If the light intensity values of the m wavelength points in the first row of the median matrix corresponding to the spectral data of the wine lees sample to be corrected are respectively (P1, X1, X2, ... X m-2 , P2), and the median matrix coefficients corresponding to the first row of m wavelength points in the median matrix are (α1, α2, ... α m-1 , α m ), combined with the median matrix coefficient, the light intensity values of the first row of m wavelength points are corrected one by one, and the corrected light intensity values of the first row of m wavelength points are (P1 / α1, X1 / α2, X2 / α3, ... X m-2 / α m-1 , P2 / α m ).
[0076] Similarly, the remaining wavelength points are corrected one by one in combination with the median matrix coefficients. After the correction of the intensity data of all wavelength points is completed, the corrected intensity values are matched with the wavelength points one by one. After the matching is completed, the new median matrix containing the corrected intensity values is reorganized again, and the (m*m) square matrix is reorganized into (1*m 2 ), and then arrange the single-row matrix from left to right from small to large wavelength values to obtain a reorganized single-row matrix, and the reorganized single-row matrix is the corrected wine grains sample spectral data.
[0077] Similarly, when m is not an integer, except for the m+1th row, the correction method of the lees spectrum data is different. The correction method of the spectrum data corresponding to the remaining (m*m) wavelength points is the same as when m is an integer. The specific method for correcting the light intensity value of each wavelength point in the m+1th row is:
[0078] If the number of null values in the m+1th row is c, then the number of non-null values is (mc). Set the light intensity values of the non-null value (mc) wavelength points in the m+1th row of the median matrix corresponding to the spectral data of the lees sample to be (F1, T1, ... T m-c-1 ), and the median matrix coefficients corresponding to these wavelength points are (β1, β2, ... β m-c ), combined with the median matrix coefficient, the light intensity values of the non-empty value (mc) wavelength points in the m+1th row are corrected one by one, and the corrected light intensity values of the non-empty value (mc) wavelength points in the m+1th row are (F1 / β1, T1 / β2…, T m-c-1 / β m-c ).
[0079] Combined with the correction method when m is an integer, the light intensity values of the (m*m) wavelength points except the m+1th row are corrected one by one. After the light intensity value data of all wavelength points are corrected, the corrected light intensity values are matched with the wavelength points one by one. After the matching is completed, the new median matrix containing the corrected light intensity values is reorganized again, and the square matrix [(m+1)*m] is reorganized into [1*(m 2 +m)], and then arrange the single-row matrix from left to right according to the wavelength values from small to large to obtain a reorganized single-row matrix, and the reorganized single-row matrix is the corrected wine grains sample spectral data.
[0080] Similarly, for the other two cases when m is not an integer, the spectral data of the wine lees sample are corrected using the median matrix coefficients in the same way to obtain the corrected spectral data of the wine lees sample, thereby completing the correction of the spectral data of the wine lees sample.
Claims
1. A near infrared spectroscopy data correction method based on median matrix coefficients, characterized in that: The following steps are involved: Step 1: Obtain the median point of the near-infrared spectrometer band range and set the median point as the reference correction point; Step 2: Arrange the wavelength points according to the number of wavelength points and the number of median points of the spectrometer; Step 3: Reorganize the wavelength point matrix according to the wavelength point arrangement of the spectrometer to obtain the median matrix; Step 4: Use the spectrometer to collect sample spectrum data, write the light intensity value of the reference correction point into the median matrix, and calculate the light intensity values of the remaining wavelength points in the median matrix; Step 5: Calculate the matrix coefficients of the median matrix after writing the light intensity value; Step 6: Obtain the median matrix of the sample spectrum to be corrected, and correct the sample spectrum to be corrected in combination with the matrix coefficients obtained in step 5; The specific arrangement of the wavelength points in step 2 is as follows: if the selected wavelength range is λ1 to λ2, the number of wavelength points M is calculated according to the resolution of the spectrometer. After deducting 4 median points and 2 extreme points, the remaining number of wavelength points is M1. The wavelength difference S between each two adjacent wavelength points is calculated as (λ2-λ1) / (M1+1), and the specific wavelength value H of each wavelength point is obtained respectively. n =λ1+n*S; n≤M1, where n is the number of wavelength points arranged in sequence, and the remaining M1 wavelength points after deducting the median point and the extreme point are arranged in ascending order of wavelength as H1nm, H2nm, ...H n nm; In step 3, the M wavelength points are reorganized into a matrix. If an m*m square matrix can be formed, the method for implementing step 3 is as follows: the four median points are placed at the four diagonals of the matrix respectively, and the wavelength points other than the median point are placed into the matrix in the order of wavelength from small to large in step 2, starting from the first row and the second column. After the first row is full, the second row is arranged in the same way until all the wavelength points are placed into the matrix to form an m*m median matrix. In step 3, the M wavelength points are reorganized into a matrix. If the M wavelength points cannot form an m*m matrix, there are three cases for implementing step 3. If M<(m+1)*m, then it is necessary to add a row or a column to the m*m square matrix, and the reorganized median matrix is an m*(m+1) or (m+1)*m matrix. The wavelength points except the median point are placed in the matrix in sequence according to the arrangement in step 2, and the positions where there are no wavelength points are filled with null values, and the median points are adjusted in order. The four median points are located at the four diagonal points of the m*m square matrix. If M=(m+1)*m, then it is necessary to add a row or a column to the m*m square matrix for arrangement, and the reorganized median matrix is an m*( m+1)*m or (m+1)*m square matrix, the four median points are located at the four diagonal points of the m*(m+1) or (m+1)*m square matrix, and the wavelength points excluding the median point are placed in the matrix in the order of arrangement in step 2; if M>(m+1)*m, it is necessary to add a row and a column to the square matrix exceeding the m*m to arrange it, and the wavelength points excluding the median point are placed in the matrix in the order of arrangement in step 2, and the reorganized median matrix is a (m+1)*(m+1) matrix, and the positions where no wavelength points are arranged are filled with null values, and the median points are adjusted in order, and the four median points are located at the four diagonal points of the m*(m+1) or (m+1)*m square matrix.
2. A near infrared spectrum data correction method based on median matrix coefficients according to claim 1, characterized in that: If the M wavelength points can just form an m*m square matrix, the method to implement step 4 is: write the light intensity values of the 4 median points into the median matrix respectively, where P1 is the light intensity value of the median point in the upper left corner of the median matrix, P2 is the light intensity value of the median point in the upper right corner of the median matrix, P3 is the light intensity value of the median point in the lower left corner of the median matrix, and P4 is the light intensity value of the median point in the lower right corner of the median matrix. The light intensity values A of each wavelength point except the median point in the first row of the matrix are a The light intensity C is calculated for each wavelength point except the median point in the mth row. c The calculation methods are: Where a is the ath wavelength point in the first row of the median matrix excluding the median point; c is the cth wavelength point in the mth row of the median matrix excluding the median point; then use the light intensity value A obtained from the first and mth rows a And light intensity C c The light intensity values of all wavelength points in the matrix are calculated in the same way.
3. A near infrared spectrum data correction method based on median matrix coefficients according to claim 2, characterized in that: If the M wavelength points cannot form an m*m square matrix, the method for implementing step 4 is as follows: the calculation method of the light intensity values of the wavelength points in the first m rows and m columns is to write the light intensity values of the four median points into the median matrix respectively, where P1 is the light intensity value of the median point in the upper left corner of the median matrix, P2 is the light intensity value of the median point in the upper right corner of the median matrix, P3 is the light intensity value of the median point in the lower left corner of the median matrix, and P4 is the light intensity value of the median point in the lower right corner of the median matrix. The light intensity values A of the wavelength points in the first row of the matrix except the median point are a The light intensity C is calculated for each wavelength point except the median point in the mth row. c The calculation methods are: Where a is the ath wavelength point in the first row of the median matrix excluding the median point; c is the cth wavelength point in the mth row of the median matrix excluding the median point; then use the light intensity value A obtained from the first and mth rows a And light intensity C c Calculate the light intensity values of all wavelength points in the matrix except row m+1; The calculation method of the light intensity value F1 of the first wavelength point in the m+1th row from left to right and the light intensity value F2 of the mth wavelength point in the m+1th row is: We can further calculate all the light intensity values of the m+1th row from left to right except the first and mth wavelength points: Here, j is the jth wavelength point in the m+1th row excluding the 1st and mth wavelength points.
4. A near infrared spectrum data correction method based on median matrix coefficients according to claim 2 or 3, characterized in that: The method for calculating the median matrix coefficients described in step 5 is: first calculate the mean value P of the light intensity values of the four median points mean =(P1+P2+P3+P4) / 4, then add the light intensity values of the wavelength points other than the median point to the mean light intensity value of the median point P mean The quotient operation is performed, and the obtained quotient value is the matrix coefficient of the wavelength point; the median matrix coefficient of the null value item is the null value.
5. A near infrared spectrum data correction method based on median matrix coefficients according to claim 4, characterized in that: The specific implementation method of step 6 is: obtain the spectral median matrix of the sample to be corrected, and write the light intensity value into the median matrix, perform a quotient operation on the light intensity value of the sample to be corrected and the obtained median matrix coefficient to obtain the corrected light intensity value, and then arrange the corrected light intensity values in order from left to right in ascending order to reorganize into a single row matrix.
