void FFT::Init(int samples_in, int samples_out, int bEqualize, float envelope_power) { // samples_in: # of waveform samples you'll feed into the FFT // samples_out: # of frequency samples you want out; MUST BE A POWER OF 2. CleanUp(); m_samples_in = samples_in; NFREQ = samples_out*2; InitBitRevTable(); InitCosSinTable(); if (envelope_power > 0) InitEnvelopeTable(envelope_power); if (bEqualize) InitEqualizeTable(); temp1 = new float[NFREQ]; temp2 = new float[NFREQ]; }
void FFT::Init(int samples_in, int samples_out, int bEqualize, float envelope_power) { // samples_in: # of waveform samples you'll feed into the FFT // samples_out: # of frequency samples you want out; MUST BE A POWER OF 2. // bEqualize: set to 1 if you want the magnitude of the basses and trebles // to be roughly equalized; 0 to leave them untouched. // envelope_power: set to -1 to disable the envelope; otherwise, specify // the envelope power you want here. See InitEnvelopeTable for more info. CleanUp(); m_samples_in = samples_in; NFREQ = samples_out*2; InitBitRevTable(); InitCosSinTable(); if (envelope_power > 0) InitEnvelopeTable(envelope_power); if (bEqualize) InitEqualizeTable(); temp1 = new float[NFREQ]; temp2 = new float[NFREQ]; }