changeset 44:4fd0ce6f1f02

corrected bass attenuation
author matthiasm
date Mon, 21 May 2012 15:19:14 +0100
parents bf13b49cd82f
children 6639d9d53fca
files armadillo-2.4.4/examples/Makefile armadillo-2.4.4/include/armadillo_bits/config.hpp songparts/Makefile.osx songparts/SongParts.cpp
diffstat 4 files changed, 36 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/armadillo-2.4.4/examples/Makefile	Mon May 21 13:10:08 2012 +0100
+++ b/armadillo-2.4.4/examples/Makefile	Mon May 21 15:19:14 2012 +0100
@@ -1,11 +1,5 @@
-# NOTE:
-# This file is mainly useful when doing a manual installation of Armadillo.
-# It is overwritten by CMake when doing an automatic installation.
-#
-# You may need to edit this file to reflect the type and capabilities
-# of your system.  The defaults are for a Linux system and will need
-# to be changed for other systems (e.g. Mac OS X).
-
+# The generated "Makefile" from "Makefile.cmake" is only usable after
+# the Armadillo library has been configured and installed by CMake.
 
 CXX=g++
 #CXX=g++-4.2
@@ -17,44 +11,27 @@
 ## When using the Sun Studio compiler
 
 
-ARMA_INCLUDE_FLAG = -I ../include
-## If you've installed Armadillo's headers manually, 
-## you may need to tell the compiler where they are.
-## For example, change ../include to /usr/local/include
-## and uncomment the above line.
-
-
-#BOOST_INCLUDE_FLAG = -I /usr/include
-## If you have Boost libraries, change /usr/include
-## to point to where they are installed and uncomment
-## the above line.
-
-
-#EXTRA_LIB_FLAGS = -llapack -lblas
-## The above line is an example of the extra libraries
-## that can be used by Armadillo. You will also need
-## to modify "include/armadillo_bits/config.hpp"
-## to indicate which extra libraries are present.
-## If you're using Mac OS, comment out the line and
-## instead use the line below.
-
-
-#EXTRA_LIB_FLAGS = -framework Accelerate
-## Uncomment the above line when using Mac OS
-## and modify "include/armadillo_bits/config.hpp"
-## to indicate that LAPACK and BLAS libraries
-## are present
-
+# flags configured by CMake
+ifeq (macos,macos)
+  EXTRA_LIB_FLAGS = -framework Accelerate
+endif
 
 #EXTRA_LIB_FLAGS = -library=sunperf
 ## When using the Sun Studio compiler
 
 
-LIB_FLAGS = $(EXTRA_LIB_FLAGS)
+ifeq (true,true)
+  BOOST_INCLUDE_FLAG = -I /usr/local/include
+endif
+
+
+
+LIB_FLAGS = -larmadillo $(EXTRA_LIB_FLAGS)
 ## NOTE: on Ubuntu and Debian based systems you may need to add 
 ## -lgfortran to LIB_FLAGS
 
 
+
 OPT = -O1
 ## As the Armadillo library uses recursive templates,
 ## compilation times depend on the level of optimisation:
@@ -91,7 +68,7 @@
 #
 #
 
-CXXFLAGS = $(ARMA_INCLUDE_FLAG) $(BOOST_INCLUDE_FLAG) $(DEBUG) $(FINAL) $(OPT) $(EXTRA_OPT) 
+CXXFLAGS = $(BOOST_INCLUDE_FLAG) $(DEBUG) $(FINAL) $(OPT) $(EXTRA_OPT)
 
 all: example1 example2
 
--- a/armadillo-2.4.4/include/armadillo_bits/config.hpp	Mon May 21 13:10:08 2012 +0100
+++ b/armadillo-2.4.4/include/armadillo_bits/config.hpp	Mon May 21 15:19:14 2012 +0100
@@ -59,15 +59,15 @@
 // #define ARMA_USE_TBB_ALLOC
 //// Uncomment the above line if you want to use Intel TBB scalable_malloc() and scalable_free() instead of standard new[] and delete[]
 
-// #define ARMA_USE_ATLAS
-// #define ARMA_ATLAS_INCLUDE_DIR /usr/include/
+/* #undef ARMA_USE_ATLAS */
+#define ARMA_ATLAS_INCLUDE_DIR /
 //// If you're using ATLAS and the compiler can't find cblas.h and/or clapack.h
 //// uncomment the above define and specify the appropriate include directory.
 //// Make sure the directory has a trailing /
 
