[USRP-users] spectrum analyzer USRP N210

Michał Wróbel michal.a.wrobel at gmail.com
Wed Nov 15 08:39:52 EST 2017


Hi Ivan,

these spikes look similar to what I am experiencing with my USRP2+WBX and
what seems to be already fixed in the GitHub repository:

https://github.com/EttusResearch/fpga/pull/4

I have asked about that just yesterday:

http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2017-November/027054.html

Best regards,
Michał

2017-11-15 14:26 GMT+01:00 Ivan Zahartchuk via USRP-users <
usrp-users at lists.ettus.com>:

> Hello. I'm trying to make a broadband spectrum analyzer. I encountered
> some difficulties with the USRP N210 board. At certain frequencies, I get
> such a picture. And there are problems with the presence of central
> frequencies. Advise me how to remove these shortcomings.
> My code:
>
> n = int(math.ceil((config.stop_freq - config.start_freq) / config.band))
> fft1 = np.array([], dtype=np.complex64)
> for i in range(0, n):
>     usrp.set_rx_freq(lib.types.tune_request(config.start_freq + config.band / 2 + config.band * i), 0)
>     streamer.recv(recv_buff, config.metadata)
>     if config.metadata.error_code == lib.types.rx_metadata_error_code.timeout:
>         print ("ERRROR")
>     elif config.metadata.error_code == lib.types.rx_metadata_error_code.late:
>         print ("ERR1")
>     elif config.metadata.error_code == lib.types.rx_metadata_error_code.broken_chain:
>         print ("ERR2")
>     elif config.metadata.error_code == lib.types.rx_metadata_error_code.overflow:
>         print ("ERR3")
>     elif config.metadata.error_code == lib.types.rx_metadata_error_code.alignment:
>         print ("ERR4")
>     elif config.metadata.error_code == lib.types.rx_metadata_error_code.bad_packet:
>         print ("ERR5")
>
>     prom1 = np.fft.fft(recv_buff)
>     prom1[0:5] = 0
>     prom1[num_samps-5:num_samps] = 0
>     prom1= np.fft.fftshift(prom1)*w
>     fft1 = np.hstack((fft1,prom1))
>
>     stream_cmd.time_spec = lib.types.time_spec(0)
>     streamer.issue_stream_cmd(stream_cmd)
>
> dbm = np.array(10 * np.log10(np.abs(fft1))  - 60)
>
> return dbm,config.start_freq+(config.band/num_samps)*np.arange(dbm.size)
>
>
> _______________________________________________
> USRP-users mailing list
> USRP-users at lists.ettus.com
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20171115/90024018/attachment-0002.html>


More information about the USRP-users mailing list