1 //
2 // dotprod_cccf_example.c
3 //
4 // This example demonstrates the interface to the complex floating-point
5 // dot product object (dotprod_cccf).
6 //
7 
8 #include <stdio.h>
9 #include "liquid.h"
10 
main()11 int main() {
12     // input array
13     float complex x[] = { 1 + 1 * _Complex_I,
14                           2 + 1 * _Complex_I,
15                           3 + 1 * _Complex_I,
16                           4 + 1 * _Complex_I,
17                           5 + 1 * _Complex_I};
18 
19     // coefficients array
20     float complex h[] = { 1 + 1 * _Complex_I,
21                          -1 + 1 * _Complex_I,
22                           1 + 1 * _Complex_I,
23                          -1 + 1 * _Complex_I,
24                           1 + 1 * _Complex_I};
25 
26     // dot product result
27     float complex y;
28 
29     // run regular dot product
30     dotprod_cccf_run(x,h,5,&y);
31     printf("dotprod_cccf              : %8.2f + j%8.2f\n", crealf(y), cimagf(y));
32 
33     // run structured dot product
34     dotprod_cccf q = dotprod_cccf_create(x,5);
35     dotprod_cccf_execute(q,h,&y);
36     printf("dotprod_cccf (structured) : %8.2f + j%8.2f\n", crealf(y), cimagf(y));
37     dotprod_cccf_destroy(q);
38 
39     return 0;
40 }
41 
42 
43