예제 #1
0
    def detect(self, dsamples, receiver, offset):
	# start looking at dsamples[offset] for the preamble sequence
        sample_seq = receiver.mapper.bits2samples(self.barker())
        local_carrier_result = sendrecv.local_carrier(receiver.fc, len(sample_seq), receiver.samplerate)
        waveform = numpy.multiply(sample_seq, local_carrier_result)
        demodulated_waveform = receiver.demodulate(waveform)
        
        search_length = self.barkerlen()*3*receiver.mapper.spb
        index = self.correlate(dsamples, demodulated_waveform[offset:(offset+search_length)])
        return offset + index
예제 #2
0
    def detect(self, dsamples, receiver, offset):
        # start looking at dsamples[offset] for the preamble sequence
        sample_seq = receiver.mapper.bits2samples(self.barker())
        local_carrier_result = sendrecv.local_carrier(receiver.fc,
                                                      len(sample_seq),
                                                      receiver.samplerate)
        waveform = numpy.multiply(sample_seq, local_carrier_result)
        demodulated_waveform = receiver.demodulate(waveform)

        search_length = self.barkerlen() * 3 * receiver.mapper.spb
        index = self.correlate(
            dsamples, demodulated_waveform[offset:(offset + search_length)])
        return offset + index
예제 #3
0
def quadrature(samples, carrier_freq, config):
    quadcarrier = sendrecv.local_carrier(carrier_freq, len(samples), config.samplerate, "demodquad")
    return numpy.multiply(samples, quadcarrier)
예제 #4
0
def heterodyne(samples, carrier_freq, config):
    sample_rate = config.samplerate
    local_carrier = sendrecv.local_carrier(carrier_freq, len(samples), sample_rate)
    return numpy.multiply(samples, local_carrier)