discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] help -- how to implement transmitting periodic on


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] help -- how to implement transmitting periodic on/off tones
Date: Mon, 29 Nov 2010 09:55:21 -0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Nov 29, 2010 at 12:42:38AM -0800, Steve Mcmahon wrote:
> Hello:

> I have a USRP2 board and a WBX daughterboard. I am trying to
> implement a scheme where a single-tone sine wave (at frequencies
> between 1 kHz and 10 kHz) is transmitted
> intermittently. Specifically, time is divided into intervals,
> defined by the user on the command line, typically of values such as
> 200 ms or 500 ms or 1s. When invoked, the flow graph (the Python
> script) would transmit nothing (all zeros) during the first time
> interval, then transmit the tone during the second time interval,
> then transmit nothing (all zeros) during the third and fourth and
> fifth time intervals, then transmit the tone during the sixth time
> interval, then transmit nothing (all zeros) during the seventh time
> interval, and then stop and end.

> How in the world could I implement this? I feel like it'd be hard to
> do, but maybe it's actually easy. Would I need to use a timer in
> Python to set what gets transmitted at the start of each interval
> duration? Any help would be very much appreciated, as I am still
> somewhat new to GNU Radio and Python. Thanks for your help,
> everyone.

Think of the on/off part as a control stream consisting of 1's and
0's.  Generate the control stream, and multiple the control stream by
the carrier stream.

Don't try to start and stop the graph or anything like that from
python. 

You can probably generate the control stream with a
gr.vector_source_f([<my-pattern>], True) followed by a dumb
interpolator that will just replicate values.

  my_pattern = [1, 1, 0, 0, 1, 0, ... ]
  interp_factor = 1000   # scale the pattern up in time to match signal

  ctrl_pattern = gr.vector_source_f(my_pattern, True)
  ctrl_interp = gr.interp_fir_filter_fff(interp_factor, interp_factor*[1.0])
  
  signal = <generate carrier>

  mult = gr.multiple_ff()

  sink = <something-downstream>


  tb.connect(ctrl_pattern, ctrl_interp, (mult, 0))
  tb.connect(signal, (mult, 1))
  tb.connect(mult, sink)



Eric



reply via email to

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