discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] how to achieve change values of parameters at ru


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] how to achieve change values of parameters at runtime
Date: Tue, 16 Jun 2009 08:30:23 -0400
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

Sheshanandan KN wrote:
Hi all,
Please ignore the previous mail. It is not complete. It was sent accidently.

Thanks Eric... I will be more specific about the problem.... here it is...

 I am trying to combine the spectrum sense and ODFM Tx code together
 using multi flow graph concept. I idea is to sense the spectrum for
 occupancy and if free, use that frequency for OFDM transmission. So
 far I have achieved the connection between spectrum sense flow graph
 and the OFDM Tx flow graph. I am taking both the spectrum sense
 parameters and OFDM Tx parameters together at the time of
 initialization.
 The code is working fine performing the spectrum sense and ofdm
 transmission. But the frequency at which the OFDM transmission is
 happening is not at the frequency sensed to be free. Instead it is
 happening at the initialized frequency (--tx-freq parameter). I want
 this parameter to be changed at runtime. I have given following piece
 of code for the same:

 class my_top_block(gr.top_block)

       self.sp_sense = spectrum_sense()
       self.ofdm_tx = ofdm_transmit()

       self.connect(ofdm_tx)
       self.connect(sp_sense)


 tx = my_top_block()

Now, in the main program, I do something like this:

if power < threshold:
       print 'spectrum is free'
       tx.ofdm_tx._tx_freq = m.center_freq

Then I perform ofdm transmission. But the last statement here has no
effect in the execution. Please let me know what is the mistake with
this kind of change of parameter value. I am looking to have this kind
of runtime change in value of parameter.

tx.ofdm_tx._tx_freq is just a variable holding the frequency, but does not set it.

You have to re-tune the usrp (tb.set_freq(new_freq)).

Tom






reply via email to

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