Example #1
0
 def thread_produce(self):
     packet = self.packetSource()
     if packet is not None:
         buf, rate = packet
         output = wifi.encode(np.fromstring(buf, dtype=np.uint8), rate)
         output = audioLoopback.processOutput(output, self.channel.Fs, self.channel.Fc, self.channel.upsample_factor, None)
     else:
         output = np.zeros((self.channel.Fs * .001,2))
     return np.hstack((self.hp[0](output[:,0])[:,np.newaxis],
                       self.hp[1](output[:,1])[:,np.newaxis]))
Example #2
0
 def init(self):
     self.mtu = self.kwargs['mtu']
     packetLength = wifi.encode(np.zeros(self.mtu, int), 0).size
     self.kwargs['maximum'] = int(packetLength*4)
     self.kwargs['trigger'] = int(packetLength*2)
     self.dtype = np.complex64
     super(ContinuousReceiver, self).init()
     self.channel = self.kwargs['channel']
     self.packetSink = self.kwargs['packetSink']
     self.inputProcessor = audioLoopback.InputProcessor(self.channel.Fs, self.channel.Fc, self.channel.upsample_factor)
Example #3
0
 def init(self):
     self.mtu = self.kwargs['mtu']
     packetLength = wifi.encode(np.zeros(self.mtu, int), 0).size
     self.kwargs['maximum'] = int(packetLength * 4)
     self.kwargs['trigger'] = int(packetLength * 2)
     self.dtype = np.complex64
     super(ContinuousReceiver, self).init()
     self.channel = self.kwargs['channel']
     self.packetSink = self.kwargs['packetSink']
     self.inputProcessor = audioLoopback.InputProcessor(
         self.channel.Fs, self.channel.Fc, self.channel.upsample_factor)
Example #4
0
 def thread_produce(self):
     packet = self.packetSource()
     if packet is not None:
         buf, rate = packet
         output = wifi.encode(np.fromstring(buf, dtype=np.uint8), rate)
         output = audioLoopback.processOutput(output, self.channel.Fs,
                                              self.channel.Fc,
                                              self.channel.upsample_factor,
                                              None)
     else:
         output = np.zeros((self.channel.Fs * .001, 2))
     return np.hstack((self.hp[0](output[:, 0])[:, np.newaxis],
                       self.hp[1](output[:, 1])[:, np.newaxis]))