-// #define ARMA_USE_BOOST
-// #define ARMA_USE_BOOST_DATE
-// #define ARMA_USE_WRAPPER
+#define ARMA_USE_BOOST
+#define ARMA_USE_BOOST_DATE
+#define ARMA_USE_WRAPPER
 
 #if !defined(ARMA_DEFAULT_OSTREAM)
   #define ARMA_DEFAULT_OSTREAM std::cout
@@ -76,13 +76,13 @@
 #define ARMA_PRINT_LOGIC_ERRORS
 #define ARMA_PRINT_RUNTIME_ERRORS
 
-// #define ARMA_HAVE_STD_ISFINITE
-// #define ARMA_HAVE_STD_ISINF
-// #define ARMA_HAVE_STD_ISNAN
-// #define ARMA_HAVE_STD_SNPRINTF
+#define ARMA_HAVE_STD_ISFINITE
+#define ARMA_HAVE_STD_ISINF
+#define ARMA_HAVE_STD_ISNAN
+#define ARMA_HAVE_STD_SNPRINTF
 
-// #define ARMA_HAVE_LOG1P
-// #define ARMA_HAVE_GETTIMEOFDAY
+#define ARMA_HAVE_LOG1P
+#define ARMA_HAVE_GETTIMEOFDAY
 
 // #define ARMA_EXTRA_DEBUG
 // #define ARMA_NO_DEBUG
--- a/songparts/Makefile.osx	Mon May 21 13:10:08 2012 +0100
+++ b/songparts/Makefile.osx	Mon May 21 15:19:14 2012 +0100
@@ -1,9 +1,9 @@
 
-CFLAGS := -O3 -ftree-vectorize -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.7.sdk -arch i386 -arch x86_64 -I../armadillo-2.4.4/include -I../vamp-plugin-sdk -I/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/Headers/ -DUSE_PTHREADS
+CFLAGS := -O3 -ftree-vectorize -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.7.sdk -arch i386 -arch x86_64 -I../armadillo-2.4.4/include -I../../boost_1_48_0 -I../../vamp-plugin-sdk -I/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/Headers/ -DUSE_PTHREADS
 
 CXXFLAGS  := $(CFLAGS)
 
-LDFLAGS	  := -isysroot /Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5 -arch i386 -arch x86_64 -lqm-dsp ../vamp-plugin-sdk/libvamp-sdk.a -dynamiclib -framework Accelerate -lpthread -install_name qm-vamp-plugins.dylib
+LDFLAGS	  := -isysroot /Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5 -arch i386 -arch x86_64 -lqm-dsp ../../vamp-plugin-sdk/libvamp-sdk.a -dynamiclib ../armadillo-2.4.4/libarmadillo.dylib -framework Accelerate -lpthread -install_name qm-vamp-plugins.dylib
 
 PLUGIN_EXT   := .dylib
 
--- a/songparts/SongParts.cpp	Mon May 21 13:10:08 2012 +0100
+++ b/songparts/SongParts.cpp	Mon May 21 15:19:14 2012 +0100
@@ -1322,7 +1322,8 @@
                     std::stringstream out;
                     out << newpartind+1;
                     newPart.letter.append(out.str());
-                    newPart.value = 20+newpartind+1;
+                    // newPart.value = 20+newpartind+1;
+                    newPart.value = 0;
                     newPart.n = 1;
                     newPart.indices.push_back(indices[iInd]);
                     newPart.level = 0;   
@@ -1391,13 +1392,13 @@
     for (int i = 0; i < nBeat; ++ i)
         for (int j = 0; j < nFeatValues/2; ++ j)
         {
-            featVal(i,j) = (quantisedChromagram[i].values[j]+quantisedChromagram[i].values[j+12]) * 0.8;
+            featVal(i,j) = 0.8 * quantisedChromagram[i].values[j] + quantisedChromagram[i].values[j+12]; // bass attenuated
         }
     
     // Set to arbitrary value to feature vectors with low std
     arma::mat a = stddev(featVal,1,1);
     
-    // Feature Colleration Matrix
+    // Feature Correlation Matrix
     arma::mat simmat0 = 1-arma::cor(arma::trans(featVal));
     
 
@@ -1418,10 +1419,10 @@
     arma::mat simmat = 1-simmat0/2;
     
     // -------- To delate when the proble with the add of beat will be solved -------
-    for (int i = 0; i < nBeat; ++ i)
-     for (int j = 0; j < nBeat; ++ j)
-         if (!std::isfinite(simmat(i,j)))
-             simmat(i,j)=0;
+    // for (int i = 0; i < nBeat; ++ i)
+    //  for (int j = 0; j < nBeat; ++ j)
+    //      if (!std::isfinite(simmat(i,j)))
+    //          simmat(i,j)=0;
     // ------------------------------------------------------------------------------
     
     // Median Filtering applied to the Correlation Matrix