def freq_shift_ramp(x, hza, dt):
N_orig = len(x)
N_padded = 2**nextpow2(N_orig)
t = numpy.arange(0, N_padded)
f_shift = numpy.linspace(hza[0], hza[1], len(x))
f_shift = numpy.append(f_shift, hza[1]*numpy.ones(N_padded-len(x)))
pc1 = f_shift[:-1] - f_shift[1:]
phase_correction = numpy.add.accumulate(
t * dt * numpy.append(numpy.zeros(1), 2*numpy.pi*pc1))
lo = numpy.exp(1j*(2*numpy.pi*dt*f_shift*t + phase_correction))
x0 = numpy.append(x, numpy.zeros(N_padded-N_orig, x.dtype))
h = scipy.signal.hilbert(x0)*lo
ret = h[:N_orig].real
return ret
# avoid most of the round-up-to-power-of-two penalty by
# doing log-n shifts. discontinuity at boundaries,
# but that's OK for JT65 2048-sample symbols.
评论列表
文章目录