discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] blks2.synthesis_filterbank


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] blks2.synthesis_filterbank
Date: Tue, 15 Jan 2008 09:35:33 -0800
User-agent: Mutt/1.5.17 (2007-11-01)

On Mon, Jan 14, 2008 at 11:18:15PM -0800, benjar wrote:
> 
> Hey guys,
> 
> I was wondering if the whole hier_block2 thing was working yet.  I tried to
> run the blks2.synthesis_filterbank in a manner that seemed appropriate and
> got the following error:
> 
> terminate called after throwing an instance of 'std::runtime_error'
>   what():  streams_to_stream(5): insufficient connected output ports (2
> needed, 1 connected)
> 
> Is this a bug in the filterbank code, or does this have to do with
> hier_block2 not working yet?
> 
> Any help would be greatly appreciated.  Thanks!
> 
> -Ben  

Hi Ben,  

looks like there are at least two (probably unrelated)
problems.  The first is a problem we've been seeing lately with
SWIG related exception handling.  That's why you're seeing it terminate
instead of entering the python exception handler.  It's independent of
the hier_block2 stuff, e.g.,

    $ python
    Python 2.5 (r25:51908, Nov  6 2007, 16:54:01)
    [GCC 4.1.2 20070925 (Red Hat 4.1.2-27)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from gnuradio import gr
    >>> gr.firdes.hilbert(5, -1)
    terminate called after throwing an instance of 'std::out_of_range'
    what():  gr_firdes:window: type out of range
    Aborted

FYI, it's ticket:181


Not sure what the other problem is.  
Johnathan, can you take a look at this?

Eric


> Here's the source code:
> -------------------------
> #!/usr/bin/env python
> 
> from gnuradio import gr,blks2
> import time
> class PTestMe(gr.top_block):
>     def __init__(self):
>         gr.top_block.__init__(self)
>         sample_rate = 200
> 
>         mpoints = 4;
>         taps = gr.firdes.low_pass(1,   # gain
>                               1,   # rate
>                               1.0/mpoints * 0.5,  # cutoff
>                               1.0/mpoints * 0.1,  # trans width
>                               gr.firdes.WIN_HANN)
> 
>  
> 
>         self.synth = blks2.synthesis_filterbank(mpoints,taps)
>         self.src0 = gr.sig_source_c (sample_rate, gr.GR_SIN_WAVE, 10, 1.0)
>         self.src1 = gr.null_source(gr.sizeof_gr_complex)
>         self.src2 = gr.null_source(gr.sizeof_gr_complex) 
>         self.src3 = gr.null_source(gr.sizeof_gr_complex)
> 
>         self.thr = gr.throttle(gr.sizeof_gr_complex, sample_rate)
>   
>         self.dst = gr.file_sink( gr.sizeof_gr_complex,'bentest.dat')
>         #self.dst = gr.vector_sink_c()
> 
>         self.connect(self.src0,(self.synth,0))
>         self.connect(self.src1,(self.synth,1))
>         self.connect(self.src2,(self.synth,2))
>         self.connect(self.src3,(self.synth,3))
>         self.connect(self.synth,self.thr,self.dst)
> 
> if __name__ == '__main__':
>     test = PTestMe();
>     test.start()
>     time.sleep(1)
>     test.stop() 




reply via email to

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