Mercurial > hg > svcore
comparison data/model/FFTModel.h @ 551:408e56d30f58
* Re-enable peak frequencies display in spectrogram
author | Chris Cannam |
---|---|
date | Thu, 05 Feb 2009 17:33:21 +0000 |
parents | 55ad231c9db7 |
children | 53e5dc8439e7 |
comparison
equal
deleted
inserted
replaced
550:107d3f3705c9 | 551:408e56d30f58 |
---|---|
83 } | 83 } |
84 inline bool isColumnAvailable(size_t x) const { | 84 inline bool isColumnAvailable(size_t x) const { |
85 return m_server->isColumnReady(x << m_xshift); | 85 return m_server->isColumnReady(x << m_xshift); |
86 } | 86 } |
87 | 87 |
88 inline float getMagnitudesAt(size_t x, float *values, size_t minbin = 0, size_t count = 0) { | 88 inline bool getMagnitudesAt(size_t x, float *values, size_t minbin = 0, size_t count = 0) { |
89 return m_server->getMagnitudesAt(x << m_xshift, values, minbin << m_yshift, count, getYRatio()); | 89 return m_server->getMagnitudesAt(x << m_xshift, values, minbin << m_yshift, count, getYRatio()); |
90 } | 90 } |
91 inline float getNormalizedMagnitudesAt(size_t x, float *values, size_t minbin = 0, size_t count = 0) { | 91 inline bool getNormalizedMagnitudesAt(size_t x, float *values, size_t minbin = 0, size_t count = 0) { |
92 return m_server->getNormalizedMagnitudesAt(x << m_xshift, values, minbin << m_yshift, count, getYRatio()); | 92 return m_server->getNormalizedMagnitudesAt(x << m_xshift, values, minbin << m_yshift, count, getYRatio()); |
93 } | 93 } |
94 inline float getPhasesAt(size_t x, float *values, size_t minbin = 0, size_t count = 0) { | 94 inline bool getPhasesAt(size_t x, float *values, size_t minbin = 0, size_t count = 0) { |
95 return m_server->getPhasesAt(x << m_xshift, values, minbin << m_yshift, count, getYRatio()); | 95 return m_server->getPhasesAt(x << m_xshift, values, minbin << m_yshift, count, getYRatio()); |
96 } | 96 } |
97 | 97 |
98 inline size_t getFillExtent() const { return m_server->getFillExtent(); } | 98 inline size_t getFillExtent() const { return m_server->getFillExtent(); } |
99 | 99 |
155 AllPeaks, /// Any bin exceeding its immediate neighbours | 155 AllPeaks, /// Any bin exceeding its immediate neighbours |
156 MajorPeaks, /// Peaks picked using sliding median window | 156 MajorPeaks, /// Peaks picked using sliding median window |
157 MajorPitchAdaptivePeaks /// Bigger window for higher frequencies | 157 MajorPitchAdaptivePeaks /// Bigger window for higher frequencies |
158 }; | 158 }; |
159 | 159 |
160 typedef std::set<size_t> PeakLocationSet; | 160 typedef std::set<size_t> PeakLocationSet; // bin |
161 typedef std::map<size_t, float> PeakSet; | 161 typedef std::map<size_t, float> PeakSet; // bin -> freq |
162 | 162 |
163 /** | 163 /** |
164 * Return locations of peak bins in the range [ymin,ymax]. If | 164 * Return locations of peak bins in the range [ymin,ymax]. If |
165 * ymax is zero, getHeight()-1 will be used. | 165 * ymax is zero, getHeight()-1 will be used. |
166 */ | 166 */ |