def __init__(self): gr.sync_block.__init__(self, name="dab_sync", in_sig=[numpy.complex64], out_sig=[numpy.complex64]) self.sample_rate = 2048000 self.step = 1 self.dp = parameters.dab_parameters(1, self.sample_rate) self.prs = make_prs.modulate_prs(self.sample_rate, True) self.frame_length = int(self.sample_rate * 96e-3) self.prs_len = len(self.prs) print "PRS length", self.prs_len self.correlator = correlate.Correlator(self.prs, self.sample_rate) self.P = 0.2 * 3 self.I = 0.2 * 3 self.fract = 1000 self.integer_offset = 0 self.fract_offset = 0 self.state = INIT self.set_history(self.prs_len + 1)
def init(self): self.sample_rate = 2048000 self.step = 1 self.dp = parameters.dab_parameters(1, self.sample_rate) self.prs = make_prs.modulate_prs(self.sample_rate, True) self.frame_length = int(self.sample_rate * 96e-3) self.prs_len = len(self.prs) self.P = 0.2 * 3 self.I = 0.2 * 3 self.fract = 1000 self.integer_offset = 0 self.fract_offset = 0 self.state = get_samples self.get_samples_count = self.frame_length self.next_state = find_start
]) sample_rate = 2048000 sample_type = 'c32' step = 4 multi_starts = [] for opt, arg in options: if opt in ('-r', '--rate'): sample_rate = int(arg) if opt in ('-f', '--format'): sample_type = arg dp = parameters.dab_parameters(1, sample_rate) prs = make_prs.modulate_prs(sample_rate, True) frame_length = int(sample_rate * 96e-3) for pair in remainder: filename = pair.split()[0] skip_frames = float(pair.split()[1]) f = open(filename, "rb") reader = iq.IQReader(f, sample_type) reader.skip(int(frame_length * skip_frames), 0) signal, integer_sample_offset, fract_sample_offset = reader.read( count=frame_length) #start = 0 #while start == 0: