comparison base/FFTCache.cpp @ 128:f47f4c7c158c

* Add FFT data server class to provide a file cache mapping for each required set of FFT parameters and source model. Make use of it in feature extraction plugin transform, though not in other places yet. * Add zero-pad option to spectrogram layer and remove window shape option from the property box. To be revised.
author Chris Cannam
date Mon, 26 Jun 2006 16:12:11 +0000
parents c4e163f911dd
children 4b2ea82fd0ed
comparison
equal deleted inserted replaced
127:514ebb0c5c6c 128:f47f4c7c158c
97 } 97 }
98 m_factor[x] = 1.0; 98 m_factor[x] = 1.0;
99 } 99 }
100 } 100 }
101 101
102 void
103 FFTMemoryCache::setColumnAt(size_t x, float *reals, float *imags)
104 {
105 float max = 0.0;
106
107 for (size_t y = 0; y < m_height; ++y) {
108 float mag = sqrtf(reals[y] * reals[y] + imags[y] * imags[y]);
109 float phase = atan2f(imags[y], reals[y]);
110 phase = princargf(phase);
111 reals[y] = mag;
112 imags[y] = phase;
113 if (mag > max) max = mag;
114 }
115
116 setColumnAt(x, reals, imags, max);
117 }
118