summaryrefslogtreecommitdiff
path: root/source/application/main/include/AudioUtils.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/application/main/include/AudioUtils.hpp')
-rw-r--r--source/application/main/include/AudioUtils.hpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/source/application/main/include/AudioUtils.hpp b/source/application/main/include/AudioUtils.hpp
index cba981d..cbf7bb7 100644
--- a/source/application/main/include/AudioUtils.hpp
+++ b/source/application/main/include/AudioUtils.hpp
@@ -124,18 +124,6 @@ namespace audio {
return ((m_dataSize - m_size)/m_stride);
}
- /**
- * @brief Calculates number of times the window can stride through the given data.
- * May not be a whole number.
- * @return Number of strides to cover all data.
- */
- float FractionalTotalStrides() {
- if (this->m_dataSize < this->m_size) {
- return 0;
- } else {
- return ((this->m_dataSize - this->m_size)/ static_cast<float>(this->m_stride));
- }
- }
protected:
T *m_start = nullptr;
@@ -146,11 +134,11 @@ namespace audio {
};
/*
- * Sliding window for ASR will cover the whole of the input, even if
+ * Sliding window that will cover the whole length of the input, even if
* this means the last window is not a full window length.
*/
template<class T>
- class ASRSlidingWindow : public SlidingWindow<T> {
+ class FractionalSlidingWindow : public SlidingWindow<T> {
public:
using SlidingWindow<T>::SlidingWindow;
@@ -161,6 +149,19 @@ namespace audio {
bool HasNext() {
return this->m_count < 1 + this->FractionalTotalStrides() && (this->NextWindowStartIndex() < this->m_dataSize);
}
+
+ /**
+ * @brief Calculates number of times the window can stride through the given data.
+ * May not be a whole number.
+ * @return Number of strides to cover all data.
+ */
+ float FractionalTotalStrides() {
+ if (this->m_dataSize < this->m_size) {
+ return 0;
+ } else {
+ return ((this->m_dataSize - this->m_size) / static_cast<float>(this->m_stride));
+ }
+ }
};