Mercurial > hg > peckfft
comparison peck_test.c @ 11:abdcde012978
backup
author | Peter Meerwald <p.meerwald@bct-electronic.com> |
---|---|
date | Thu, 22 Sep 2011 15:19:18 +0200 |
parents | 707be088ccc3 |
children |
comparison
equal
deleted
inserted
replaced
10:05f6ab0a17c0 | 11:abdcde012978 |
---|---|
65 | 65 |
66 peck_fftri(pi, out, res); | 66 peck_fftri(pi, out, res); |
67 | 67 |
68 if (j == 0) { | 68 if (j == 0) { |
69 for (i = 0; i < 8; i++) | 69 for (i = 0; i < 8; i++) |
70 printf("%d: %f\n", i, *(float*)&res[i] / N); | 70 printf("%d: %f %f\n", i, ((float*)&res[i])[0] / N, ((float*)&res[i])[1] / N); |
71 } | 71 } |
72 } | 72 } |
73 peck_fftr_free(p); | 73 peck_fftr_free(p); |
74 peck_fftr_free(pi); | 74 peck_fftr_free(pi); |
75 peck_fft_cleanup(); | 75 peck_fft_cleanup(); |
76 | 76 |
77 for (i = 0; i < N; i++) { | 77 for (i = 0; i < N; i++) { |
78 if (fabs(*(float*)&in[i] - *(float*)&res[i]/N) > 0.00001) { | 78 if (fabs(((float*)&in[i])[0] - ((float*)&res[i])[0]/N) > 0.00001) { |
79 fprintf(stderr, "!!!! ERROR !!!! at %d\n", i); | 79 fprintf(stderr, "!!!! ERROR0 !!!! at %d\n", i); |
80 exit(EXIT_FAILURE); | |
81 } | |
82 if (fabs(((float*)&in[i])[1] - ((float*)&res[i])[1]/N) > 0.00001) { | |
83 fprintf(stderr, "!!!! ERROR1 !!!! at %d\n", i); | |
80 exit(EXIT_FAILURE); | 84 exit(EXIT_FAILURE); |
81 } | 85 } |
82 } | 86 } |
83 | 87 |
84 return EXIT_SUCCESS; | 88 return EXIT_SUCCESS; |