Jpp  15.0.1-rc.1-highqe
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
KM3NeT_Audio_Data Class Reference

#include <KM3NeT_Audio_Data.h>

Public Member Functions

 KM3NeT_Audio_Data (uint32_t window=STD_WINDOW, uint32_t overlap=STD_OVERLAP)
 
virtual ~KM3NeT_Audio_Data ()
 
void Check_time (Audio_Header header)
 
bool Append (real_type sample)
 
real_type * Get_window (ToA_Packet *packet)
 
uint32_t Get_size ()
 

Static Public Attributes

static const int DEBUG_LEVEL =2
 

Private Attributes

Audio_Header header_
 
Audio_Time next_
 
uint32_t offset_
 
uint32_t window_
 
uint32_t overlap_
 
uint32_t bound_
 
uint32_t write_
 
real_type * data_
 

Detailed Description

Author
fsimeone

Definition at line 19 of file KM3NeT_Audio_Data.h.

Constructor & Destructor Documentation

KM3NeT_Audio_Data::KM3NeT_Audio_Data ( uint32_t  window = STD_WINDOW,
uint32_t  overlap = STD_OVERLAP 
)
Author
fsimeone

Definition at line 19 of file KM3NeT_Audio_Data.cc.

20 {
21  DEBUG_MSG("Constructor",0);
22  if ((window==0)||(overlap==0)||(overlap>=window))
23  {
24  window=STD_WINDOW;
26  }
27  window_=window;
30  write_=offset_=0;
31  data_=(real_type*)malloc(window_*sizeof(real_type));
34 }
Audio_Header header_
#define STD_OVERLAP
#define DEBUG_MSG(str, lev)
uint32_t Time_Stamp_ticks
uint32_t Time_Stamp_seconds
uint32_t Time_Stamp_seconds
DAQ_Common_Header Common_Header
bool overlap(const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
Test overlap between ranges.
Definition: JRange.hh:663
#define STD_WINDOW
KM3NeT_Audio_Data::~KM3NeT_Audio_Data ( )
virtual

Definition at line 36 of file KM3NeT_Audio_Data.cc.

37 {
38  DEBUG_MSG("Desctructor",0);
39  free(data_);
40 }
#define DEBUG_MSG(str, lev)

Member Function Documentation

void KM3NeT_Audio_Data::Check_time ( Audio_Header  header)

Definition at line 42 of file KM3NeT_Audio_Data.cc.

43 {
44  DEBUG_MSG("common header frame length="<<header.Common_Header.Frame_Length,1);
45  DEBUG_MSG("common header data type="<<header.Common_Header.Data_Type,1);
46  DEBUG_MSG("common header detector identifier="<<header.Common_Header.Detector_Identifier,1);
47  DEBUG_MSG("common header run number="<<header.Common_Header.Run_Number,1);
48  DEBUG_MSG("common header sequence number="<<header.Common_Header.Sequence_Number,1);
49  DEBUG_MSG("common header seconds="<<header.Common_Header.Time_Stamp_seconds,1);
50  DEBUG_MSG("common header ticks="<<header.Common_Header.Time_Stamp_ticks,1);
51  DEBUG_MSG("common header dom id="<<header.Common_Header.DOM_Identifier,1);
52  DEBUG_MSG("common header dq status="<<header.Common_Header.DQ_Status,1);
53  DEBUG_MSG("common header som status1="<<header.Common_Header.DOM_Status1,1);
54  DEBUG_MSG("common header som status2="<<header.Common_Header.DOM_Status2,1);
55  DEBUG_MSG("common header som status3="<<header.Common_Header.DOM_Status3,1);
56  DEBUG_MSG("common header som status4="<<header.Common_Header.DOM_Status4,1);
57  DEBUG_MSG("common header items="<<header.Common_Header.Number_of_Items,1);
58 
59  DEBUG_MSG("header time info="<<header.Info.Time_Info,1);
60  header.Info.Time_Info=ntohl(header.Info.Time_Info);
61 
63  {
64  DEBUG_MSG("cktime reset",3);
65  DEBUG_MSG("next s="<<next_.Time_Stamp_seconds,3);
66  DEBUG_MSG("next tick="<<next_.Time_Stamp_ticks,3);
67  DEBUG_MSG("head s="<<header.Common_Header.Time_Stamp_seconds,3);
68  DEBUG_MSG("head tick="<<(header.Common_Header.Time_Stamp_ticks+header.Info.Time_Info),3);
69  header_=header;
70  offset_=round(((float)header_.Info.Time_Info)/62.5);
73  write_=0;
74  }
75  else
76  {
77  DEBUG_MSG("cktime NO reset",0);
78  }
79 }
Audio_Header header_
#define DEBUG_MSG(str, lev)
uint32_t Time_Stamp_ticks
uint32_t Time_Stamp_seconds
Info_Word Info
uint32_t Time_Stamp_seconds
uint32_t Detector_Identifier
DAQ_Common_Header Common_Header
uint32_t Time_Info
bool KM3NeT_Audio_Data::Append ( real_type  sample)

Definition at line 81 of file KM3NeT_Audio_Data.cc.

82 {
83  if (data_==NULL) return false;
84  data_[write_]=d;
85  write_++;
86  DEBUG_MSG("append sampling"<<header_.Info.Samplig_Rate,1);
88  if (next_.Time_Stamp_ticks>=62500000)
89  {
90  next_.Time_Stamp_ticks-=62500000;
92  }
93  if (write_ == window_) return true;
94  return false;
95 }
Audio_Header header_
#define DEBUG_MSG(str, lev)
uint32_t Time_Stamp_ticks
uint32_t Time_Stamp_seconds
uint8_t Samplig_Rate
Info_Word Info
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
real_type * KM3NeT_Audio_Data::Get_window ( ToA_Packet packet)

Definition at line 97 of file KM3NeT_Audio_Data.cc.

98 {
99  real_type* l_dummy=data_;
100  data_=(real_type*)malloc(window_*sizeof(real_type));
101  memcpy((void*)data_,(void*)(l_dummy+bound_),overlap_*sizeof(real_type));
103  packet->Time.ToA=offset_;
104  packet->Header=header_.Common_Header;
107 
109  while (header_.Common_Header.Time_Stamp_ticks>=62500000)
110  {
113  }
114  return l_dummy;
115 }
Audio_Header header_
struct Info_Word::Info_Word_Bitfield::@0 Bits
Acoustic_Time_of_Arrival Time
uint8_t Samplig_Rate
Info_Word Info
uint32_t Time_Stamp_seconds
DAQ_Common_Header Common_Header
union Info_Word::Info_Word_Bitfield Info
DAQ_Common_Header Header
uint32_t KM3NeT_Audio_Data::Get_size ( )
inline

Definition at line 30 of file KM3NeT_Audio_Data.h.

30 { return window_; };

Member Data Documentation

const int KM3NeT_Audio_Data::DEBUG_LEVEL =2
static

Definition at line 22 of file KM3NeT_Audio_Data.h.

Audio_Header KM3NeT_Audio_Data::header_
private

Definition at line 30 of file KM3NeT_Audio_Data.h.

Audio_Time KM3NeT_Audio_Data::next_
private

Definition at line 34 of file KM3NeT_Audio_Data.h.

uint32_t KM3NeT_Audio_Data::offset_
private

Definition at line 35 of file KM3NeT_Audio_Data.h.

uint32_t KM3NeT_Audio_Data::window_
private

Definition at line 36 of file KM3NeT_Audio_Data.h.

uint32_t KM3NeT_Audio_Data::overlap_
private

Definition at line 37 of file KM3NeT_Audio_Data.h.

uint32_t KM3NeT_Audio_Data::bound_
private

Definition at line 38 of file KM3NeT_Audio_Data.h.

uint32_t KM3NeT_Audio_Data::write_
private

Definition at line 39 of file KM3NeT_Audio_Data.h.

real_type* KM3NeT_Audio_Data::data_
private

Definition at line 40 of file KM3NeT_Audio_Data.h.


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