16 #ifndef _FFT_MEMORY_CACHE_H_ 17 #define _FFT_MEMORY_CACHE_H_ 25 #include <QReadWriteLock> 50 int width,
int height);
58 Profiler profiler(
"FFTMemoryCache::getMagnitudeAt: cart to polar");
78 Profiler profiler(
"FFTMemoryCache::getValuesAt: cart to polar");
83 int16_t i = (int16_t)
m_phase[x][y];
84 return (
float(i) / 32767.0) * M_PI;
88 void getValuesAt(
int x,
int y,
float &real,
float &imag)
const {
93 Profiler profiler(
"FFTMemoryCache::getValuesAt: polar to cart");
96 real = mag * cosf(phase);
97 imag = mag * sinf(phase);
104 for (
int i = 0; i < count; ++i) {
105 int y = i * step + minbin;
110 for (
int i = 0; i < count; ++i) {
111 int y = i * step + minbin;
115 for (
int i = 0; i < count; ++i) {
116 int y = i * step + minbin;
129 void setColumnAt(
int x,
float *mags,
float *phases,
float factor);
131 void setColumnAt(
int x,
float *reals,
float *imags);
176 else m_phase[x][y] = uint16_t(int16_t((phase * 32767) / M_PI));
FFTMemoryCache(FFTCache::StorageType storageType, int width, int height)
void getValuesAt(int x, int y, float &real, float &imag) const
bool haveSetColumnAt(int x) const
static int getCacheSize(int width, int height, FFTCache::StorageType type)
float getPhaseAt(int x, int y) const
float getMaximumMagnitudeAt(int x) const
void setMagnitudeAt(int x, int y, float mag)
void setColumnAt(int x, float *mags, float *phases, float factor)
bool get(size_t column) const
void setNormalizedMagnitudeAt(int x, int y, float norm)
void setPhaseAt(int x, int y, float phase)
void getMagnitudesAt(int x, float *values, int minbin, int count, int step) const
float getMagnitudeAt(int x, int y) const
FFTCache::StorageType getStorageType() const
QReadWriteLock m_colsetLock
ResizeableBitset m_colset
void setNormalizationFactor(int x, float factor)
float getNormalizedMagnitudeAt(int x, int y) const
FFTCache::StorageType m_storageType
Profile point instance class.