1 /*************************************************************************/ 2 /* */ 3 /* Centre for Speech Technology Research */ 4 /* (University of Edinburgh, UK) and */ 5 /* Korin Richmond */ 6 /* Copyright (c) 2003 */ 7 /* All Rights Reserved. */ 8 /* */ 9 /* Permission is hereby granted, free of charge, to use and distribute */ 10 /* this software and its documentation without restriction, including */ 11 /* without limitation the rights to use, copy, modify, merge, publish, */ 12 /* distribute, sublicense, and/or sell copies of this work, and to */ 13 /* permit persons to whom this work is furnished to do so, subject to */ 14 /* the following conditions: */ 15 /* */ 16 /* 1. The code must retain the above copyright notice, this list of */ 17 /* conditions and the following disclaimer. */ 18 /* 2. Any modifications must be clearly marked as such. */ 19 /* 3. Original authors' names are not deleted. */ 20 /* 4. The authors' names are not used to endorse or promote products */ 21 /* derived from this software without specific prior written */ 22 /* permission. */ 23 /* */ 24 /* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */ 25 /* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */ 26 /* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT */ 27 /* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */ 28 /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */ 29 /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */ 30 /* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */ 31 /* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */ 32 /* THIS SOFTWARE. */ 33 /* */ 34 /*************************************************************************/ 35 /* */ 36 /* Author : Korin Richmond */ 37 /* Date : 25 July 2003 */ 38 /* ------------------------------------------------------------------- */ 39 /* EST_Wave and EST_Track signal processing functions */ 40 /* */ 41 /*************************************************************************/ 42 43 %module EST_SignalProc 44 45 %{ 46 #include "sigpr/EST_filter.h" 47 #include "sigpr/EST_filter_design.h" 48 %} 49 50 %include "EST_typemaps.i" 51 %import "EST_Wave.i" 52 53 54 void FIRfilter(EST_Wave &in_sig, const EST_FVector &numerator, 55 int delay_correction=0); 56 57 void FIRfilter(const EST_Wave &in_sig, EST_Wave &out_sig, 58 const EST_FVector &numerator, int delay_correction=0); 59 60 void FIR_double_filter(EST_Wave &in_sig, EST_Wave &out_sig, 61 const EST_FVector &numerator); 62 63 void FIRlowpass_filter(EST_Wave &sigin, int freq, int order=DEFAULT_FILTER_ORDER); 64 65 void FIRlowpass_filter(const EST_Wave &in_sig, EST_Wave &out_sig, 66 int freq, int order=DEFAULT_FILTER_ORDER); 67 68 void FIRhighpass_filter(EST_Wave &in_sig, int freq, int order); 69 70 void FIRhighpass_filter(const EST_Wave &sigin, EST_Wave &out_sig, 71 int freq, int order=DEFAULT_FILTER_ORDER); 72 73 void FIRhighpass_double_filter(EST_Wave &sigin, int freq, 74 int order=DEFAULT_FILTER_ORDER); 75 76 void FIRhighpass_double_filter(const EST_Wave &int_sig, EST_Wave &out_sig, 77 int freq, int order=DEFAULT_FILTER_ORDER); 78 79 void FIRlowpass_double_filter(EST_Wave &sigin, int freq, 80 int order=DEFAULT_FILTER_ORDER); 81 82 void FIRlowpass_double_filter(const EST_Wave &in_sig, EST_Wave &out_sig, 83 int freq, int order=DEFAULT_FILTER_ORDER); 84 85 86 void lpc_filter(EST_Wave &sig, EST_FVector &a, EST_Wave &res); 87 88 89 void inv_lpc_filter(EST_Wave &sig, EST_FVector &a, EST_Wave &res); 90 91 void lpc_filter_1(EST_Track &lpc, EST_Wave & res, EST_Wave &sig); 92 93 void lpc_filter_fast(EST_Track &lpc, EST_Wave & res, EST_Wave &sig); 94 95 void inv_lpc_filter_ola(EST_Wave &sig, EST_Track &lpc, EST_Wave &res); 96 97 void pre_emphasis(EST_Wave &sig, float a=DEFAULT_PRE_EMPH_FACTOR); 98 99 void pre_emphasis(EST_Wave &sig, EST_Wave &out, 100 float a=DEFAULT_PRE_EMPH_FACTOR); 101 102 void post_emphasis(EST_Wave &sig, float a=DEFAULT_PRE_EMPH_FACTOR); 103 104 void post_emphasis(EST_Wave &sig, EST_Wave &out, 105 float a=DEFAULT_PRE_EMPH_FACTOR); 106 107 void simple_mean_smooth(EST_Wave &c, int n); 108 109 110 EST_FVector design_FIR_filter(const EST_FVector &freq_response, 111 int filter_order); 112 113 EST_FVector design_lowpass_FIR_filter(int sample_rate, 114 int freq, int order); 115 116 EST_FVector design_highpass_FIR_filter(int sample_rate, 117 int freq, int order); 118