[USRP-users] spectrum analyzer USRP N210

Derek Kozel derek.kozel at ettus.com
Wed Nov 15 08:56:53 EST 2017


Hello Ivan,

The rule of thumb is that the digital filters are flat over 80% of the
passband. A good start would be to exclude the first and last 10% of each
FFT and reduce your frequency step size to 80% of the sample rate. This
will flatten your spectrum considerably.

USRPs have a calibration routine for many of the daughterboards, which one
are you using? Some DC offset spur is usually inevitable, but there are
correction algorithms built into the USRP's FPGA. The tool will calculate
values for these APIs but also they can be set manually.
http://files.ettus.com/manual/page_calibration.html
http://files.ettus.com/manual/classuhd_1_1usrp_1_1multi__usrp.html#a263ab7f0364c03e8a6e330c546769e4f
http://files.ettus.com/manual/classuhd_1_1usrp_1_1multi__usrp.html#a586c52db545664cb2caf830ac90c051e

Regards,
Derek



On Wed, Nov 15, 2017 at 1:26 PM, Ivan Zahartchuk via USRP-users <
usrp-users at lists.ettus.com> wrote:

> 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/13d2f53e/attachment-0002.html>


More information about the USRP-users mailing list