This repository was archived by the owner on Feb 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathawmOptSet.py
More file actions
38 lines (34 loc) · 2.03 KB
/
awmOptSet.py
File metadata and controls
38 lines (34 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import numpy as np
class AwmOptSet:
pass
def __init__(self, method):
if method == 'mclt':
self.frameSize = 1024
# need to minus one since the index starts 0 in python
self.syncFreqBand = [148, 184]
self.dataFreqBand = [148, 183]
self.spreadLen = 36
self.overlap = 512
self.data = 'Mirlab'
#self.syncSeq = np.matrix([[1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1], [1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, -1], [1, -1, -1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1], [-1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1], [-1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1], [-1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, -1, -1, 1]])
self.syncSeq = np.matrix([1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, -1, -1, 1])
self.method = 'mclt'
elif method == 'dct':
pass
else:
print('Unknown method')
def setOpt(self, key, value):
if hasattr(self, key):
setattr(self, key, value)
else:
print('Undefined option: %s' % (key))
def display(self):
print('==============================')
print('Frame size: {0}'.format(self.frameSize))
print('Overlap: {0}'.format(self.overlap))
print('Sync. target band: {0}'.format(self.syncFreqBand))
print('Data target band: {0}'.format(self.dataFreqBand))
print('Spreading length: {0}'.format(self.spreadLen))
print('Data: {0}'.format(self.data))
print('Method: {0}'.format(self.method))
print('==============================')