コード例 #1
0
    def help_stream_2ff(self, N, stream_sizes):
        v0 = gr.vector_source_f(N*[1,], False)
        v1 = gr.vector_source_f(N*[2,], False)

        mux = blocks_swig.stream_mux(gr.sizeof_float, stream_sizes)

        dst = gr.vector_sink_f ()

        self.tb.connect (v0, (mux,0))
        self.tb.connect (v1, (mux,1))
        self.tb.connect (mux, dst)
        self.tb.run ()

        return dst.data ()
コード例 #2
0
    def help_stream_ramp_2ff(self, N, stream_sizes):
        r1 = range(N)
        r2 = range(N)
        r2.reverse()

        v0 = gr.vector_source_f(r1, False)
        v1 = gr.vector_source_f(r2, False)

        mux = blocks_swig.stream_mux(gr.sizeof_float, stream_sizes)

        dst = gr.vector_sink_f ()

        self.tb.connect (v0, (mux,0))
        self.tb.connect (v1, (mux,1))
        self.tb.connect (mux, dst)
        self.tb.run ()

        return dst.data ()
コード例 #3
0
    def help_stream_ramp_2ff(self, N, stream_sizes):
        r1 = range(N)
        r2 = range(N)
        r2.reverse()

        v0 = blocks.vector_source_f(r1, False)
        v1 = blocks.vector_source_f(r2, False)

        mux = blocks.stream_mux(gr.sizeof_float, stream_sizes)

        dst = blocks.vector_sink_f()

        self.tb.connect(v0, (mux, 0))
        self.tb.connect(v1, (mux, 1))
        self.tb.connect(mux, dst)
        self.tb.run()

        return dst.data()
コード例 #4
0
    def help_stream_2ff(self, N, stream_sizes):
        v0 = blocks.vector_source_f(N * [
            1,
        ], False)
        v1 = blocks.vector_source_f(N * [
            2,
        ], False)

        mux = blocks.stream_mux(gr.sizeof_float, stream_sizes)

        dst = blocks.vector_sink_f()

        self.tb.connect(v0, (mux, 0))
        self.tb.connect(v1, (mux, 1))
        self.tb.connect(mux, dst)
        self.tb.run()

        return dst.data()