libsdr
0.1.0
A simple SDR library
|
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... | |
Implements a fractional sub-sampler.
typedef Traits<Scalar>::SScalar sdr::FracSubSampleBase< Scalar >::SScalar |
The input & output type super-scalar.
|
inline |
Constructor.
frac | Specifies the output sample rate relative to the input sample rate. I.e. 2 means half the input sample rate. |
|
inlinevirtual |
Destructor.
|
inline |
Returns the effective sub-sample fraction.
|
inline |
Reset sample counter.
|
inline |
Resets the sample rate fraction.
|
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.
|
protected |
The average.
|
protected |
The sub-sample period.
|
protected |
The number of samples collected times (1<<16).