Rana M.Al-Marshedy
Rana M.Al-Marshedy

Reputation: 27

How to find the time axis of inverse Fourier transform in python?

I have a pulse (experimental points) in the frequency domain. I used the code

func_t = ifft(ifftshift(func_w))

to transform it to the time domain. The problem I am facing now is how to get the corresponding time axis "t" so that I can plot:

plt.plot(t, func_t )

Upvotes: 2

Views: 2088

Answers (1)

KZiovas
KZiovas

Reputation: 4779

You need to calculate it by using the sampling frequency 'Fs' so your time array would be

import numpy as np
t = np.arange(0, n/Fs, 1/Fs)

where n is you number of points in your signal and Fs the sampling frequency

Note: Your sampling frequency is double your maximum frequency in your original signal if you follow the Nyquist sampling theorem

Upvotes: 2

Related Questions