signal.h
Go to the documentation of this file.
1 // feat/signal.h
2 
3 // Copyright 2015 Tom Ko
4 
5 // See ../../COPYING for clarification regarding multiple authors
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 // http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15 // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16 // MERCHANTABLITY OR NON-INFRINGEMENT.
17 // See the Apache 2 License for the specific language governing permissions and
18 // limitations under the License.
19 
20 #ifndef KALDI_FEAT_SIGNAL_H_
21 #define KALDI_FEAT_SIGNAL_H_
22 
23 #include "base/kaldi-common.h"
24 #include "util/common-utils.h"
25 
26 namespace kaldi {
27 
28 /*
29  The following three functions are having the same functionality but
30  different implementations so as the efficiency. After the convolution,
31  the length of the signal will be extended to (original signal length +
32  filter length - 1).
33 */
34 
35 /*
36  This function implements a simple non-FFT-based convolution of two signals.
37  It is suggested to use the FFT-based convolution function which is more
38  efficient.
39 */
40 void ConvolveSignals(const Vector<BaseFloat> &filter, Vector<BaseFloat> *signal);
41 
42 /*
43  This function implements FFT-based convolution of two signals.
44  However this should be an inefficient version of BlockConvolveSignals()
45  as it processes the entire signal with a single FFT.
46 */
47 void FFTbasedConvolveSignals(const Vector<BaseFloat> &filter, Vector<BaseFloat> *signal);
48 
49 /*
50  This function implements FFT-based block convolution of two signals using
51  overlap-add method. This is an efficient way to evaluate the discrete
52  convolution of a long signal with a finite impulse response filter.
53 */
54 void FFTbasedBlockConvolveSignals(const Vector<BaseFloat> &filter, Vector<BaseFloat> *signal);
55 
56 } // namespace kaldi
57 
58 #endif // KALDI_FEAT_SIGNAL_H_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
void FFTbasedConvolveSignals(const Vector< BaseFloat > &filter, Vector< BaseFloat > *signal)
Definition: signal.cc:50
void FFTbasedBlockConvolveSignals(const Vector< BaseFloat > &filter, Vector< BaseFloat > *signal)
Definition: signal.cc:77
void ConvolveSignals(const Vector< BaseFloat > &filter, Vector< BaseFloat > *signal)
Definition: signal.cc:34