diff options
author | Glenn Kasten <gkasten@android.com> | 2012-10-17 14:36:35 -0700 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2012-10-17 14:36:35 -0700 |
commit | 5e8e3fc30111534858fbd1f52a92e5128613af0e (patch) | |
tree | 6d3ec889d1f3048db87f765d1e03b93a252cee42 | |
parent | d218670119dc19fbbc5c804ae3ab7c0a5dd985d8 (diff) | |
parent | 65682fb8e99ab2f1d2ad6a44ed507e78e757ffa9 (diff) | |
download | frameworks_av-5e8e3fc30111534858fbd1f52a92e5128613af0e.zip frameworks_av-5e8e3fc30111534858fbd1f52a92e5128613af0e.tar.gz frameworks_av-5e8e3fc30111534858fbd1f52a92e5128613af0e.tar.bz2 |
Merge "fix a few small typos in the FIR computation"
-rw-r--r-- | tools/resampler_tools/fir.cpp | 8 |
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 |