[Top][All Lists]

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

Re: [Discuss-gnuradio] floats over UDP into GRC?

From: Marcus D. Leech
Subject: Re: [Discuss-gnuradio] floats over UDP into GRC?
Date: Tue, 13 Sep 2011 19:45:19 -0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110831 Fedora/3.1.12-2.fc14 Thunderbird/3.1.12

I'm producing the stream in C++ (using openFrameworks) and sending the data as 
char arrays,
and have confirmed that this is indeed all that is being sent (e.g. "1.25")…
So, you're sending them in ASCII?  As ASCII strings?

GRC/gnuradio has no method for dealing with that. The UDP block assumes native machine-binary format for data coming in over UDP. Doing it in ASCII (Or Unicode, or whatever) strings will be hugely inefficient, both in terms of bandwidth required-- it takes many more bytes to represent a floating-point number in ASCII, than in the native binary format, and converting from strings back into the native binary format is also quite expensive. Since UDP is entirely binary transparent, there's no reason to send them as ascii strings. The only thing you have to watch out for is if the raw floating-point format between your two machines is different. But between x86-family machines, it's all the same.

Marcus Leech
Principal Investigator
Shirleys Bay Radio Astronomy Consortium

reply via email to

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