Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/fcwt/fcwt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ limitations under the License.
*/

#include "fcwt.h"
#include <cassert>

Morlet::Morlet(float bandwidth) {
four_wavelen = 0.9876f;
Expand Down Expand Up @@ -100,8 +101,8 @@ void Morlet::getWavelet(float scale, complex<float>* pwav, int pn) {
pwav[t].imag(imag[t]);
}

delete real;
delete imag;
free(real);
free(imag);
};

//==============================================================//
Expand Down Expand Up @@ -403,9 +404,15 @@ void FCWT::convolve(fftwf_plan p, fftwf_complex *Ihat, fftwf_complex *O1, comple
#endif
memset(lastscalemem,0,sizeof(fftwf_complex)*newsize);

fftbased(p, Ihat, O1, (float*)lastscalemem, wav->mother, newsize, scale, wav->imag_frequency, wav->doublesided);
fftbased(p, Ihat, O1, (float*)lastscalemem, wav->mother, newsize, scale,
wav->imag_frequency, wav->doublesided);
if(use_normalization) fft_normalize((complex<float>*)lastscalemem, newsize);
memcpy(out, (complex<float>*)lastscalemem, sizeof(complex<float>)*size);
#ifdef _WIN32
_aligned_free(lastscalemem);
#else
free(lastscalemem);
#endif
} else {
if(!out) {
std::cout << "OUT NOT A POINTER" << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions tests/test_fcwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ def test_plan():

morl = Morlet(2.0)
fcwt = FCWT(morl, 1, True, False)
fcwt.create_FFT_optimization_plan(2048,0)
fcwt.create_FFT_optimization_plan(2048, "FFTW_ESTIMATE")
fname = "n2048_t1.wis"

assert os.path.isfile(fname)

fcwt = FCWT(morl, 8, True, False)
fcwt.create_FFT_optimization_plan(2048,0)
fcwt.create_FFT_optimization_plan(2048, "FFTW_ESTIMATE")
fname = "n2048_t8.wis"

assert os.path.isfile(fname)
assert os.path.isfile(fname)