diff src/matlab/AnalysisCache.m @ 0:c52bc3e8d3ad tip

user: boblsturm branch 'default' added README.md added assets/.DS_Store added assets/playButton.jpg added assets/stopButton.png added assets/swapButton.jpg added data/.DS_Store added data/fiveoctaves.mp3 added data/glock2.wav added data/sinScale.mp3 added data/speech_female.mp3 added data/sweep.wav added nimfks.m.lnk added src/.DS_Store added src/matlab/.DS_Store added src/matlab/AnalysisCache.m added src/matlab/CSS.m added src/matlab/DataHash.m added src/matlab/ExistsInCache.m added src/matlab/KLDivCost.m added src/matlab/LoadFromCache.m added src/matlab/SA_B_NMF.m added src/matlab/SaveInCache.m added src/matlab/Sound.m added src/matlab/SynthesisCache.m added src/matlab/chromagram_E.m added src/matlab/chromagram_IF.m added src/matlab/chromagram_P.m added src/matlab/chromsynth.m added src/matlab/computeSTFTFeat.m added src/matlab/controller.m added src/matlab/decibelSliderReleaseCallback.m added src/matlab/drawClickCallBack.m added src/matlab/fft2chromamx.m added src/matlab/hz2octs.m added src/matlab/ifgram.m added src/matlab/ifptrack.m added src/matlab/istft.m added src/matlab/nimfks.fig added src/matlab/nimfks.m added src/matlab/nmfFn.m added src/matlab/nmf_beta.m added src/matlab/nmf_divergence.m added src/matlab/nmf_euclidean.m added src/matlab/prune_corpus.m added src/matlab/rot_kernel.m added src/matlab/templateAdditionResynth.m added src/matlab/templateDelCb.m added src/matlab/templateScrollCb.m
author boblsturm
date Sun, 18 Jun 2017 06:26:13 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/matlab/AnalysisCache.m	Sun Jun 18 06:26:13 2017 -0400
@@ -0,0 +1,34 @@
+    classdef AnalysisCache < handle
+    properties
+        Corpus
+        Target
+        WinType
+        Window
+        Hop
+        Hash
+    end
+    
+    methods
+        function obj = AnalysisCache(varargin)
+            % [Corpus Target Window Hop]
+            if nargin == 5
+                obj.Corpus = varargin{1};
+                obj.Target = varargin{2};
+                obj.Window = varargin{3};
+                obj.WinType = varargin{4};
+                obj.Hop = varargin{5};
+            end
+        end
+        
+        function obj = GenerateHash(obj)
+            ArrayToHash = [obj.Corpus; obj.Target; obj.WinType; obj.Window; obj.Hop];
+            Opt = struct( 'Method', 'SHA-1' );
+            try
+                obj.Hash = ['id', char(DataHash(ArrayToHash, Opt))];
+            catch ME
+                disp( ME );
+                obj.Hash = abs( floor( 1000*randn ) );
+            end
+        end
+    end
+end
\ No newline at end of file