def search(x,prn,doppler_search,ms): blocks = ms//10 fs = 8192000.0 n = 81920 # 10 ms coherent integration doppler_min, doppler_max, doppler_incr = doppler_search incr = float(b1cp.code_length)/n c = b1cp.code(prn,0,0,incr,n) # obtain samples of the B1Cp code boc = nco.boc11(0,0,incr,n) c = fft.fft(c*boc) m_metric,m_code,m_doppler = 0,0,0 for doppler in np.arange(doppler_min,doppler_max,doppler_incr): # doppler bins q = np.zeros(n) w = nco.nco(-doppler/fs,0,n) for block in range(blocks): # incoherent sums b = x[(block*n):((block+1)*n)] b = b*w r = fft.ifft(c*np.conj(fft.fft(b))) q = q + np.absolute(r) idx = np.argmax(q) if q[idx]>m_metric: m_metric = q[idx] m_code = b1cp.code_length*(float(idx)/n) m_doppler = doppler m_code = m_code%b1cp.code_length return m_metric,m_code,m_doppler
def search(x,prn,doppler,l2cm_code_phase): n = int(fs*0.020) w = nco.nco(-doppler/fs,0,n) incr = l2cl.chip_rate/fs m_metric,m_k = 0,0 for k in range(75): q = 0 for block in range(4): c = l2cl.code(prn,(k+block)*10230+l2cm_code_phase,0,incr,n) p = x[n*block:n*(block+1)]*c*w q = q + np.absolute(np.sum(p)) if q>m_metric: m_metric = q m_k = k return m_metric,m_k
def search(x, chan, doppler, ca_code_phase): n = int(fs * 0.004) w = nco.nco(-(562500 * chan + doppler) / fs, 0, n) m_metric, m_k = 0, 0 for k in range(1000): q = 0 cp = 5110 * k + 10 * ca_code_phase for block in range(20): incr = 5110000.0 / fs c = p.code(0, cp, incr, n) xp = x[n * block:n * (block + 1)] * c * w q = q + np.absolute(np.sum(xp)) cp += n * incr print('%f %f' % (k, q)) if q > m_metric: m_metric = q m_k = k return m_metric, m_k
def search(x,chan,doppler,ca_code_phase): n = int(fs*0.004) w = nco.nco(-(437500*chan+doppler)/fs,0,n) m_metric,m_k = 0,0 for k in range(1000): q = 0 cp = 5110*k + 10*ca_code_phase for block in range(20): incr = 5110000.0/fs c = p.code(0,cp,incr,n) xp = x[n*block:n*(block+1)]*c*w q = q + np.absolute(np.sum(xp)) cp += n*incr print('%f %f'%(k,q)) if q>m_metric: m_metric = q m_k = k return m_metric,m_k
def search(x,chan): fs = 16384000.0 n = 16384 incr = float(ca.code_length)/n c = ca.code(0,0,incr,n) # obtain samples of the C/A code c = fft.fft(c) m_metric,m_code,m_doppler = 0,0,0 for doppler in np.arange(-5000,5000,200): # doppler bins q = np.zeros(n) w = nco.nco(-(437500*chan+doppler)/fs,0,n) for block in range(80): # 80 incoherent sums b = x[(block*n):((block+1)*n)] b = b*w r = fft.ifft(c*np.conj(fft.fft(b))) q = q + np.absolute(r) idx = np.argmax(q) if q[idx]>m_metric: m_metric = q[idx] m_code = ca.code_length*(float(idx)/n) m_doppler = doppler return m_metric,m_code,m_doppler
def search(x,prn): fs = 4096000.0 n = 81920 # 20 ms coherent integration incr = float(l2cm.code_length)/n c = l2cm.code(prn,0,0,incr,n) # obtain samples of the L2CM code c = fft.fft(np.concatenate((c,np.zeros(n)))) m_metric,m_code,m_doppler = 0,0,0 for doppler in np.arange(-5000,5000,20): # doppler bins q = np.zeros(2*n) w = nco.nco(-doppler/fs,0,2*n) for block in range(2): # 2 incoherent sums b = x[(block*n):((block+2)*n)] b = b*w r = fft.ifft(c*np.conj(fft.fft(b))) q = q + np.absolute(r) idx = np.argmax(q) if q[idx]>m_metric: m_metric = q[idx] m_code = l2cm.code_length*(float(idx)/n) m_doppler = doppler m_code = m_code%l2cm.code_length return m_metric,m_code,m_doppler
def search(x, prn): fs = 3 * 10230000.0 n = 3 * 10230 # 1 ms coherent integration incr = float(l5i.code_length) / n c = l5i.code(prn, 0, 0, incr, n) # obtain samples of the E5b-I code c = fft.fft(np.concatenate((c, np.zeros(n)))) m_metric, m_code, m_doppler = 0, 0, 0 for doppler in np.arange(-4000, 4000, 200): # doppler bins q = np.zeros(2 * n) w = nco.nco(-doppler / fs, 0, 2 * n) for block in range(80): # 80 incoherent sums b = x[(block * n):((block + 2) * n)] b = b * w r = fft.ifft(c * np.conj(fft.fft(b))) q = q + np.absolute(r) idx = np.argmax(q) if q[idx] > m_metric: m_metric = q[idx] m_code = l5i.code_length * (float(idx) / n) m_doppler = doppler m_code = m_code % l5i.code_length return m_metric, m_code, m_doppler
def search(x,prn): fs = 3*10230000.0 n = 3*10230 # 1 ms coherent integration incr = float(e5aq.code_length)/n c = e5aq.code(prn,0,0,incr,n) # obtain samples of the E5b-Q code c = fft.fft(np.concatenate((c,np.zeros(n)))) m_metric,m_code,m_doppler = 0,0,0 for doppler in np.arange(-4000,4000,200): # doppler bins q = np.zeros(2*n) w = nco.nco(-doppler/fs,0,2*n) for block in range(80): # 80 incoherent sums b = x[(block*n):((block+2)*n)] b = b*w r = fft.ifft(c*np.conj(fft.fft(b))) q = q + np.absolute(r) idx = np.argmax(q) if q[idx]>m_metric: m_metric = q[idx] m_code = e5aq.code_length*(float(idx)/n) m_doppler = doppler m_code = m_code%e5aq.code_length return m_metric,m_code,m_doppler
def search(x,prn): fs = 4096000.0 n = 4096 # 1 ms coherent integration incr = float(ca.code_length)/n c = ca.code(prn,0,0,incr,n) # obtain samples of the C/A code c = fft.fft(c) m_metric,m_code,m_doppler = 0,0,0 for doppler in np.arange(-7000,7000,200): # doppler bins q = np.zeros(n) w = nco.nco(-doppler/fs,0,n) for block in range(80): # 80 incoherent sums b = x[(block*n):((block+1)*n)] b = b*w r = fft.ifft(c*np.conj(fft.fft(b))) q = q + np.absolute(r) idx = np.argmax(q) metric = q[idx]/np.mean(q) if metric>m_metric: m_metric = metric m_code = ca.code_length*(float(idx)/n) m_doppler = doppler return m_metric,m_code,m_doppler
def search(x,prn): fs = 4096000.0 n = 4096 # 1 ms coherent integration incr = float(ca.code_length)/n c = ca.code(prn,0,0,incr,n) # obtain samples of the C/A code c = fft.fft(c) m_metric,m_code,m_doppler = 0,0,0 for doppler in np.arange(-5000,5000,200): # doppler bins q = np.zeros(n) w = nco.nco(-doppler/fs,0,n) for block in range(80): # 80 incoherent sums b = x[(block*n):((block+1)*n)] b = b*w r = fft.ifft(c*np.conj(fft.fft(b))) q = q + np.absolute(r) idx = np.argmax(q) metric = q[idx]/np.mean(q) if metric>m_metric: m_metric = metric m_code = ca.code_length*(float(idx)/n) m_doppler = doppler return m_metric,m_code,m_doppler
def search(x, prn): fs = 8192000.0 n = 32768 # 4 ms coherent integration incr = float(e1b.code_length) / n c = e1b.code(prn, 0, 0, incr, n) # obtain samples of the E1-B code boc = nco.boc11(0, 0, incr, n) c = fft.fft(np.concatenate((c * boc, np.zeros(n)))) m_metric, m_code, m_doppler = 0, 0, 0 for doppler in np.arange(-9000, 9000, 50): # doppler bins q = np.zeros(2 * n) w = nco.nco(-doppler / fs, 0, 2 * n) for block in range(20): # 20 incoherent sums b = x[(block * n):((block + 2) * n)] b = b * w r = fft.ifft(c * np.conj(fft.fft(b))) q = q + np.absolute(r) idx = np.argmax(q) if q[idx] > m_metric: m_metric = q[idx] m_code = e1b.code_length * (float(idx) / n) m_doppler = doppler m_code = m_code % e1b.code_length return m_metric, m_code, m_doppler
def search(x,prn,doppler_search,ms): fs = 3*5115000.0 n = 3*5115 # 1 ms coherent integration doppler_min, doppler_max, doppler_incr = doppler_search incr = float(e6c.code_length)/n c = e6c.code(prn,0,0,incr,n) # obtain samples of the E1-B code c = fft.fft(np.concatenate((c,np.zeros(n)))) m_metric,m_code,m_doppler = 0,0,0 for doppler in np.arange(doppler_min,doppler_max,doppler_incr): # doppler bins q = np.zeros(2*n) w = nco.nco(-doppler/fs,0,2*n) for block in range(ms): # incoherent sums b = x[(block*n):((block+2)*n)] b = b*w r = fft.ifft(c*np.conj(fft.fft(b))) q = q + np.absolute(r) idx = np.argmax(q) if q[idx]>m_metric: m_metric = q[idx] m_code = e6c.code_length*(float(idx)/n) m_doppler = doppler m_code = m_code%e6c.code_length return m_metric,m_code,m_doppler
def search(x, prn): fs = 8192000.0 n = 81920 # 10 ms coherent integration incr = float(l1cd.code_length) / n c = l1cd.code(prn, 0, 0, incr, n) # obtain samples of the L1Cd code boc = nco.boc11(0, 0, incr, n) c = fft.fft(c * boc) m_metric, m_code, m_doppler = 0, 0, 0 for doppler in np.arange(-7000, 7000, 20): # doppler bins q = np.zeros(n) w = nco.nco(-doppler / fs, 0, n) for block in range(8): # 8 incoherent sums b = x[(block * n):((block + 1) * n)] b = b * w r = fft.ifft(c * np.conj(fft.fft(b))) q = q + np.absolute(r) idx = np.argmax(q) if q[idx] > m_metric: m_metric = q[idx] m_code = l1cd.code_length * (float(idx) / n) m_doppler = doppler m_code = m_code % l1cd.code_length return m_metric, m_code, m_doppler