Imported Upstream version 3.0
[debian/gnuradio] / gnuradio-core / src / lib / filter / ccomplex_dotprod_generic.cc
1 /* -*- c -*- */
2 /*
3  * Copyright 2002 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  * 
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING.  If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26 #include <gr_complex.h>
27 #include "gr_fir_ccc_simd.h"
28 #include "ccomplex_dotprod_generic.h"
29
30 #include <iostream>
31
32 void
33 ccomplex_dotprod_generic (const float *input,
34                        const float *taps, unsigned n_2_ccomplex_blocks,
35                        float *result)
36 {
37   gr_complex sum0(0,0);
38   gr_complex sum1(0,0);
39
40   std::cerr << "Blah!!!\n";
41   do {
42     const gr_complex tap0(taps[0], taps[1]);
43     const gr_complex tap1(taps[2], taps[3]);
44     const gr_complex input0(input[0], input[1]);
45     const gr_complex input1(input[2], input[3]);
46
47     sum0 += input0 * tap0;
48     sum1 += input1 * tap1;
49
50     input += 8;
51     taps += 8;
52
53   } while (--n_2_ccomplex_blocks != 0);
54
55
56   sum0 += sum1;
57   result[0] = sum0.real();
58   result[1] = sum0.imag();
59 }