gr.diff_phasor_cc


※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif 

#include <gr_diff_phasor_cc.h>
#include <gr_io_signature.h>

gr_diff_phasor_cc_sptr
gr_make_diff_phasor_cc ()
{
  return gr_diff_phasor_cc_sptr (new gr_diff_phasor_cc());
}

gr_diff_phasor_cc::gr_diff_phasor_cc ()
  : gr_sync_block ("diff_phasor_cc",
                   gr_make_io_signature (1, 1, sizeof (gr_complex)),
                   gr_make_io_signature (1, 1, sizeof (gr_complex)))
{
  set_history(2);
}


gr_diff_phasor_cc::~gr_diff_phasor_cc(){}

int
gr_diff_phasor_cc::work (int noutput_items,
                         gr_vector_const_void_star &input_items,
                         gr_vector_void_star &output_items)
{
  gr_complex const *in = (const gr_complex *) input_items[0];
  gr_complex *out = (gr_complex *) output_items[0];
  in += 1; // ensure that i - 1 is valid. 

  for(int i = 0; i < noutput_items; i++){
    out[i] = in[i] * conj(in[i-1]);
  } 

  return noutput_items;
}