Forum: GNU Radio Extracting intermediate data

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1fc35c055fe967a4488c596d1484b969?d=identicon&s=25 Catalin Lacatus (Guest)
on 2009-01-20 21:49
(Received via mailing list)
Hello,

I am working with usrp_spectrum_sense.py and I am trying to analyze the
intermediate data from different DSP blocks.

After I passed the input stream to a vector I tried to save this
information on a file like this:



        /s2v = gr.stream_to_vector(gr.sizeof_gr_complex, self.fft_size)

        output2=gr.file_sink(gr.sizeof_gr_complex,"file2.txt")

        self.connect(self.u, s2v, output2)/





and I received the following error:



/node1-2:~/gnuradio/gnuradio-examples/python/usrp#
./usrp_spectrum_sense.py -F 16 4.5M 7.5M

Using RX d'board A: Basic Rx

Traceback (most recent call last):

  File "./usrp_spectrum_sense.py", line 305, in <module>

    tb = my_top_block()

  File "./usrp_spectrum_sense.py", line 179, in __init__

    self.connect(self.u, s2v, output2)

  File
"/usr/local/lib/python2.5/site-packages/gnuradio/gr/top_block.py", line
70, in connect

    self._connect(points[i-1], points[i])

  File
"/usr/local/lib/python2.5/site-packages/gnuradio/gr/top_block.py", line
76, in _connect

    dst_block.basic_block(), dst_port)

  File
"/usr/local/lib/python2.5/site-packages/gnuradio/gr/gnuradio_swig_py_runtime.py",
line 1469, in connect

    return _gnuradio_swig_py_runtime.gr_top_block_sptr_connect(*args)

ValueError: itemsize mismatch: stream_to_vector(4):0 using 128,
file_sink(5):0 using 8/

/ /



It seems to be a format mismatch.
Please any advice how to write the output of s2v to a file.



Thank you,
Catalin
3719f4fea703e38bcbf8de6fe6bcdf55?d=identicon&s=25 Martin DvH (Guest)
on 2009-01-21 02:50
(Received via mailing list)
On Tue, 2009-01-20 at 15:33 -0500, Catalin Lacatus wrote:
>         output2=gr.file_sink(gr.sizeof_gr_complex,"file2.txt")
>
>         self.connect(self.u, s2v, output2)/
>
You should have written
output2=gr.file_sink(gr.sizeof_gr_complex*self.fft_size,"file2.txt")
You are now getting vectors of 128 complex values as one item.

Success,
Martin
This topic is locked and can not be replied to.