discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] RE: How to insert a matlab file into GNURadio in pyth


From: Kevin Rudd
Subject: [Discuss-gnuradio] RE: How to insert a matlab file into GNURadio in python
Date: Thu, 20 Mar 2008 08:30:24 -0400


I used MATLAB to create waveforms and then send them to GNURadio using TCP
ports and out through the USRP (and vise versa).  Not sure if this is what
you want, but this is how I did it...

On the python side, I used the following code to open the TCP socket...

http://alumni.media.mit.edu/~jcooley/gr_experiments/experiments/gr_socket.ht
m

On the MATLAB side, I used this code...

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=345

The MATLAB code would look something like...

Data = <create a waveform>
con=pnet('tcpconnect','127.0.0.1',8881)
pnet(con,'write', data, 'NATIVE');
pnet(con,'close');

The python code would look something like...

## imports...
from gr_socket import *

# the main flow would be as follows.
u = usrp.sink_c ()       
(src, fd, conn) = make_socket_source(8881, 4)
fmtx = blks.nbfm_tx (fg, audio_rate, usrp_rate, max_dev=2.5e3, tau=75e-6)
gain = gr.multiply_const_cc (40.0)
fg.connect (src, fmtx, gain, u)

You can receive data in GNURadio and send it directly to MATLAB just as
easy.  Hope this helps...

Kevin







reply via email to

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