Re: The shortest pulse length

This is what I did:

def build_graph ():
nchan = 1
interp = 512
duc0 = 0
duc1 = 0
fs = 250e3 #2nd sample rate
between usb and dac
max_dev = 32e3 #1st sample rate divided
by 4 (1st = 2nd sample rate)
gain = 16e3
k = 2 * math.pi * max_dev / fs
vec1 = Numeric.arange (0.624, 0.656, 0.0000128)
vsource = gr.vector_source_f(vec1, False)
fmmod = gr.frequency_modulator_fc (k)
amp = gr.multiply_const_cc(gain)

fg = gr.flow_graph ()

u = usrp.sink_c (0, interp, nchan)
tx_subdev_spec = (1, 0) #usrp.pick_tx_subdevice(u)
m = usrp.determine_tx_mux_value(u, tx_subdev_spec)
u.set_mux(m)
subdev = usrp.selected_subdev(u, tx_subdev_spec)
subdev.set_enable(True)

sample_rate = u.dac_freq () / interp
u.set_tx_freq (0, duc0)
u.set_tx_freq (1, duc1)


fg.connect (vsource, fmmod, amp, u)

return fg

I modified a version of siggen_min2.py into the above.

Regards

Lance

----- Original Message ----
From: David S. [email protected]
To: seph 004 [email protected]
Cc: Lee P. [email protected]; [email protected]
Sent: Thursday, March 1, 2007 5:59:22 AM
Subject: Re: [Discuss-gnuradio] The shortest pulse length

On Feb 28, 2007, at 4:29 AM, seph 004 wrote:

Well, I have implemented a bit of a strange setup which seems to be
working somewhat now. I’m not really trying to view only the first few
samples, I’m currently trying to track where I might of made a mistake
with trying to generate a defined pulse with a specific length. My aim
is to generate a very narrow band chirp to transmit on a little
ultrasonic tranducer. I figured out which numerical values to the
gr.modulation block produce which frequencies. Using this, I made a
vector of the exact number of samples I want with the values to produce
the frequencies I want. In my case 39-41 kHz. For some reason these low
frequencies still make it through the transformer on the basic TX db,
so I’m using them. Initially I was just generating a sine wave, and
trying to use gr.head to limit the number of samples, but I’ve since
switched to this approach

I figured that if I wanted to produce a wave form lasting 10 msecs, then
I would need at least 2500 samples. I got this number from the DAC rate
of 128M and the highest interpolation factor of 512. When I test with
the scope set to auto store, I spot the waveform, but it is only 1 msec
long. So either I’ve lost a lot of samples somewhere, or my scaling is
wrong.

How are you creating the flow graph?

I pretty much abandoned using gr.head, as it wasn’t producing anything.
At least now though I can see a waveform, though my scaling seems to
have gone wrong somewhere. When you say you used a looback, do you mean
you connected the TX db output and RX db input, and used the gr.oscope
block to view your signals?

Regards

Lance

----- Original Message ----
From: Lee P. [email protected]
To: seph 004 [email protected]
Cc: [email protected]
Sent: Tuesday, February 27, 2007 12:58:31 AM
Subject: Re: [Discuss-gnuradio] The shortest pulse length

On Mon, 2007-02-26 at 00:55 -0800, seph 004 wrote:

I have a vector source producing a sine wave, and then I’m using
gr.head to limit the number of samples sent.

I’m sure you checked this, but are you trying to capture the first few
samples of sin(x)? I so, sin(x) = x for small angles, and sin(0)=0.
So, you won’t see anything in the first few samples anyway.

From your explanation, I should be ok with even a low number of
samples. When I tested my setup, I couldn’t catch anything on the
scope. There is probably some problem in how I made the app.

I saw something mentioned elsewhere in the discussion archives that
the usrp dumps the first few samples it receives from the host before
transmitting. Is this still something to take note of?

I don’t know whether or not the USRP dumps the first few samples. I
don’t think I’ve ever experienced it though. I can say that there is an
unpredictable delay from the generation of the first sample in software
until the time it actually reaches the output port.

I haven’t tried to do what you’re doing – i.e., capture the first few
output samples on a scope. How is the scope triggered? (What I did was
create a loopback whereby I transmit and receive by reading the
bleedover on the daugherboard.)

-Lee

Now that’s room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your
fit._______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

On 3/1/07, seph 004 [email protected] wrote:

max_dev = 32e3                              #1st sample rate divided
u = usrp.sink_c (0, interp, nchan)
tx_subdev_spec = (1, 0) #usrp.pick_tx_subdevice(u)
m = usrp.determine_tx_mux_value(u, tx_subdev_spec)
u.set_mux(m)
subdev = usrp.selected_subdev(u, tx_subdev_spec)
subdev.set_enable(True)

sample_rate = u.dac_freq () / interp
u.set_tx_freq (0, duc0)
u.set_tx_freq (1, duc1)

Are you trying to use one daughter boards(nchen=1)? Why did you set
duc0 =
0? that means your frequency will not be set at all. You do not need
to
do set_tx_freq() twice if you are using one daughter board. you only
need :
u.set_tx_freq (0, duc0) where duc0 is some frequency. Also, if you are
using the basic daughterboards, you need to make sure that you have the
output connector connect to TXA not TXB (according to your
tx_subdev_spec)

Hope this helped.

David

On Thu, Mar 01, 2007 at 12:15:36PM -0500, David S. wrote:

between usb and dac

David
Lance, you really want to be using tune, not set_tx_freq.
tune knows about all the daughterboards and does the right thing to
split the work between the digital upconverter and the RF front end (if
any).

Take a look at fm_tx4.py or fm_tx_2_daughterboards.py

Eric