mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-04 06:54:39 -04:00
Fixed FFT factory new plan allocation and effectively grab fftw-file option in the main parser
This commit is contained in:
@@ -48,10 +48,27 @@ void FFTWEngine::configure(int n, bool inverse)
|
||||
m_currentPlan->out = (fftwf_complex*)fftwf_malloc(sizeof(fftwf_complex) * n);
|
||||
QTime t;
|
||||
t.start();
|
||||
m_globalPlanMutex.lock();
|
||||
m_globalPlanMutex.lock();
|
||||
|
||||
if (m_fftWisdomFileName.size() > 0)
|
||||
{
|
||||
int rc = fftwf_import_wisdom_from_filename(m_fftWisdomFileName.toStdString().c_str());
|
||||
|
||||
if (rc == 0) { // that's an error (undocumented)
|
||||
qInfo("FFTWEngine::configure: importing from FFTW wisdom file: '%s' failed", qPrintable(m_fftWisdomFileName));
|
||||
} else {
|
||||
qDebug("FFTWEngine::configure: successfully imported from FFTW wisdom file: '%s'", qPrintable(m_fftWisdomFileName));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug("FFTWEngine::configure: no FFTW wisdom file");
|
||||
}
|
||||
|
||||
m_currentPlan->plan = fftwf_plan_dft_1d(n, m_currentPlan->in, m_currentPlan->out, inverse ? FFTW_BACKWARD : FFTW_FORWARD, FFTW_PATIENT);
|
||||
m_globalPlanMutex.unlock();
|
||||
qDebug("FFT: creating FFTW plan (n=%d,%s) took %dms", n, inverse ? "inverse" : "forward", t.elapsed());
|
||||
m_globalPlanMutex.unlock();
|
||||
|
||||
qDebug("FFT: creating FFTW plan (n=%d,%s) took %dms", n, inverse ? "inverse" : "forward", t.elapsed());
|
||||
m_plans.push_back(m_currentPlan);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user