Beispiel #1
0
 def setUp(self):
     path = join(dirname(__file__), "data")
     # setting up sliding window data
     data_z = np.loadtxt(join(path, "MBGA_Z.ASC"))
     data_e = np.loadtxt(join(path, "MBGA_E.ASC"))
     data_n = np.loadtxt(join(path, "MBGA_N.ASC"))
     n = 256
     fs = 75
     inc = int(0.05 * fs)
     self.data_win_z, self.nwin, self.no_win = util.enframe(data_z, signal.hamming(n), inc)
     self.data_win_e, self.nwin, self.no_win = util.enframe(data_e, signal.hamming(n), inc)
     self.data_win_n, self.nwin, self.no_win = util.enframe(data_n, signal.hamming(n), inc)
     # global test input
     self.fk = [2, 1, 0, -1, -2]
     self.norm = pow(np.max(data_z), 2)
     self.res = np.loadtxt(join(path, "3cssan.hy.1.MBGA_Z"))
Beispiel #2
0
 def setUp(self):
     path = join(dirname(__file__), 'data')
     # setting up sliding window data
     data_z = np.loadtxt(join(path, 'MBGA_Z.ASC'))
     data_e = np.loadtxt(join(path, 'MBGA_E.ASC'))
     data_n = np.loadtxt(join(path, 'MBGA_N.ASC'))
     n = 256
     fs = 75
     inc = int(0.05 * fs)
     self.data_win_z, self.nwin, self.no_win = \
         util.enframe(data_z, signal.hamming(n), inc)
     self.data_win_e, self.nwin, self.no_win = \
         util.enframe(data_e, signal.hamming(n), inc)
     self.data_win_n, self.nwin, self.no_win = \
         util.enframe(data_n, signal.hamming(n), inc)
     # global test input
     self.fk = [2, 1, 0, -1, -2]
     self.norm = pow(np.max(data_z), 2)
     self.res = np.loadtxt(join(path, '3cssan.hy.1.MBGA_Z'))
Beispiel #3
0
 def setUp(self):
     # directory where the test files are located
     self.path = os.path.join(os.path.dirname(__file__), "data")
     file = os.path.join(self.path, "3cssan.hy.1.MBGA_Z")
     f = open(file)
     self.res = np.loadtxt(f)
     f.close()
     file = os.path.join(self.path, "MBGA_Z.ASC")
     f = open(file)
     self.data = np.loadtxt(f)
     f.close()
     # self.path = os.path.dirname(__file__)
     # self.res = np.loadtxt("3cssan.hy.1.MBGA_Z")
     # data = np.loadtxt("MBGA_Z.ASC")
     self.n = 256
     self.fs = 75
     self.smoothie = 3
     self.fk = [2, 1, 0, -1, -2]
     self.inc = int(0.05 * self.fs)
     self.nc = 12
     self.p = np.floor(3 * np.log(self.fs))
     # [0] Time (k*inc)
     # [1] A_norm
     # [2] dA_norm
     # [3] dAsum
     # [4] dA2sum
     # [5] ct
     # [6] dct
     # [7] omega
     # [8] domega
     # [9] sigma
     # [10] dsigma
     # [11] log_cepstrum
     # [12] log_cepstrum
     # [13] log_cepstrum
     # [14] dperiod
     # [15] ddperiod
     # [16] bandwidth
     # [17] dbwith
     # [18] cfreq
     # [19] dcfreq
     # [20] hob1
     # [21] hob2
     # [22] hob3
     # [23] hob4
     # [24] hob5
     # [25] hob6
     # [26] hob7
     # [27] hob8
     # [28] phi12
     # [29] dphi12
     # [30] phi13
     # [31] dphi13
     # [32] phi23
     # [33] dphi23
     # [34] lv_h1
     # [35] lv_h2
     # [36] lv_h3
     # [37] dlv_h1
     # [38] dlv_h2
     # [39] dlv_h3
     # [40] rect
     # [41] drect
     # [42] plan
     # [43] dplan
     self.data_win, self.nwin, self.no_win = util.enframe(self.data, signal.hamming(self.n), self.inc)
     self.data_win_bc, self.nwin_, self.no_win_ = util.enframe(self.data, np.ones(self.n), self.inc)
 def setUp(self):
     # directory where the test files are located
     self.path = os.path.join(os.path.dirname(__file__), 'data')
     file = os.path.join(self.path, '3cssan.hy.1.MBGA_Z')
     f = open(file)
     self.res = np.loadtxt(f)
     f.close()
     file = os.path.join(self.path, 'MBGA_Z.ASC')
     f = open(file)
     data = np.loadtxt(f)
     f.close()
     # self.path = os.path.dirname(__file__)
     # self.res = np.loadtxt("3cssan.hy.1.MBGA_Z")
     # data = np.loadtxt("MBGA_Z.ASC")
     self.n = 256
     self.fs = 75
     self.smoothie = 3
     self.fk = [2, 1, 0, -1, -2]
     self.inc = int(0.05 * self.fs)
     self.fc1 = 0.68
     self.nofb = 8
     # [0] Time (k*inc)
     # [1] A_norm
     # [2] dA_norm
     # [3] dAsum
     # [4] dA2sum
     # [5] ct
     # [6] dct
     # [7] omega
     # [8] domega
     # [9] sigma
     # [10] dsigma
     # [11] log_cepstrum
     # [12] log_cepstrum
     # [13] log_cepstrum
     # [14] dperiod
     # [15] ddperiod
     # [16] bandwidth
     # [17] dbwith
     # [18] cfreq
     # [19] dcfreq
     # [20] hob1
     # [21] hob2
     # [22] hob3
     # [23] hob4
     # [24] hob5
     # [25] hob6
     # [26] hob7
     # [27] hob8
     # [28] phi12
     # [29] dphi12
     # [30] phi13
     # [31] dphi13
     # [32] phi23
     # [33] dphi23
     # [34] lv_h1
     # [35] lv_h2
     # [36] lv_h3
     # [37] dlv_h1
     # [38] dlv_h2
     # [39] dlv_h3
     # [40] rect
     # [41] drect
     # [42] plan
     # [43] dplan
     self.data_win, self.nwin, self.no_win = \
         util.enframe(data, signal.hamming(self.n), self.inc)
