On 27/10/11 03:42 AM, Paul M. Bendixen wrote:
> Hello to you too
>
> At our university we have seen this behaviour as well.
> Our setup is a USRP N210 with a 2400 daughterboard into a Rhode &
> Swartz spectrum analyzer.
> We also get these sidelobes, and if you trawl the archives, you will
> find others have as well.
>
> Currently we are working on a theory that it might be the CORDIC
> algorithm in the FPGA that causes the disturbance.
>
> I have managed to create Matlab and Python code showing some of the
> same characteristics, and am currently working on implementing this
> into a block, so that a channel model can be done.
>
> I believe the reason is the way the CORDIC algorithm is implemented.
> In the verilog code, there are two hints that it might be written
> better, but that it is difficult because of the verilog language.
> It is however almost trivial using VHDL, so I am currently considering
> rewriting the CORDIC in VHDL, although this will probably not be
> untill we have handed in our Masters Thesis (The main object of the
> thesis is not correcting possible errors, but documenting their impact).
>
> We would very much like to use the very descriptive images you have
> provided in our work, if that's okay with you.
>
> Best Regards
> Paul M. Bendixen
> Stud. Scient EE
>
The attached two_tone flow-graph shows that close-in intermod products
are sensitive to overall
  signal magnitude settings.  Keep the digitla signal magnitudes lower,
and the intermod products are
  quite well suppressed.  The flow-graph is setup for a WBX for the
antenna settings.

Keep in mind that the CORDIC is used only when the desired target
frequency is not a multiple of
  the resolution of the PLL synthesizer on whatever daughtercard you're
using, otherwise the CORDIC
  NCO doesn't do anything to the signal.

Connect the TX/RX port to the RX2 port through a 60dB attenuator, so you
can use the RX side to
  monitor the spectrum of the TX side.  The RX-side bandwidth is set to
50Khz total, which gives you
  a good close-in view of the spectrum around the +/- 1Khz tones.  Vary
the digital gain control, and
  observe intermod peaks around the fundamental tones, and observe that
at digital gains below 0.250,
  the intermod peaks become well suppressed (about 45dB down from the
fundamental tones).



-- 
Principal Investigator
Shirleys Bay Radio Astronomy Consortium
http://www.sbrac.org

Attachment: two_tone.grc
Description: application/gnuradio-grc

#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Two Tone
# Generated: Thu Oct 27 10:46:46 2011
##################################################

from gnuradio import eng_notation
from gnuradio import gr
from gnuradio import uhd
from gnuradio import window
from gnuradio.eng_option import eng_option
from gnuradio.gr import firdes
from gnuradio.wxgui import fftsink2
from gnuradio.wxgui import forms
from grc_gnuradio import wxgui as grc_wxgui
from optparse import OptionParser
import wx

