107 nr_windows(nr_windows_),
109 window_length(win_len_),
110 result_windows_even(nr_windows_),
111 result_windows_odd(nr_windows_+1)
125 return std::max(1.0, (get_noise_even(mz)+get_noise_odd(mz))/2.0 );
131 int window_nr = (int)((mz - mz_start)/window_length);
132 assert(window_nr >= 0);
133 assert(window_nr < (
int)result_windows_even.size());
135 double noise = result_windows_even[window_nr];
142 int window_nr = (int)((mz - mz_start + window_length/2.0)/window_length);
143 assert(window_nr >= 0);
144 assert(window_nr < (
int)result_windows_odd.size());
146 double noise = result_windows_odd[window_nr];
153 window_length_(window_length)
163 return estimateNoise(spectrum->getMZArray()->data, spectrum->getIntensityArray()->data);
172 return estimateNoise(chrom->getTimeArray()->data, chrom->getIntensityArray()->data);
182 assert(mz_array.size() == int_array.size());
183 assert(mz_array.size() > 2);
185 int nr_windows = (int)((mz_array[mz_array.size()-1] - mz_array[0])/window_length_) + 1;
191 computeNoiseInWindows_(mz_array, int_array, eval.
result_windows_odd, mz_array[0] - window_length_/2.0);
203 void computeNoiseInWindows_(
const std::vector<double>& mz_array, std::vector<double> int_array, std::vector<double> & result,
double mz_start);
211 double computeMedian_(std::vector<double>::iterator & first, std::vector<double>::iterator & last);
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:236
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:156
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46