Mercurial > hg > aimc
diff trunk/src/Support/SignalBank.cc @ 277:6b4921704eb1
- Ported over HTK file output
- Added some more meat to the Slaney IIR gammatone implementation
- Ported over the AIM-MAT sf2003 parabola strobe algorithm
- Finished making the SAI implementation compile
- Ported over the strobe list class (now uses STL deques internally)
author | tomwalters |
---|---|
date | Thu, 18 Feb 2010 16:55:40 +0000 |
parents | c26222c51fb7 |
children | ed91095d9240 |
line wrap: on
line diff
--- a/trunk/src/Support/SignalBank.cc Tue Feb 16 18:40:55 2010 +0000 +++ b/trunk/src/Support/SignalBank.cc Thu Feb 18 16:55:40 2010 +0000 @@ -84,11 +84,12 @@ centre_frequencies_.resize(channel_count_, 0.0f); for (int i = 0; i < channel_count_; ++i) { - centre_frequencies_[i] = input.get_centre_frequency(i); + centre_frequencies_[i] = input.centre_frequency(i); } for (int i = 0; i < channel_count_; ++i) { signals_[i].resize(buffer_length_, 0.0f); + strobes_[i].resize(0); } initialized_ = true; return true; @@ -122,8 +123,20 @@ signals_[channel][index] = value; } -const deque<int> &SignalBank::strobes(int channel) const { - return strobes_[channel]; +int SignalBank::strobe(int channel, int index) const { + return strobes_[channel][index]; +} + +int SignalBank::strobe_count(int channel) const { + return strobes_[channel].size(); +} + +void SignalBank::AddStrobe(int channel, int time) { + strobes_[channel].push_back(time); +} + +void SignalBank::ResetStrobes(int channel) { + strobes_[channel].resize(0); } float SignalBank::sample_rate() const { @@ -142,7 +155,7 @@ start_time_ = start_time; } -float SignalBank::get_centre_frequency(int i) const { +float SignalBank::centre_frequency(int i) const { if (i < channel_count_) return centre_frequencies_[i]; else