discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Complex numbers in math operations


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] Complex numbers in math operations
Date: Fri, 9 Jun 2017 16:02:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

That's not the multiplication "*", that's an operator that takes only one argument (hence, "operand type is", singular). Point being

IdealFMCW[tapIdx] is already a (reference to) a bare gr_complex, NOT a gr_complex* !

Best regards,

Marcus


On 09.06.2017 07:57, Vipin Sharma wrote:
I have a custom block with some input streams being declared as gr_complex type as shown here:

Control_impl::general_work (int noutput_items,
                       gr_vector_int &ninput_items,
                       gr_vector_const_void_star &input_items,
                       gr_vector_void_star &output_items)
    {
      const gr_complex *hTx1 = (const gr_complex *) input_items[0];
      const gr_complex *hTx2 = (const gr_complex *) input_items[1];
      const gr_complex *IdealFMCW = (const gr_complex *) input_items[2];


Later on I use IdealFMCW as follows:

       for(tapIdx=0; tapIdx<TapSize; tapIdx++) {
        *Tx1 = *Tx1 + *(IdealFMCW[tapIdx]) * (*hTx1); 

When I do make, I get compile errors:

error: no match for ‘operator*’ (operand type is ‘const gr_complex {aka const std::complex<float>}’)
         *Tx1 = *Tx1 + *(IdealFMCW[tapIdx]) * (*hTx1); 

I am simply trying to de-reference the pointer (defined by IdealFMCW[tapIdx]) and use the value. What am I not doing right?

Vipin


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

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