On Thu, 2011-10-27 at 19:00 -0600, hasanimam wrote:
> Hello,
> 
> I am in deep deep trouble. And it would be really great if somebody come up
> with any sort of help.

Well, here is the code I cobbled together to do this. It is nothing
fancy.

- Wayde

-------------------------------------------------------------------------------


#!/usr/bin/env python

import sys, struct

if len(sys.argv) != 2:   # Need to have one input data file
                         # Print out splash banner in case the filename
                         # isn't entered correctly

      print
      print '   [gr_raw2num.py, Version 20100308 by J. Wayde Allen]'
      print
      print '   NAME:  gr_raw2num.py  '
      print
      print '   USAGE:  gr_raw2num.py filename'
      print
      print '   DESCRIPTION:'
      print
      print '   Converts raw complex float data to complex'

else:

   myfile = sys.argv[1]
   f = open(myfile, 'rb')
   eof = False

   while not eof:
      try:
         chunk = f.read(8)
         a,b = struct.unpack('ff',chunk)
         value = complex(a,b)
         print a, b
      except:
         eof = True


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to