[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] General question concerning usrp & audio

From: Thomas Seidel
Subject: Re: [Discuss-gnuradio] General question concerning usrp & audio
Date: Tue, 21 Sep 2010 23:36:14 +0200 (CEST)

Thanks a lot for your help!

file2.py now looks like this:

class soundcheck(gr.top_block):

   def __init__(self):
     self.decim_rate = 256
     self.u = usrp.source_c(0, self.decim_rate)
     self.rx_subdev_spec = usrp.pick_rx_subdevice(self.u)
     self.subdev = usrp.selected_subdev(self.u, self.rx_subdev_spec)
     self.input_rate = self.u.adc_freq() / self.decim_rate

    res = self.u.tune(0, self.subdev, 13.56e6)
    if res:
       print 'frequency successfully changed to 13.56Mhz'
      print 'tuning failed'

    interp = gru.lcm(self.input_rate, 48000) / self.input_rate
    decim = gru.lcm(self.input_rate, 48000) / 48000
    interp = int(interp)
   decim = int(decim)
   print 'interp = %d, decim = %d' % (interp, decim)
   rr = blks2.rational_resampler_ccc(interp, decim)

   self.sndsink = audio.sink(48000, 'plughw:0,0')
   self.magblk = gr.complex_to_mag()
   self.connect(self.u, rr, self.magblk, (self.sndsink, 0))

As one can see I added the reational_resampler_ccc(), hoping that it does the 
magic work needed that I can hear a nice sine wave, but still there is only 
noise. On the transmitting side a gr.sig_source_c(48000, gr.GR_SIN_WAVE, 4000, 
1000) is used with the interpolation of the USRP set to a factor of 32. Maybe I 
still lack of a proper understanding of the whole issue so that I would really 
appreciate your help.


-----Ursprüngliche Nachricht-----
Von: "Alexandru Csete" <address@hidden>
Gesendet: Sep 21, 2010 12:32:17 PM
An: address@hidden
Betreff: Re: [Discuss-gnuradio] General question concerning usrp & audio

>On Tue, Sep 21, 2010 at 5:09 AM, Thomas Seidel <address@hidden> wrote:
>> hHey!
>> I am just playing around with gnuradio and the usrp stuff and want to 
>> achieve the following:
>> file1.py
>> [...]
>> self.u = usrp.sink_c(0, 64)
>> self.src gr.sig_source_c(48000, gr.GR_SIN_WAVE, 400, 1)
>> self.connect(self.src, self.u)
>> [...]
>> file2.py
>> [...]
>> self.u = usrp.source_c(0, self.decim_rate)
>> self.sndsink = audio.sink(48000, 'plughw:0,0')
>> self.blk = gr.complex_to_mag()
>> self.connect(self.u, self.blk, (self.sndsink, 0))
>> [...]
>> in words: file1.py should serve as the sender of sine signal with a 
>> frequency of 400Hz and file2.py should receive this signal and emit it on 
>> the soundcard. Both excerpts are implemented as a derived class from 
>> gr.top_block().
>> Running usrp_oscope.py, I can see that a sine is transmitted, however i can 
>> not here anything than noise(?). Actually I would have expected something 
>> like the output of dial_tone.py. Can somebody tell me why I am wrong and 
>> don't receive what i expect.
>One of the problems is that you connect the USRP to the audio sink
>without any downsampling. Even with max decimation, 256, the USRP will
>generate 250 ksps while your audio sink expects only 48 ksps. If you
>look at the receiver examples you'll see that all of them use a
>channel filter (usually low pass) which also does some downsampling.
>By the way, using a channel filter in a receiver is generally a good
>idea ;-)
>Other problems could be receiver settings (gain, frequency, antenna
>selection, etc.).
>Discuss-gnuradio mailing list
GRATIS: Spider-Man 1-3 sowie 300 weitere Videos!
Jetzt kostenlose Movie-FLAT freischalten! http://movieflat.web.de

reply via email to

[Prev in Thread] Current Thread [Next in Thread]