Summary of the invention
The invention discloses a kind of based on organism method for quickly identifying in the surface water of spectrum; Overcome the deficiency of existing recognition methods; Provide a kind of computer Recognition method to be used for the organism of quick identification surface water; Realizing the automatic computing of omnidistance computing machine, need not the people be the input and output intervention, has realized robotization quick identification process.
Be to realize above-mentioned purpose, the invention provides a kind ofly, be characterized in that the method includes the steps of based on organism method for quickly identifying in the surface water of spectrum:
Step 1 is set up the organism spectra database;
The surface water solution of the organism A of a series of variable concentrations of step 1.1 preparation;
Step 1.2 is gathered the spectrogram of organism A solution;
Step 1.3 utilizes the convolution smoothing algorithm to carry out the spectrogram that smoothing processing is gathered;
Step 1.4 draws the maximum value in the spectrogram, and pairing wavelength, and gathering this wavelength is organic absorbing wavelength;
Step 1.5 is changed the organism of other kind, and various organic absorbing wavelength are gathered in the circulation of repeating step 1.1 to step 1.4;
The various organic absorbing wavelength that step 1.6 will be gathered is formed the organism spectra database;
Step 2 is gathered the spectrogram of water body to be detected;
Step 3 utilizes the convolution smoothing method that water body spectrogram to be detected is carried out smoothing processing, removes because the electronic noise that the circuit of spectrometer self produces disturbs through the convolution smoothing method;
Step 4 draws the maximum value in the level and smooth spectrogram, and pairing wavelength;
Step 4.1 pair level and smooth spectroscopic data carries out single order and leads computing, and concrete formula is following:
Wherein yi is meant the ordinate value that i is ordered in the spectroscopic data, and xi is meant the abscissa value that i is ordered in the spectroscopic data;
When calculating, establishing that initial 2 last single orders with ending of spectrum lead at 2 is 0;
The level and smooth spectroscopic data of step 4.2 pair above-mentioned gained carries out second order and leads computing, and concrete formula is following:
Wherein, yi is meant the ordinate value that i is ordered in the spectroscopic data, and xi is meant the abscissa value that i is ordered in the spectroscopic data;
When calculating, it is 0 that the second order of establishing spectrum starting point and rearmost point is led;
The maximum value of this spectrogram of step 4.3 is specially single order in the spectrogram to lead is zero, second order is led is negative point; And its adjacent left side point single order is led to just, and adjacent the right point single order is led to negative, and corresponding absorption value is bigger than overall optical spectrogram baseline value; Through aforementioned calculation, draw the maximum value of spectrogram;
Step 4.4 obtain and the recording light spectrogram in the wavelength of each maximum value;
Step 5 is compared organic wavelength in wavelength and the organism database of maximum value in the water body spectrogram to be detected one by one, draws the organism that comprises in the water body to be detected;
The wavelength of the maximum value that step 5.1 is found out from little extremely big ordering spectrogram, and the number of the affirmation wavelength of finding out;
Step 5.2 wavelength that each organism write down in the wavelength of maximum value and the organism spectra database in the spectrum one by one;
The wavelength that step 5.3 is judged maximum value in the spectrum whether with the organism spectra database in the organic wavelength that write down be complementary, if then there is this organism to exist in this water body to be detected.If not, then there is not this organism in this water body to be detected.
The scope of the organic absorbing wavelength of gathering in the above-mentioned step 1.4 is ± 1nm.
The convolution smoothing method adopts 5 smoothing methods of Savitzky-Golay in the above-mentioned step 3, and its formula is following:
Wherein, Xi* is an element in the spectroscopic data vector of level and smooth back, and Xi is an element in the level and smooth preceding spectroscopic data vector, W
JIt is the weight factor in level and smooth.
Above-mentioned step 4.3 can also adopt following steps:
Single order is led greater than zero, second order and is led less than zero in the calculating spectrum, and adjacent the right point is for bearing simultaneously, and the absorption value of correspondence is bigger than overall optical spectrogram baseline value, and this point is the point of the maximum value of spectrogram.
A kind of water body detection method based on organism method for quickly identifying in the surface water of spectrum and prior art of the present invention is compared, and its advantage is that the present invention can carry out field monitoring to the water body of required monitoring, and program is simple, and is consuming time shorter relatively.Because measuring operation is easy, does not produce secondary pollution, can be used for the on-the-spot quick identification in risk source.Simultaneously, can realize the automatic computing of omnidistance computing machine, need not the people be the input and output intervention, really realized robotization quick identification process.
Embodiment
Below in conjunction with description of drawings embodiment of the present invention.
As shown in Figure 1, the present invention is a kind of based on organism method for quickly identifying in the surface water of spectrum, and the method includes the steps of.
Step 1 is set up the organism spectra database.
Step 1.1 is a solvent with certain surface water, and organism A is a solute, prepares the surface water solution of the organism A of a series of variable concentrations.
The step 1.2 pair a series of organism A solution that prepare carry out spectra collection, obtain the spectrogram of this organism A solution.
Step 1.3 utilizes the convolution smoothing method that the spectrogram of organism A solution is carried out smoothing processing, removes because the electronic noise that the circuit of spectrometer self produces disturbs.What adopt in the present embodiment is that 5 of Savitzky-Golay are level and smooth, and formula is following:
Wherein, X
i *Be an element in the spectroscopic data vector of level and smooth back, X
iBe an element in the spectroscopic data vector before level and smooth.W
JBe the weight factor of moving window in level and smooth, above-mentioned W
JValue confirm according to the Savitzky-Golay coefficient table.
Utilize following formula that the surface water spectrogram that detects is iterated and circulate 10 times, and from thirdly progressively moving each point extremely at last thirdly.From thirdly beginning level and smooth calculating, promptly the value of the every bit of spectrogram after level and smooth be this any initial value with its before and after the weighted sum of each two point value, ask the each point of spectrogram successively, the each point of spectrogram is all calculated the spectrogram that promptly obtains after the level and smooth calculating.
Spectrogram after step 1.4 pair is level and smooth utilizes the method for first order derivative and second derivative to handle, and the pairing wavelength of the maximum value in the spectrogram is found out.
This maximum value is specially single order in the spectrogram to lead is zero, second order is led is negative point, and its adjacent left side point single order leads to just, and adjacent the right point single order is led to bearing, and the absorption value of correspondence is bigger than overall optical spectrogram baseline value.
The level and smooth spectroscopic data of above-mentioned gained is carried out single order lead computing, concrete formula is following:
Y wherein
iBe meant the ordinate value that i is ordered in the spectroscopic data, x
iBe meant the abscissa value that i is ordered in the spectroscopic data.
When calculating, establishing that initial 2 last single orders with ending of spectrum lead at 2 is 0.
The level and smooth spectroscopic data of above-mentioned gained is carried out second order lead computing, concrete formula is following:
Wherein, y
iBe meant the ordinate value that i is ordered in the spectroscopic data, x
iBe meant the abscissa value that i is ordered in the spectroscopic data.
When calculating, it is 0 that the second order of establishing spectrum starting point and rearmost point is led.
Through aforementioned calculation, draw the maximum value of spectrogram, and draw the wavelength of this maximum value.
The wavelength of this maximum value writes down the absorbing wavelength of organism A for this reason, the scope of this absorbing wavelength the wavelength of maximum value ± the 1nm scope.
Step 1.5 is changed the organism of other kind, repeats the circulation of above-mentioned steps 1.1 to step 1.4, gathers various organic absorbing wavelength successively.
The various organic absorbing wavelength that step 1.6 will be gathered is formed the organism spectra database, and this organism spectra database expands the quantity of the organism absorbing wavelength of its record in real time with concrete needs.
The surface water that step 2 collection and pre-service need detect, and this detection water body is carried out instrumental analysis through spectrum detection instrument, obtaining the spectrogram of this water body, the ordinate of this spectrogram is an absorbance, horizontal ordinate is a wavelength.
Step 3 utilizes the convolution smoothing method that the surface water spectrogram of gathering is carried out smoothing processing, removes because the electronic noise that the circuit of spectrometer self produces disturbs.What the convolution smoothing method adopted in the present embodiment is that 5 of Savitzky-Golay are level and smooth, and formula is following:
Wherein, X
i *Be an element in the spectroscopic data vector of level and smooth back, X
iBe an element in the spectroscopic data vector before level and smooth.W
JBe the weight factor of moving window in level and smooth, above-mentioned W
JValue confirm according to the Savitzky-Golay coefficient table.
Utilize following formula that the absorbance in the surface water spectrogram that detects is iterated and circulate 10 times, be removed to guarantee the electronic noise interference that circuit produces in the spectrogram.These 10 concrete grammars of circulation that iterate are following: because 5 level and smooth calculating of Savitzky-Golay of certain some ordinate value need adjacent each side 2 the ordinate value of this point in the spectrogram; And this condition is not all satisfied with 2 of the rightmost sides in 2 of the leftmost sides in the spectrogram; Can't obtain adjacent each side 2 ordinate value; Therefore level and smooth calculating from the spectrogram left side thirdly begins to finish to point third from the bottom; Being the every bit of the spectrogram value after level and smooth is this any initial value and its weighted sum of two point values each side; This is that once level and smooth calculating accomplish, and the ordinate value of level and smooth calculating gained spectrogram is carried out ten level and smooth calculating again being the circulation 10 times that iterates.
Utilize the convolution smoothing method each point of the spectrogram that obtains of computational analysis successively, after the each point of spectrogram is all calculated, promptly obtain the spectrogram after level and smooth the calculating.
Spectrogram after step 4 pair level and smooth the calculating carries out the method for first order derivative and second derivative to be handled, and draws the pairing wavelength of maximum value in the spectrogram.
The level and smooth spectroscopic data of step 4.1 pair above-mentioned gained carries out single order and leads computing, and concrete formula is following:
Y wherein
iBe meant the ordinate value that i is ordered in the spectroscopic data, x
iBe meant the abscissa value that i is ordered in the spectroscopic data.
When calculating, establishing that initial 2 last single orders with ending of spectrum lead at 2 is 0.
The level and smooth spectroscopic data of step 4.2 pair above-mentioned gained carries out second order and leads computing, and concrete formula is following:
Wherein, y
iBe meant the ordinate value that i is ordered in the spectroscopic data, x
iBe meant the abscissa value that i is ordered in the spectroscopic data.
When calculating, it is 0 that the second order of establishing spectrum starting point and rearmost point is led.
The maximum value of this spectrogram of step 4.3 is specially single order in the spectrogram to lead is zero, second order is led is negative point, and its adjacent left side point single order leads to just, and adjacent the right point single order is led to bearing, and the absorption value of correspondence is bigger than overall optical spectrogram baseline value.
Through aforementioned calculation, draw the maximum value of spectrogram.
Step 4.4 is noted the pairing abscissa value of the maximum value that obtains in the step 4.3, obtains the wavelength of each maximum value in the spectrogram.
If said method can not obtain the maximum value of spectrogram; Can also adopt following method: judge each point first order derivative in the spectrogram; Require this single order to lead greater than zero, second order and lead less than zero, adjacent the right point is for negative simultaneously, and the absorption value of correspondence is bigger than overall optical spectrogram baseline value; This point is the point of the maximum value of spectrogram, draws the wavelength of this point.
Step 5 is compared organic wavelength in above-mentioned wavelength and the organism spectra database through the water body maximum value to be detected that calculate to obtain one by one; As find with spectra database in the organism of identical wavelength, then think and contain this organism in this surface water.
The wavelength of the maximum value of being found out in the spectrogram of step 5.1 with water body to be detected extremely sorts greatly from little, and confirms the number of the wavelength of finding out.
The wavelength that each organism write down in the wavelength of maximum value and the organism spectra database in this spectrum of step 5.2 is compared one by one, and the deviation that allowed of comparison is at ± 1.0nm.
The wavelength that step 5.3 is judged maximum value in the spectrum one by one whether with the organism spectra database in the organic wavelength that write down be complementary; If; In the tested water body in the wavelength of maximum value and the organism spectra database a certain organic wavelength be complementary, then have this organism to exist in this water body to be detected.If not, in the tested water body wavelength of maximum value not with the organism spectra database in a certain organic wavelength be complementary, then do not have this organism in this water body to be detected.
Although content of the present invention has been done detailed introduction through above-mentioned preferred embodiment, will be appreciated that above-mentioned description should not be considered to limitation of the present invention.After those skilled in the art have read foregoing, for multiple modification of the present invention with to substitute all will be conspicuous.Therefore, protection scope of the present invention should be limited appended claim.