discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Complex numbers in math operations


From: Vipin Sharma
Subject: [Discuss-gnuradio] Complex numbers in math operations
Date: Thu, 8 Jun 2017 22:57:54 -0700

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

reply via email to

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