/* * MVA.cc * Basic Mean subtraction, Variance normalization, and ARMA filtering * of an HTK feature file, where the ARMA order is given by the command * line argument. This is modified from a program that does mean subtraction, * variance normalization and ARMA filtering on-line, so here the ARMA * filtering is done sequentially. It can be modified such that the entire * feature file is read into a buffer and then the ARMA filtering is done * entirely in place. Also note that this program is written for little-endian * machines and assumes that the size of short is 2, int is 4 and float is 4. * Such can be modified in obvious ways for machines of different architectures. * We have made sure this is a working version, but it is noted that certain * modifications can be used to speed things up. * * Written by Chia-ping Chen * * Copyright (c) 2003, University of Washington * * Permission to use, copy, modify, and distribute this * software and its documentation for any non-commercial purpose * and without fee is hereby granted, provided that the above copyright * notice appears in all copies. The University of Washington, * Seattle make no representations about the suitability of this software * for any purpose. It is provided "as is" without express or implied * warranty. */ #include #include #include #include #include /* * MV * a function that performs mean subtraction with mean[] and variance * normalization with var[] on data-array data[]. */ void MV(float *data, float *mean, float *var, int d) { for(int i=0;i * buf <----------------------> * buf <----------------------> * buf <----------------------> * . . * . . * buf <----------------------> * */ float *mData = new float[feaD*(2*M+1)]; int inRow=0; int outRow=0; for(t=0;t