MLECO-3164: Additional refactoring of KWS API

Part 1
* Add KwsClassifier
* KwsPostProcess can now be told to average results
* Averaging is handlded by KwsClassifier
* Current sliding window index is now an argument of DoPreProcess

Change-Id: I07626da595ad1cbd982e8366f0d1bb56d1040459
diff --git a/source/use_case/kws/src/MainLoop.cc b/source/use_case/kws/src/MainLoop.cc
index e0518f2..2489df8 100644
--- a/source/use_case/kws/src/MainLoop.cc
+++ b/source/use_case/kws/src/MainLoop.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2022 Arm Limited. All rights reserved.
  * SPDX-License-Identifier: Apache-2.0
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 #include "InputFiles.hpp"           /* For input audio clips. */
-#include "Classifier.hpp"           /* Classifier. */
+#include "KwsClassifier.hpp"        /* Classifier. */
 #include "MicroNetKwsModel.hpp"     /* Model class for running inference. */
 #include "hal.h"                    /* Brings in platform definitions. */
 #include "Labels.hpp"               /* For label strings. */
@@ -34,7 +34,6 @@
 } /* namespace app */
 } /* namespace arm */
 
-using KwsClassifier = arm::app::Classifier;
 
 enum opcodes
 {
@@ -83,8 +82,8 @@
     caseContext.Set<int>("frameStride", arm::app::kws::g_FrameStride);
     caseContext.Set<float>("scoreThreshold", arm::app::kws::g_ScoreThreshold);  /* Normalised score threshold. */
 
-    KwsClassifier classifier;  /* classifier wrapper object. */
-    caseContext.Set<arm::app::Classifier&>("classifier", classifier);
+    arm::app::KwsClassifier classifier;  /* classifier wrapper object. */
+    caseContext.Set<arm::app::KwsClassifier&>("classifier", classifier);
 
     std::vector <std::string> labels;
     GetLabelsVector(labels);
diff --git a/source/use_case/kws/src/UseCaseHandler.cc b/source/use_case/kws/src/UseCaseHandler.cc
index 61c6eb6..d61ba9d 100644
--- a/source/use_case/kws/src/UseCaseHandler.cc
+++ b/source/use_case/kws/src/UseCaseHandler.cc
@@ -17,7 +17,7 @@
 #include "UseCaseHandler.hpp"
 
 #include "InputFiles.hpp"
-#include "Classifier.hpp"
+#include "KwsClassifier.hpp"
 #include "MicroNetKwsModel.hpp"
 #include "hal.h"
 #include "AudioUtils.hpp"
@@ -29,8 +29,6 @@
 
 #include <vector>
 
-using KwsClassifier = arm::app::Classifier;
-
 namespace arm {
 namespace app {
 
@@ -124,14 +122,11 @@
             while (audioDataSlider.HasNext()) {
                 const int16_t* inferenceWindow = audioDataSlider.Next();
 
-                /* The first window does not have cache ready. */
-                preProcess.m_audioWindowIndex = audioDataSlider.Index();
-
                 info("Inference %zu/%zu\n", audioDataSlider.Index() + 1,
                      audioDataSlider.TotalStrides() + 1);
 
                 /* Run the pre-processing, inference and post-processing. */
-                if (!preProcess.DoPreProcess(inferenceWindow, audio::MicroNetKwsMFCC::ms_defaultSamplingFreq)) {
+                if (!preProcess.DoPreProcess(inferenceWindow, audioDataSlider.Index())) {
                     printf_err("Pre-processing failed.");
                     return false;
                 }