Mercurial > hg > aimc
comparison carfac/carfac_output.h @ 626:586b0677aae8
Fourth revision of Alex Brandmeyer's C++ implementation. Fixed more style issues, changed AGC structures to vectors, replaced FloatArray2d with vector<FloatArray>, implemented first tests using GTest to verify coefficients and monaural output against Matlab values (stored in aimc/carfac/test_data/). To run tests, change the path stored in carfac_test.h in TEST_SRC_DIR. Added CARFAC_GenerateTestData to the Matlab branch, fixed stage indexing in CARFAC_Cross_Couple.m to reflect changes in AGCCoeffs and AGCState structs.
author | alexbrandmeyer |
---|---|
date | Wed, 22 May 2013 21:30:02 +0000 |
parents | 0fbaf443ec82 |
children | 27f2d9b76075 |
comparison
equal
deleted
inserted
replaced
625:f72ad5807857 | 626:586b0677aae8 |
---|---|
31 // the neural activation patterns (NAPs) generated by the CARFAC model. | 31 // the neural activation patterns (NAPs) generated by the CARFAC model. |
32 // | 32 // |
33 // The 'InitOutput' method is used to initialize the arrays in each of the | 33 // The 'InitOutput' method is used to initialize the arrays in each of the |
34 // EarOutput sub-objects once the target data dimensions ears (n_ears), channels | 34 // EarOutput sub-objects once the target data dimensions ears (n_ears), channels |
35 // (n_ch) and timepoints (n_tp) are known. | 35 // (n_ch) and timepoints (n_tp) are known. |
36 // | |
37 // The 'MergeOutput' method is for integrating a smaller CARFACOutput into a | |
38 // larger CARFACOutput object. This is intended to be used in the context of | |
39 // the CARFAC class's 'Run' and 'RunSegments' methods. | |
40 | 36 |
41 #ifndef CARFAC_Open_Source_C__Library_carfac_output_h | 37 #ifndef CARFAC_Open_Source_C__Library_carfac_output_h |
42 #define CARFAC_Open_Source_C__Library_carfac_output_h | 38 #define CARFAC_Open_Source_C__Library_carfac_output_h |
43 | 39 |
44 #include "ear_output.h" | 40 #include "ear_output.h" |
45 | 41 |
46 class CARFACOutput { | 42 class CARFACOutput { |
47 public: | 43 public: |
48 void InitOutput(int n_ears, int n_ch, int32_t n_tp); | 44 void InitOutput(const int n_ears, const int n_ch, |
49 void MergeOutput(CARFACOutput output, int32_t start, int32_t length); | 45 const int32_t n_timepoints); |
50 void StoreNAPOutput(int32_t timepoint, int ear, int n_ch, FloatArray nap); | 46 void StoreNAPOutput(const int32_t timepoint, const int ear, |
51 void StoreBMOutput(int32_t timepoint, int ear, int n_ch, FloatArray bm); | 47 const FloatArray& nap); |
52 void StoreOHCOutput(int32_t timepoint, int ear, int n_ch, FloatArray ohc); | 48 void StoreBMOutput(const int32_t timepoint, const int ear, |
53 void StoreAGCOutput(int32_t timepoint, int ear, int n_ch, FloatArray agc); | 49 const FloatArray& bm); |
50 void StoreOHCOutput(const int32_t timepoint, const int ear, | |
51 const FloatArray& ohc); | |
52 void StoreAGCOutput(const int32_t timepoint, const int ear, | |
53 const FloatArray& agc); | |
54 | |
54 private: | 55 private: |
55 int n_ears_; | 56 int n_ears_; |
56 std::vector<EarOutput> ears_; | 57 std::vector<EarOutput> ears_; |
57 }; | 58 }; |
58 | 59 |