common code: Make preemphasis 0 dB @ 1000 Hz

This commit is contained in:
Andreas Eversberg 2016-04-25 18:14:04 +02:00
parent 16acdbf59d
commit 0c99848120
2 changed files with 5 additions and 3 deletions

View File

@ -35,11 +35,11 @@ int init_emphasis(emphasis_t *state, int samplerate)
return -1; return -1;
} }
factor = 0.95; factor = 0.97;
state->p.factor = factor; 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.factor = factor;
state->d.amp = 1.0 / (samplerate / 48000.0 * 4.0); /* mysterious 48000 */ state->d.amp = 1.0 / (samplerate / 6350.0);
return 0; return 0;
} }

View File

@ -52,6 +52,8 @@ int main(void)
emphasis_t estate; emphasis_t estate;
int16_t samples[SAMPLERATE]; 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 */ /* generate sweep 0..4khz */
gen_samples(samples); gen_samples(samples);