summaryrefslogtreecommitdiff
path: root/apps/eq.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/eq.c')
-rw-r--r--apps/eq.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/eq.c b/apps/eq.c
index 57c29dc357..17165be541 100644
--- a/apps/eq.c
+++ b/apps/eq.c
@@ -132,7 +132,7 @@ static long dbtoA(long db)
132/* Calculate second order section peaking filter coefficients. 132/* Calculate second order section peaking filter coefficients.
133 cutoff is a value from 0 to 0xffffffff, where 0 represents 0 hz and 133 cutoff is a value from 0 to 0xffffffff, where 0 represents 0 hz and
134 0xffffffff represents nyquist (samplerate/2). 134 0xffffffff represents nyquist (samplerate/2).
135 Q is an unsigned 6.26 fixed point number, lower bound is artificially set 135 Q is an unsigned 16.16 fixed point number, lower bound is artificially set
136 at 0.5. 136 at 0.5.
137 db is s15.16 fixed point and describes gain/attenuation at peak freq. 137 db is s15.16 fixed point and describes gain/attenuation at peak freq.
138 c is a pointer where the coefs will be stored. 138 c is a pointer where the coefs will be stored.
@@ -141,7 +141,7 @@ void eq_pk_coefs(unsigned long cutoff, unsigned long Q, long db, long *c)
141{ 141{
142 const long one = 1 << 28; /* s3.28 */ 142 const long one = 1 << 28; /* s3.28 */
143 const long A = dbtoA(db); 143 const long A = dbtoA(db);
144 const long alpha = DIV64(fsin(cutoff), 2*Q, 25); /* s1.30 */ 144 const long alpha = DIV64(fsin(cutoff), 2*Q, 15); /* s1.30 */
145 long a0, a1, a2; /* these are all s3.28 format */ 145 long a0, a1, a2; /* these are all s3.28 format */
146 long b0, b1, b2; 146 long b0, b1, b2;
147 147
@@ -164,7 +164,7 @@ void eq_ls_coefs(unsigned long cutoff, unsigned long Q, long db, long *c)
164{ 164{
165 const long one = 1 << 24; /* s7.24 */ 165 const long one = 1 << 24; /* s7.24 */
166 const long A = dbtoA(db); 166 const long A = dbtoA(db);
167 const long alpha = DIV64(fsin(cutoff), 2*Q, 25); /* s1.30 */ 167 const long alpha = DIV64(fsin(cutoff), 2*Q, 15); /* s1.30 */
168 const long ap1 = (A >> 5) + one; 168 const long ap1 = (A >> 5) + one;
169 const long am1 = (A >> 5) - one; 169 const long am1 = (A >> 5) - one;
170 const long twosqrtalpha = 2*(FRACMUL(fsqrt(A >> 5, 24), alpha) << 1); 170 const long twosqrtalpha = 2*(FRACMUL(fsqrt(A >> 5, 24), alpha) << 1);
@@ -191,7 +191,7 @@ void eq_hs_coefs(unsigned long cutoff, unsigned long Q, long db, long *c)
191{ 191{
192 const long one = 1 << 24; /* s7.24 */ 192 const long one = 1 << 24; /* s7.24 */
193 const long A = dbtoA(db); 193 const long A = dbtoA(db);
194 const long alpha = DIV64(fsin(cutoff), 2*Q, 25); /* s1.30 */ 194 const long alpha = DIV64(fsin(cutoff), 2*Q, 15); /* s1.30 */
195 const long ap1 = (A >> 5) + one; 195 const long ap1 = (A >> 5) + one;
196 const long am1 = (A >> 5) - one; 196 const long am1 = (A >> 5) - one;
197 const long twosqrtalpha = 2*(FRACMUL(fsqrt(A >> 5, 24), alpha) << 1); 197 const long twosqrtalpha = 2*(FRACMUL(fsqrt(A >> 5, 24), alpha) << 1);