aboutsummaryrefslogtreecommitdiffstats
path: root/utils/bsincgen.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-08-21 04:54:49 -0700
committerChris Robinson <[email protected]>2017-08-21 04:54:49 -0700
commitef7ce8282857dbe0de3162ea86dda59200f2bc3d (patch)
tree3dee02364a758e1608534a0f1ba9de19253a0740 /utils/bsincgen.c
parent921a820867f5b5683858247d0e9c4c42241c65f0 (diff)
Properly postfix the filter order number
Diffstat (limited to 'utils/bsincgen.c')
-rw-r--r--utils/bsincgen.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/utils/bsincgen.c b/utils/bsincgen.c
index e4683ded..324e8b04 100644
--- a/utils/bsincgen.c
+++ b/utils/bsincgen.c
@@ -244,7 +244,7 @@ static void BsiGenerateTables()
i += 4 * BSINC_PHASE_COUNT * mt[si];
fprintf(stdout, "/* Generated by bsincgen, do not edit! */\n\n"
-"/* Table of windowed sinc coefficients and deltas. This %dth order filter\n"
+"/* Table of windowed sinc coefficients and deltas. This %d%s order filter\n"
" * has a rejection of -%gdB, yielding a transition width of ~%.3f\n"
" * (normalized frequency). Order increases when downsampling to a limit of\n"
" * one octave, after which the quality of the filter (transition width)\n"
@@ -256,7 +256,11 @@ static void BsiGenerateTables()
" const float scaleBase, scaleRange;\n"
" const int m[BSINC_SCALE_COUNT];\n"
" const int filterOffset[BSINC_SCALE_COUNT];\n"
-"} bsinc = {\n", BSINC_ORDER, BSINC_REJECTION, width, log2(1.0/scaleBase), i);
+"} bsinc = {\n", BSINC_ORDER, (((BSINC_ORDER%100)/10) == 1) ? "th" :
+ ((BSINC_ORDER%10) == 1) ? "st" :
+ ((BSINC_ORDER%10) == 2) ? "nd" :
+ ((BSINC_ORDER%10) == 3) ? "rd" : "th",
+ BSINC_REJECTION, width, log2(1.0/scaleBase), i);
fprintf(stdout, " /* Tab */ {\n");
for(si = 0; si < BSINC_SCALE_COUNT; si++)