comparison data/model/FFTModel.h @ 1094:b386363ff6c8 simple-fft-model

A small cache for source samples
author Chris Cannam
date Fri, 12 Jun 2015 19:18:56 +0100
parents 44b079427b36
children b66734b5f806
comparison
equal deleted inserted replaced
1093:44b079427b36 1094:b386363ff6c8
166 return { startFrame, endFrame }; 166 return { startFrame, endFrame };
167 } 167 }
168 168
169 std::vector<std::complex<float> > getFFTColumn(int column) const; 169 std::vector<std::complex<float> > getFFTColumn(int column) const;
170 std::vector<float> getSourceSamples(int column) const; 170 std::vector<float> getSourceSamples(int column) const;
171 std::vector<float> getSourceData(std::pair<sv_frame_t, sv_frame_t>) const;
171 172
173 struct SavedSourceData {
174 std::pair<sv_frame_t, sv_frame_t> range;
175 std::vector<float> data;
176 };
177 mutable SavedSourceData m_savedData;
178
172 struct SavedColumn { 179 struct SavedColumn {
173 int n; 180 int n;
174 std::vector<std::complex<float> > col; 181 std::vector<std::complex<float> > col;
175 }; 182 };
176
177 mutable std::deque<SavedColumn> m_cached; 183 mutable std::deque<SavedColumn> m_cached;
178 size_t m_cacheSize; 184 size_t m_cacheSize;
179 185
180 //!!! also optionally cache polar? 186 //!!! also optionally cache polar?
181 }; 187 };