Hello. I'm making a receiver for H210. I only output the first frequency
position. When the frequency is changed on the generator, it is not
displayed on the graph. Tell me what the problem is.
Thank you in advance

import numpy as np
import libpyuhd
import pyqtgraph as pg
import time
from PyQt4 import QtGui,QtCore
app = QtGui.QApplication([])
win=pg.GraphicsWindow()
label = pg.LabelItem(justify='right')
win.addItem(label)
p1 = win.addPlot(row=1, col=0)
p2=p1.plot()
global p2
vb = p1.vb
usrp1=libpyuhd.usrp.multi_usrp("addr=192.168.10.4")
chanels=0
usrp1.set_rx_rate(50e6,0)
usrp1.set_rx_gain(38,0)
usrp1.set_rx_freq(libpyuhd.types.tune_request(420e6),0)
st_args=libpyuhd.usrp.stream_args("fc32","sc8")
st_args.chanels=chanels
metadata=libpyuhd.types.rx_metadata()
streamer=usrp1.get_rx_stream(st_args)
stream_cmd = libpyuhd.types.stream_cmd(libpyuhd.types.stream_mode.num_more)
streamer.issue_stream_cmd(stream_cmd)
stream_cmd.num_samps=4096
stream_cmd.stream_now=True
recv_buff = np.zeros(4096, dtype=np.complex64)
np.set_printoptions(threshold='nan')
buffer_samps=streamer.get_max_num_samps()
#start=time.time()
def update():
    start=time.time()
    streamer.recv(recv_buff, metadata)
    print (time.time()-start)
    #print (np.array_equal(recv_buff,res))
    p2.setData(abs(np.fft.fft(recv_buff)),pen="r")
timer = QtCore.QTimer()
timer.timeout.connect(update)
timer.start(0)
    #recv_buff = np.zeros(4096, dtype=np.complex64)
if __name__ == '__main__':
    import sys
    if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
        QtGui.QApplication.instance().exec_()
_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Reply via email to