class two_tone(grc_wxgui.top_block_gui):

	def __init__(self):
		grc_wxgui.top_block_gui.__init__(self, title="Two Tone")
		_icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png"
		self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))

		##################################################
		# Variables
		##################################################
		self.samp_rate = samp_rate = 200000
		self.freq = freq = 200e6
		self.dgain = dgain = 0.5

		##################################################
		# Blocks
		##################################################
		self._freq_text_box = forms.text_box(
			parent=self.GetWin(),
			value=self.freq,
			callback=self.set_freq,
			label="Frequency",
			converter=forms.float_converter(),
		)
		self.Add(self._freq_text_box)
		_dgain_sizer = wx.BoxSizer(wx.VERTICAL)
		self._dgain_text_box = forms.text_box(
			parent=self.GetWin(),
			sizer=_dgain_sizer,
			value=self.dgain,
			callback=self.set_dgain,
			label="Digital Gain",
			converter=forms.float_converter(),
			proportion=0,
		)
		self._dgain_slider = forms.slider(
			parent=self.GetWin(),
			sizer=_dgain_sizer,
			value=self.dgain,
			callback=self.set_dgain,
			minimum=0,
			maximum=2.0,
			num_steps=100,
			style=wx.SL_HORIZONTAL,
			cast=float,
			proportion=1,
		)
		self.Add(_dgain_sizer)
		self.wxgui_fftsink2_0 = fftsink2.fft_sink_c(
			self.GetWin(),
			baseband_freq=0,
			y_per_div=10,
			y_divs=10,
			ref_level=50,
			ref_scale=2.0,
			sample_rate=samp_rate/4,
			fft_size=1024,
			fft_rate=5,
			average=False,
			avg_alpha=None,
			title="FFT Plot",
			peak_hold=False,
		)
		self.Add(self.wxgui_fftsink2_0.win)
		self.uhd_usrp_source_0 = uhd.usrp_source(
			device_addr="",
			io_type=uhd.io_type.COMPLEX_FLOAT32,
			num_channels=1,
		)
		self.uhd_usrp_source_0.set_samp_rate(samp_rate)
		self.uhd_usrp_source_0.set_center_freq(freq, 0)
		self.uhd_usrp_source_0.set_gain(25, 0)
		self.uhd_usrp_source_0.set_antenna("RX2", 0)
		self.uhd_usrp_sink_0 = uhd.usrp_sink(
			device_addr="",
			io_type=uhd.io_type.COMPLEX_FLOAT32,
			num_channels=1,
		)
		self.uhd_usrp_sink_0.set_samp_rate(samp_rate)
		self.uhd_usrp_sink_0.set_center_freq(freq, 0)
		self.uhd_usrp_sink_0.set_gain(25, 0)
		self.uhd_usrp_sink_0.set_antenna("TX/RX", 0)
		self.gr_sig_source_x_0_0 = gr.sig_source_c(samp_rate, gr.GR_COS_WAVE, 1000, 0.5, 0)
		self.gr_sig_source_x_0 = gr.sig_source_c(samp_rate, gr.GR_COS_WAVE, -1000, 0.5, 0)
		self.gr_multiply_const_vxx_0 = gr.multiply_const_vcc((dgain, ))
		self.gr_add_xx_0 = gr.add_vcc(1)
		self.band_pass_filter_0 = gr.fir_filter_ccc(4, firdes.complex_band_pass(
			1, samp_rate, -25e3, 25e3, 3e3, firdes.WIN_HAMMING, 6.76))

		##################################################
		# Connections
		##################################################
		self.connect((self.gr_sig_source_x_0, 0), (self.gr_add_xx_0, 0))
		self.connect((self.gr_sig_source_x_0_0, 0), (self.gr_add_xx_0, 1))
		self.connect((self.gr_add_xx_0, 0), (self.gr_multiply_const_vxx_0, 0))
		self.connect((self.gr_multiply_const_vxx_0, 0), (self.uhd_usrp_sink_0, 0))
		self.connect((self.uhd_usrp_source_0, 0), (self.band_pass_filter_0, 0))
		self.connect((self.band_pass_filter_0, 0), (self.wxgui_fftsink2_0, 0))

	def get_samp_rate(self):
		return self.samp_rate

	def set_samp_rate(self, samp_rate):
		self.samp_rate = samp_rate
		self.gr_sig_source_x_0.set_sampling_freq(self.samp_rate)
		self.gr_sig_source_x_0_0.set_sampling_freq(self.samp_rate)
		self.band_pass_filter_0.set_taps(firdes.complex_band_pass(1, self.samp_rate, -25e3, 25e3, 3e3, firdes.WIN_HAMMING, 6.76))
		self.wxgui_fftsink2_0.set_sample_rate(self.samp_rate/4)
		self.uhd_usrp_sink_0.set_samp_rate(self.samp_rate)
		self.uhd_usrp_source_0.set_samp_rate(self.samp_rate)

	def get_freq(self):
		return self.freq

	def set_freq(self, freq):
		self.freq = freq
		self._freq_text_box.set_value(self.freq)
		self.uhd_usrp_sink_0.set_center_freq(self.freq, 0)
		self.uhd_usrp_source_0.set_center_freq(self.freq, 0)

	def get_dgain(self):
		return self.dgain

	def set_dgain(self, dgain):
		self.dgain = dgain
		self.gr_multiply_const_vxx_0.set_k((self.dgain, ))
		self._dgain_slider.set_value(self.dgain)
		self._dgain_text_box.set_value(self.dgain)

if __name__ == '__main__':
	parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
	(options, args) = parser.parse_args()
	tb = two_tone()
	tb.Run(True)

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to