From 2c2d60ddd400d4ab9de2aeb6a7eb01b398e670b0 Mon Sep 17 00:00:00 2001 From: drowe67 Date: Fri, 20 Aug 2010 06:45:28 +0000 Subject: [PATCH] remove un-needed files after refactor git-svn-id: https://svn.code.sf.net/p/freetel/code@177 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2/src/refine.c | 162 -------------------------------------------- codec2/src/spec.c | 82 ---------------------- codec2/src/synth.c | 84 ----------------------- codec2/src/synth.h | 37 ---------- codec2/src/window.c | 138 ------------------------------------- codec2/src/window.h | 16 ----- 6 files changed, 519 deletions(-) delete mode 100644 codec2/src/refine.c delete mode 100644 codec2/src/spec.c delete mode 100644 codec2/src/synth.c delete mode 100644 codec2/src/synth.h delete mode 100644 codec2/src/window.c delete mode 100644 codec2/src/window.h diff --git a/codec2/src/refine.c b/codec2/src/refine.c deleted file mode 100644 index 163f9fab..00000000 --- a/codec2/src/refine.c +++ /dev/null @@ -1,162 +0,0 @@ -/*---------------------------------------------------------------------------*\ - - FILE........: refine.c - AUTHOR......: David Rowe - DATE CREATED: 27/5/94 - - Functions for refining the pitch estimate using the harmonic sum method. - -\*---------------------------------------------------------------------------*/ - -/* - Copyright (C) 2009 David Rowe - - All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2, 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 General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include "sine.h" - -/*---------------------------------------------------------------------------*\ - - FUNCTION....: dft_speech - AUTHOR......: David Rowe - DATE CREATED: 27/5/94 - - Finds the DFT of the current speech input speech frame. - -\*---------------------------------------------------------------------------*/ - -void dft_speech(float Sn[], COMP Sw[]) -{ - int i; - - for(i=0; i TWO_PI/P_MIN) - model.Wo = TWO_PI/P_MIN; - - model.L = floor(PI/model.Wo); -} - -/*---------------------------------------------------------------------------*\ - - FUNCTION....: hs_pitch_refinement - AUTHOR......: David Rowe - DATE CREATED: 27/5/94 - - Harmonic sum pitch refinement function. - - pmin pitch search range minimum - pmax pitch search range maximum - step pitch search step size - model current pitch estimate in model.Wo - - model refined pitch estimate in model.Wo - -\*---------------------------------------------------------------------------*/ - -void hs_pitch_refinement(float pmin, float pmax, float pstep) -{ - int m; /* loop variable */ - int b; /* bin for current harmonic centre */ - float E; /* energy for current pitch*/ - float Wo; /* current "test" fundamental freq. */ - float Wom; /* Wo that maximises E */ - float Em; /* mamimum energy */ - float r; /* number of rads/bin */ - float p; /* current pitch */ - - /* Initialisation */ - - model.L = PI/model.Wo; /* use initial pitch est. for L */ - Em = 0.0; - r = TWO_PI/FFT_ENC; - - /* Determine harmonic sum for a range of Wo values */ - - for(p=pmin; p<=pmax; p+=pstep) { - E = 0.0; - Wo = TWO_PI/p; - - /* Sum harmonic magnitudes */ - - for(m=1; m<=model.L; m++) { - b = floor(m*Wo/r + 0.5); - E += Sw[b].real*Sw[b].real + Sw[b].imag*Sw[b].imag; - } - - /* Compare to see if this is a maximum */ - - if (E > Em) { - Em = E; - Wom = Wo; - } - } - - model.Wo = Wom; -} - diff --git a/codec2/src/spec.c b/codec2/src/spec.c deleted file mode 100644 index e8cd710f..00000000 --- a/codec2/src/spec.c +++ /dev/null @@ -1,82 +0,0 @@ -/*---------------------------------------------------------------------------*\ - - FILE........: spec.c - AUTHOR......: David Rowe - DATE CREATED: 27/5/94 - - Functions for estimating the sinusoidal model parameters. - -\*---------------------------------------------------------------------------*/ - -/* - Copyright (C) 2009 David Rowe - - All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2, 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 General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include "defines.h" -#include "spec.h" - -/*---------------------------------------------------------------------------*\ - - FUNCTION....: estimate_amplitudes - AUTHOR......: David Rowe - DATE CREATED: 27/5/94 - - Estimates the complex amplitudes of the harmonics. - -\*---------------------------------------------------------------------------*/ - -void estimate_amplitudes(MODEL *model, float Sw[]) -{ - int i,m; /* loop variables */ - int am,bm; /* bounds of current harmonic */ - int b; /* DFT bin of centre of current harmonic */ - float den; /* denominator of amplitude expression */ - float r; /* number of rads/bin */ - float E; - int offset; - COMP Am; - - r = TWO_PI/FFT_ENC; - for(i=0; iL; l++) { - b = floor(l*model->Wo*FFT_DEC/TWO_PI + 0.5); - Sw_[b].real = model->A[l]*cos(model->phi[l]); - Sw_[b].imag = model->A[l]*sin(model->phi[l]); - Sw_[FFT_DEC-b].real = Sw_[b].real; - Sw_[FFT_DEC-b].imag = -Sw_[b].imag; - } - - /* Perform inverse DFT */ - - four1(&Sw_[-1].imag,FFT_DEC,1); - - /* Overlap add to previous samples */ - - for(i=0; i -#include "defines.h" -#include "window.h" - -float make_window( - float w[], /* time domain analysis window */ - COMP W[] /* w[] in frequency domain */ -) -{ - float m; - COMP temp; - int i,j; - - /* - Generate Hamming window centered on M-sample pitch analysis window - - 0 M/2 M-1 - |-------------|-------------| - |-------|-------| - NW samples - - All our analysis/synthsis is centred on the M/2 sample. - */ - - m = 0.0; - for(i=0; i