fun_ofdm
1.0
802.11a Physical Layer for USRP
|
The circular_accumulator template. More...
#include <circular_accumulator.h>
Public Member Functions | |
circular_accumulator (int _size) | |
Constructor for circular_accumulator. More... | |
void | add (T sample) |
Adds a sample to the accumulator. More... | |
Public Attributes | |
T | sum |
The sum of the current samples in the samples vector. More... | |
std::vector< T > | samples |
The vector containing the past size samples of type T. More... | |
int | index |
The current index where the newest sample will be inserted on the next call to add(). More... | |
int | size |
The max number of samples the accumulator holds at any give time. More... | |
The circular_accumulator template.
This class is a template class for the circular accumulator which is used to keep a running sum of the past size samples
Definition at line 25 of file circular_accumulator.h.
|
inline |
Constructor for circular_accumulator.
_size | The max number of samples that the accumulator can hold at any given time. |
Initializes the samples vector to contain size elements and sets each element to 0 along with the initial sum.
Definition at line 69 of file circular_accumulator.h.
|
inline |
Adds a sample to the accumulator.
sample | The sample to add to the accumulator |
If the accumulator is full the oldest sample in the accumulator is overwritten by the new sample and the current value of sum is updated accordingly.
Definition at line 88 of file circular_accumulator.h.
Referenced by fun::frame_detector::work().
int fun::circular_accumulator< T >::index |
The current index where the newest sample will be inserted on the next call to add().
This variable is essentially private as the user should not interface with it directly.
Definition at line 51 of file circular_accumulator.h.
Referenced by fun::circular_accumulator< std::complex< double > >::add(), and fun::circular_accumulator< std::complex< double > >::circular_accumulator().
std::vector<T> fun::circular_accumulator< T >::samples |
The vector containing the past size samples of type T.
This member is essentially private as the user should not interface with it directly.
Definition at line 42 of file circular_accumulator.h.
Referenced by fun::circular_accumulator< std::complex< double > >::add(), and fun::circular_accumulator< std::complex< double > >::circular_accumulator().
int fun::circular_accumulator< T >::size |
The max number of samples the accumulator holds at any give time.
This variable is essentially private as the user should not interface with it directly.
Definition at line 59 of file circular_accumulator.h.
Referenced by fun::circular_accumulator< std::complex< double > >::add(), and fun::circular_accumulator< std::complex< double > >::circular_accumulator().
T fun::circular_accumulator< T >::sum |
The sum of the current samples in the samples vector.
This is the key variable from this class that the user should be interested in. In other words, it is essentially the only public variable.
Definition at line 34 of file circular_accumulator.h.
Referenced by fun::circular_accumulator< std::complex< double > >::add(), fun::circular_accumulator< std::complex< double > >::circular_accumulator(), and fun::frame_detector::work().