diff options
| author | drowe67 <[email protected]> | 2023-12-12 09:50:48 +1030 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-12 09:50:48 +1030 |
| commit | 93dbb6290495ccb194759506372b72fac1b1b104 (patch) | |
| tree | c7a57ab014674259999feb3b2eba0dd004a5f664 /src | |
| parent | 4f4f7304542c4c3ef49d443ae78732b0e6683a0f (diff) | |
| parent | b8e452709330c75abfab55919575966da3bb030c (diff) | |
Merge pull request #31 from drowe67/dr-codec2-doc
WP2000 - Codec 2 Algorithm Description
Diffstat (limited to 'src')
| -rw-r--r-- | src/c2sim.c | 2 | ||||
| -rw-r--r-- | src/codec2.c | 1 | ||||
| -rw-r--r-- | src/codec2_internal.h | 8 | ||||
| -rw-r--r-- | src/newamp2.h | 80 |
4 files changed, 1 insertions, 90 deletions
diff --git a/src/c2sim.c b/src/c2sim.c index cf23d3a..3117415 100644 --- a/src/c2sim.c +++ b/src/c2sim.c @@ -1023,7 +1023,7 @@ int main(int argc, char *argv[]) { if (lpc_model) { lsp_to_lpc(&lsps_dec[i][0], &ak_dec[i][0], order); aks_to_M2(fftr_fwd_cfg, &ak_dec[i][0], order, &model_dec[i], e_dec[i], - &snr, 0, simlpcpf, lpcpf, 1, LPCPF_BETA, LPCPF_GAMMA, Aw); + &snr, 1, simlpcpf, lpcpf, 1, LPCPF_BETA, LPCPF_GAMMA, Aw); apply_lpc_correction(&model_dec[i]); sum_snr += snr; #ifdef DUMP diff --git a/src/codec2.c b/src/codec2.c index 52602e3..b27626a 100644 --- a/src/codec2.c +++ b/src/codec2.c @@ -46,7 +46,6 @@ #include "lpc.h" #include "lsp.h" #include "machdep.h" -#include "newamp2.h" #include "nlp.h" #include "phase.h" #include "postfilter.h" diff --git a/src/codec2_internal.h b/src/codec2_internal.h index 0b54585..32cd7eb 100644 --- a/src/codec2_internal.h +++ b/src/codec2_internal.h @@ -32,7 +32,6 @@ #include "codec2_fft.h" #include "newamp1.h" -#include "newamp2.h" struct CODEC2 { int mode; @@ -87,13 +86,6 @@ struct CODEC2 { float eq[NEWAMP1_K]; /* optional equaliser */ bool eq_en; - /*newamp2 states (also uses newamp1 states )*/ - float energy_prev; - float n2_rate_K_sample_freqs_kHz[NEWAMP2_K]; - float n2_prev_rate_K_vec_[NEWAMP2_K]; - float n2_pwb_rate_K_sample_freqs_kHz[NEWAMP2_16K_K]; - float n2_pwb_prev_rate_K_vec_[NEWAMP2_16K_K]; - /* used to dump features for deep learning experiments */ FILE *fmlfeat, *fmlmodel; diff --git a/src/newamp2.h b/src/newamp2.h deleted file mode 100644 index 6a4d6a4..0000000 --- a/src/newamp2.h +++ /dev/null @@ -1,80 +0,0 @@ -/*---------------------------------------------------------------------------*\ - - FILE........: newamp2.h - AUTHOR......: Thomas Kurin and Stefan Erhardt - INSTITUTE...: Institute for Electronics Engineering, University of -Erlangen-Nuremberg DATE CREATED: July 2018 BASED ON....: "newamp1.h" by -David Rowe - - Quantisation functions for the sinusoidal coder, using "newamp1" - algorithm that resamples variable rate L [Am} to a fixed rate K then - VQs. - -\*---------------------------------------------------------------------------*/ - -/* - Copyright Thomas Kurin and Stefan Erhardt 2018 - - All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 2.1, as - published by the Free Software Foundation. This program is - distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef __NEWAMP2__ -#define __NEWAMP2__ - -#define NEWAMP2_N_INDEXES \ - 4 /* Number of indexes to pack: vq1, vq2, energy, Wo */ -#define NEWAMP2_PHASE_NFFT \ - 128 /* size of FFT used for phase synthesis */ -#define NEWAMP2_K 29 /* rate K vector length */ -#define NEWAMP2_16K_K \ - 40 /* rate K vector length for 16k Mode */ - -#include "codec2_fft.h" -#include "comp.h" - -void n2_mel_sample_freqs_kHz(float rate_K_sample_freqs_kHz[], int K); -void n2_resample_const_rate_f(C2CONST *c2const, MODEL *model, - float rate_K_vec[], - float rate_K_sample_freqs_kHz[], int K); -void n2_rate_K_mbest_encode(int *indexes, float *x, float *xq, int ndim); -void n2_resample_rate_L(C2CONST *c2const, MODEL *model, float rate_K_vec[], - float rate_K_sample_freqs_kHz[], int K, - int plosive_flag); -void n2_post_filter_newamp2(float vec[], float sample_freq_kHz[], int K, - float pf_gain); -void newamp2_interpolate(float interpolated_surface_[], float left_vec[], - float right_vec[], int K, int plosive_flag); -void newamp2_model_to_indexes(C2CONST *c2const, int indexes[], MODEL *model, - float rate_K_vec[], - float rate_K_sample_freqs_kHz[], int K, - float *mean, float rate_K_vec_no_mean[], - float rate_K_vec_no_mean_[], int plosiv); -void newamp2_indexes_to_rate_K_vec(float rate_K_vec_[], - float rate_K_vec_no_mean_[], - float rate_K_sample_freqs_kHz[], int K, - float *mean_, int indexes[], float pf_gain); -void newamp2_16k_indexes_to_rate_K_vec(float rate_K_vec_[], - float rate_K_vec_no_mean_[], - float rate_K_sample_freqs_kHz[], int K, - float *mean_, int indexes[], - float pf_gain); -void newamp2_indexes_to_model(C2CONST *c2const, MODEL model_[], COMP H[], - float interpolated_surface_[], - float prev_rate_K_vec_[], float *Wo_left, - int *voicing_left, - float rate_K_sample_freqs_kHz[], int K, - codec2_fft_cfg fwd_cfg, codec2_fft_cfg inv_cfg, - int indexes[], float pf_gain, int flag16k); - -#endif |
