All Classes Namespaces Files Functions Variables Typedefs Macros
clizPreprocessor.h
Go to the documentation of this file.
1 // clizPreprocessor.h - ClusterLizard header file - Module: Preprocessor
2 
3 // Copyright (C) 2013, 2014 Simeon Knieling, M.Sc.
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 //
9 
10 //Preprocessor Class
11 
12 #pragma once
13 #ifndef _INCLUDE_CLIZPREPROCESSOR
14 #define _INCLUDE_CLIZPREPROCESSOR
15 
16 #include "clizSave.h"
17 
20 namespace cliz
21 {
22 
26  {
27  unsigned int intChunkSize; //internal data chunk size. Greater values mean greater delays but less frequent calculations (less CPU usage)
28  unsigned int fmax; //Maximum frequency for elliptic band-pass filter
29  unsigned int fmin; //Minimum frequency for elliptic band-pass filter
30  double samplingFrequency; //Sympling rate/frequency
31  unsigned int valuesperspike; //Number of data-points that will be cut out around a peak
32  unsigned int filterCutOffFront; //How many data-points should be ignored (due to corruption by filter effects) at the beginning
33  unsigned int filterCutOffBack; //How many data-points should be ignored (due to corruption by filter effects) at the end
34  };
35 
49  {
50  private:
51  PreprocessorHandle handle; //Parameter handle
52  std::vector<IndicesStruct> indicesOut; //Which Modules that receive output from this module need which output?
53  std::vector<Save*> inputSaveVec; //Input Saves
54  std::vector<Save*> outputSaveVec; //Output Saves
55 
56  float *dataDetect; //Data buffer processed for detection
57  float *data; //Data buffer processed for cutting out spikes
58  float *rawData; //Raw data buffer
59  float *fData; //Band-pass filtered data buffer
60  MemoryManager memMan;
61 
62  public:
66  Preprocessor(PreprocessorHandle iHandle, std::vector<Save*> &iInputSaveVec, std::vector<Save*> &iOutputSaveVec, std::vector<IndicesStruct> &iIndicesOut);
67 
72  void filter(float *intChunk);
73 
77  void threadFunc();
79  {
80  memMan.free(dataDetect);
81  memMan.free(data);
82  memMan.free(rawData);
83  memMan.free(fData);
84  };
85  };
86 }
87 
88 #endif
unsigned int valuesperspike
Definition: clizPreprocessor.h:31
unsigned int fmin
Definition: clizPreprocessor.h:29
double samplingFrequency
Definition: clizPreprocessor.h:30
Definition: cliz.h:55
unsigned int intChunkSize
Definition: clizPreprocessor.h:27
unsigned int filterCutOffFront
Definition: clizPreprocessor.h:32
unsigned int filterCutOffBack
Definition: clizPreprocessor.h:33
Definition: clizFunctions.h:268
void free(memPtr *memAdr)
Definition: clizFunctions.h:331
Definition: clizPreprocessor.h:48
Preprocessor(PreprocessorHandle iHandle, std::vector< Save * > &iInputSaveVec, std::vector< Save * > &iOutputSaveVec, std::vector< IndicesStruct > &iIndicesOut)
Definition: clizPreprocessor.cpp:22
~Preprocessor()
Definition: clizPreprocessor.h:78
void threadFunc()
Definition: clizPreprocessor.cpp:48
void filter(float *intChunk)
Definition: clizPreprocessor.cpp:119
Definition: clizPreprocessor.h:25
unsigned int fmax
Definition: clizPreprocessor.h:28