##// END OF EJS Templates
regresar bloque
José Chávez -
r1005:6d4c9673341e
parent child
Show More
@@ -632,7 +632,7 class Decoder(Operation):
632 for j in profilesList:
632 for j in profilesList:
633 self.datadecTime[i,j,:] = numpy.correlate(data[i,j,:], code_block[j,:], mode='full')[self.nBaud-1:]
633 self.datadecTime[i,j,:] = numpy.correlate(data[i,j,:], code_block[j,:], mode='full')[self.nBaud-1:]
634
634
635 @profile
635 #@profile
636 def __convolutionByBlockInTime(self, data):
636 def __convolutionByBlockInTime(self, data):
637
637
638 repetitions = self.__nProfiles / self.nCode
638 repetitions = self.__nProfiles / self.nCode
@@ -640,12 +640,11 class Decoder(Operation):
640 junk = numpy.lib.stride_tricks.as_strided(self.code, (repetitions, self.code.size), (0, self.code.itemsize))
640 junk = numpy.lib.stride_tricks.as_strided(self.code, (repetitions, self.code.size), (0, self.code.itemsize))
641 junk = junk.flatten()
641 junk = junk.flatten()
642 code_block = numpy.reshape(junk, (self.nCode*repetitions, self.nBaud))
642 code_block = numpy.reshape(junk, (self.nCode*repetitions, self.nBaud))
643
643 profilesList = xrange(self.__nProfiles)
644
644
645 # def toVectorize(a,b):
645 # def toVectorize(a,b):
646 # return numpy.correlate(a,b, mode='full')
646 # return numpy.correlate(a,b, mode='full')
647 # vectorized = numpy.vectorize(toVectorize, signature='(n),(m)->(k)')
647 # vectorized = numpy.vectorize(toVectorize, signature='(n),(m)->(k)')
648 a = time()
649 for i in range(self.__nChannels):
648 for i in range(self.__nChannels):
650 # self.datadecTime[i,:,:] = numpy.array([numpy.correlate(data[i,j,:], code_block[j,:], mode='full')[self.nBaud-1:] for j in profilesList ])
649 # self.datadecTime[i,:,:] = numpy.array([numpy.correlate(data[i,j,:], code_block[j,:], mode='full')[self.nBaud-1:] for j in profilesList ])
651 # def func(i, j):
650 # def func(i, j):
@@ -653,14 +652,13 class Decoder(Operation):
653 # map(lambda j: func(i, j), range(self.__nProfiles))
652 # map(lambda j: func(i, j), range(self.__nProfiles))
654 #print data[i,:,:].shape
653 #print data[i,:,:].shape
655 # self.datadecTime[i,:,:] = vectorized(data[i,:,:], code_block[:,:])[:,self.nBaud-1:]
654 # self.datadecTime[i,:,:] = vectorized(data[i,:,:], code_block[:,:])[:,self.nBaud-1:]
656 self.oldCorrelate(i, data, code_block)
655 for j in profilesList:
657 print self.datadecTime[i,:,:]
656 self.datadecTime[i,j,:] = numpy.correlate(data[i,j,:], code_block[j,:], mode='full')[self.nBaud-1:]
658 # print data[i,:,:]
657 # print data[i,:,:]
659 # print cSchain.correlateByBlock(data[i,:,:], code_block, 2)
658 # print cSchain.correlateByBlock(data[i,:,:], code_block, 2)
660 self.datadecTime[i,:,:] = cSchain.correlateByBlock(data[i,:,:], code_block, 2)
659 # self.datadecTime[i,:,:] = cSchain.correlateByBlock(data[i,:,:], code_block, 2)
661 print self.datadecTime[i,:,:]
660 # print self.datadecTime[i,:,:]
662 #print self.datadecTime[i,:,:].shape
661 #print self.datadecTime[i,:,:].shape
663 print time() - a
664 return self.datadecTime
662 return self.datadecTime
665
663
666
664
General Comments 0
You need to be logged in to leave comments. Login now