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 Scaperoth <[EMAIL PROTECTED]>
To: seph 004 <[EMAIL PROTECTED]>
Cc: Lee Patton <[EMAIL PROTECTED]>; discuss-gnuradio@gnu.org
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 Patton <[EMAIL PROTECTED]>
To: seph 004 <[EMAIL PROTECTED]>
Cc: discuss-gnuradio@gnu.org
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
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio