FreeCalypso > hg > gsm-codec-lib
view libgsmefr/preemph.c @ 282:9ee8ad3d4d30
frtest: rm gsmfr-hand-test and gsmfr-max-out utils
These hack programs were never properly documented and were written
only as part of a debug chase, in pursuit of a bug that ultimately
turned out to be in our then-hacky patch to osmo-bts-sysmo,
before beginning of proper patches in Osmocom. These hack programs
need to be dropped from the present sw package because they depend
on old libgsm, and we are eliminating that dependency.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 14 Apr 2024 05:44:47 +0000 |
parents | 9aef9e54b19d |
children |
line wrap: on
line source
/*---------------------------------------------------------------------* * routine preemphasis() * * ~~~~~~~~~~~~~~~~~~~~~ * * Preemphasis: filtering through 1 - g z^-1 * *---------------------------------------------------------------------*/ #include "gsm_efr.h" #include "typedef.h" #include "namespace.h" #include "basic_op.h" #include "no_count.h" #include "sig_proc.h" #include "cnst.h" #include "dec_state.h" void preemphasis ( struct EFR_decoder_state *st, Word16 *signal, /* (i/o) : input signal overwritten by the output */ Word16 g, /* (i) : preemphasis coefficient */ Word16 L /* (i) : size of filtering */ ) { Word16 *p1, *p2, temp, i; p1 = signal + L - 1; p2 = p1 - 1; temp = *p1; for (i = 0; i <= L - 2; i++) { *p1 = sub (*p1, mult (g, *p2--)); p1--; } *p1 = sub (*p1, mult (g, st->mem_pre)); st->mem_pre = temp; return; }