@@ -1,6 +1,5 | |||||
1 | import sys |
|
1 | import sys | |
2 | import numpy |
|
2 | import numpy | |
3 | from profilehooks import profile |
|
|||
4 | from scipy import interpolate |
|
3 | from scipy import interpolate | |
5 | from schainpy import cSchain |
|
4 | from schainpy import cSchain | |
6 | from jroproc_base import ProcessingUnit, Operation |
|
5 | from jroproc_base import ProcessingUnit, Operation | |
@@ -623,13 +622,6 class Decoder(Operation): | |||||
623 |
|
622 | |||
624 | return self.datadecTime |
|
623 | return self.datadecTime | |
625 |
|
624 | |||
626 | #@profile |
|
|||
627 | def oldCorrelate(self, i, data, code_block): |
|
|||
628 | profilesList = xrange(self.__nProfiles) |
|
|||
629 | for j in profilesList: |
|
|||
630 | self.datadecTime[i,j,:] = numpy.correlate(data[i,j,:], code_block[j,:], mode='full')[self.nBaud-1:] |
|
|||
631 |
|
||||
632 | #@profile |
|
|||
633 | def __convolutionByBlockInTime(self, data): |
|
625 | def __convolutionByBlockInTime(self, data): | |
634 |
|
626 | |||
635 | repetitions = self.__nProfiles / self.nCode |
|
627 | repetitions = self.__nProfiles / self.nCode | |
@@ -639,25 +631,10 class Decoder(Operation): | |||||
639 | code_block = numpy.reshape(junk, (self.nCode*repetitions, self.nBaud)) |
|
631 | code_block = numpy.reshape(junk, (self.nCode*repetitions, self.nBaud)) | |
640 | profilesList = xrange(self.__nProfiles) |
|
632 | profilesList = xrange(self.__nProfiles) | |
641 |
|
633 | |||
642 | # def toVectorize(a,b): |
|
634 | for i in range(self.__nChannels): | |
643 | # return numpy.correlate(a,b, mode='full') |
|
635 | for j in profilesList: | |
644 | # vectorized = numpy.vectorize(toVectorize, signature='(n),(m)->(k)') |
|
636 | self.datadecTime[i,j,:] = numpy.correlate(data[i,j,:], code_block[j,:], mode='full')[self.nBaud-1:] | |
645 | for i in range(self.__nChannels): |
|
637 | return self.datadecTime | |
646 | # self.datadecTime[i,:,:] = numpy.array([numpy.correlate(data[i,j,:], code_block[j,:], mode='full')[self.nBaud-1:] for j in profilesList ]) |
|
|||
647 | # def func(i, j): |
|
|||
648 | # self.datadecTime[i,j,:] = numpy.correlate(data[i,j,:], code_block[j,:], mode='full')[self.nBaud-1:] |
|
|||
649 | # map(lambda j: func(i, j), range(self.__nProfiles)) |
|
|||
650 | #print data[i,:,:].shape |
|
|||
651 | # self.datadecTime[i,:,:] = vectorized(data[i,:,:], code_block[:,:])[:,self.nBaud-1:] |
|
|||
652 | for j in profilesList: |
|
|||
653 | self.datadecTime[i,j,:] = numpy.correlate(data[i,j,:], code_block[j,:], mode='full')[self.nBaud-1:] |
|
|||
654 | # print data[i,:,:] |
|
|||
655 | # print cSchain.correlateByBlock(data[i,:,:], code_block, 2) |
|
|||
656 | # self.datadecTime[i,:,:] = cSchain.correlateByBlock(data[i,:,:], code_block, 2) |
|
|||
657 | # print self.datadecTime[i,:,:] |
|
|||
658 | #print self.datadecTime[i,:,:].shape |
|
|||
659 | return self.datadecTime |
|
|||
660 |
|
||||
661 |
|
638 | |||
662 | def __convolutionByBlockInFreq(self, data): |
|
639 | def __convolutionByBlockInFreq(self, data): | |
663 |
|
640 |
@@ -7,7 +7,6 import json | |||||
7 | import numpy |
|
7 | import numpy | |
8 | import paho.mqtt.client as mqtt |
|
8 | import paho.mqtt.client as mqtt | |
9 | import zmq |
|
9 | import zmq | |
10 | from profilehooks import profile |
|
|||
11 | import datetime |
|
10 | import datetime | |
12 | from zmq.utils.monitor import recv_monitor_message |
|
11 | from zmq.utils.monitor import recv_monitor_message | |
13 | from functools import wraps |
|
12 | from functools import wraps |
General Comments 0
You need to be logged in to leave comments.
Login now