discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] question regarding GrMixer.h


From: Joseph DiVerdi
Subject: [Discuss-gnuradio] question regarding GrMixer.h
Date: Mon, 14 Jul 2003 23:32:51 -0600

Still studying existing code to learn "how they do it".

While deep in the GrMixer.h code learning how to access input and output data I 
noticed that it appears this module emulates a "partial" mixer where only the 
sine multiplication is performed rather than both the sine and cosine 
multiplication.

Or is it that these operators and the sin function are overloaded with complex 
calculations when complex data is being processed?

A code snippet from the module follows:

--------------------------------------------
template<class iType,class oType>
int GrMixer<iType, oType>::work(VrSampleRange output, void *ao[], VrSampleRange 
inputs[], void *ai[]) {
  iType *in  = ((iType**) ai)[0];
  oType *out = ((iType**) ao)[0];

  sync (output.index);
  
  for (unsigned oo = 0; oo < output.size; oo++){
    out[oo] = (oType) (gain * in[oo] * nco.sin());
    nco.step();
  }

  return output.size;
}
--------------------------------------------

Best regards,
Joseph
-- 
Joseph A. DiVerdi, Ph.D., M.B.A.          
http://xtrsystems.com/           970.980.5868 (voice) 
PGP Key ID: 0xD50A9E33




reply via email to

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