/packages/modules/Bluetooth/system/embdrv/lc3/test/ |
D | appendix_c.py | 21 import numpy as np namespace 24 NBYTES = (32e3 * np.array([ 7.5e-3, 10e-3 ]) / 8).astype(int) 29 X_PCM_10M = np.array([ 75 X_PCM_7M5 = np.array([ 116 X_10M = np.array([ 202 X_7M5 = np.array([ 273 X_TILDE_12K8D_10M = np.array([ 345 X_TILDE_12K8D_7M5 = np.array([ 406 T_CURR_10M = np.array([ 25, 26 ]) 407 T_CURR_7M5 = np.array([ 22, 25 ]) [all …]
|
D | tables.py | 17 import numpy as np namespace 26 DT_MS = np.array([ 7.5, 10 ]) 36 SRATE_KHZ = np.array([ 8, 16, 24, 32, 48 ]) 40 NE = [ np.append(NS[dt][:-1], (NS[dt][-1] * 5) // 6) for dt in range(NUM_DT) ] 47 I_10M_8K = np.array([ 57 I_10M_16K = np.array([ 67 I_10M_24K = np.array([ 77 I_10M_32K = np.array([ 87 I_10M_48K = np.array([ 97 I_7M5_8K = np.array([ [all …]
|
D | ltpf.py | 17 import numpy as np namespace 36 self.x = np.zeros(self.w + T.NS[dt][sr]) 37 self.u = np.zeros(self.n + 2) 38 self.y = np.zeros(self.n + self.d + history) 64 h = np.zeros(240 + p) 71 k = np.arange(-120, 120 + p, p) - f 72 u[2+i] = p * np.dot( x[e:e+w+1], np.take(h, k) ) 93 self.x = np.zeros(n + 5) 96 self.y = np.zeros(self.n + history) 118 self.y[:n] = [ np.dot(x[2*i:2*i+5], h) for i in range(self.n) ] [all …]
|
D | mdct.py | 17 import numpy as np namespace 35 self.t = np.zeros(2*self.ns) 57 z = t * np.exp(-2j * np.pi * np.arange(n) / (2*n)) 59 z = z * np.exp(-2j * np.pi * 60 (n2/2 + 0.5) * (np.arange(n2) + 0.5) / (2 * n2)) 61 return np.real(z) * np.sqrt(2/n2) 77 x = np.append(x, -x[::-1]) 78 z = x * np.exp(2j * np.pi * (n/2 + 0.5) * np.arange(2*n) / (2*n)) 80 z = z * np.exp(2j * np.pi * (np.arange(2*n) + (n/2 + 0.5)) / (4*n)) 81 t = np.real(z) * np.sqrt(2/n) [all …]
|
D | sns.py | 17 import numpy as np namespace 57 scf_i = np.empty(4*len(scf)) 71 scf_i = np.append(scf_i[:n2], scf_i[2*n2:]) 73 g_sns = np.power(2, [ -scf_i, scf_i ][inv]) 77 y = np.empty(len(x)) 100 e = np.append(np.empty(n2), e) 106 e_s = np.zeros(len(e)) 114 e_p = e_s * (10 ** ((np.arange(64) * g_tilt) / 630)) 118 noise_floor = max(np.average(e_p) * (10 ** (-40/10)), 2 ** -32) 119 e_p = np.fmax(e_p, noise_floor * np.ones(len(e))) [all …]
|
D | tns.py | 17 import numpy as np namespace 109 r = np.append([ 3 ], np.zeros(8)) 113 c = [ np.dot(x[S[s]:S[s+1]-k], x[S[s]+k:S[s+1]]) 116 r[k] = np.sum( np.array(c) / np.array(e) ) 118 r *= np.exp(-0.5 * (0.02 * np.pi * np.arange(9)) ** 2) 123 a = np.ones(len(r)) 139 return a * np.power(gamma, np.arange(len(a))) 143 rc = np.zeros(8) 155 delta = np.pi / 17 156 rc_i = np.rint(np.arcsin(rc) / delta).astype(int) + 8 [all …]
|
D | energy.py | 17 import numpy as np namespace 33 e = [ np.mean(np.square(x[self.I[i]:self.I[i+1]])) 36 e_lo = np.sum(e[:len(e) - [4, 2][self.dt]]) 37 e_hi = np.sum(e[len(e) - [4, 2][self.dt]:]) 39 return np.append(e, np.zeros(64-len(e))), (e_hi > 30*e_lo) 54 ok = ok and np.amax(np.abs(e_c - e)) < 1e-5 and nn_c == nn 60 ok = ok and np.amax(np.abs(e_c - e)) < 1e-3 and nn_c == nn 70 ok = ok and np.amax(np.abs(1 - e/C.E_B[dt][0])) < 1e-6 73 ok = ok and np.amax(np.abs(1 - e/C.E_B[dt][1])) < 1e-6 79 rng = np.random.default_rng(1234)
|
D | attdet.py | 17 import numpy as np namespace 62 x_att = np.array([ np.sum(x[i*r:(i+1)*r]) for i in range(mf) ]) 64 x_hp = np.empty(mf) 75 e_att = np.array([ np.sum(np.square(x_hp[40*i:40*(i+1)])) 78 a_att = np.empty(nb) 79 a_att[0] = np.maximum(0.25 * self.an1, self.en1) 81 a_att[i] = np.maximum(0.25 * a_att[i-1], e_att[i-1]) 129 x_c = np.zeros(ns+6) 142 x_c = np.append(x_c[-6:], x) 146 ok = ok and np.amax(np.abs(1 - state_c['en1']/attdet.en1)) < 2 [all …]
|
D | spec.py | 17 import numpy as np namespace 50 xq = np.append(xq[:lastnz], np.zeros(len(xq) - lastnz)) 52 i_nf = [ np.all(xq[k-nf_width:min(bw_stop, k+nf_width+1)] == 0) 77 e = [ np.sum(x[4*k:4*(k+1)] ** 2) for k in range(len(x) // 4) ] 78 e = 10 * np.log10(2**-31 + np.array(e)) 107 x_max = np.amax(np.abs(x)) 109 g_min = 28 * np.log10(x_max / (32768 - 0.375)) 110 g_min = np.ceil(g_min).astype(int) - g_off 125 xq = np.where(xg < 0, np.ceil(xg - 0.375), np.floor(xg + 0.375)) 127 xq = np.fmin(np.fmax(xq, -32768), 32767) [all …]
|
D | decoder.py | 18 import numpy as np namespace 84 x = np.append(x, np.zeros(self.ns - self.ne)) 110 ok = ok and np.max(np.abs(pcm - C.X_HAT_CLIP[dt][i])) < 1 160 pcm_c = np.empty(0).astype(np.int16) 161 pcm_py = np.empty(0).astype(np.int16) 183 pcm_py = np.append(pcm_py, 184 np.clip(np.round(x), -32768, 32767).astype(np.int16)) 187 pcm_c = np.append(pcm_c, x_c)
|
D | bwdet.py | 17 import numpy as np namespace 60 if np.mean(e[i0:i1+1]) >= TQ[bw]: 72 c = 10 * np.log10(1e-31 + e[i0-l+1:i1-l+2] / e[i0+1:i1+2]) 73 if np.amax(c) <= TC[bw0]: 82 1 + np.log2(self.sr).astype(int) 112 e[i0:i1+1] /= (np.mean(e[i0:i1+1]) / TQ[i] + 1e-3) 122 e[i0-l+1:i1+2] /= np.power(10, np.arange(2*l+1) / (1 + drop)) 150 rng = np.random.default_rng(1234)
|
/packages/modules/Bluetooth/system/embdrv/lc3/tables/ |
D | mktables.py | 18 import numpy as np namespace 20 LTPF_H12K8 = np.array([ 83 LTPF_HI = np.array([ 105 kv = -2 * np.pi * np.arange(n // 2) / n 107 print('{{ {:14.7e}, {:14.7e} }},'.format(np.cos(k), np.sin(k)), 114 kv = -2 * np.pi * np.arange(n) / n 118 np.cos(k), np.sin(k), np.cos(2*k), np.sin(2*k))) 127 kv = 2 * np.pi * (np.arange(n // 4) + 1/8) / n 129 print('{{ {:14.7e}, {:14.7e} }},'.format(np.cos(k), np.sin(k)), 136 ns = np.array([ [ 60, 120, 180, 240, 360], [ 80, 160, 240, 320, 480] ]) [all …]
|
D | fastmath.py | 18 import numpy as np namespace 24 p = p.astype(np.float32) 25 x = x.astype(np.float32) 29 return np.power(y.astype(np.float32), 16) 33 x = np.arange(-8, 8, step=1e-3) 35 p = np.polyfit(x, ((2 ** (x/16)) - 1) / x, 4) 37 e = np.abs(y - 2**x) / (2 ** x) 41 print('Max relative error: ', np.max(e)) 42 print('Max RMS error: ', np.sqrt(np.mean(e ** 2))) 59 p = p.astype(np.float32) [all …]
|
/packages/modules/Bluetooth/android/pandora/mmi2grpc/mmi2grpc/ |
D | _audio.py | 71 stereo = np.zeros(sine.size * 2, dtype=sine.dtype) 81 np.sin(2 * np.pi * np.arange(self.fs * duration) * (f / self.fs)) 95 audio = data[samplerate:samplerate*2, 0].astype(np.float) / 32767 98 spectrum = np.abs(np.fft.fft(audio)) 99 frequency = np.fft.fftfreq(samplerate, d=1/samplerate) 101 index = np.where(frequency == SINE_FREQUENCY)
|
/packages/modules/Bluetooth/system/blueberry/utils/ |
D | bt_audio_utils.py | 8 import numpy as np namespace 91 return sample_rate * (np.argmax(np.abs(np.fft.rfft(signal))) / len(signal)) 103 return np.sqrt(np.mean(np.absolute(signal)**2)) 121 signal -= np.mean(signal)
|
/packages/services/Iwlan/src/com/google/android/iwlan/ |
D | IwlanNetworkService.java | 161 for (IwlanNetworkServiceProvider np : sIwlanNetworkServiceProviders.values()) { in onSubscriptionsChanged() 162 np.subscriptionChanged(); in onSubscriptionsChanged() 365 IwlanNetworkServiceProvider np = new IwlanNetworkServiceProvider(slotIndex, this); in onCreateNetworkServiceProvider() local 369 .obtainMessage(EVENT_CREATE_NETWORK_SERVICE_PROVIDER, np)); in onCreateNetworkServiceProvider() 370 return np; in onCreateNetworkServiceProvider() 419 for (IwlanNetworkServiceProvider np : sIwlanNetworkServiceProviders.values()) { in setNetworkConnected() 420 np.notifyNetworkRegistrationInfoChanged(); in setNetworkConnected() 424 void addIwlanNetworkServiceProvider(IwlanNetworkServiceProvider np) { in addIwlanNetworkServiceProvider() argument 425 int slotIndex = np.getSlotIndex(); in addIwlanNetworkServiceProvider() 430 sIwlanNetworkServiceProviders.put(slotIndex, np); in addIwlanNetworkServiceProvider() [all …]
|
/packages/modules/NeuralNetworks/runtime/test/specs/V1_3/ |
D | bidirectional_sequence_rnn_1_3.mod.py | 16 import numpy as np namespace 21 return np.array(tensor).reshape(tensor_shape).transpose( 26 a = np.array(a).reshape(a_shape) 27 b = np.array(b).reshape(b_shape) 28 return np.concatenate((a, b), axis=2).flatten().tolist() 31 return np.array(tensor).reshape(tensor_shape)[:, ::-1, :].flatten().tolist() 34 tensor = np.array(tensor).reshape(tensor_shape) 35 left, right = np.split(tensor, 2, axis=len(tensor_shape) - 1)
|
D | bidirectional_sequence_rnn_state_output.mod.py | 16 import numpy as np namespace 21 return np.array(tensor).reshape(tensor_shape).transpose([1, 0, 2 26 a = np.array(a).reshape(a_shape) 27 b = np.array(b).reshape(b_shape) 28 return np.concatenate((a, b), axis=2).flatten().tolist() 32 return np.array(tensor).reshape(tensor_shape)[:, ::-1, :].flatten().tolist() 36 tensor = np.array(tensor).reshape(tensor_shape) 37 left, right = np.split(tensor, 2, axis=len(tensor_shape) - 1)
|
D | pad_quant8_signed.mod.py | 17 import numpy as np namespace 36 output0: np.pad([[[[1.0, 2.0, 3.0], 138 output0: np.pad([[[[-127, -126, -125],
|
/packages/apps/LegacyCamera/jni/feature_mos/src/mosaic/ |
D | Pyramid.cpp | 209 ImageTypeShortBase *s, *ns, *ls, *p, *np; in BorderReduceOdd() local 217 np = p + in->pitch; in BorderReduceOdd() 220 for (; s < ls; s = ns, ns += scr->pitch, p = np, np += in->pitch) { in BorderReduceOdd() 236 np = p + pitch2; in BorderReduceOdd() 237 for (; s < ls; s = ns, ns += out->pitch, p = np, np += pitch2) { in BorderReduceOdd()
|
/packages/modules/NeuralNetworks/runtime/test/specs/V1_2/ |
D | bidirectional_sequence_rnn.mod.py | 16 import numpy as np namespace 21 return np.array(tensor).reshape(tensor_shape).transpose( 26 a = np.array(a).reshape(a_shape) 27 b = np.array(b).reshape(b_shape) 28 return np.concatenate((a, b), axis=2).flatten().tolist() 31 return np.array(tensor).reshape(tensor_shape)[:, ::-1, :].flatten().tolist() 34 tensor = np.array(tensor).reshape(tensor_shape) 35 left, right = np.split(tensor, 2, axis=len(tensor_shape) - 1)
|
D | pad_v2_all_dims_quant8.mod.py | 17 import numpy as np namespace 32 output0: np.pad([[[[1, 2, 3],
|
D | pad_v2_all_dims.mod.py | 17 import numpy as np namespace 32 output0: np.pad([[[[1.0, 2.0, 3.0],
|
D | pad_all_dims.mod.py | 17 import numpy as np namespace 36 output0: np.pad([[[[1.0, 2.0, 3.0],
|
/packages/modules/NeuralNetworks/tools/test_generator/ |
D | test_generator.py | 37 import numpy as np namespace 67 v = np.round(v) 71 v = np.minimum(np.maximum(v, 0), 255) 73 v = np.minimum(np.maximum(v, 0), 65535) 75 v = np.minimum(np.maximum(v, -127), 127) 77 v = np.maximum(v, 0) 79 v = np.minimum(np.maximum(v, -128), 127) 250 return np.array(self.scales).reshape(bshape) 281 return np.array(self.value).reshape(self.type.dimensions) 793 v = Dequantize(op.GetValueAsNumpy().astype(np.float32), op.type) [all …]
|