def main(self, input_rings, output_rings):
"""
@param[in] input_rings First ring in this list will be used for
data
@param[out] output_rings First ring in this list will be used for
data output."""
data_accumulate = None
for ispan in self.iterate_ring_read(input_rings[0]):
if self.nbit < 8:
unpacked_data = unpack(ispan.data_view(self.dtype), self.nbit)
else:
unpacked_data = ispan.data_view(self.dtype)
if data_accumulate is not None:
data_accumulate = np.concatenate((data_accumulate, unpacked_data[0]))
else:
data_accumulate = unpacked_data[0]
if self.shape != [1, 1]:
data_accumulate = np.reshape(data_accumulate, (self.shape[0], -1))
data_accumulate = data_accumulate.astype(np.complex64)
self.out_gulp_size = data_accumulate.nbytes
outspan_generator = self.iterate_ring_write(output_rings[0])
ospan = outspan_generator.next()
result = np.fft.fft(data_accumulate).astype(np.complex64)
ospan.data_view(np.complex64)[0] = result.ravel()
评论列表
文章目录