Hi Martin,
Thanks, for sure the C++ program is giving output in doubles. I was told
by Josh that you can use the gr file block with vector length 8 to read
it in as a double with GRC, but none of the other blocks use double
which is why I would need a double to float converter.
The C++ program I’m working with has a function to convert from double
to float, but I don’t think it handles the buffer correctly. I didn’t
write it.
For sure the output looks good when I use the C++ program and the
converter from double to float and read it in with GRC as float. I
checked with an oscilloscope, the problem is when I get the underruns.
I’m not exactly sure how to handle the clock, I’m using a camera, then
the C++ modulator, then the C++ converter (double to float), and that
gets fed into GRC. In GRC I have the gr file block, a resampler (to
match the sampling frequency of the signal to the USRP), a float to
complex block, then the USRP sink block.
At this point even a simple custom block from double to float in GRC is
hard for me to make myself due to my lack of programming experience.
Thanks for the advice
— On Mon, 4/4/11, Martin B. [email protected] wrote:
From: Martin B. [email protected]
Subject: Re: [Discuss-gnuradio] Buffer Question for Streaming with USRP
To: [email protected]
Date: Monday, April 4, 2011, 8:10 AM
On Sun, Apr 03, 2011 at 07:12:58PM -0700, Tom H. wrote:
consistently, and about 500msec of no signal for each underrun. With the
this isn’t real time.
My other idea is to find a way to do the conversion from double to float in GRC
with a custom block. I also wonder if going from stdout to a pipe file and
then reading the pipe file from GRC is also a problem.
Hi Tom,
I wonder… how do you get double-values in the first place? Literally
no GNU Radio block in the main tree uses double. Perhaps it’s the Monday
morning, but the only way I can think of to get doubles into your flow
graph
without writing lots of code yourself is by reading them from a file,
which you could convert to float beforehand.
Just checking here… are you sure you have double? After your custom
converter,
is the data valid?
Your underruns might also be caused by something else. Do you have a
hardware clock on both ends of the flow graph (e.g. a USRP and a sound
card)?
However, writing simple blocks like a double->float converter is
super-easy. I reckon it would take you as long as it took to set up the
custom converter and the pipes. Use create-gnuradio-out-of-tree-project
to get started and then add a sync block.
MB
–
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)
Dipl.-Ing. Martin B.
Research Associate
Kaiserstrae 12
Building 05.01
76131 Karlsruhe
Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu
KIT – University of the State of Baden-Wrttemberg and
National Laboratory of the Helmholtz Association
-----Inline Attachment Follows-----