discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Multiplying the inputs with a scalar/vector in my


From: Pavan Yedavalli
Subject: Re: [Discuss-gnuradio] Multiplying the inputs with a scalar/vector in my own block
Date: Tue, 7 Jun 2016 16:39:59 -0700

Sorry, and just as an addition, obviously I could use the "Multiply by...." blocks in GRC, but I am trying to do a much more complex loop involving this block, so multiplying is only part of the process, and I'm running into issues there already. Thanks.

On Tue, Jun 7, 2016 at 4:30 PM, Pavan Yedavalli <address@hidden> wrote:
Hi,

I created my own block because I wanted to multiply the source sinusoids by weights before transmitting them out, as shown in the attached GRC diagram (my_block.png).

However, in my work() function for the block created, I am seeing that simply multiplying the inputs by anything (first test was multiply by 1 and then by complex(1.0,0.0)) completely alters the level of the signal. Multiplying by unity should not do anything, but instead, using a spectrum analyzer, I see the signal jump up by 30 dBm and then fluctuate up and down for some reason, using the code below:

    def work(self, input_items, output_items):
        in0 = input_items[0]
        in1 = input_items[1]
        out0 = output_items[0]
        out1 = output_items[1]

        out0[:] = [x * 1 for x in in1]
        out1[:] = [x * 1 for x in in1]

        #did this afterward
        #out0[:] = [x * complex(1.0,0.0) for x in in1]
        #out1[:] = [x * complex(1.0,0.0) for x in in1]
 
        return len(output_items[0])

 When I don't multiply the inputs by anything, using the code below, the signal stays stable:

    def work(self, input_items, output_items):
        in0 = input_items[0]
        in1 = input_items[1]
        out0 = output_items[0]
        out1 = output_items[1]
 
        return len(output_items[0])

Since my intent is simply to multiply the signal by some complex weights (eventually), I'm not sure what I am doing wrong here. Something is clearly wrong with how/what I'm multiplying, and I don't think I am understanding. Please keep me posted. Thank you so much for the help!

--
Pavan



--
Pavan

reply via email to

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