jboone / tpms

Tire Pressure Monitoring System decoding tools.
352 stars 73 forks source link

FFTW issue #6

Open iDoka opened 9 years ago

iDoka commented 9 years ago

I try to use tpms-tools on fresh install of Ububtu 14.04 LTS. I have some issue with python code, which using FFTW. The root of problem is FFTW v2 in Ububtu 14.04 is obsolete. Only FFTW v3 (aka FFTW3) only allowable options. I have unsuccessful tried to install FFTW v2 by pip manager, but API of FFTW2 is obsolete and incompatible with recent version of NumPy (also required dependencies).

I need some help with porting burst_detector.py from FFTW2 to FFTW3. just three string needed for rewriting, but it seems I don't have proper knowledge. Bellow my try:

FFTW2:

import pyfftw
...
...
        self.fft_in  = pyfftw.n_byte_align_empty((self.block_size,), self.block_size, dtype='complex64')
        self.fft_out = pyfftw.n_byte_align_empty((self.block_size,), self.block_size, dtype='complex64')
        self.fft     = pyfftw.FFTW(self.fft_in, self.fft_out)

FFTW3:

import fftw3
...
...
        self.fft_in   = fftw3.create_aligned_array((self.block_size,), complex, self.block_size)
        self.fft_out  = fftw3.create_aligned_array((self.block_size,), complex, self.block_size)
        self.fft     = fftw3.Plan(self.fft_in, self.fft_out)

Whats wrong in my FFTW3 code?