def plotfft(s, fmax, doplot=False):
    ' This functions computes the fft of a signal, returning the frequency\n    and their magnitude values.\n\n    Parameters\n    ----------\n    s: array-like\n      the input signal.\n    fmax: int\n      the sampling frequency.\n    doplot: boolean\n      a variable to indicate whether the plot is done or not.\n\n    Returns\n    -------\n    f: array-like\n      the frequency values (xx axis)\n    fs: array-like\n      the amplitude of the frequency values (yy axis)\n    '
    fs = abs(np.fft.fft(s))
    f = linspace(0, (fmax / 2), (len(s) / 2))
    if doplot:
        pl.plot(f[1:(len(s) / 2)], fs[1:(len(s) / 2)])
    return (f[1:(len(s) / 2)].copy(), fs[1:(len(s) / 2)].copy())
This functions computes the fft of a signal, returning the frequency
and their magnitude values.

Parameters
----------
s: array-like
  the input signal.
fmax: int
  the sampling frequency.
doplot: boolean
  a variable to indicate whether the plot is done or not.

Returns
-------
f: array-like
  the frequency values (xx axis)
fs: array-like
  the amplitude of the frequency values (yy axis)
def plotfft(s, fmax, doplot=False):
    ' This functions computes the fft of a signal, returning the frequency\n    and their magnitude values.\n\n    Parameters\n    ----------\n    s: array-like\n      the input signal.\n    fmax: int\n      the sampling frequency.\n    doplot: boolean\n      a variable to indicate whether the plot is done or not.\n\n    Returns\n    -------\n    f: array-like\n      the frequency values (xx axis)\n    fs: array-like\n      the amplitude of the frequency values (yy axis)\n    '
    fs = abs(np.fft.fft(s))
    f = linspace(0, (fmax / 2), (len(s) / 2))
    if doplot:
        pl.plot(f[1:(len(s) / 2)], fs[1:(len(s) / 2)])
    return (f[1:(len(s) / 2)].copy(), fs[1:(len(s) / 2)].copy())