-
Notifications
You must be signed in to change notification settings - Fork 1
/
data_pro.py
69 lines (56 loc) · 1.75 KB
/
data_pro.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import scipy.io as scio
import numpy as np
import os
from glob import glob
#time_path='./data'
#MS_path='./data/data/MS_N_4_30.mat'
#OTDOA_DATA_path='./data/data/OTDOA_DATA_N_4_30.mat'
#time_path='./data'
#MS_path='./train_step2AWGN3/output_2_10.mat'
#OTDOA_DATA_path='./train_step2AWGN3/input2_2_10.mat'
MS_path='./train_step1/output.mat'
OTDOA_DATA_path='./train_step1/input.mat'
#time_path='./data'
#MS_path='./EVA5_4_25/aug1/distance_1.mat'
#OTDOA_DATA_path='./EVA5_4_25/aug1/signal_all_ri_phase_1.mat'
#OTDOA_DATA_path='./EVA5_1km_15/signal_AWGN_all_abs_1.mat'
def get_OTADA_DATA(BSN):
file_mame_t1=OTDOA_DATA_path
t=[]
t=scio.loadmat(file_mame_t1)
OTADA_DATA=[]
OTADA_DATA.extend(t['corr'])
OTADA_DATA=np.array(OTADA_DATA)
OTADA_DATA = np.reshape(OTADA_DATA, (84000,BSN-1))
OTADA_DATA = np.expand_dims(OTADA_DATA,axis=1)
#OTADA_DATA=(OTADA_DATA-OTADA_DATA.min())/(OTADA_DATA.max()-OTADA_DATA.min())
return OTADA_DATA
def get_OTADA_DATA_X(BSN):
file_mame_t1=OTDOA_DATA_path
t=[]
t=scio.loadmat(file_mame_t1)
#print(t)
OTADA_DATA=[]
OTADA_DATA.extend(t['input'])
OTADA_DATA=np.array(OTADA_DATA)
print(OTADA_DATA.shape)
OTADA_DATA = np.reshape(OTADA_DATA, (80000,14,60,1))
#OTADA_DATA = np.expand_dims(OTADA_DATA,axis=1)
OTADA_DATA=OTADA_DATA[0:80000,:,0:30,:]
# print(np.shape(OTADA_DATA))
# OTADA_DATA=np.reshape(OTADA_DATA,[10000,120,3])
return OTADA_DATA
def get_MS( ):
file_mame_MS=MS_path
t=[]
t=scio.loadmat(file_mame_MS)
#print(t)
MS=[]
MS.extend(t['output'])
MS =np.array(MS)
MS=np.reshape(MS,(80000,1))
MS=MS[0:80000,:]
#MS=np.append(MS,MS,axis=0)
#MS=MS-156.25
#MS = (MS - MS.min()) / (MS.max() - MS.min())
return MS