Summary of the invention
The object of the present invention is to provide a kind of imitative nuclear signal generating system processors, are imitated with realizing nuclear energy spectral line
Very.
In order to solve the above-mentioned technical problems, the present invention provides a kind of imitative nuclear signal generating system processors, comprising: with
The connected spectrum curve image data acquisition unit of spectrum curve image data acquiring unit;The spectrum curve image data obtains
The practical spectrum curve image data for taking unit to be suitable for will acquire is sent to random number generation unit, and list occurs by random number
Member obtains simulation spectrum curve to export.
Further, the spectrum curve image data acquisition unit include: display controller, curve data processing module and
Data storage control module;The spectrum curve image data acquiring unit includes: camera, memory module, display module, spectrum
Line drafting module and image processing module connected to the camera;Described image processing module is by display controller and shows
Show that module is connected, to show the image of the practical nuclear spectrum curve graph of camera shooting by display module, and the image is led to
The data point on spectral line drafting module acquisition spectrum curve is crossed to curve data processing module;The curve data processing module is suitable
Spectrum curve data are obtained in each key point that the practical spectrum curve figure according to display copies the nuclear energy spectral curve, and pass through number
Memory module is sent to according to storage control module to establish spectrum curve database.
Further, the curve data processing module is connected with random number generation unit, and the random number generation unit
It include: nuclear signal time statistical property analog module and nuclear signal amplitude statistics simulated behavior module, wherein when the nuclear signal
Between statistical property analog module be suitable for by obey exponential distribution random number realize nuclear signal time statistical property simulation, it is described
The random number of exponential distribution by (0,1] equally distributed random number by inverse function method converts to obtain, and (0,1] be uniformly distributed with
Machine number is suitable for acquiring by linear congruential method;The nuclear signal amplitude statistics simulated behavior module is suitable for by practical nuclear spectrum
Curves Recognition simultaneously digitizes and obtains each energy level amplitude and counting rate, then pass through Monte Carlo method direct sampling and export it is described with
Machine number is to simulate the randomness of nuclear decay process, then carries out statistical disposition to the random number and obtain the simulation spectrum curve.
Further, the processor further include: module occurs for ambient noise, which occurs module and be suitable for output use
In the noise signal superimposed with simulation spectrum curve.
Further, the processor further include: multiple tracks data processor, multiple tracks data processor connection is for being visited
Survey the multi-channel analysis acquisition unit of the true nuclear energy spectral line data of device acquisition;The multiple tracks data processor includes: adc data
And the analysis of control module, data and spectral line data processing module and peak detection and control module;The multi-channel analysis acquisition is single
Member includes: the preamplifier being connected with detector, the output end of the preamplifier respectively with sampling and holding circuit, energy level
The input terminal of detection circuit is connected;The output end of the sampling and holding circuit passes through ADC converter;The adc data and control
Molding block is suitable for accessing true nuclear energy spectral line data, and sends the data to data analysis and spectral line data processing module;
The peak detection and control module are suitable for acquiring the energy level data of true nuclear energy spectral line data, and first, second is controlled
Signal is respectively sent to sampling and holding circuit in multi-channel analysis acquisition unit, adc data and control module;The data point
Analysis and spectral line data processing module are connected with random number generation unit, by the energy spectrum diagram of true nuclear signal to simulation spectrum curve
Data are demarcated and are calibrated;
Further, the processor further include: feedback and calibration circuit, and simulated by the feedback and calibration circuit
The feedback data of nuclear energy spectral line, and random number generation unit will be sent to after the feedback data inverting;And/or feedback signal is sent out
It send to the input terminal of preamplifier.
Another aspect, on the basis of above-mentioned imitative nuclear signal generating system, the present invention also provides a kind of imitative nuclear signals to send out
Raw system.
The spectrum curve image data that this imitative nuclear signal generating system includes: the processor, is connected with the processor is adopted
Collect unit, the output end of the processor is connected by simulating spectrum curve data outputting unit with detector.
Further, the spectrum curve image data acquiring unit further include: the image being connected with memory module saves work
Tool, and protected respectively the set a song to music image of line chart of the practical nuclear energy obtained by image conserving appliance by described image conserving appliance
It deposits;The memory module is also connected with image processing module, i.e., will be obtained by image conserving appliance by described image processing module
Practical nuclear energy respectively set a song to music line chart image through filtering, noise reduction pretreatment, Curves Recognition, curvilinear characteristic extraction, and progress
Interpolation processing lacks each point data of spectrum curve to improve and repair, to establish spectrum curve database.
The third aspect, the present invention also provides a kind of working method of imitative nuclear signal generating system processor, this work
Method includes the following steps:
Step S1 obtains practical nuclear spectrum curve graph;
Step S2 handles to obtain simulation spectrum curve practical nuclear spectrum curve graph;And
Simulation spectrum curve and practical spectrum curve are compared in step S3, inverting, to obtain simulation spectrum curve and practical energy
Error between spectral curve.
Further, the method in step S2 by being handled practical nuclear spectrum curve graph to obtain simulation spectrum curve
Include:
Step S21 carries out Curves Recognition to practical nuclear spectrum curve graph and spectrum curve quantizes, to obtain to set a song to music
The numerical value of line each point;Step S22 is obtained by Monte Carlo method this group of numerical value of random direct sampling about each nuclear level
Random number, to simulate the randomness of nuclear decay process;Step S23 carries out statistical disposition to the random number and obtains the simulation
Spectrum curve;
Wherein, in the step S21 to practical nuclear spectrum curve graph carry out Curves Recognition and by spectrum curve quantize with
The method for obtaining the numerical value of spectrum curve each point include: by practical nuclear energy respectively set a song to music line chart image after filtering and noise reduction is handled again
Practical spectrum curve figure is shown, and copies each key point of the nuclear energy spectral curve according to the practical spectrum curve figure of display
Spectrum curve data are obtained, to establish spectrum curve database;Or by practical nuclear energy respectively set a song to music line chart image through filtering, noise reduction
Pretreatment, Curves Recognition, curvilinear characteristic extract, and carry out interpolation processing to improve and repair each points of missing spectrum curve
According to establish spectrum curve database;
It is obtained by Monte Carlo method this group of numerical value of random direct sampling about the random of each nuclear level in step S22
Number includes: the simulation of nuclear signal time statistical property in the method for simulating the randomness of nuclear decay process;And nuclear signal amplitude system
Count simulated behavior;The method of the nuclear signal time statistical property simulation includes: to be realized by obeying the random number of exponential distribution
The simulation of nuclear signal time statistical property, wherein the random number of exponential distribution by (0,1] equally distributed random number passes through inverse function
Method converts to obtain, and (0,1] uniform random number be suitable for acquired by linear congruential method;The nuclear signal amplitude statistics characteristic
The method of simulation includes: then to be passed through by practical nuclear spectrum Curves Recognition and digitizing and obtaining each energy level amplitude and counting rate
Monte Carlo method direct sampling simultaneously exports the random number;The wherein identification to practical nuclear energy spectral curve and digitized process
Include: step S221, practical spectrum curve figure is filtered, noise reduction;Step S222 finds out threshold by split plot design between maximum kind
Value, and spectrum curve figure is subjected to binary conversion treatment, then the numerical value of each point on spectrum curve is extracted i.e. by pixel scanning method
Coordinate;Step S223, repairs spectrum curve and is quantized;It is described to pass through Monte Carlo method direct sampling and export institute
The method for stating random number, i.e., by each point value on Monte Carlo method direct sampling spectrum curve and curve, to obtain one
Series of random numbers, thus to simulate the randomness of nuclear decay process;Practical spectrum curve figure is filtered in the step S221
The method of wave carries out Wiener filtering processing to practical spectrum curve figure, to filter out the Gaussian noise in spectrum curve figure;It is described
Repaired and quantized to spectrum curve in step S223 includes: to be filled up by cubic spline interpolation in spectrum curve spy
The data point that sign lacks during extracting, and stretched by the expansion of the ratio of coordinate to obtain the numerical value of each point on spectrum curve figure.
The invention has the advantages that imitative nuclear signal generating system processor of the invention, system and working method are logical
It crosses and Curves Recognition is carried out to practical nuclear spectrum curve graph and spectrum curve quantizes, to obtain the numerical value of spectrum curve each point
(i.e. the counting rate of the energy level of nuclear spectrum and each energy level), then by this group of numerical value of the random direct sampling of Monte Carlo method to obtain
To the random number about each nuclear level, to simulate the randomness of nuclear decay process, finally the random number is counted again
Processing obtains simulation spectrum curve, imitates nuclear signal by inverting comparative simulation spectrum curve and practical spectrum curve to determine
The reliability and accuracy of system.
Embodiment 1
As shown in Fig. 2, the present invention provides a kind of imitative nuclear signal generating system processors, comprising: with spectrum curve figure
The spectrum curve image data acquisition unit being connected as data acquisition unit;The spectrum curve image data acquisition unit is suitable for
The practical spectrum curve image data that will acquire is sent to random number generation unit, and is simulated by random number generation unit
Spectrum curve is to export.
Specifically, the output end of the processor is connected by simulating spectrum curve output unit with detector.
The spectrum curve image data acquisition unit includes: that display controller, curve data processing module and data are deposited
Store up control module;The spectrum curve image data acquiring unit includes: camera, memory module, display module, spectral line drafting
Module and image processing module connected to the camera;Described image processing module passes through display controller and display module
It is connected, to show the image of the practical nuclear spectrum curve graph of camera shooting by display module, and the image is passed through into spectral line
Drafting module acquires the data point on spectrum curve to curve data processing module;The curve data processing module is suitable for basis
Each key point that the practical spectrum curve figure of display copies the nuclear energy spectral curve obtains spectrum curve data, and is stored by data
Control module is sent to memory module to establish spectrum curve database.
The curve data processing module is connected with random number generation unit, and the random number generation unit includes: core
Signal time statistical property analog module and nuclear signal amplitude statistics simulated behavior module, wherein nuclear signal time statistics is special
Property analog module be suitable for by obey exponential distribution random number realize nuclear signal time statistical property simulation, the exponential distribution
Random number by (0,1] equally distributed random number by inverse function method converts to obtain, and (0,1] uniform random number is suitable for
It is acquired by linear congruential method;The nuclear signal amplitude statistics simulated behavior module is suitable for by practical nuclear spectrum Curves Recognition
And it digitizes and obtains each energy level amplitude and counting rate, then pass through Monte Carlo method direct sampling and export the random number with mould
The randomness of nucleoid decay process, then statistical disposition is carried out to the random number and obtains the simulation spectrum curve.
Reality is met by nuclear signal time statistical property analog module and nuclear signal amplitude statistics simulated behavior module
Nuclear decay process the time after with the statistical property in amplitude.
About the specific implementation process of random number generation unit, will be described in detail in example 2.
Optionally, the nuclear signal time statistical property analog module and nuclear signal amplitude statistics simulated behavior module also with
First DAC data and control module are connected, and the first DAC data and control module are suitable for changing circuit by corresponding digital-to-analogue dress
Simulation spectrum curve data are sent to detector.
The processor further include: module occurs for ambient noise, and ambient noise generation module is used for suitable for output and mould
The superimposed noise signal of quasi- spectrum curve.
The processor further include: multiple tracks data processor, multiple tracks data processor connection are adopted for obtaining detector
The multi-channel analysis acquisition unit of the true nuclear energy spectral line data of collection;The multiple tracks data processor includes: adc data and control
Module, data analysis and spectral line data processing module and peak detection and control module;The multi-channel analysis acquisition unit includes:
The preamplifier being connected with detector, the output end of the preamplifier detect electricity with sampling and holding circuit, energy level respectively
The input terminal on road is connected;The output end of the sampling and holding circuit passes through ADC converter;The adc data and control module
Suitable for accessing true nuclear energy spectral line data, and send the data to data analysis and spectral line data processing module;The peak
Value detection and control module are suitable for acquiring the energy level data of true nuclear energy spectral line data, and control signal point for first, second
The sampling not being sent in multi-channel analysis acquisition unit and holding circuit, adc data and control module;The data analysis and spectrum
Line data processing module is connected with random number generation unit, by the energy spectrum diagram of true nuclear signal to simulation spectrum curve data into
Rower is fixed and calibrates;
The effect of the adc data and control module is to transmit for analog quantity and control ADC converter.
The ambient noise occurs module and is suitable for being superimposed nuclear signal and Gaussian noise, to reach the true nuclear signal of simulation
Purpose, finally analyzed again through multi-channel analysis acquisition unit again by the capture of spy core device to verify the reliability of system.
Specifically, the ambient noise generator passes through the 2nd DAC data and control module and simulation spectrum curve data
Corresponding D/A converting circuit in output unit is connected with Signal averaging module.
The effect of first, second DAC data and control module is transmitted for digital quantity and to subsequent digital-to-analogue conversion electricity
Road is controlled.
The specific algorithm that module generation noise occurs for ambient noise is as follows:
If (X, Y) is one group of mutually indepedent and Normal Distribution stochastic variable, then, it is known that its two-dimentional joint density
Function expression are as follows:
It can be obtained by polar coordinate transform formula: x=Rcos (θ), y=Rsin (θ), wherein the π of 0≤R≤r, 0≤θ≤2, then have
Dxdy=RdRd θ, therefore the distribution function of R can be calculated are as follows:
It can so acquire
Thus F is calculated-1 R(X) it obtains
I.e.
If random number X obeys (0,1) and is uniformly distributed, it is uniformly distributed then 1-X is similarly obeyed, therefore can replace as follows
Wherein U, V are any (0,1) uniform random number.
Similarly have
To which by two uniform random numbers U, V random numbers of Gaussian distribution can be obtained by formula (5) or formula (6) transformation.It is right
It can be acquired by standardized normal distribution by transformation in different parameters normal distribution.
If X~N (0,1), then
σ X+ ε~N (ε, σ2) (7)
Also, the processor further include: feedback and calibration circuit, and simulation core is obtained by the feedback and calibration circuit
The feedback data of energy spectral line, and random number generation unit will be sent to after the feedback data inverting;And/or feedback signal is sent
To the input terminal of preamplifier (by simulating control switch).
Optionally, feedback circuit unit includes: the gain module being connected with the output end of Signal averaging module and the gain
The connected ADC module of module, the ADC module will be sent to random number by feedback and calibration module and list occur after data inversion
Member.
Specific implementation process includes:
By feed circuit by superposed signal gain G=1 times of nuclear signal and noise signal, respectively by superposed signal through A/
D conversion is exported to random number generating system and sampling obtains D againfeedbackBe transmitted to multichannel analyzer after obtain Dinput.It is logical
Cross the available error coefficient k of spectrum curve data that comparison two ways obtains:
K=Dinput/Dfeedback (8)
When the system is operated, final output signal actual value are as follows:
Doutput=k*Dinitial (9)
Also, the output end of the gain module also passes through the input that a simulation control switch is connected to preamplifier
End, and be suitable for feedback signal being introduced to multi-channel analysis acquisition unit, the simulation control switch is responsible for being switched on or switched off feedback
Signal can be realized by low and high level.
Each functional module, unit in the processor can be realized using FPGA.
Also, it is additionally provided with USB interface in the processor, which is connected with random number generation unit, in order to PC
Machine carries out data debugging.
Embodiment 3
As shown in figure 3, on that basis of example 1, the present invention also provides a kind of imitative nuclear signal generating system processors
Working method, include the following steps:
Step S1 obtains practical nuclear spectrum curve graph;Step S2 handles to obtain mould practical nuclear spectrum curve graph
Quasi- spectrum curve;And simulation spectrum curve and practical spectrum curve is compared in step S3, inverting, with obtain simulation spectrum curve and
Error between practical spectrum curve.
Further, as shown in figure 4, being handled practical nuclear spectrum curve graph to obtain simulation power spectrum in the step S2
The method of curve, i.e., realize simulation spectrum curve by random number generation unit, and method includes:
Step S21 carries out Curves Recognition to practical nuclear spectrum curve graph and spectrum curve quantizes, to obtain to set a song to music
The numerical value of line each point;Step S22 is obtained by Monte Carlo method this group of numerical value of random direct sampling about each nuclear level
Random number, to simulate the randomness of nuclear decay process;And step S23, random number progress statistical disposition is obtained described
Simulate spectrum curve.
Specifically, carrying out Curves Recognition to practical nuclear spectrum curve graph in the step S21 and spectrum curve quantizing
Include: in the method for obtaining the numerical value of spectrum curve each point
Respectively the set a song to music image of line chart of practical nuclear energy is again shown practical spectrum curve figure after filtering and noise reduction is handled,
And spectrum curve data are obtained according to each key point that the practical spectrum curve figure of display copies the nuclear energy spectral curve, to establish energy
Spectral curve database;Or by practical nuclear energy respectively set a song to music line chart image through filtering, noise reduction pretreatment, Curves Recognition, curvilinear characteristic
It extracts, and carries out interpolation processing to improve and repair each point data of missing spectrum curve, to establish spectrum curve database.
Wherein, it is obtained by Monte Carlo method this group of numerical value of random direct sampling about each core in the step S22
The random number of energy level includes: the simulation of nuclear signal time statistical property and nuclear signal in the method for simulating the randomness of nuclear decay process
Amplitude statistics simulated behavior.
The method of the nuclear signal time statistical property simulation includes: to realize core letter by obeying the random number of exponential distribution
The simulation of number time statistical property, wherein the random number of exponential distribution by (0,1] equally distributed random number passes through inverse function method change
Get in return, and (0,1] uniform random number be suitable for acquired by linear congruential method.
Specifically, acquired by linear congruential method (0,1] method of uniform random number is as follows:
The recurrence formula of linear congruential method is as follows:
xi+1≡λxi+c(mod M) (10)
Wherein λ, c are constant.The initial x chosen1Referred to as seed has certain influence, value to the generation quality of random number
Respectively 1~216It is chosen between=65535.For the ease of using on computers, usually take
M=2S, wherein S is binary maximum possible number of significant digit in computer.
Fig. 5 be take 10000 (0,1] random-number distribution situation
The production method of exponential distribution random number, i.e. exponential distribution random number can be realized that detailed process is such as by inverse function method
Under:
If the distribution function of stochastic variable X obeys exponential distribution:
F (x)=1-e-ax, x >=0 (12)
Wherein, a is a time constant, and e is the nature truth of a matter.
Can be with by above formula, F (x) ∈ [0,1), and the monotone decreasing in domain, therefore function F (x) must have in 0~+∞
Inverse function seeks its inverse function:
Due to 0 < 1-F (x)≤1, above formula can simplify for
By formula (14) it can be seen that by meet (0,1] equally distributed Random sampling obtains obeying exponential distribution random number x.
It takesThe exponential distribution random-number distribution generated by the equal distribution random numbers of the above unit by inverse function method
Figure such as Fig. 6.1000 group squares are evenly dividing to the above exponential distribution random number value range and are counted, final statistical chart is such as
Shown in Fig. 7.
The method of the nuclear signal amplitude statistics simulated behavior includes: by practical nuclear spectrum Curves Recognition and digitizing
Each energy level amplitude and counting rate are obtained, then passes through Monte Carlo method direct sampling and exports the random number;Wherein to reality
The identification of nuclear energy spectral curve and digitized process includes:
Step S221 is filtered practical spectrum curve figure, noise reduction;Step S222 is asked by split plot design between maximum kind
Threshold value out, and spectrum curve figure is subjected to binary conversion treatment, then the number of each point on spectrum curve is extracted by pixel scanning method
Value is coordinate;Step S223, repairs spectrum curve and is quantized.
Specifically, the method for passing through Monte Carlo method direct sampling and exporting the random number, i.e., special by covering
A series of each point value on Caro method direct sampling spectrum curve and curve, to obtain random random numbers, thus with mould
The randomness of nucleoid decay process.
The method being filtered in the step S221 to practical spectrum curve figure is tieed up practical spectrum curve figure
Filtering processing of receiving is interfered with filtering out the Gaussian noise in spectrum curve figure to reduce noise bring as far as possible.
The specific implementation process of the method for the nuclear signal amplitude statistics simulated behavior is as follows:
Practical spectrum curve figure is filtered in the step S221, the specific implementation step of noise reduction it is as follows:
Practical spectrum curve figure is filtered by Wiener filtering, noise reduction process, i.e., the described Wiener filter is one kind
Linear filter, and still it is a kind of based on minimum mean square error criterion, to the optimal estimation device of stationary process.
Assuming that Wiener filter input signal is s (t), superimposed noise n (t).Output signal x (t) passes through filter g (t)
It is obtained by following convolution algorithm:
X (t)=g (t) * (s (t)+n (t)) (15)
For the signal x (t) estimated, it is expected that being equal to s (t).
Its error are as follows: e (t)=s (t+d)-x (t) (16)
Variance are as follows: e2(t)=s2(t+d)-2s(t+d)x(t)+x2(t) (17)
Wherein s (t+d) is desired filter output.
Write x (t) as convolution integral, i.e.,
Square error can be calculated are as follows:
Wherein RsIt is the auto-correlation function of s (t), RxIt is the auto-correlation function of x (t), RxsIt is the auto-correlation of x (t) He s (t)
Function.The final purpose of Wiener filtering is exactly to seek optimal g (t), so that E (e2) minimum.
Threshold value is found out by split plot design between maximum kind in the step S222, and spectrum curve figure is carried out at binaryzation
It manages, then extracts the numerical value i.e. coordinate of each point on spectrum curve by pixel scanning method;
The specific algorithm process of maximum variance between clusters is as follows:
If the gray value of piece image is 1~m, the pixel number that wherein gray value is i is ni, N expression image pixel
Point sum, then gray value is the probability that i occurs are as follows:
Enabling gray value be greater than threshold value k is C1Group, i.e. C1={ 1~k }, gray value are then C greater than threshold value k's2Group, C2={ k
+ 1~m }, then C1And C2The probability of appearance is respectively as follows:
C is calculated1And C2Gray average are as follows:
Wherein,It can so obtain:
μr=ω1·μ1+ω2·μ2 (25)
Thus the variances sigma between two groups can be calculated2Are as follows: σ2(k)=ω1(μ1-μr)2+ω2(μ2-μr)2 (26)
Formula (25) substitution formula (26) can be obtained: σ2(k)=ω1ω2(μ2-μ1)2
So optimal threshold T*=Arg max { σ2(k) }, (27) 0≤k < m-1
Acquire segmentation threshold T*=0.6353.
Being repaired and quantized to spectrum curve in the step S223, specific step is as follows:
The numerical value that practical nuclear spectrum curve graph extracts each point on nuclear energy spectral curve after filtering and noise reduction, binaryzation is sat
Mark, need to extract spectrum curve feature, and curve is quantized.Detailed process is as follows:
Firstly, Straight Line Identification identifies straight in nuclear energy spectrogram that is, by the row and column of scanning nuclear energy spectral curve binary map
Line;
Secondly, fixed point, cross, the ordinate of coordinate system where judging spectrum curve by the straight line identified, and origin is positioned,
Generally from top to bottom, it scans from left to right, the straight line identified is just horizontal, ordinate;
Third, spectrum curve feature extraction.For the influence for reducing frame and coordinate pair curve in image, frame need to be filtered
It removes.Filter out after frame again by pixel scan method line by line or scan by column point that pixel is 0 (black is 0 in bianry image,
1) white is.
Finally, curve quantizes.After extracting curve, by calculating the spectrum curve available point scanned to scan origin
Row and stringer distance determine position of the pixel in figure, be somebody's turn to do finally by multiplied by the scale factor for expanding coordinate
The coordinate value of pixel.
Final extraction spectrum curve characteristic effect is as shown in Figure 8.
And spectrum curve Preliminary Simulation effect is as shown in Figure 9.
Further, it can be seen from Fig. 8 and Fig. 9, the spectrum curve figure of obtained simulation is compared with proper energy spectral curve in certain points
Data lack.To be truly reflected practical spectrum curve characteristic as far as possible, need that the data of missing fill up repairing
It is multiple.
Specifically, described fill up the number lacked during spectrum curve feature extraction by cubic spline interpolation
Strong point, and stretched by the expansion of the ratio of coordinate to obtain the numerical value of each point on spectrum curve figure, it is effective to the data of missing to realize
It fills up and repairs in ground.
The cubic spline interpolation fills up the specific of the data point lacked during spectrum curve feature extraction
Algorithm is as follows:
Piecewise function S (x) on interval of definition [a, b], if meeting:
1. S (x) is in each subinterval [xi, xi+1] on be a cubic polynomial function;
2. S (x) has continuous second dervative on entire section [a, b].
Then S (x) is referred to as on section [a, b] about a=x0< x1< ... < xnA cubic spline function of=b.To three
Secondary spline interpolation problem are as follows: the n+1 node x of given function g (x)0, x1..., xnObtain function y0, y1..., yn, ask one
Cubic spline function S (x) makes its satisfaction:
S(xj)=yj, j=0,1 ..., n (28)
Wherein, function S (x) is known as the cubic spline functions of g (x).
If S (x) is the sample spline interpolation function three times of f (x), it must satisfy the following conditions:
1. interpolation condition, i.e.,
S(xj)=yj, j=0,1 ..., n-1
2. the condition of continuity, i.e.,
2. the first derivative condition of continuity, i.e.,
4. the second dervative condition of continuity, i.e.,
By the effect picture after cubic spline interpolation, as shown in Figure 10, can see by its partial enlarged view, cubic spline
Data point after interpolation is more smooth, more approaches actual value.
Practical nuclear spectrum curve simulation effect finally obtains practical nuclear spectrum curve graph after above-mentioned image procossing
It is as shown in figure 11 that the spectrum curve simulates effect picture.
Specifically, by each point value on Monte Carlo method direct sampling spectrum curve and curve, to obtain a system
Random random number is arranged, thus to simulate the randomness of nuclear decay process.
Figure 12 shows the effect picture of the simulation random generating process of nuclear signal;
Figure 13 shows that (this figure is by practical spectrum curve figure numerical value using Monte Carlo method direct sampling final effect figure
After obtaining energy level and counting rate this array after change, what random sampling procedure and counting obtained.This figure is suitable for proving by Meng Teka
The reasonability and accuracy of sieve sampling).
Numerical value (the horizontal seat of each point on simulation spectrum curve and curve has been obtained by numbers above image processing process
It is designated as location Channel, ordinate is counting rate Count), then can be obtained with this group of data of Monte Carlo method direct sampling
To a series of random energy level random numbers, (energy level such as, but not limited to passes through what multichannel analyzer quantified, and road location is
Refer to what the energy of nuclear decay process release obtained after multichannel analyzer quantifies), thus to simulate the randomness of nuclear decay process.
Finally the random number is counted again, available simulation spectrum curve figure, on the one hand can verify system in this way can
It, on the other hand can also be with inverting in multichannel analyzer, to demarcate the accuracy of multichannel analyzer by property and accuracy.
Simulation calculating is carried out to probability P (A)=p (unknown) that certain event A occurs using Monte Carlo method, it is specific to count
Calculation method:
(1) n times are carried out and repeat independent sampling test, calculating event A frequency is nA。
Introduce stochastic variable Xi, indicate event A frequency in i-th test, enable
Then have
(2) it calculates event A and repeats the occurrence frequency f in independent sampling test in n timesN, it is
(3) when N is sufficiently big, with probability fNAs probability P (A)=p estimated valueFor
(4) estimated value is requiredFor probability P (A)=p unbiased esti-mator, i.e.,
And direct sampling, the i.e. characteristic to nuclear signal on time and amplitude are with the random of two groups of obedience different distributions
Number is simulated, and random number be it is discrete, it is discontinuous.Sampling for discrete random sequence, the non-convention of direct sampling method
Think.
The specific sampling process of discrete distribution direct sampling method is as follows:
If the value range of discrete random variable X is Xi(i=0,1,2,3 ...), probability distribution are P (X=Xi)=Pi
(i=0,1,2,3 ...).Wherein Pi>=0,
(1) equally distributed random number r on (0,1) section is generated;
(2) positive integer n=0,1,2... are acquired, so that r meets
(3) sample value for extracting discrete random variable X is X=Xn.And as 0 < r≤P0When X=X0;
(4) step (1), (2), (3) are repeated until extracting n sample value.
Due to generation (0,1) if equally distributed random number r is in sectionProbability be
That is eventThe probability of appearance is equal to event X=XnThe probability of generation.
Again because random number r obeys being uniformly distributed on (0,1), probability density function is
Its distribution function is as follows:
Therefore it is X=x that the random number r generated, which draws sample value,nProbability be
It follows that being drawn into (X=X by direct sampling methodn) probability be equivalent to random number XnIn random number sequence X1,
X2... XnThe frequency of appearance.
It can be by following proof for direct sampling method reliability:
If X is discrete random variable, probability distribution Pi=P { X=Xi, wherein i=1,2 ....X is respectively with Pi
Obtain Xi, thenEvent | X-E (X) | >=ε indicates that stochastic variable X acquirement is all and meets inequality | Xi- E (X) | >=ε's
Probable value Xi, then
∵
∴
∴
Due to event X=XiThe probability that (i=0,1,2 ... N) occurs is pi(0<pi< 1), then X ≠ XiProbability be then 1-
pi, and each X=XiThe probability of generation is constant, and sampling results are unrelated with other each extraction results every time.Therefore X=Xi
Individual event is a bernoulli experiment, then sampling n times, then be n again Bernoulli trials.If enabling event A (X=Xi) occur
Number is nA, i.e. nA~B (n, p).Due to X1, X2..., XnIt is the random of 0-1 distribution of the n mutually indepedent and obedience parameters for p
Variable, and
HaveGiving any ε > 0 then has
It can be derived from by (4.31) formula
And
Therefore it can be derived from
Abbreviation obtains
I.e. when the frequency n of extraction is bigger, the frequency ratio of event A occurs after sampling number and population of samples is closer to thing
The probability that part A occurs.
Its error of random number is extracted by direct sampling are as follows:
It enablesTherefore
I.e.It is the unbiased esti-mator of p,
That is the number of sampling n is bigger, estimated valueCloser to theoretical value p.
Taking the above-mentioned ideal embodiment according to the present invention as inspiration, through the above description, relevant staff is complete
Various changes and amendments can be carried out without departing from the scope of the technological thought of the present invention' entirely.The technology of this invention
Property range is not limited to the contents of the specification, it is necessary to which the technical scope thereof is determined according to the scope of the claim.