35 #ifndef OPENMS_FILTERING_NOISEESTIMATION_SIGNALTONOISEESTIMATORMEDIANRAPID_H 36 #define OPENMS_FILTERING_NOISEESTIMATION_SIGNALTONOISEESTIMATORMEDIANRAPID_H 108 nr_windows(nr_windows_),
110 window_length(win_len_),
111 result_windows_even(nr_windows_),
112 result_windows_odd(nr_windows_+1)
126 return std::max(1.0, (get_noise_even(mz)+get_noise_odd(mz))/2.0 );
132 int window_nr = (int)((mz - mz_start)/window_length);
133 assert(window_nr >= 0);
134 assert(window_nr < (
int)result_windows_even.size());
136 double noise = result_windows_even[window_nr];
143 int window_nr = (int)((mz - mz_start + window_length/2.0)/window_length);
144 assert(window_nr >= 0);
145 assert(window_nr < (
int)result_windows_odd.size());
147 double noise = result_windows_odd[window_nr];
154 window_length_(window_length)
164 return estimateNoise(spectrum->getMZArray()->data, spectrum->getIntensityArray()->data);
173 return estimateNoise(chrom->getTimeArray()->data, chrom->getIntensityArray()->data);
183 assert(mz_array.size() == int_array.size());
184 assert(mz_array.size() > 2);
186 int nr_windows = (int)((mz_array[mz_array.size()-1] - mz_array[0])/window_length_) + 1;
192 computeNoiseInWindows_(mz_array, int_array, eval.
result_windows_odd, mz_array[0] - window_length_/2.0);
204 void computeNoiseInWindows_(
const std::vector<double>& mz_array, std::vector<double> int_array, std::vector<double> & result,
double mz_start);
212 double computeMedian_(std::vector<double>::iterator & first, std::vector<double>::iterator & last);
218 #endif // OPENMS_FILTERING_NOISEESTIMATION_SIGNALTONOISEESTIMATORMEDIANRAPID_H boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:237
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:157
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47