summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2007-08-23 21:01:28 -0700
committerGlenn Kasten <gkasten@google.com>2012-10-17 11:24:27 -0700
commit65682fb8e99ab2f1d2ad6a44ed507e78e757ffa9 (patch)
tree6d3ec889d1f3048db87f765d1e03b93a252cee42 /tools
parent4b8a3d8a89814dc3fb365f18d01733e26eb495a1 (diff)
downloadframeworks_av-65682fb8e99ab2f1d2ad6a44ed507e78e757ffa9.zip
frameworks_av-65682fb8e99ab2f1d2ad6a44ed507e78e757ffa9.tar.gz
frameworks_av-65682fb8e99ab2f1d2ad6a44ed507e78e757ffa9.tar.bz2
fix a few small typos in the FIR computation
Change-Id: I6e56b514fe520f30f7487f85c64ea5d2a7c19b40 Signed-off-by: Glenn Kasten <gkasten@google.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/resampler_tools/fir.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/tools/resampler_tools/fir.cpp b/tools/resampler_tools/fir.cpp
index 919a97b..0ab2d2b 100644
--- a/tools/resampler_tools/fir.cpp
+++ b/tools/resampler_tools/fir.cpp
@@ -78,10 +78,9 @@ int main(int argc, char** argv)
const int nz = 4;
// total number of coefficients
- const int N = (1 << 4) * nzc;
+ const int N = (1 << nz) * nzc;
// generate the right half of the filter
-
printf("const int32_t RESAMPLE_FIR_SIZE = %d;\n", N);
printf("const int32_t RESAMPLE_FIR_NUM_COEF = %d;\n", nzc);
printf("const int32_t RESAMPLE_FIR_COEF_BITS = %d;\n", nc);
@@ -91,19 +90,16 @@ int main(int argc, char** argv)
printf("static int16_t resampleFIR[%d] = {", N);
for (int i=0 ; i<N ; i++)
{
- double x = (2.0 * M_PI * i * Fcr) / (1 << 4);
+ double x = (2.0 * M_PI * i * Fcr) / (1 << nz);
double y = kaiser(i+N, 2*N, alpha) * sinc(x);
int yi = floor(y * (1<<(nc-1)) + 0.5);
if (yi >= (1<<(nc-1))) yi = (1<<(nc-1))-1;
- //printf("%6d\n", yi);
-
if ((i % (1 << 4)) == 0) printf("\n ");
printf("0x%04x, ", yi & 0xFFFF);
}
printf("\n};\n");
-
return 0;
}
\ No newline at end of file