Forum: GNU Radio Tutorial 1 (C++) QA testing

Posted by Brooke Hayden (Guest)
on 2013-02-11 21:00
(Received via mailing list)
Martin,

I'm creating a C++ block using the first tutorial like you assumed. I 
have
re-done this tutorial about 10 times now. I have the latest version of 
GNU
Radio installed. The part in the tutorial you pointed out is most likely
the problem, but I don't know how. My QA code is as follows:
from gnuradio import gr, gr_unittest
import howto_swig as howto

class qa_square_ff (gr_unittest.TestCase):

    def setUp (self):
        self.tb = gr.top_block ()

    def tearDown (self):
        self.tb = None

    def test_001_square_ff (self):
        src_data = (-3, 4, -5.5, 2, 3)
        expected_result = (9, 16, 30.25, 4, 9)
        src = gr.vector_source_f(src_data)
        sqr = howto.square_ff()
        dst= gr.vector_sink_f()
        self.tb.connect(src, sqr)
        self.tb.connect(sqr, dst)
        self.tb.run()
        result_data = dst.data()
        self.assertFloatTuplesAlmostEqual(expexted_result, result_data, 
6)


if __name__ == '__main__':
    gr_unittest.run(qa_square_ff, "qa_square_ff.xml")

One thing that is confusing in the tutorial is the following:
So, we open python/qa_square_ff.py, which we edit to look like this:

Check out this code, which we save as python/qa_howto.py (only the 
modified
portion is shown):

I'm not sure if I need to edit and save qa_square_ff.py, create
qa_howto,py, or do both. If you, or someone else, has a gr-howto folder
that works I would like to compare and see what is happening.

Thanks
Posted by Nathan West (Guest)
on 2013-02-11 21:41
(Received via mailing list)
Hi,

I had the same issue a couple of weeks ago. I forget what the
differences were, but I remember the code that comes with GNU Radio
working, so check here:
http://gnuradio.org/redmine/projects/gnuradio/repo...

I chalked up the differences to the tutorial being written for the
next release and didn't bother changing the wiki. Maybe it's worth
doing.

-Nathan
Posted by Martin Braun (CEL) (Guest)
on 2013-02-12 09:50
(Received via mailing list)
On Mon, Feb 11, 2013 at 02:14:15PM -0600, Nathan West wrote:
> Hi,
>
> I had the same issue a couple of weeks ago. I forget what the
> differences were, but I remember the code that comes with GNU Radio
> working, so check here:
> 
http://gnuradio.org/redmine/projects/gnuradio/repo...
>
> I chalked up the differences to the tutorial being written for the
> next release and didn't bother changing the wiki. Maybe it's worth
> doing.

Hi guys,

hope your stuff is working now.
There might be problems in the tutorial (I actually did the tutorial on
another screen while I was writing it, so it should be 99% correct, 1%
remains to be checked :).

The actual output of gr_modtool as shown in the wiki page might not be
exactly what you see. There are several versions of modtool out there;
we're planning to merge it into main GNU Radio soon. Then, there will be
one official version to go with.

This concurs with what Nathan said: When 3.6.4 is the official release,
the tutorial, modtool and GNU Radio will fit much better.

However, right now, it should still be useful, assuming the user can
adapt to slightly different outputs--with you guys, I'm not worried in
that respect.

MB

> > from gnuradio import gr, gr_unittest
> >     def test_001_square_ff (self):
> >
> > I'm not sure if I need to edit and save qa_square_ff.py, create qa_howto,py,
> > or do both. If you, or someone else, has a gr-howto folder that works I
> > would like to compare and see what is happening.

--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.