sdr::FracSubSampleBase< Scalar > Class Template Reference

Implements a fractional sub-sampler. More...

`#include <subsample.hh>`

## Public Types

typedef Traits< Scalar >::SScalar | SScalar
| The input & output type super-scalar. More...

## Public Member Functions

| FracSubSampleBase (double frac)
| Constructor. More...
virtual | ~FracSubSampleBase ()
| Destructor. More...
void | setFrac (double frac)
| Resets the sample rate fraction. More...
double | frac () const
| Returns the effective sub-sample fraction. More...
void | reset ()
| Reset sample counter. More...
Buffer< Scalar > | subsample (const Buffer< Scalar > &in, const Buffer< Scalar > &out)
| Performs the sub-sampling. More...

## Protected Attributes

SScalar | _avg
| The average. More...
size_t | _sample_count
| The number of samples collected times (1<<16). More...
size_t | _period
| The sub-sample period. More...

## Detailed Description

### template<class Scalar>
class sdr::FracSubSampleBase< Scalar >

Implements a fractional sub-sampler.

## Member Typedef Documentation

template<class Scalar >

typedef Traits<Scalar>::SScalar sdr::FracSubSampleBase< Scalar >::SScalar

The input & output type super-scalar.

## Constructor & Destructor Documentation

template<class Scalar >

sdr::FracSubSampleBase< Scalar >::FracSubSampleBase | ( | double | frac | ) |

inline

Constructor.

Parameters

  frac | Specifies the output sample rate relative to the input sample rate. I.e. 2 means half the input sample rate.

template<class Scalar >

virtual sdr::FracSubSampleBase< Scalar >::~FracSubSampleBase | ( |  | ) |

inlinevirtual

Destructor.

## Member Function Documentation

template<class Scalar >

double sdr::FracSubSampleBase< Scalar >::frac | ( |  | ) | const

inline

Returns the effective sub-sample fraction.

template<class Scalar >

void sdr::FracSubSampleBase< Scalar >::reset | ( |  | ) |

inline

Reset sample counter.

template<class Scalar >

void sdr::FracSubSampleBase< Scalar >::setFrac | ( | double | frac | ) |

inline

Resets the sample rate fraction.

template<class Scalar >

Buffer<Scalar> sdr::FracSubSampleBase< Scalar >::subsample | ( | const Buffer< Scalar > & | in,
|  | const Buffer< Scalar > & | out
| ) |  |

inline

Performs the sub-sampling.

`in` and `out` may refer to the same buffer allowing for an in-place operation. Returns a view on the output buffer containing the sub-samples.

## Member Data Documentation

template<class Scalar >

SScalar sdr::FracSubSampleBase< Scalar >::_avg

protected

The average.

template<class Scalar >

size_t sdr::FracSubSampleBase< Scalar >::_period

protected

The sub-sample period.

template<class Scalar >

size_t sdr::FracSubSampleBase< Scalar >::_sample_count

protected

The number of samples collected times (1<<16).

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

- /Users/hannes/Uni/Elektronik/sdr/libsdr/src/subsample.hh