source: ammosreader/AmmosExtendedAudioDataHeader.py@ 1e781ba

AmmosSource guix
Last change on this file since 1e781ba was 1e781ba, checked in by recknagel <recknagel@…>, 3 years ago

former radardex-project

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[1e781ba]1import struct
2import numpy as np
3from AmmosAudioDataHeader import AmmosAudioDataHeader
4
5
6class AmmosExtendedAudioDataHeader():
7
8 @classmethod
9 def from_bytes(cls, bytes):
10 standard_header = AmmosAudioDataHeader.from_bytes(bytes[0:36])
11 extended_header_elements = struct.unpack('Q', bytes[36:])
12 timestamp = extended_header_elements[0]
13 sample_rate = standard_header.sample_rate
14 status = standard_header.status
15 frequency = standard_header.frequency
16 demod_bandwidth = standard_header.demod_bandwidth
17 demod_type = standard_header.demod_type
18 sample_count = standard_header.sample_count
19 channel_count = standard_header.channel_count
20 sample_size = standard_header.sample_size
21 return AmmosExtendedAudioDataHeader(sample_rate, status, frequency, demod_bandwidth, demod_type,
22 sample_count, channel_count, sample_size, timestamp)
23
24 def __init__(self, sample_rate, status, frequency, demod_bandwidth, demod_type,
25 sample_count, channel_count, sample_size, timestamp):
26 self.sample_rate = sample_rate
27 self.status = status
28 self.frequency = frequency
29 self.demod_bandwidth = demod_bandwidth
30 self.demod_type = demod_type
31 self.sample_count = sample_count
32 self.channel_count = channel_count
33 self.sample_size = sample_size
34 self.timestamp = timestamp
Note: See TracBrowser for help on using the repository browser.