1
0
Fork 0
mirror of https://github.com/hb9fxq/gr-digitalhf synced 2024-12-22 07:09:59 +00:00

improved doppler estimation for shortened 110C preambles

This commit is contained in:
Christoph Mayer 2019-09-09 16:05:09 +02:00
parent c6c590a3d9
commit 09ef3402aa

View file

@ -320,15 +320,21 @@ class PhysicalLayer(object):
cc = np.correlate(iq_samples, zp) cc = np.correlate(iq_samples, zp)
imax = np.argmax(np.abs(cc[0:23*sps])) imax = np.argmax(np.abs(cc[0:23*sps]))
print('imax=', imax, len(iq_samples)) print('imax=', imax, len(iq_samples))
pks = [np.correlate(iq_samples[imax+i*m+idx], pks = np.array([np.correlate(iq_samples[imax+i*m+idx],
zp[i*m+idx])[0] zp[i*m+idx])[0]
for i in range(n//m)] for i in range(n//m)])
val = [np.mean(np.abs(np.correlate(iq_samples[imax+i*m+idx2], val = np.array([np.mean(np.abs(np.correlate(iq_samples[imax+i*m+idx2],
zp[i*m+idx])[11*sps+np.arange(-2*sps,2*sps)])) zp[i*m+idx])[11*sps+np.arange(-2*sps,2*sps)]))
for i in range((n//m)-1)] for i in range((n//m)-1)])
tests = np.abs(pks[0:-1])/val ## filter out
r['success'] = bool(np.median(tests) > 2.0) (i,) = (np.abs(pks) > 0.5*np.mean(np.abs(pks[-3:]))).nonzero()
print('test:', np.abs(pks), tests) i = i[0] if i.size > 0 else 0
pks = pks[i:]
val = val[i:]
if pks.size > 1:
tests = np.abs(pks[:-1])/val
r['success'] = bool(np.median(tests) > 2.0)
print('test:', np.abs(pks), tests)
if r['success']: if r['success']:
print('doppler apks', np.abs(pks)) print('doppler apks', np.abs(pks))
print('doppler ppks', np.angle(pks), print('doppler ppks', np.angle(pks),