blah2
A real-time passive radar
Detection Class Reference

A class to store detection data. More...

#include <Detection.h>

Collaboration diagram for Detection:
Collaboration graph

Public Member Functions

 Detection (std::vector< double > delay, std::vector< double > doppler, std::vector< double > snr)
 Constructor. More...
 
 Detection (double delay, double doppler, double snr)
 Constructor for single detection. More...
 
std::vector< double > get_delay ()
 Get detections in delay. More...
 
std::vector< double > get_doppler ()
 Get detections in Doppler. More...
 
std::vector< double > get_snr ()
 Detections in SNR. More...
 
size_t get_nDetections ()
 Get number of detections. More...
 
std::string to_json (uint64_t timestamp)
 Generate JSON of the detections and metadata. More...
 
std::string delay_bin_to_km (std::string json, uint32_t fs)
 Update JSON to convert delay bins to km. More...
 
bool save (std::string json, std::string path)
 Append the detections to a save file. More...
 

Private Attributes

std::vector< double > delay
 Detections in delay (bins). More...
 
std::vector< double > doppler
 Detections in Doppler (Hz). More...
 
std::vector< double > snr
 Detections in SNR. More...
 

Detailed Description

A class to store detection data.

Author
30hours

Constructor & Destructor Documentation

◆ Detection() [1/2]

Detection::Detection ( std::vector< double >  delay,
std::vector< double >  doppler,
std::vector< double >  snr 
)

Constructor.

Parameters
delayDetections in delay (bins).
dopplerDetections in Doppler (Hz).
Returns
The object.

◆ Detection() [2/2]

Detection::Detection ( double  delay,
double  doppler,
double  snr 
)

Constructor for single detection.

Parameters
delayDetection in delay (bins).
dopplerDetection in Doppler (Hz).
Returns
The object.

Member Function Documentation

◆ delay_bin_to_km()

std::string Detection::delay_bin_to_km ( std::string  json,
uint32_t  fs 
)

Update JSON to convert delay bins to km.

Parameters
jsonInput JSON string with delay field.
fsSampling frequency (Hz).
Returns
JSON string.

◆ get_delay()

std::vector< double > Detection::get_delay ( )

Get detections in delay.

Returns
Detections in delay (bins).

◆ get_doppler()

std::vector< double > Detection::get_doppler ( )

Get detections in Doppler.

Returns
Detections in Doppler (Hz).

◆ get_nDetections()

size_t Detection::get_nDetections ( )

Get number of detections.

Returns
Number of detections

◆ get_snr()

std::vector< double > Detection::get_snr ( )

Detections in SNR.

Returns
Detections in SNR.

◆ save()

bool Detection::save ( std::string  json,
std::string  path 
)

Append the detections to a save file.

Parameters
jsonJSON string of detections and metadata.
pathPath of file to save.
Returns
True is save is successful.

◆ to_json()

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

Generate JSON of the detections and metadata.

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

Member Data Documentation

◆ delay

std::vector<double> Detection::delay
private

Detections in delay (bins).

◆ doppler

std::vector<double> Detection::doppler
private

Detections in Doppler (Hz).

◆ snr

std::vector<double> Detection::snr
private

Detections in SNR.


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