aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2016-04-25 18:14:04 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2016-05-01 15:14:57 +0200
commit0c99848120f654538334491cc1abe450b831f3f0 (patch)
tree587f6f360971663fbc2d3ce332de7f2ab629ebdd /src
parent16acdbf59d8b56f759efad3ad86c75b7e472b4cd (diff)
common code: Make preemphasis 0 dB @ 1000 Hz
Diffstat (limited to 'src')
-rw-r--r--src/common/emphasis.c6
-rw-r--r--src/test/test_emphasis.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/common/emphasis.c b/src/common/emphasis.c
index cdd4458..ccacd1f 100644
--- a/src/common/emphasis.c
+++ b/src/common/emphasis.c
@@ -35,11 +35,11 @@ int init_emphasis(emphasis_t *state, int samplerate)
return -1;
}
- factor = 0.95;
+ factor = 0.97;
state->p.factor = factor;
- state->p.amp = samplerate / 48000.0 * 4.0; /* mysterious 48000 */
+ state->p.amp = samplerate / 6350.0;
state->d.factor = factor;
- state->d.amp = 1.0 / (samplerate / 48000.0 * 4.0); /* mysterious 48000 */
+ state->d.amp = 1.0 / (samplerate / 6350.0);
return 0;
}
diff --git a/src/test/test_emphasis.c b/src/test/test_emphasis.c
index b93d0c3..dc95023 100644
--- a/src/test/test_emphasis.c
+++ b/src/test/test_emphasis.c
@@ -52,6 +52,8 @@ int main(void)
emphasis_t estate;
int16_t samples[SAMPLERATE];
+ printf("1000 Hz shall be close to 0 dB, that is no significant change in volume.\n\n");
+
/* generate sweep 0..4khz */
gen_samples(samples);