00001 /* 00002 * $Id: agc.h,v 1.11 2009/05/30 00:45:51 kprox Exp $ 00003 * 00004 * Copyright (C) 2002-2006: 00005 * Ken Prox <kprox@users.sourceforge.net> 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 00020 */ 00021 #ifndef AGC_H 00022 #define AGC_H 00023 00030 typedef enum { 00035 AGC_LINEAR_PEAK_LIMIT = 0, 00040 AGC_PERCENTAGE_W_NOISE_FLOOR, 00045 AGC_PERCENTAGE_PEAK_LIMIT, 00050 AGC_LINEAR_PEAK_W_COMPUTED_GAIN_ON_CLIP, 00051 AGC_NUMBER_OF_ADJUSTMENT_TYPES 00052 } te_agc_types; 00053 00057 typedef struct s_agc *agc; 00058 00068 agc agc_create(double max_gain, 00069 double min_gain, 00070 double noise_floor, 00071 double max_amp, 00072 te_agc_types agc_type, 00073 double gain_increase_correct, 00074 double gain_decrease_correct); 00075 00079 void agc_destroy(agc *gain_object); 00080 00085 double agc_update(agc gain_object, double current_amplitude); 00086 00087 #endif /* AGC_H */