Content of the invention
It is an object of the invention to provide there is system processor in a kind of imitative nuclear signal, to realize to nuclear energy spectral line
Emulated.
In order to solve above-mentioned technical problem, the invention provides there is system processor in a kind of imitative nuclear signal,
Including:Spectrum curve image data acquisition unit connected with spectrum curve image data acquiring unit;Described
Spectrum curve image data acquisition unit is suitable to send the actual spectrum curve view data for obtaining to random number
Generating unit, and simulation spectrum curve is obtained to export by random number generation unit.
Further, the spectrum curve image data acquisition unit includes:At display controller, curve data
Reason module data storage control module;The spectrum curve image data acquiring unit includes:Camera,
Memory module, display module, spectral line drafting module, and image processing module connected with camera;Institute
State image processing module to be connected with display module by display controller, to show camera by display module
The image of the actual nuclear spectrum curve map for shooting, and the image is gathered spectrum curve by spectral line drafting module
On data point to curve data processing module;The curve data processing module is suitable to according to the reality for showing
Spectrum curve figure is copied each key point of the nuclear energy spectral curve and obtains spectrum curve data, and passes through data storage
Control module is sent to memory module to set up spectrum curve database.
Further, the curve data processing module is connected with random number generation unit, and the random number is sent out
Raw unit includes:Nuclear signal time statistical property analog module and nuclear signal amplitude statistics simulated behavior module,
Wherein described nuclear signal time statistical property analog module is suitable to realize core by the random number for obeying exponential distribution
Signal time statistical property is simulated, the random number of the exponential distribution by (0,1] equally distributed random number leads to
Cross inverse function method conversion to obtain, and (0,1] uniform random number is suitable to try to achieve by linear congruential method;Institute
State nuclear signal amplitude statistics simulated behavior module to be suitable to by actual nuclear spectrum Curves Recognition and digitizing and obtaining
Each energy level amplitude and counting rate, then by DSMC direct sampling and the random number is exported to simulate
The randomness of nuclear decay process, then carry out statistical disposition to the random number and obtain the simulation spectrum curve.
Further, the processor also includes:There is module in ambient noise, the ambient noise occurs module to fit
In the noise signal that output is used for and simulation spectrum curve is superimposed.
Further, the processor also includes:Multiple tracks data processor, the multiple tracks data processor connection are used
Multi-channel analysis collecting unit in the real nuclear energy spectral line data for obtaining detector collection;Many track datas
Processor includes:Adc data and control module, data analysis and spectral line data processing module and peakvalue's checking and
Control module;The multi-channel analysis collecting unit includes:Preamplifier connected with detector, this is preposition
The output end of amplifier is connected with the input of sampling and holding circuit, energy level detection circuit respectively;Described adopt
The output end of sample and holding circuit passes through ADC converter;The adc data and control module are suitable to access very
Real 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 to gather the energy level data of real nuclear energy spectral line data, and by first, second
Control signal is respectively sent to the sampling in multi-channel analysis collecting unit and holding circuit, adc data and control mould
Block;The data analysis and spectral line data processing module are connected with random number generation unit, and real core is believed
Number energy spectrum diagram demarcated and calibrated to simulating spectrum curve data;
Further, the processor also includes:Feedback and calibration circuit, and by the feedback and calibration circuit
The feedback data of simulation nuclear energy spectral line is obtained, and random number generation unit will be sent to after the feedback data inverting;
And/or send feedback signal to the input of preamplifier.
Another aspect, on the basis of above-mentioned imitative nuclear signal generation system, present invention also offers a kind of imitative core
Signal generating system.
This imitative nuclear signal occurs system to include:Processor spectrum curve image connected with the processor
Data acquisition unit, the output end of the processor is by simulating spectrum curve data outputting unit and detector
It is connected.
Further, the spectrum curve image data acquiring unit also includes:Image connected with memory module
Conserving appliance, and the actual nuclear energy obtained by image conserving appliance is respectively set a song to music by described image conserving appliance
The image of line chart is preserved;The memory module is also connected with image processing module, that is, pass through described image
Processing module by the actual nuclear energy obtained by image conserving appliance respectively set a song to music line chart image is filtered, noise reduction is pre-
Process, Curves Recognition, curvilinear characteristic extract, and carry out interpolation processing with improve and repair disappearance can set a song to music
Each point data of line, to set up spectrum curve database.
The third aspect, present invention also offers there is the method for work of system processor in a kind of imitative nuclear signal,
This method of work comprises the steps:
Step S1, obtains actual nuclear spectrum curve map;
Step S2, is processed to actual nuclear spectrum curve map to obtain simulation spectrum curve;And
Step S3, inverting compare simulation spectrum curve and actual spectrum curve, with obtain simulation spectrum curve and
Error between actual spectrum curve.
Further, by being processed actual nuclear spectrum curve map to obtain simulation spectrum curve in step S2
Method include:
Step S21, carries out Curves Recognition to actual nuclear spectrum curve map and spectrum curve quantizes, to obtain
The numerical value of spectrum curve each point;Step S22, is obtained by this group numerical value of the random direct sampling of DSMC
The random number with regard to each nuclear level is arrived, to simulate the randomness of nuclear decay process;Step S23, to described random
Number carries out statistical disposition and obtains the simulation spectrum curve;
Wherein, Curves Recognition is carried out to actual nuclear spectrum curve map in step S21 and by spectrum curve number
Value includes in the method for obtaining the numerical value of spectrum curve each point:Actual nuclear energy is respectively set a song to music the image warp of line chart
Actual spectrum curve figure is shown after processing by filtering and noise reduction again, and the actual spectrum curve figure according to display
The each key point for copying the nuclear energy spectral curve obtains spectrum curve data, to set up spectrum curve database;Or
By actual nuclear energy respectively set a song to music line chart image is filtered, noise reduction pretreatment, Curves Recognition, curvilinear characteristic are extracted,
And interpolation processing is carried out so that each point data of disappearance spectrum curve is improved and repair, to set up spectrum curve number
According to storehouse;
Obtained with regard to each nuclear level by this group numerical value of the random direct sampling of DSMC in step S22
Random number include in the method for simulating the randomness of nuclear decay process:Nuclear signal time statistical property is simulated;
And nuclear signal amplitude statistics simulated behavior;The method of the nuclear signal time statistical property simulation includes:Logical
The random number for crossing obedience exponential distribution realizes the simulation of nuclear signal time statistical property, and wherein exponential distribution is random
Number by (0,1] equally distributed random number by inverse function method convert obtain, and (0,1] be uniformly distributed with
Machine number is suitable to try to achieve by linear congruential method;The method of the nuclear signal amplitude statistics simulated behavior includes:Logical
Cross to actual nuclear spectrum Curves Recognition and digitize and each energy level amplitude and counting rate is obtained, then pass through Monte Carlo
Method direct sampling simultaneously exports the random number;The wherein identification to actual nuclear energy spectral curve digitized mistake
Journey includes:Step S221, is filtered to actual spectrum curve figure, noise reduction;Step S222, by maximum
Between class, split plot design obtains threshold value, and spectrum curve figure is carried out binary conversion treatment, then is carried by pixel scanning method
The numerical value for taking out each point on spectrum curve is coordinate;Step S223, is repaired to spectrum curve and is quantized;
Described by DSMC direct sampling and the method that exports the random number, that is, pass through Monte Carlo side
Each point value on method direct sampling spectrum curve and curve, to obtain a series of random numbers, so as to simulation
The randomness of nuclear decay process;The method actual spectrum curve figure being filtered in step S221, i.e.,
Wiener filtering process is carried out to actual spectrum curve figure, to filter the Gaussian noise of spectrum curve in figure;Described
Spectrum curve is repaired in step S223 and is quantized including:Filled up by cubic spline interpolation
The data point lacked during spectrum curve feature extraction, and stretched by the ratio expansion of coordinate to obtain power spectrum
The numerical value of each point on curve map.
The invention has the beneficial effects as follows, there is system processor, system and work in the imitative nuclear signal of the present invention
Method by carrying out Curves Recognition to actual nuclear spectrum curve map and spectrum curve quantizing, so as to obtain energy
The numerical value (i.e. the counting rate of the energy level of nuclear spectrum and each energy level) of spectral curve each point, then pass through DSMC
Random this group numerical value of direct sampling to obtain the random number with regard to each nuclear level, so as to simulate nuclear decay process
Randomness, finally again the random number is carried out statistical disposition obtain simulate spectrum curve, by inverting pair
There is the reliability of system and accuracy with actual spectrum curve to determine imitative nuclear signal than simulating spectrum curve.
Embodiment 1
As shown in Fig. 2 the invention provides a kind of imitative nuclear signal occurs system processor, including:With energy
The connected spectrum curve image data acquisition unit of spectral curve image data acquiring unit;The spectrum curve figure
As data capture unit is suitable to send the actual spectrum curve view data for obtaining to random number generation unit,
And simulation spectrum curve is obtained to export by random number generation unit.
Specifically, the output end of the processor is connected with detector by simulating spectrum curve output unit.
The spectrum curve image data acquisition unit includes:Display controller, curve data processing module and
Data storage control module;The spectrum curve image data acquiring unit includes:Camera, memory module,
Display module, spectral line drafting module, and image processing module connected with camera;Described image is processed
Module is connected with display module by display controller, to show the reality of camera shooting by display module
The image of nuclear spectrum curve map, and the image is gathered the data point on spectrum curve by spectral line drafting module
To curve data processing module;The curve data processing module is suitable to according to the actual spectrum curve figure for showing
The each key point for copying the nuclear energy spectral curve obtains spectrum curve data, and is sent out by data storage control module
Memory module is delivered to set up spectrum curve database.
The curve data processing module is connected with random number generation unit, and the random number generation unit bag
Include:Nuclear signal time statistical property analog module and nuclear signal amplitude statistics simulated behavior module, wherein described
Nuclear signal time statistical property analog module is suitable to realize the nuclear signal time by the random number for obeying exponential distribution
Statistical property is simulated, the random number of the exponential distribution by (0,1] equally distributed random number passes through inverse function
Method conversion is obtained, and (0,1] uniform random number is suitable to try to achieve by linear congruential method;The nuclear signal
Amplitude statistics simulated behavior module is suitable to by actual nuclear spectrum Curves Recognition and digitizing and obtaining each energy level width
Value and counting rate, then by DSMC direct sampling and the random number is exported to simulate nuclear decay
The randomness of journey, then carry out statistical disposition to the random number and obtain the simulation spectrum curve.
Met by nuclear signal time statistical property analog module and nuclear signal amplitude statistics simulated behavior module
Actual nuclear decay process the time after with amplitude on statistical property.
With regard to 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 mould
Block is also connected with DAC data and control module, and DAC data and control module are suitable to pass through
Corresponding digital-to-analogue dress changes circuit and will simulate spectrum curve data is activation to detector.
The processor also includes:There is module in ambient noise, the ambient noise occurs module to be suitable to output use
In the noise signal superimposed with simulation spectrum curve.
The processor also includes:Multiple tracks data processor, the multiple tracks data processor are connected to obtain and visit
Survey the multi-channel analysis collecting unit of the real nuclear energy spectral line data of device collection;The multiple tracks data processor bag
Include:Adc data and control module, data analysis and spectral line data processing module and peakvalue's checking and control module;
The multi-channel analysis collecting unit includes:Preamplifier connected with detector, the preamplifier defeated
Go out end to be connected with the input of sampling and holding circuit, energy level detection circuit respectively;The sampling and holding electricity
The output end on road passes through ADC converter;The adc data and control module are suitable to access real nuclear spectrum
Line number evidence, and send the data to data analysis and spectral line data processing module;The peakvalue's checking and control
Molding block is suitable to gather the energy level data of real nuclear energy spectral line data, and first, second control signal is divided
Sampling and holding circuit, adc data and control module in not sending to multi-channel analysis collecting unit;The number
It is connected with random number generation unit according to analysis and spectral line data processing module, by the energy spectrum diagram of real nuclear signal
Simulation spectrum curve data are demarcated and is calibrated;
The effect of the adc data and control module is to transmit for analog quantity and ADC converter is controlled
System.
The ambient noise occurs module to be suitable to being superimposed nuclear signal and Gaussian noise, to reach simulation truly
The purpose of nuclear signal, is finally analyzed through multi-channel analysis collecting unit with checking system by the device capture of spy core again again
Reliability.
Specifically, the ambient noise generator can be set a song to music with simulation by the 2nd DAC data and control module
Corresponding D/A converting circuit in line data outputting unit is connected with Signal averaging module.
The effect of first, second DAC data and control module is transmitted for digital quantity and to follow-up digital-to-analogue
Change-over circuit is controlled.
Ambient noise occurs the specific algorithm of module generation noise as follows:
If (X, Y) is the stochastic variable of one group of separate and Normal Distribution, then understand its two dimension
Joint density function expression formula is:
Can be obtained by polar coordinate transform formula:X=Rcos (θ), y=Rsin (θ), wherein 0≤R≤r, 0≤θ≤2 π,
Then there is dxdy=RdRd θ, the distribution function that therefore can calculate R is:
Can so try to achieve
Thus F is calculated-1 R(X) obtain
I.e.
If random number X is obeyed (0,1) and is uniformly distributed, then 1-X is similarly obeyed and is uniformly distributed, therefore
Following replacement can be made
Wherein U, V are any (0,1) uniform random number.
Have in the same manner
So as to Gauss can be obtained and is divided by formula (5) or formula (6) conversion by two uniform random numbers U, V
Cloth random number.Can be tried to achieve by conversion by standardized normal distribution for different parameters normal distribution.
If X~N (0,1), then
σ X+ ε~N (ε, σ2) (7)
Also, the processor also includes:Feedback and calibration circuit, and obtained by the feedback and calibration circuit
The feedback data of nuclear energy spectral line must be simulated, and random number generation unit will be sent to after the feedback data inverting;
And/or send feedback signal to the input of preamplifier (by simulating controlling switch).
Optionally, feedback circuit unit includes:Gain module connected with the output end of Signal averaging module,
ADC connected with the gain module, the ADC by feedback and calibration module by data inversion after
It is sent to random number generation unit.
The process of implementing includes:
By feedback circuit by nuclear signal and superposed signal gain G=1 times of noise signal, respectively superposition is believed
Number to random number generating system and again sample through A/D conversion output and to obtain DfeedbackWith transmit to multi-channel analysis
D is obtained after deviceinput.The spectrum curve data obtained by contrasting two ways can obtain error coefficient k:
K=Dinput/Dfeedback(8)
When the system is operated, final output signal actual value is:
Doutput=k*Dinitial(9)
Also, the output end of the gain module is communicated to preamplifier also by a simulation controlling switch
Input, and be suitable to for feedback signal to be introduced to multi-channel analysis collecting unit, the simulation controlling switch is responsible for
Feedback signal is switched on or switched off, can be realized by low and high level.
Each functional module, unit in the processor can be realized using FPGA.
Also, USB interface is additionally provided with the processor, the USB interface is connected with random number generation unit,
Data debugging is carried out in order to PC.
Embodiment 3
As shown in figure 3, on the basis of embodiment 1, present invention also offers there is system in a kind of imitative nuclear signal
With the method for work of processor, comprise the steps:
Step S1, obtains actual nuclear spectrum curve map;Step S2, at actual nuclear spectrum curve map
Reason is to obtain simulation spectrum curve;And step S3, inverting compares simulation spectrum curve and actual spectrum curve,
To obtain the error between simulation spectrum curve and actual spectrum curve.
Further, as shown in figure 4, being processed to actual nuclear spectrum curve map in step S2 to obtain
The method of simulation spectrum curve, i.e., realize simulation spectrum curve by random number generation unit, and its method includes:
Step S21, carries out Curves Recognition to actual nuclear spectrum curve map and spectrum curve quantizes, to obtain
The numerical value of spectrum curve each point;Step S22, is obtained by this group numerical value of the random direct sampling of DSMC
The random number with regard to each nuclear level is arrived, to simulate the randomness of nuclear decay process;And step S23, to described
Random number carries out statistical disposition and obtains the simulation spectrum curve.
Specifically, Curves Recognition is carried out to actual nuclear spectrum curve map in step S21 and by spectrum curve
Quantizing is included with obtaining the method for the numerical value of spectrum curve each point:
Actual nuclear energy is respectively set a song to music line chart the filtered denoising of image after again actual spectrum curve figure is carried out
Show, and each key point for the nuclear energy spectral curve being copied according to the actual spectrum curve figure for showing is obtained and can be set a song to music
Line number evidence, to set up spectrum curve database;Or by actual nuclear energy respectively set a song to music line chart image filtered, drop
Make an uproar pretreatment, Curves Recognition, curvilinear characteristic extract, and carry out interpolation processing with improve and repair disappearance energy
Each point data of spectral curve, to set up spectrum curve database.
Wherein, closed by this group numerical value of the random direct sampling of DSMC in step S22
Include in the method for simulating the randomness of nuclear decay process in the random number of each nuclear level:The nuclear signal time counts
Simulated behavior and nuclear signal amplitude statistics simulated behavior.
The method of the nuclear signal time statistical property simulation includes:By obeying the random number reality of exponential distribution
Existing nuclear signal time statistical property simulation, the wherein random number of exponential distribution by (0,1] equally distributed random
Number is obtained by inverse function method conversion, and (0,1] uniform random number is suitable to try to achieve by linear congruential method.
Specifically, tried to achieve 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 for choosing1Referred to as seed, the generation quality to random number have one to be fixed
Ring, its value is respectively 1~216Choose between=65535.For the ease of using on computers, generally 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 by inverse function method, specifically
Process is as follows:
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.
Permissible by above formula, F (x) ∈ [0,1), and monotone decreasing in the domain of definition, therefore function F (x) is in 0~+∞
There must be inverse function, seek its inverse function:
Due to 0 < 1-F (x)≤1, therefore above formula can be reduced to
Can be learnt by meeting by formula (14) (0,1] equally distributed Random sampling obtain obeying exponential distribution with
Machine number x.
TakeThe exponential distribution produced by inverse function method by the equal distribution random numbers of above unit is random
Number distribution map such as Fig. 6.1000 group squares are evenly dividing to above exponential distribution random number span and are carried out
Statistics, final statistical chart are as shown in Figure 7.
The method of the nuclear signal amplitude statistics simulated behavior includes:By to actual nuclear spectrum Curves Recognition simultaneously
Digitlization obtains each energy level amplitude and counting rate, then by DSMC direct sampling and export described with
Machine number;Identification digitized process wherein to actual nuclear energy spectral curve includes:
Step S221, is filtered to actual spectrum curve figure, noise reduction;Step S222, by between maximum kind
Split plot design obtains threshold value, and spectrum curve figure is carried out binary conversion treatment, then is extracted by pixel scanning method
On spectrum curve, the numerical value of each point is coordinate;Step S223, is repaired to spectrum curve and is quantized.
Specifically, described by DSMC direct sampling and the method that exports the random number, that is, lead to
Each point value on crossing DSMC direct sampling spectrum curve and curve, a series of random to obtain
Random number, so as to simulate the randomness of nuclear decay process.
The method actual spectrum curve figure being filtered in step S221, i.e., to actual spectrum curve figure
Wiener filtering process is carried out, so that the Gaussian noise of spectrum curve in figure is filtered, so as to reduce noise as far as possible
The interference for bringing.
The specific implementation process of the method for the nuclear signal amplitude statistics simulated behavior is as follows:
Actual spectrum curve figure is filtered in step S221, the specific implementation step of noise reduction as follows:
Actual spectrum curve figure is filtered by Wiener filtering, noise reduction process, i.e., described Wiener filter
For a kind of linear filter, and also it is a kind of based on minimum mean square error criterion, the optimum to stationary process
Estimator.
Assume that Wiener filter input signal is s (t), superimposed noise n (t).Output signal x (t) passes through wave filter g (t)
Obtained by following convolution algorithm:
X (t)=g (t) * (s (t)+n (t)) (15)
For signal x (t) for estimating, it is desirable to be equal to s (t).
Its error is:E (t)=s (t+d)-x (t) (16)
Variance is:e2(t)=s2(t+d)-2s(t+d)x(t)+x2(t) (17)
Wherein s (t+d) is the output of desired wave filter.
X (t) is write as convolution integral, i.e.,
Square error can be calculated is:
Wherein RsIt is the auto-correlation function of s (t), RxIt is the auto-correlation function of x (t), RxsIt is x (t) and s (t) from phase
Close function.The final purpose of Wiener filtering is exactly to seek optimum g (t) so that E (e2) minimum.
Threshold value is obtained by split plot design between maximum kind in step S222, and spectrum curve figure is carried out two-value
Change is processed, then the numerical value i.e. coordinate for being extracted 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, wherein gray value is n for the pixel number of ii, N represents figure
As pixel sum, then the probability that gray value occurs for i is:
It is C more than threshold value k to make gray value1Group, i.e. C1={ 1~k }, that gray value is more than threshold value k is then C2Group,
C2={ k+1~m }, then C1And C2The probability of appearance is respectively:
It is calculated C1And C2Gray average be:
Wherein,Can so obtain:
μr=ω1·μ1+ω2·μ2(25)
Thus the variances sigma between two groups can be calculated2For:σ2(k)=ω1(μ1-μr)2+ω2(μ2-μr)2(26)
Formula (25) is substituted into formula (26) to obtain:σ2(k)=ω1ω2(μ2-μ1)2
So optimal threshold T*=Arg max { σ2(k) }, 0≤k < m-1 (27)
Try to achieve segmentation threshold T*=0.6353.
That spectrum curve repaired in step S223 and quantized comprises the following steps that:
For extracting the number of each point on nuclear energy spectral curve after the filtered denoising of actual nuclear spectrum curve map, binaryzation
Value is coordinate, need to extract spectrum curve feature, and curve is quantized.Detailed process is as follows:
First, Straight Line Identification, i.e., by the row and column of scanning nuclear energy spectral curve binary map, identify nuclear spectrum
The straight line of in figure;
Secondly, fixed point, is judged horizontal stroke, the ordinate of spectrum curve place coordinate system by the straight line for recognizing, and
Positioning initial point, typically from top to bottom, is scanned from left to right, and the straight line for identifying just is sat for horizontal, vertical
Mark;
3rd, spectrum curve feature extraction.For reduce image in frame and coordinate pair curve impact, need by
Frame is filtered.Again the point (two that pixel is 0 line by line or is scanned by column by pixel scan method after filtering frame
In value image, black is 0, and white is 1).
Finally, curve quantizes.After extracting curve, arrived by calculating the spectrum curve available point for scanning
With stringer distance, the row of scan origin determines that the pixel, in the position of in figure, is sat finally by being multiplied by expand
Target scale factor obtains the coordinate value of the 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, can be seen that from Fig. 8 and Fig. 9, the spectrum curve figure of the simulation for obtaining is than proper energy spectral curve
Lack in the data of some points.For truly reflecting actual spectrum curve characteristic as far as possible, need to lacking
The data of mistake carry out filling up reparation.
Specifically, described being filled up by cubic spline interpolation is lacked during spectrum curve feature extraction
The data point of mistake, and stretched by the ratio expansion of coordinate to obtain the numerical value of each point on spectrum curve figure, to realize
Data to lacking effectively are filled up and reparation.
The cubic spline interpolation is filling up the data point lacked during the spectrum curve feature extraction
Specific algorithm is as follows:
Piecewise function S (x) on interval of definition [a, b], if meet:
1. S (x) is in each subinterval [xi, xi+1] on be a cubic polynomial function;
2. S (x) has continuous second dervative on whole interval [a, b].
Then S (x) be called on interval [a, b] with regard to a=x0< x1< ... < xnOne cubic spline function of=b.
So as to cubic spline interpolation problem it is:N+1 node x of given function g (x)0, x1..., xnObtain function
y0, y1..., yn, seek cubic spline function S (x) so as to meet:
S(xj)=yj, j=0,1 ..., n (28)
Wherein, function S (x) is referred to as the cubic spline functions of g (x).
If S (x) is three sample spline interpolation functions of f (x), then must be fulfilled for following condition:
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.,
Design sketch after cubic spline interpolation, as shown in Figure 10, can be seen by its partial enlarged drawing,
Data point after cubic spline interpolation is more smoothed, and more approaches actual value.
Actual nuclear spectrum curve simulation effect, i.e., to actual nuclear spectrum curve map after above-mentioned image procossing, most
It is as shown in figure 11 that the spectrum curve simulation design sketch is obtained eventually.
Specifically, by each point value on DSMC direct sampling spectrum curve and curve, to obtain
A series of random random numbers are obtained, so as to simulate the randomness of nuclear decay process.
Figure 12 shows the design sketch of the random generating process of simulation nuclear signal;
Figure 13 shows that (this figure is by actual spectrum curve using DSMC direct sampling final effect figure
Figure obtains energy level and this array of counting rate after quantizing after, random sampling procedure counting is obtained.This figure
It is suitable to prove by reasonability and the accuracy of Monte-Carlo step).
Obtain simulating the numerical value of each point on spectrum curve and curve by numbers above image processing process
(abscissa is road location Channel, and ordinate is counting rate Count), then directly taken out with DSMC
This group data of sample can just obtain a series of random energy level random numbers, and (energy level is such as, but not limited to by multiple tracks
Analyzer quantization is obtained, and the road location refers to the energy of nuclear decay process release after multichannel analyzer quantization
Obtain), so as to simulate the randomness of nuclear decay process.Finally again the random number is counted, can
To obtain simulating spectrum curve figure, so on the one hand can be with the reliability of checking system and accuracy, the opposing party
Face can also inverting in multichannel analyzer, in order to demarcate the accuracy of multichannel analyzer.
Using DSMC, probability P (A)=p (unknown) that certain event A is occurred, meter is simulated
Calculate, circular:
(1) n times are carried out and repeats independent sampling test, it is n to calculate event A frequencyA.
Introduce stochastic variable Xi, represent event A frequency in i & lt test, order
Then have
(2) calculate event A and repeat the occurrence frequency f in independent sampling test in n timesN, it is
(3) when N is fully big, with probability fNEstimate as probability P (A)=pFor
(4) estimate is requiredFor the unbiased esti-mator of probability P (A)=p, i.e.,
And direct sampling, i.e. characteristic to nuclear signal on time and amplitude be with two groups of obedience different distributions
Random number simulating, and random number be discrete, discontinuous.For the sampling of discrete random sequence,
Direct sampling method is ideal.
The concrete sampling process of discrete distribution direct sampling method is as follows:
If the span of discrete random variable X is Xi(i=0,1,2,3 ...), its probability distribution is
P (X=Xi)=Pi(i=0,1,2,3 ...).Wherein Pi>=0,
(1) equally distributed random number r on (0,1) interval is produced;
(2) positive integer n=0 is tried to achieve, 1,2... so that r meets
(3) sample value for extracting discrete random variable X is X=Xn.And work as 0<r≤P0When X=X0;
(4) repeat step (1), (2), (3) are until extracting n sample value.
Due to producing (0,1) if equally distributed random number r is in intervalProbability 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), its probability density function is
Its distribution function is as follows:
Therefore random number r for producing draws sample value for X=xnProbability be
It follows that being drawn into (X=X by direct sampling methodn) probability be equivalent to random number XnIn random number sequence
Row X1, X2... XnThe frequency of appearance.
Can be by following proof for direct sampling method reliability:
If X is discrete random variable, its probability distribution is Pi=P { X=Xi, wherein i=1,2 ....X respectively with
PiObtain Xi, thenEvent | X-E (X) | >=ε represents that stochastic variable X obtains all satisfactions
Inequality | Xi- E (X) | the probable value X of >=εi, then
∵
∴
∴
Due to event X=XiThe probability that (i=0,1,2 ... N) occurs is pi(0<pi<1), then X ≠ XiGeneral
Rate is then 1-pi, and X=X every timeiThe probability of generation be constant, and every time sampling results with other each time extraction
As a result unrelated.Therefore X=XiIndividual event is a bernoulli experiment, then sampling n time, then weigh primary for n
Nu Li is tested.If making event A (X=Xi) number of times that occurs is nA, i.e. nA~B (n, p).Due to X1, X2...,
XnIt is n stochastic variable that is separate and obeying the 0-1 distribution that parameter is p, and
HaveGiving any ε > 0 then has
Can be derived from by (4.31) formula
And
Therefore can be derived from
Abbreviation is obtained
I.e. when the frequency n for extracting is bigger, after sampling, the number of times of event A appearance is got over the frequency ratio of population of samples
Close to the probability that event A occurs.
Its error of random number is extracted by direct sampling is:
OrderTherefore
I.e.It is the unbiased esti-mator of p,
That is the number of times of sampling n is bigger, estimateCloser to theoretical value p.
With the above-mentioned desirable embodiment according to the present invention as enlightenment, by above-mentioned description, related work
Personnel can carry out various change and modification completely in the range of without departing from this invention technological thought.
The technical scope of this invention is not limited to the content on specification, it is necessary to according to right
To determine its technical scope.