@staticmethod
def add_arguments(parser, window=None, fft_size=None):
    """
        Add STFT related arguments to an existing parser.

        Parameters
        ----------
        parser : argparse parser instance
            Existing argparse parser.
        window : numpy ufunc, optional
            Window function.
        fft_size : int, optional
            Use this size for FFT (should be a power of 2).

        Returns
        -------
        argparse argument group
            STFT argument parser group.

        Notes
        -----
        Parameters are included in the group only if they are not 'None'.

        """
    g = parser.add_argument_group('short-time Fourier transform arguments')
    if window is not None:
        g.add_argument('--window', dest='window', action='store', default=
            window, help='window function to use for FFT')
    if fft_size is not None:
        g.add_argument('--fft_size', action='store', type=int, default=
            fft_size, help=
            'use this size for FFT (should be a power of 2) [default=%(default)i]'
            )
    return g
