annotate trunk/src/Modules/Features/ModuleGaussians_test.py @ 273:c26222c51fb7

- Fixed the python SWIG wrappers - Added stub test for the Gaussian features, and test data - Fixed build errors
author tomwalters
date Mon, 15 Feb 2010 20:37:26 +0000
parents
children 3640d25b65ab
rev   line source
tomwalters@273 1 #!/usr/bin/env python
tomwalters@273 2 # encoding: utf-8
tomwalters@273 3 #
tomwalters@273 4 # AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@273 5 # http://www.acousticscale.org/AIMC
tomwalters@273 6 #
tomwalters@273 7 # This program is free software: you can redistribute it and/or modify
tomwalters@273 8 # it under the terms of the GNU General Public License as published by
tomwalters@273 9 # the Free Software Foundation, either version 3 of the License, or
tomwalters@273 10 # (at your option) any later version.
tomwalters@273 11 #
tomwalters@273 12 # This program is distributed in the hope that it will be useful,
tomwalters@273 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
tomwalters@273 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
tomwalters@273 15 # GNU General Public License for more details.
tomwalters@273 16 #
tomwalters@273 17 # You should have received a copy of the GNU General Public License
tomwalters@273 18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
tomwalters@273 19 """
tomwalters@273 20 ModuleGaussians_test.py
tomwalters@273 21
tomwalters@273 22 Created by Thomas Walters on 2010-02-15.
tomwalters@273 23 Copyright 2010 Thomas Walters <tom@acousticscale.org>
tomwalters@273 24 Test for the Gaussians module. Runs a number of pre-computed SAI profiles
tomwalters@273 25 through the module, and tests them against the equivalent output from the
tomwalters@273 26 MATLAB rubber_GMM code.
tomwalters@273 27 """
tomwalters@273 28
tomwalters@273 29 import aimc
tomwalters@273 30 import matplotlib
tomwalters@273 31 import pylab
tomwalters@273 32 import scipy
tomwalters@273 33
tomwalters@273 34 def main():
tomwalters@273 35 data_file = "src/Modules/Features/testdata/aa153.0p108.1s100.0t+000itd.mat"
tomwalters@273 36 data = scipy.io.loadmat(data_file)
tomwalters@273 37
tomwalters@273 38 given_profiles = data["Templates"]
tomwalters@273 39 matlab_features = data["feature"]
tomwalters@273 40
tomwalters@273 41
tomwalters@273 42
tomwalters@273 43 pass
tomwalters@273 44
tomwalters@273 45
tomwalters@273 46 if __name__ == '__main__':
tomwalters@273 47 main()