Fm modulation

Hi,
I am trying to build a simple FM transmitter. The signal should be send
by
the USRP to an Spectrum Analyzer. I connected the Daughterboard BasicTX
(TX_A) to a Spectrum Analyzer, but I didn’t see the expected Spectrum.
I used the Frequency Mod Block in grc. I think this Block should
modulate
the signal and the USRP send it out on 12,8 MHz. I hope you can help me
building a graph who do this simple task of frequency modulation. I also
tried the example on this website
http://www.opendigitalradio.org/index.php/Simple_FM_transmitter_using_gnuradio
, but on the spectrum analyzer i also didn’t see the expected values.

from gnuradio import gr
from gnuradio.eng_option import eng_option
from grc_gnuradio import usrp as grc_usrp
from grc_gnuradio import wxgui as grc_wxgui
from optparse import OptionParser
import wx

class top_block(grc_wxgui.top_block_gui):

def init(self):
grc_wxgui.top_block_gui.init(self, title=“Top Block”)

##################################################
# Variables
##################################################
self.samp_rate = samp_rate = 32000

##################################################
# Blocks
##################################################
self.gr_frequency_modulator_fc_0 = gr.frequency_modulator_fc(3)
self.gr_multiply_const_vxx_0 = gr.multiply_const_vcc((100, ))
self.gr_multiply_const_vxx_1 = gr.multiply_const_vff((10, ))
self.gr_sig_source_x_0_0 = gr.sig_source_f(6400, gr.GR_CONST_WAVE, 

3200,
1, 0)
self.usrp_simple_sink_x_0 = grc_usrp.simple_sink_c(which=0,
side=“A”)
self.usrp_simple_sink_x_0.set_interp_rate(200)
self.usrp_simple_sink_x_0.set_frequency(12800000, verbose=True)
self.usrp_simple_sink_x_0.set_gain(0)

##################################################
# Connections
##################################################
self.connect((self.gr_frequency_modulator_fc_0, 0),

(self.gr_multiply_const_vxx_0, 0))
self.connect((self.gr_sig_source_x_0_0, 0),
(self.gr_multiply_const_vxx_1,
0))
self.connect((self.gr_multiply_const_vxx_1, 0),
(self.gr_frequency_modulator_fc_0, 0))
self.connect((self.gr_multiply_const_vxx_0, 0),
(self.usrp_simple_sink_x_0, 0))

def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate

if name == ‘main’:
parser = OptionParser(option_class=eng_option, usage=“%prog:
[options]”)
(options, args) = parser.parse_args()
tb = top_block()
tb.Run(True)


View this message in context:
http://old.nabble.com/fm-modulation-tp29149390p29149390.html
Sent from the GnuRadio mailing list archive at Nabble.com.

My guess is that the sample rates are messed up. Your signal source
uses 6.4 ksps and the USRP interpolation rate is set to 200. This will
give 1.28 Msps but you need to go up to 128 Msps. If I remember well
the highest interpolation USRP can have is 512, which gives 250 ksps
sample rate.

Under examples/usrp/ you can find several examples for FM transmitters
using the higher level NBFM modulator block. This block can already do
interpolation from audio rates to > 250 ksps required by USRP.

PS: Maybe you can attach the .grc file next time instead of the
generated python code.

Alex

Thank you,
I tried to use the NBFM transmit block.
I generated a signal with a frequency of 32k. This I connected with the
NBFM-Block. The quadrature Rate of this block is 320k. This output i
connected with the USRP an a FFT-Plot. I expected to see a line
at 320k and two lines at (320k- 32k) = 288k and (320k+32k) = 352k. But
on
the FFT-Plot and on the Spectrum Analzer which is connected to the USRP,
I
only see a line at 320k.
Here the grc-file:
http://old.nabble.com/file/p29150442/myFM.grc myFM.grc

View this message in context:
http://old.nabble.com/fm-modulation-tp29149390p29150442.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Thank you very much. Now it is running perfectly :slight_smile: You helped me a lot
to
understand it. Thank you.

Alexandru C.-3 wrote:

Alex

the FFT-Plot and on the Spectrum Analzer which is connected to the USRP,
Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


View this message in context:
http://old.nabble.com/fm-modulation-tp29149390p29158586.html
Sent from the GnuRadio mailing list archive at Nabble.com.

If you fix your sampling rates to be consistent in all blocks (e.g.
64k on audio side, 320k on the other side) and decrease the signal
frequency to be strictly less than half the audio rate, say 31 kHz
you’ll see the peaks.

Note that the NBFM block is for narrow band FM, which usually means
less than 5kHz. If you want to send higher frequency signal you may
want to switch to the WBFM block.

Alex