コード例 #1
0
ファイル: AbstractClassifier.cs プロジェクト: tdav/emocije
        private void ComputeSuperFeatures()
        {
            foreach (IFeature f in SubFeatures)
            {
                FastQueue <double> CurrentQueue = SubResults[f];
                List <double>      CurrentData  = CurrentQueue.Peek(SuperWindowLength);
                CurrentQueue.Delete(SuperWindowShift);
                DataProvider.Data = CurrentData;

                List <IFeature> CurrentSuperFeatures = SuperFeatures[f];
                foreach (IFeature superf in CurrentSuperFeatures)
                {
                    superf.Compute();
                    FinalFeatures.Add(superf.Feature);
                }
            }

            if (SuperFeaturesComputed != null)
            {
                SubFeaturesComputedEventArgs e = new SubFeaturesComputedEventArgs();
                e.ComputedFeatures = FinalFeatures;
                SuperFeaturesComputed.Invoke(this, e);
            }
            Classify();
            AllFeatures.Add(new List <double>(FinalFeatures));
            FinalFeatures.Clear();
            if (SubResults.First().Value.Count > SuperWindowLength)
            {
                ComputeSuperFeatures();
            }
        }
コード例 #2
0
ファイル: AbstractClassifier.cs プロジェクト: tdav/emocije
        public AbstractClassifier()
        {
            Results       = new List <EmoClassifierResult>();
            SubData       = new FastQueue <double>(500000);
            SubFeatures   = new List <IFeature>();
            SubResults    = new Dictionary <IFeature, FastQueue <double> >();
            FinalFeatures = new List <double>();
            SuperFeatures = new Dictionary <IFeature, List <IFeature> >();


            this.SubWindowLength = 1102; // 44100 [samples per second] * 0.025 [25 milisecond interval]
            this.SubWindowShift  = 661;  // 44100 [samples per second] * 0.015 [15 milisecond interval]

            this.SuperWindowLength = 80; // 44100 [samples per second] / 1102 [SubFeatures per second] * 2 [seconds]
            this.SuperWindowShift  = 40; // 44100 [samples per second] / 1102 [SubFeatures per second] * 1 [seconds]

            //Napravi feature
            MakeFeatures();

            foreach (IFeature f in SubFeatures)
            {
                SubResults.Add(f, new FastQueue <double>(10000));
            }
        }