jakevdp / nfft

Lightweight non-uniform Fast Fourier Transform in Python
MIT License
203 stars 29 forks source link

how to perform nonuniform IFFT #25

Open evileleven opened 3 weeks ago

evileleven commented 3 weeks ago

I have an OFDM signal, but the frequency interval is different. In this way, I want to use IFFT on uniform frequency data to get the time data. However, I do not know the exact time for the result of the IFFT signal. Do you know how I can do that?

N = 80
delta_f = 312.5e3
Frequency = np.arange(N) * delta_f 
Frequency[40] = Frequency[39] + 2*delta_f # nonuniform frequency interval
Frequency_signal = np.random.rand(1000)

how to use nfft_adjoint(x, Frequency_signal)? what should I define as 'x'? Is there any place for me to input the nonuniform frequency interval?

jakevdp commented 3 weeks ago

The nfft package implements fast routines for computing the two sums mentioned in the README: https://github.com/jakevdp/nfft?tab=readme-ov-file#about

You should figure out the quantity you wish to compute (it's hard for me to tell from your description), and relate it mathematically to one of these expressions in order to make use of the nfft or nfft_adjoint kernel.