blah2
A real-time passive radar
IqData Class Reference

A class to store IQ data. More...

#include <IqData.h>

Collaboration diagram for IqData:
Collaboration graph

Public Member Functions

 IqData (uint32_t n)
 Constructor. More...
 
uint32_t get_n ()
 Getter for maximum number of samples. More...
 
uint32_t get_length ()
 Getter for current data length. More...
 
void lock ()
 Locker for mutex. More...
 
void unlock ()
 Unlocker for mutex. More...
 
std::deque< std::complex< double > > get_data ()
 Getter for data. More...
 
void push_back (std::complex< double > sample)
 Push a sample to the queue. More...
 
std::complex< double > pop_front ()
 Pop the front of the queue. More...
 
void print ()
 Print to stdout (debug). More...
 
void clear ()
 Clear samples from the queue. More...
 
void update_spectrum (std::vector< std::complex< double >> spectrum)
 Update the time differences and names. More...
 
void update_frequency (std::vector< double > frequency)
 Update the time differences and names. More...
 
std::string to_json (uint64_t timestamp)
 Generate JSON of the signal and metadata. More...
 

Private Attributes

uint32_t n
 Maximum number of samples. More...
 
std::mutex mutex_lock
 True if should not push to buffer (mutex). More...
 
std::deque< std::complex< double > > * data
 Pointer to IQ data. More...
 
double min
 Minimum value. More...
 
double max
 Maximum value. More...
 
double mean
 Mean value. More...
 
std::vector< std::complex< double > > spectrum
 Spectrum vector. More...
 
std::vector< double > frequency
 Frequency vector (Hz). More...
 

Detailed Description

A class to store IQ data.

Implements a FIFO queue to store IQ samples.

Author
30hours

Constructor & Destructor Documentation

◆ IqData()

IqData::IqData ( uint32_t  n)

Constructor.

Parameters
nNumber of samples.
Returns
The object.

Member Function Documentation

◆ clear()

void IqData::clear ( )

Clear samples from the queue.

Returns
Void.

◆ get_data()

std::deque< std::complex< double > > IqData::get_data ( )

Getter for data.

Returns
IQ data.

◆ get_length()

uint32_t IqData::get_length ( )

Getter for current data length.

Returns
Number of samples currently in data.

◆ get_n()

uint32_t IqData::get_n ( )

Getter for maximum number of samples.

Returns
Maximum number of samples.

◆ lock()

void IqData::lock ( )

Locker for mutex.

Returns
Void.

◆ pop_front()

std::complex< double > IqData::pop_front ( )

Pop the front of the queue.

Returns
Sample from the front of the queue.

◆ print()

void IqData::print ( )

Print to stdout (debug).

Returns
Void.

◆ push_back()

void IqData::push_back ( std::complex< double >  sample)

Push a sample to the queue.

Parameters
sampleA single sample.
Returns
Void.

◆ to_json()

std::string IqData::to_json ( uint64_t  timestamp)

Generate JSON of the signal and metadata.

Parameters
timestampCurrent time (POSIX ms).
Returns
JSON string.

◆ unlock()

void IqData::unlock ( )

Unlocker for mutex.

Returns
Void.

◆ update_frequency()

void IqData::update_frequency ( std::vector< double >  frequency)

Update the time differences and names.

Parameters
frequencyFrequency vector.
Returns
Void.

◆ update_spectrum()

void IqData::update_spectrum ( std::vector< std::complex< double >>  spectrum)

Update the time differences and names.

Parameters
spectrumSpectrum vector.
Returns
Void.

Member Data Documentation

◆ data

std::deque<std::complex<double> >* IqData::data
private

Pointer to IQ data.

◆ frequency

std::vector<double> IqData::frequency
private

Frequency vector (Hz).

◆ max

double IqData::max
private

Maximum value.

◆ mean

double IqData::mean
private

Mean value.

◆ min

double IqData::min
private

Minimum value.

◆ mutex_lock

std::mutex IqData::mutex_lock
private

True if should not push to buffer (mutex).

◆ n

uint32_t IqData::n
private

Maximum number of samples.

◆ spectrum

std::vector<std::complex<double> > IqData::spectrum
private

Spectrum vector.


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