Loris::Resampler Class Reference

#include <Resampler.h>

List of all members.

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)


Detailed Description

Class Resampler represents an algorithm for resampling Partial envelopes at regular time intervals. Resampling makes the envelope data more suitable for exchange (as SDIF data, for example) with other applications that cannot process raw (continuously-distributed) reassigned data. Resampling will often greatly reduce the size of the data (by greatly reducing the number of Breakpoints in the Partials) without adversely affecting the quality of the reconstruction.

Constructor & Destructor Documentation

Loris::Resampler::Resampler ( double  sampleInterval  )  [explicit]

Construct a new Resampler using the specified sampling interval and sparse resampling.

Parameters:
sampleInterval is the resampling interval in seconds, Breakpoint data is computed at integer multiples of sampleInterval seconds.
Exceptions:
InvalidArgument if sampleInterval is not positive.


Member Function Documentation

template<typename Iter >
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.

Parameters:
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.
Exceptions:
InvalidArgument if sampleInterval is not positive.
If compiled with NO_TEMPLATE_MEMBERS defined, then begin and end must be PartialList::iterators, otherwise they can be any type of iterators over a sequence of Partials.

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.

Parameters:
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.
Exceptions:
InvalidArgument if sampleInterval is not positive.
If compiled with NO_TEMPLATE_MEMBERS defined, then begin and end must be PartialList::iterators, otherwise they can be any type of iterators over a sequence of Partials.

template<typename Iter >
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.

Parameters:
begin is the beginning of the range of Partials to resample
end is (one-past) the end of the range of Partials to resample
If compiled with NO_TEMPLATE_MEMBERS defined, then begin and end must be PartialList::iterators, otherwise they can be any type of iterators over a sequence of Partials.

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.

Parameters:
begin is the beginning of the range of Partials to resample
end is (one-past) the end of the range of Partials to resample
If compiled with NO_TEMPLATE_MEMBERS defined, then begin and end must be PartialList::iterators, otherwise they can be any type of iterators over a sequence of Partials.

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.

Parameters:
p is the Partial to resample

void Loris::Resampler::setDenseResampling ( bool  useDense  ) 

Select dense or sparse resampling.

Parameters:
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.

Parameters:
correctPhase is a boolean flag specifying that (if true) frequency/phase correction should be applied after resampling.


The documentation for this class was generated from the following file:

Generated on Wed Mar 11 15:39:43 2009 for Loris by  doxygen 1.5.7