comparison base/FFTCache.h @ 113:534373d65f39

* Use fractional window overlaps in the spectrogram, instead of percentages (90% is kind of meaningless when none of your window sizes are divisible by 10!) * ResizeableBitmap -> ResizeableBitset and the odd other tidy up
author Chris Cannam
date Wed, 10 May 2006 11:43:52 +0000
parents 0c19e50bad7c
children f47f4c7c158c
comparison
equal deleted inserted replaced
112:7648e8502822 113:534373d65f39
34 34
35 virtual float getMagnitudeAt(size_t x, size_t y) const = 0; 35 virtual float getMagnitudeAt(size_t x, size_t y) const = 0;
36 virtual float getNormalizedMagnitudeAt(size_t x, size_t y) const = 0; 36 virtual float getNormalizedMagnitudeAt(size_t x, size_t y) const = 0;
37 virtual float getPhaseAt(size_t x, size_t y) const = 0; 37 virtual float getPhaseAt(size_t x, size_t y) const = 0;
38 38
39 virtual bool haveColumnAt(size_t x) const = 0; 39 virtual bool haveSetColumnAt(size_t x) const = 0;
40 virtual void setColumnAt(size_t x, float *mags, float *phases, float factor) = 0; 40 virtual void setColumnAt(size_t x, float *mags, float *phases, float factor) = 0;
41 41
42 bool isLocalPeak(size_t x, size_t y) const { 42 bool isLocalPeak(size_t x, size_t y) const {
43 float mag = getMagnitudeAt(x, y); 43 float mag = getMagnitudeAt(x, y);
44 if (y > 0 && mag < getMagnitudeAt(x, y - 1)) return false; 44 if (y > 0 && mag < getMagnitudeAt(x, y - 1)) return false;
118 if (x < m_width && y < m_height) { 118 if (x < m_width && y < m_height) {
119 m_phase[x][y] = uint16_t(int16_t((phase * 32767) / M_PI)); 119 m_phase[x][y] = uint16_t(int16_t((phase * 32767) / M_PI));
120 } 120 }
121 } 121 }
122 122
123 virtual bool haveColumnAt(size_t x) const { 123 virtual bool haveSetColumnAt(size_t x) const {
124 return true; 124 return true;
125 } 125 }
126 126
127 virtual void setColumnAt(size_t x, float *mags, float *phases, float factor) { 127 virtual void setColumnAt(size_t x, float *mags, float *phases, float factor) {
128 setNormalizationFactor(x, factor); 128 setNormalizationFactor(x, factor);