def calculate_fft(data, tbin):
if len(np.shape(data)) > <NUM_LIT:1>:<EOL><INDENT>n = len(data[<NUM_LIT:0>])<EOL>return np.fft.fftfreq(n, tbin * <NUM_LIT>), np.fft.fft(data, axis=<NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>n = len(data)<EOL>return np.fft.fftfreq(n, tbin * <NUM_LIT>), np.fft.fft(data)<EOL><DEDENT>
Function to calculate the Fourier transform of data.


Parameters
----------
data : numpy.ndarray
    1D or 2D array containing time series.
tbin : float
    Bin size of time series (in ms).


Returns
-------
freqs : numpy.ndarray
    Frequency axis of signal in Fourier space.         
fft : numpy.ndarray
    Signal in Fourier space.