Lines Matching +full:peak +full:- +full:to +full:- +full:peak
4 * The contents of this file are subject to the terms of the
24 * Use is subject to license terms.
51 // u-law max value converted to floating point
54 // XXX - patchable dc time constant: TC = 1 / (sample rate / DCfreq)
106 g -= NoSigWeight; in WeightedGain()
120 // Return latest weighted peak
121 // Clears the weighted peak for next calculation.
127 // Peak sum is averaged by the cache size in WeightedPeak()
130 g -= NoSigWeight; in WeightedPeak()
172 // Process an input buffer according to the specified flags
185 if (Undefined(inbuf->GetLength())) { in Process()
189 inbuf->RaiseError(err); in Process()
190 inbuf->Reference(); in Process()
191 inbuf->Dereference(); in Process()
195 // Set up to convert to floating point; verify all header formats in Process()
196 newhdr = inbuf->GetHeader(); in Process()
208 // Convert to floating-point up front, if necessary in Process()
209 if (inbuf->GetHeader() != newhdr) { in Process()
215 // Reference the resulting buffer to make sure it gets ditched later in Process()
216 inbuf->Reference(); in Process()
218 // run through highpass filter to reject DC in Process()
227 inbuf->Dereference(); in Process()
232 // Buffer is assumed to be floating-point double PCM
246 inhdr = inbuf->GetHeader(); in process_dcfilter()
247 inptr = (double *)inbuf->GetAddress(); in process_dcfilter()
248 frames = (size_t)inhdr.Time_to_Samples(inbuf->GetLength()); in process_dcfilter()
252 // Time constant corresponds to the number of samples for 500Hz in process_dcfilter()
254 dcweight = 1. - timeconstant; in process_dcfilter()
257 // XXX - should deal with multi-channel data! in process_dcfilter()
258 // XXX - for now, check first channel only in process_dcfilter()
263 if ((val >= PeakSig) || (val <= -PeakSig)) { in process_dcfilter()
273 // Add in this value to weighted average in process_dcfilter()
275 val -= DCaverage; in process_dcfilter()
278 else if (val < -1.) in process_dcfilter()
279 val = -1.; in process_dcfilter()
285 // Buffer is assumed to be floating-point double PCM
298 inhdr = inbuf->GetHeader(); in process_instant()
299 inptr = (double *)inbuf->GetAddress(); in process_instant()
300 frames = (size_t)inhdr.Time_to_Samples(inbuf->GetLength()); in process_instant()
303 // XXX - should deal with multi-channel data! in process_instant()
304 // XXX - for now, check first channel only in process_instant()
316 // Normalize to within a reasonable range in process_instant()
317 val -= LoSigInstantRange; in process_instant()
334 // Buffer is assumed to be floating-point double PCM
347 inhdr = inbuf->GetHeader(); in process_weighted()
348 inptr = (double *)inbuf->GetAddress(); in process_weighted()
349 frames = (size_t)inhdr.Time_to_Samples(inbuf->GetLength()); in process_weighted()
362 // Scale up the 'no signal' level to avoid a divide in the inner loop in process_weighted()
367 // save the peak sum of squares; in process_weighted()
370 // XXX - should deal with multi-channel data! in process_weighted()
371 // XXX - for now, check first channel only in process_weighted()
377 weighted_sum -= gain_cache[i]; in process_weighted()
378 gain_cache[i] = val; // save value to subtract later in process_weighted()
380 weighted_peaksum = weighted_sum; // save peak in process_weighted()
383 // above threshold (this attempts to keep the volume in process_weighted()