ldas-tools-filters
2.6.5
|
#include <Resample.hh>
Public Types | |
typedef ResampleTraits< TIn >::OutType | TOut |
typedef ResampleTraits< TIn >::OutType | TOut |
typedef ResampleTraits< TIn >::OutType | TOut |
Public Member Functions | |
Resample (const int p, const int q, const int n=10, const double beta=5.0L) | |
General purpose constructor. More... | |
Resample (const int p, const int q, const std::valarray< double > &b) | |
Special purpose constructor. More... | |
Resample (const Resample &rhs) | |
Copy constructor. More... | |
virtual | ~Resample () |
Virtual destructor. More... | |
const Resample & | operator= (const Resample &rhs) |
Assignment, needed because class has pointer members. More... | |
bool | operator== (const Resample &rhs) |
Comparison operator. More... | |
virtual Resample * | Clone () const |
Virtual constructor. More... | |
void | getB (std::valarray< double > &b) const |
Filter coefficents accessor. More... | |
virtual void | reset () |
Reset the internal state to its initial condition. More... | |
void | apply (TOut *const out, const TIn *const in, const size_t inlen) |
Resamples "in" by the factor p/q and returns the result in "out". More... | |
void | apply (std::valarray< TOut > &out, const std::valarray< TIn > &in) |
Resamples "in" by the factor p/q and returns the result in "out". More... | |
Resample (const int p, const int q, const int n=10, const double beta=5.0L) | |
General purpose constructor. More... | |
Resample (const int p, const int q, const std::valarray< double > &b) | |
Special purpose constructor. More... | |
Resample (const Resample &rhs) | |
Copy constructor. More... | |
virtual | ~Resample () |
Virtual destructor. More... | |
const Resample & | operator= (const Resample &rhs) |
Assignment, needed because class has pointer members. More... | |
bool | operator== (const Resample &rhs) |
Comparison operator. More... | |
virtual Resample * | Clone () const |
Virtual constructor. More... | |
void | getB (std::valarray< double > &b) const |
Filter coefficents accessor. More... | |
virtual void | reset () |
Reset the internal state to its initial condition. More... | |
void | apply (TOut *const out, const TIn *const in, const size_t inlen) |
Resamples "in" by the factor p/q and returns the result in "out". More... | |
void | apply (std::valarray< TOut > &out, const std::valarray< TIn > &in) |
Resamples "in" by the factor p/q and returns the result in "out". More... | |
Resample (const int p, const int q, const int n=10, const double beta=5.0L) | |
General purpose constructor. More... | |
Resample (const int p, const int q, const std::valarray< double > &b) | |
Special purpose constructor. More... | |
Resample (const Resample &rhs) | |
Copy constructor. More... | |
virtual | ~Resample () |
Virtual destructor. More... | |
const Resample & | operator= (const Resample &rhs) |
Assignment, needed because class has pointer members. More... | |
bool | operator== (const Resample &rhs) |
Comparison operator. More... | |
virtual Resample * | Clone () const |
Virtual constructor. More... | |
void | getB (std::valarray< double > &b) const |
Filter coefficents accessor. More... | |
virtual void | reset () |
Reset the internal state to its initial condition. More... | |
void | apply (TOut *const out, const TIn *const in, const size_t inlen) |
Resamples "in" by the factor p/q and returns the result in "out". More... | |
void | apply (std::valarray< TOut > &out, const std::valarray< TIn > &in) |
Resamples "in" by the factor p/q and returns the result in "out". More... | |
int | getP () const |
Gets the resample numerator. More... | |
int | getP () const |
Gets the resample numerator. More... | |
int | getP () const |
Gets the resample numerator. More... | |
int | getQ () const |
Gets the resample numerator. More... | |
int | getQ () const |
Gets the resample numerator. More... | |
int | getQ () const |
Gets the resample numerator. More... | |
int | getN () const |
Gets anti-aliasing filter parameters. More... | |
int | getN () const |
Gets anti-aliasing filter parameters. More... | |
int | getN () const |
Gets anti-aliasing filter parameters. More... | |
int | getNOrder () const |
Gets anti-aliasing filter parameters. More... | |
int | getNOrder () const |
Gets anti-aliasing filter parameters. More... | |
int | getNOrder () const |
Gets anti-aliasing filter parameters. More... | |
double | getBeta () const |
Gets anti-aliasing filter parameters. More... | |
double | getBeta () const |
Gets anti-aliasing filter parameters. More... | |
double | getBeta () const |
Gets anti-aliasing filter parameters. More... | |
double | getDelay () const |
Gets the delay due to the filtering action. More... | |
double | getDelay () const |
Gets the delay due to the filtering action. More... | |
double | getDelay () const |
Gets the delay due to the filtering action. More... | |
bool | operator== (const ResampleBase &rhs) |
Comparison operator. More... | |
Private Types | |
typedef LinFilt< double, TOut > | lft_type |
typedef lft_type * | lfd_type |
typedef std::vector< lfd_type > | lf_type |
typedef LinFilt< double, TOut > | lft_type |
typedef lft_type * | lfd_type |
typedef std::vector< lfd_type > | lf_type |
typedef LinFilt< double, TOut > | lft_type |
typedef lft_type * | lfd_type |
typedef std::vector< lfd_type > | lf_type |
Private Member Functions | |
void | initFilters (const std::valarray< double > &b) |
Initialise the filter bank. More... | |
LinFilt< double, TOut > & | getFilter (const int p, const int q) const |
Obtain the filter at position (p, q) More... | |
void | initFilters (const std::valarray< double > &b) |
Initialise the filter bank. More... | |
LinFilt< double, TOut > & | getFilter (const int p, const int q) const |
Obtain the filter at position (p, q) More... | |
void | initFilters (const std::valarray< double > &b) |
Initialise the filter bank. More... | |
LinFilt< double, TOut > & | getFilter (const int p, const int q) const |
Obtain the filter at position (p, q) More... | |
Private Attributes | |
std::valarray< TOut > | m_orphan |
Pointer to partial sum saved for split input purposes. More... | |
lf_type | m_lf |
Storage for anti-aliasing filters. More... | |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
typedef ResampleTraits< TIn >::OutType Filters::Resample< TIn >::TOut |
typedef ResampleTraits< TIn >::OutType Filters::Resample< TIn >::TOut |
typedef ResampleTraits< TIn >::OutType Filters::Resample< TIn >::TOut |
Filters::Resample< TIn >::Resample | ( | const int | p, |
const int | q, | ||
const int | n = 10 , |
||
const double | beta = 5.0L |
||
) |
General purpose constructor.
[in] | p | upsampling ratio |
[in] | q | downsampling ratio |
[in] | n | = 10 filter order: 2*n*max(p, q) is the length of the filter |
[in] | beta | = 5 the beta parameter of the Kaiser Window |
invalid_argument | if p or q or n < 1 or beta < 0.0 |
Filters::Resample< TIn >::Resample | ( | const int | p, |
const int | q, | ||
const std::valarray< double > & | b | ||
) |
Special purpose constructor.
[in] | p | upsampling ratio |
[in] | q | downsampling ratio |
[in] | b | filter to use |
invalid_argument | b.size() == 0 |
Filters::Resample< TIn >::Resample | ( | const Resample< TIn > & | rhs | ) |
Copy constructor.
[in] | rhs | instance to be copied |
|
virtual |
Virtual destructor.
Filters::Resample< TIn >::Resample | ( | const int | p, |
const int | q, | ||
const int | n = 10 , |
||
const double | beta = 5.0L |
||
) |
General purpose constructor.
[in] | p | upsampling ratio |
[in] | q | downsampling ratio |
[in] | n | = 10 filter order: 2*n*max(p, q) is the length of the filter |
[in] | beta | = 5 the beta parameter of the Kaiser Window |
invalid_argument | if p or q or n < 1 or beta < 0.0 |
Filters::Resample< TIn >::Resample | ( | const int | p, |
const int | q, | ||
const std::valarray< double > & | b | ||
) |
Special purpose constructor.
[in] | p | upsampling ratio |
[in] | q | downsampling ratio |
[in] | b | filter to use |
invalid_argument | b.size() == 0 |
Filters::Resample< TIn >::Resample | ( | const Resample< TIn > & | rhs | ) |
Copy constructor.
[in] | rhs | instance to be copied |
|
virtual |
Virtual destructor.
Filters::Resample< TIn >::Resample | ( | const int | p, |
const int | q, | ||
const int | n = 10 , |
||
const double | beta = 5.0L |
||
) |
General purpose constructor.
[in] | p | upsampling ratio |
[in] | q | downsampling ratio |
[in] | n | = 10 filter order: 2*n*max(p, q) is the length of the filter |
[in] | beta | = 5 the beta parameter of the Kaiser Window |
invalid_argument | if p or q or n < 1 or beta < 0.0 |
Filters::Resample< TIn >::Resample | ( | const int | p, |
const int | q, | ||
const std::valarray< double > & | b | ||
) |
Special purpose constructor.
[in] | p | upsampling ratio |
[in] | q | downsampling ratio |
[in] | b | filter to use |
invalid_argument | b.size() == 0 |
Filters::Resample< TIn >::Resample | ( | const Resample< TIn > & | rhs | ) |
Copy constructor.
[in] | rhs | instance to be copied |
|
virtual |
Virtual destructor.
void Filters::Resample< TIn >::apply | ( | TOut *const | out, |
const TIn *const | in, | ||
const size_t | inlen | ||
) |
Resamples "in" by the factor p/q and returns the result in "out".
The first call to apply initialises the internal state of Resample so that the input data is treated as if it were preceded by an infinite number of zeroes. After the first apply(), the Resampler is in a non-default state and it will assume that the next call to apply() is on a segment of data that is contiguous with the preceding input. In this way, a long data set can be broken up into smaller segments which can be resampled individually. The recombined data is identical resampling the original long data set.
This function is not const to remind users that its use modifies the internal state of Resample.
[out] | out | pointer to result of resampling the "in" data |
[in] | in | pointer to data to be resampled |
[in] | inlen | length of in |
invalid_argument | Input length must be a multiple of q |
void Filters::Resample< TIn >::apply | ( | TOut *const | out, |
const TIn *const | in, | ||
const size_t | inlen | ||
) |
Resamples "in" by the factor p/q and returns the result in "out".
The first call to apply initialises the internal state of Resample so that the input data is treated as if it were preceded by an infinite number of zeroes. After the first apply(), the Resampler is in a non-default state and it will assume that the next call to apply() is on a segment of data that is contiguous with the preceding input. In this way, a long data set can be broken up into smaller segments which can be resampled individually. The recombined data is identical resampling the original long data set.
This function is not const to remind users that its use modifies the internal state of Resample.
[out] | out | pointer to result of resampling the "in" data |
[in] | in | pointer to data to be resampled |
[in] | inlen | length of in |
invalid_argument | Input length must be a multiple of q |
void Filters::Resample< TIn >::apply | ( | TOut *const | out, |
const TIn *const | in, | ||
const size_t | inlen | ||
) |
Resamples "in" by the factor p/q and returns the result in "out".
The first call to apply initialises the internal state of Resample so that the input data is treated as if it were preceded by an infinite number of zeroes. After the first apply(), the Resampler is in a non-default state and it will assume that the next call to apply() is on a segment of data that is contiguous with the preceding input. In this way, a long data set can be broken up into smaller segments which can be resampled individually. The recombined data is identical resampling the original long data set.
This function is not const to remind users that its use modifies the internal state of Resample.
[out] | out | pointer to result of resampling the "in" data |
[in] | in | pointer to data to be resampled |
[in] | inlen | length of in |
invalid_argument | Input length must be a multiple of q |
void Filters::Resample< TIn >::apply | ( | std::valarray< TOut > & | out, |
const std::valarray< TIn > & | in | ||
) |
Resamples "in" by the factor p/q and returns the result in "out".
The first call to apply initialises the internal state of Resample so that the input data is treated as if it were preceded by an infinite number of zeroes. After the first apply(), the Resampler is in a non-default state and it will assume that the next call to apply() is on a segment of data that is contiguous with the preceding input. In this way, a long data set can be broken up into smaller segments which can be resampled individually. The recombined data is identical resampling the original long data set.
This function is not const to remind users that its use modifies the internal state of Resample.
[out] | out | result of resampling the "in" data |
[in] | in | data to be resampled |
invalid_argument | Input length must be a multiple of q |
void Filters::Resample< TIn >::apply | ( | std::valarray< TOut > & | out, |
const std::valarray< TIn > & | in | ||
) |
Resamples "in" by the factor p/q and returns the result in "out".
The first call to apply initialises the internal state of Resample so that the input data is treated as if it were preceded by an infinite number of zeroes. After the first apply(), the Resampler is in a non-default state and it will assume that the next call to apply() is on a segment of data that is contiguous with the preceding input. In this way, a long data set can be broken up into smaller segments which can be resampled individually. The recombined data is identical resampling the original long data set.
This function is not const to remind users that its use modifies the internal state of Resample.
[out] | out | result of resampling the "in" data |
[in] | in | data to be resampled |
invalid_argument | Input length must be a multiple of q |
void Filters::Resample< TIn >::apply | ( | std::valarray< TOut > & | out, |
const std::valarray< TIn > & | in | ||
) |
Resamples "in" by the factor p/q and returns the result in "out".
The first call to apply initialises the internal state of Resample so that the input data is treated as if it were preceded by an infinite number of zeroes. After the first apply(), the Resampler is in a non-default state and it will assume that the next call to apply() is on a segment of data that is contiguous with the preceding input. In this way, a long data set can be broken up into smaller segments which can be resampled individually. The recombined data is identical resampling the original long data set.
This function is not const to remind users that its use modifies the internal state of Resample.
[out] | out | result of resampling the "in" data |
[in] | in | data to be resampled |
invalid_argument | Input length must be a multiple of q |
|
virtual |
|
virtual |
|
virtual |
void Filters::Resample< TIn >::getB | ( | std::valarray< double > & | b | ) | const |
Filter coefficents accessor.
[in] | b | FIR filter coefficents array |
void Filters::Resample< TIn >::getB | ( | std::valarray< double > & | b | ) | const |
Filter coefficents accessor.
[in] | b | FIR filter coefficents array |
void Filters::Resample< TIn >::getB | ( | std::valarray< double > & | b | ) | const |
Filter coefficents accessor.
[in] | b | FIR filter coefficents array |
|
inherited |
Gets anti-aliasing filter parameters.
|
inherited |
Gets anti-aliasing filter parameters.
|
inherited |
Gets anti-aliasing filter parameters.
|
inherited |
Gets the delay due to the filtering action.
|
inherited |
Gets the delay due to the filtering action.
|
inherited |
Gets the delay due to the filtering action.
|
private |
Obtain the filter at position (p, q)
|
private |
Obtain the filter at position (p, q)
|
private |
Obtain the filter at position (p, q)
|
inherited |
Gets anti-aliasing filter parameters.
|
inherited |
Gets anti-aliasing filter parameters.
|
inherited |
Gets anti-aliasing filter parameters.
|
inherited |
Gets anti-aliasing filter parameters.
|
inherited |
Gets anti-aliasing filter parameters.
|
inherited |
Gets anti-aliasing filter parameters.
|
inlineinherited |
Gets the resample numerator.
|
inherited |
Gets the resample numerator.
|
inherited |
Gets the resample numerator.
|
inherited |
Gets the resample numerator.
|
inlineinherited |
Gets the resample numerator.
|
inherited |
Gets the resample numerator.
|
private |
Initialise the filter bank.
|
private |
Initialise the filter bank.
|
private |
Initialise the filter bank.
const Resample& Filters::Resample< TIn >::operator= | ( | const Resample< TIn > & | rhs | ) |
Assignment, needed because class has pointer members.
[in] | rhs | instance to be assigned from |
const Resample< TIn > & Filters::Resample< TIn >::operator= | ( | const Resample< TIn > & | rhs | ) |
Assignment, needed because class has pointer members.
[in] | rhs | instance to be assigned from |
const Resample& Filters::Resample< TIn >::operator= | ( | const Resample< TIn > & | rhs | ) |
Assignment, needed because class has pointer members.
[in] | rhs | instance to be assigned from |
|
inherited |
Comparison operator.
[in] | rhs | instance to be assigned from |
bool Filters::Resample< TIn >::operator== | ( | const Resample< TIn > & | rhs | ) |
Comparison operator.
[in] | rhs | instance to be assigned from |
bool Filters::Resample< TIn >::operator== | ( | const Resample< TIn > & | rhs | ) |
Comparison operator.
[in] | rhs | instance to be assigned from |
bool Filters::Resample< TIn >::operator== | ( | const Resample< TIn > & | rhs | ) |
Comparison operator.
[in] | rhs | instance to be assigned from |
|
virtual |
Reset the internal state to its initial condition.
Implements Filters::ResampleBase.
|
virtual |
Reset the internal state to its initial condition.
Implements Filters::ResampleBase.
|
virtual |
Reset the internal state to its initial condition.
Implements Filters::ResampleBase.
|
private |
Storage for anti-aliasing filters.
|
private |
Pointer to partial sum saved for split input purposes.