#include <Resampler.h>
Public Member Functions | |
| Resampler (double sampleInterval) | |
| void | setDenseResampling (bool useDense) |
| void | setPhaseCorrect (bool correctPhase) |
| void | resample (Partial &p) const |
| void | operator() (Partial &p) const |
| Function call operator: same as resample( p ). | |
| template<typename Iter > | |
| void | resample (Iter begin, Iter end) const |
| template<typename Iter > | |
| void | operator() (Iter begin, Iter end) const |
| Function call operator: same as resample( begin, end ). | |
Static Public Member Functions | |
| template<typename Iter > | |
| static void | resample (Iter begin, Iter end, double sampleInterval, bool denseResampling=false) |
| Loris::Resampler::Resampler | ( | double | sampleInterval | ) | [explicit] |
Construct a new Resampler using the specified sampling interval and sparse resampling.
| sampleInterval | is the resampling interval in seconds, Breakpoint data is computed at integer multiples of sampleInterval seconds. |
| InvalidArgument | if sampleInterval is not positive. |
| void Loris::Resampler::resample | ( | Iter | begin, | |
| Iter | end, | |||
| double | sampleInterval, | |||
| bool | denseResampling = false | |||
| ) | [inline, static] |
Static member that constructs an instance and applies it to a sequence of Partials. Construct a Resampler using the specified resampling interval, and use it to channelize a sequence of Partials.
| begin | is the beginning of a sequence of Partials to resample. | |
| end | is the end of a sequence of Partials to resample. | |
| sampleInterval | is the resampling interval in seconds, Breakpoint data is computed at integer multiples of sampleInterval seconds. | |
| denseResampling | is a boolean flag indicating that dense resamping (Breakpoint at every integer multiple of the resampling interval) should be performed. If false (the default), sparse resampling (Breakpoints only at multiples of the resampling interval near Breakpoint times in the original Partial) is performed. |
| InvalidArgument | if sampleInterval is not positive. |
Static member that constructs an instance and applies phase-correct resampling to a sequence of Partials. Construct a Resampler using the specified resampling interval, and use it to channelize a sequence of Partials.
| begin | is the beginning of a sequence of Partials to resample. | |
| end | is the end of a sequence of Partials to resample. | |
| sampleInterval | is the resampling interval in seconds, Breakpoint data is computed at integer multiples of sampleInterval seconds. | |
| denseResampling | is a boolean flag indicating that dense resamping (Breakpoint at every integer multiple of the resampling interval) should be performed. If false (the default), sparse resampling (Breakpoints only at multiples of the resampling interval near Breakpoint times in the original Partial) is performed. |
| InvalidArgument | if sampleInterval is not positive. |
| void Loris::Resampler::resample | ( | Iter | begin, | |
| Iter | end | |||
| ) | const [inline] |
Resample all Partials in the specified (half-open) range using this Resampler's stored quanitization interval. If sparse resampling (the default) has be selected, Breakpoint times are quantized to integer multiples of the resampling interval. If dense resampling is selected, a Breakpoint will be provided at every integer multiple of the resampling interval in the time span of the Partial, starting and ending with the nearest multiples to the ends of the Partial. Frequencies and phases are corrected to be in agreement and to match as nearly as possible the resampled phases if phase correct resampling is specified (the default). Resampling is performed in-place.
| begin | is the beginning of the range of Partials to resample | |
| end | is (one-past) the end of the range of Partials to resample |
Resample all Partials in the specified (half-open) range using this Resampler's stored sampling interval, so that the Breakpoints in the Partial envelopes will all lie on a common temporal grid. The Breakpoint times in the resampled Partial will comprise a contiguous sequence of integer multiples of the sampling interval, beginning with the multiple nearest to the Partial's start time and ending with the multiple nearest to the Partial's end time. Resampling is performed in-place.
| begin | is the beginning of the range of Partials to resample | |
| end | is (one-past) the end of the range of Partials to resample |
| void Loris::Resampler::resample | ( | Partial & | p | ) | const |
Resample a Partial using this Resampler's stored quanitization interval. If sparse resampling (the default) has be selected, Breakpoint times are quantized to integer multiples of the resampling interval. If dense resampling is selected, a Breakpoint will be provided at every integer multiple of the resampling interval in the time span of the Partial, starting and ending with the nearest multiples to the ends of the Partial. Frequencies and phases are corrected to be in agreement and to match as nearly as possible the resampled phases if phase correct resampling is specified (the default). Resampling is performed in-place.
| p | is the Partial to resample |
| void Loris::Resampler::setDenseResampling | ( | bool | useDense | ) |
Select dense or sparse resampling.
| useDense | is a boolean flag indicating that dense resamping (Breakpoint at every integer multiple of the resampling interval) should be performed. If false (the default), sparse resampling (Breakpoints only at multiples of the resampling interval near Breakpoint times in the original Partial) is performed. |
| void Loris::Resampler::setPhaseCorrect | ( | bool | correctPhase | ) |
Specify phase-corrected resampling, or not. If phase correct, Partial frequencies are altered slightly to match, as nearly as possible, the Breakpoint phases after resampling. Phases are updated so that the Partial frequencies and phases are consistent after resampling.
| correctPhase | is a boolean flag specifying that (if true) frequency/phase correction should be applied after resampling. |
1.5.7