discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] How to use the read_float_binary.m function


From: Marcus D. Leech
Subject: Re: [Discuss-gnuradio] How to use the read_float_binary.m function
Date: Thu, 27 Oct 2011 23:43:04 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10

>
> Still no ray of hope.
>
> I am pasting the complete code here.
>
> ---------------------------------------------------------------------------------------------------------------------------
>         collect_raw_data = gr.file_sink(self.fft_size, "observed_data")
>
>         numpy.fromfile("observed_data", dtype=numpy.complex64, count=-1,
> sep='')
>         thingy = numpy.fromfile("observed_data", dtype=int, count=-1,
> sep='')
>
>         file = open ("outputfile", "w")
>
>         for n in range(0, len(thingy)):
>             x = str(thingy[n].real) + " " + str(thingy[n].imag)+ "\n"
>             file.write(x)
>
>         file.close()
>        
>        self.connect(self.u, s2v, c2mag, collect_raw_data)
> ---------------------------------------------------------------------------------------
>
> What do you think what should be the output of the above alogrithm.
> I am getting two output files for this algorithm.
> One is "observed_data" which contains some unreadable characters. I think
> this is a binary file. I have to convert this binary file to understand the
> raw data.
> The other one is "output" which contains nothing. I guess this file should
> contain the converted data of "observed_data" file.
>
> Still looking for some sort of help.
>
> Thanks.
>
>
>   
The crucial item we were all missing was that you were trying to do this
*inside a Gnu Radio flowgraph*.

Let the flow-graph run, then use an independant Python program *after
the fact* to convert your
  data file.

>From your code, it's clear that you're confused about how all this
works, and probably software-design
  and programming in general.  I suspect that you're a student, and that
you have an overdue assignment
  and you don't even know where to start.  From the code-segment you
provided, I'm guessing that your
  programming and software design background is extremely limited.
 While people on this list are
  generally pretty generous with their time and knowledge, the
assumption is that our good will
  won't be abused.  Using the people on this list as a means to complete
your academic assignments for
  you is definitely an abuse of that good will.



-- 
Principal Investigator
Shirleys Bay Radio Astronomy Consortium
http://www.sbrac.org





reply via email to

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