def framing(signal, Segment_length, Segment_shift):
    win = np.ones(Segment_length)
    Frames = enframe(signal, win, Segment_shift)
    return Frames
Beispiel #6
0
 def setUp(self):
     # directory where the test files are located
     self.path = os.path.join(os.path.dirname(__file__), 'data')
     file = os.path.join(self.path, '3cssan.hy.1.MBGA_Z')
     f = open(file)
     self.res = np.loadtxt(f)
     f.close()
     file = os.path.join(self.path, 'MBGA_Z.ASC')
     f = open(file)
     data_z = np.loadtxt(f)
     f.close()
     file = os.path.join(self.path, 'MBGA_E.ASC')
     f = open(file)
     data_e = np.loadtxt(f)
     f.close()
     file = os.path.join(self.path, 'MBGA_N.ASC')
     f = open(file)
     data_n = np.loadtxt(f)
     f.close()
     #self.path = os.path.dirname(__file__)
     #self.res = N.loadtxt("3cssan.hy.1.MBGA_Z")
     #data = N.loadtxt("MBGA_Z.ASC")
     self.n = 256
     self.fs = 75
     self.smoothie = 3
     self.fk = [2, 1, 0, -1, -2]
     self.inc = int(0.05 * self.fs)
     self.norm = pow(np.max(data_z), 2)
     #[0] Time (k*inc)
     #[1] A_norm
     #[2] dA_norm
     #[3] dAsum
     #[4] dA2sum
     #[5] ct
     #[6] dct
     #[7] omega
     #[8] domega
     #[9] sigma
     #[10] dsigma
     #[11] logcep
     #[12] logcep
     #[13] logcep
     #[14] dperiod
     #[15] ddperiod
     #[16] bwith
     #[17] dbwith
     #[18] cfreq
     #[19] dcfreq
     #[20] hob1
     #[21] hob2
     #[22] hob3
     #[23] hob4
     #[24] hob5
     #[25] hob6
     #[26] hob7
     #[27] hob8
     #[28] phi12
     #[29] dphi12
     #[30] phi13
     #[31] dphi13
     #[32] phi23
     #[33] dphi23
     #[34] lv_h1
     #[35] lv_h2
     #[36] lv_h3
     #[37] dlv_h1
     #[38] dlv_h2
     #[39] dlv_h3
     #[40] rect
     #[41] drect
     #[42] plan
     #[43] dplan
     self.data_win_z, self.nwin, self.no_win = \
         util.enframe(data_z, signal.hamming(self.n), self.inc)
     self.data_win_e, self.nwin, self.no_win = \
         util.enframe(data_e, signal.hamming(self.n), self.inc)
     self.data_win_n, self.nwin, self.no_win = \
         util.enframe(data_n, signal.hamming(self.n), self.inc)