I'm having some problems with my flowgraph in GNU Radio. I built a custom block to be a Delay block because the native block didn't work very well for my application. Before my custom block there is a UHD Source. It's working in a sample rate of 4M. However when I start my simulation it is generating overflows ("O"). I think this is strange because when I save in a file the output of UHD source and then play again the simulation in mode "off-line" there isn't errors of overflow. In the other words, I have problems just when I am working in mode "on-line". Only when I'm working with UHD Source and not a file saved before by UHD Source.
Delay_amostra_sync block code:
import numpy
from gnuradio import gr
class Delay_amostra_sync(gr.sync_block):
"""
docstring for block Delay_amostra_sync
"""
def init(self, var):
gr.sync_block.init(self,
name="Delay_amostra_sync",
in_sig=[numpy.complex64],
out_sig=[numpy.complex64])
self.var = var
self.cont = 0
self.buffer = numpy.array([])
self.c = 1
def work(self, input_items, output_items):
in0 = input_items[0]
out = output_items[0]
self.dados = numpy.array(input_items[0], copy=True)
self.buffer = numpy.append(self.buffer, self.dados)
if self.cont >= self.var:
out[:] = self.buffer[range(0,len(out))]
self.buffer = numpy.delete(self.buffer, range(0,len(out)), 0)
self.cont = self.cont + 1