'''simple docstring'''






from math import cos, sin, sqrt, tau

from audio_filters.iir_filter import IIRFilter






def  UpperCamelCase__					(					_lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				float = 1 / sqrt(2     )     )							->	IIRFilter:

  '''simple docstring'''





  __UpperCAmelCase:					Tuple		= tau * frequency / samplerate
  __UpperCAmelCase:					Dict		= sin(_lowercase     )
  __UpperCAmelCase:					Optional[Any]		= cos(_lowercase     )
  __UpperCAmelCase:					str		= _sin / (2 * q_factor)

  __UpperCAmelCase:					Optional[Any]		= (1 - _cos) / 2
  __UpperCAmelCase:					List[Any]		= 1 - _cos

  __UpperCAmelCase:					Optional[int]		= 1 + alpha
  __UpperCAmelCase:					Any		= -2 * _cos
  __UpperCAmelCase:					int		= 1 - alpha

  __UpperCAmelCase:					int		= IIRFilter(2     )
  filt.set_coefficients([aa, aa, aa]   ,    [ba, ba, ba]     )
  return filt






def  UpperCamelCase__					(					_lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				float = 1 / sqrt(2     )     )							->	IIRFilter:

  '''simple docstring'''





  __UpperCAmelCase:					Union[str, Any]		= tau * frequency / samplerate
  __UpperCAmelCase:					int		= sin(_lowercase     )
  __UpperCAmelCase:					Dict		= cos(_lowercase     )
  __UpperCAmelCase:					Optional[Any]		= _sin / (2 * q_factor)

  __UpperCAmelCase:					str		= (1 + _cos) / 2
  __UpperCAmelCase:					Union[str, Any]		= -1 - _cos

  __UpperCAmelCase:					Optional[int]		= 1 + alpha
  __UpperCAmelCase:					Tuple		= -2 * _cos
  __UpperCAmelCase:					Any		= 1 - alpha

  __UpperCAmelCase:					Any		= IIRFilter(2     )
  filt.set_coefficients([aa, aa, aa]   ,    [ba, ba, ba]     )
  return filt






def  UpperCamelCase__					(					_lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				float = 1 / sqrt(2     )     )							->	IIRFilter:

  '''simple docstring'''





  __UpperCAmelCase:					Tuple		= tau * frequency / samplerate
  __UpperCAmelCase:					Optional[Any]		= sin(_lowercase     )
  __UpperCAmelCase:					Union[str, Any]		= cos(_lowercase     )
  __UpperCAmelCase:					Any		= _sin / (2 * q_factor)

  __UpperCAmelCase:					Tuple		= _sin / 2
  __UpperCAmelCase:					int		= 0
  __UpperCAmelCase:					Any		= -ba

  __UpperCAmelCase:					str		= 1 + alpha
  __UpperCAmelCase:					Union[str, Any]		= -2 * _cos
  __UpperCAmelCase:					Optional[Any]		= 1 - alpha

  __UpperCAmelCase:					Optional[Any]		= IIRFilter(2     )
  filt.set_coefficients([aa, aa, aa]   ,    [ba, ba, ba]     )
  return filt






def  UpperCamelCase__					(					_lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				float = 1 / sqrt(2     )     )							->	IIRFilter:

  '''simple docstring'''





  __UpperCAmelCase:					Optional[int]		= tau * frequency / samplerate
  __UpperCAmelCase:					int		= sin(_lowercase     )
  __UpperCAmelCase:					List[str]		= cos(_lowercase     )
  __UpperCAmelCase:					Tuple		= _sin / (2 * q_factor)

  __UpperCAmelCase:					Optional[int]		= 1 - alpha
  __UpperCAmelCase:					str		= -2 * _cos
  __UpperCAmelCase:					Optional[Any]		= 1 + alpha

  __UpperCAmelCase:					List[Any]		= IIRFilter(2     )
  filt.set_coefficients([ba, ba, ba]   ,    [ba, ba, ba]     )
  return filt






def  UpperCamelCase__					(					_lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				float   ,    _lowercase    :				float = 1 / sqrt(2     )   ,    )							->	IIRFilter:

  '''simple docstring'''





  __UpperCAmelCase:					Optional[int]		= tau * frequency / samplerate
  __UpperCAmelCase:					int		= sin(_lowercase     )
  __UpperCAmelCase:					Optional[Any]		= cos(_lowercase     )
  __UpperCAmelCase:					Tuple		= _sin / (2 * q_factor)
  __UpperCAmelCase:					Union[str, Any]		= 1_0 ** (gain_db / 4_0)

  __UpperCAmelCase:					str		= 1 + alpha * big_a
  __UpperCAmelCase:					str		= -2 * _cos
  __UpperCAmelCase:					List[Any]		= 1 - alpha * big_a
  __UpperCAmelCase:					Union[str, Any]		= 1 + alpha / big_a
  __UpperCAmelCase:					Union[str, Any]		= -2 * _cos
  __UpperCAmelCase:					str		= 1 - alpha / big_a

  __UpperCAmelCase:					Optional[Any]		= IIRFilter(2     )
  filt.set_coefficients([aa, aa, aa]   ,    [ba, ba, ba]     )
  return filt






def  UpperCamelCase__					(					_lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				float   ,    _lowercase    :				float = 1 / sqrt(2     )   ,    )							->	IIRFilter:

  '''simple docstring'''





  __UpperCAmelCase:					Optional[int]		= tau * frequency / samplerate
  __UpperCAmelCase:					List[Any]		= sin(_lowercase     )
  __UpperCAmelCase:					List[Any]		= cos(_lowercase     )
  __UpperCAmelCase:					List[str]		= _sin / (2 * q_factor)
  __UpperCAmelCase:					str		= 1_0 ** (gain_db / 4_0)
  __UpperCAmelCase:					str		= (big_a + 1) - (big_a - 1) * _cos
  __UpperCAmelCase:					Tuple		= (big_a + 1) + (big_a - 1) * _cos
  __UpperCAmelCase:					int		= (big_a - 1) - (big_a + 1) * _cos
  __UpperCAmelCase:					Union[str, Any]		= (big_a - 1) + (big_a + 1) * _cos
  __UpperCAmelCase:					List[Any]		= 2 * sqrt(_lowercase     ) * alpha

  __UpperCAmelCase:					Dict		= big_a * (pmc + aaa)
  __UpperCAmelCase:					int		= 2 * big_a * mpc
  __UpperCAmelCase:					List[Any]		= big_a * (pmc - aaa)
  __UpperCAmelCase:					int		= ppmc + aaa
  __UpperCAmelCase:					int		= -2 * pmpc
  __UpperCAmelCase:					Tuple		= ppmc - aaa

  __UpperCAmelCase:					Optional[int]		= IIRFilter(2     )
  filt.set_coefficients([aa, aa, aa]   ,    [ba, ba, ba]     )
  return filt







def  UpperCamelCase__					(					_lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				float   ,    _lowercase    :				float = 1 / sqrt(2     )   ,    )							->	IIRFilter:

  '''simple docstring'''





  __UpperCAmelCase:					str		= tau * frequency / samplerate
  __UpperCAmelCase:					List[str]		= sin(_lowercase     )
  __UpperCAmelCase:					Optional[Any]		= cos(_lowercase     )
  __UpperCAmelCase:					Union[str, Any]		= _sin / (2 * q_factor)
  __UpperCAmelCase:					Dict		= 1_0 ** (gain_db / 4_0)
  __UpperCAmelCase:					Any		= (big_a + 1) - (big_a - 1) * _cos
  __UpperCAmelCase:					Optional[int]		= (big_a + 1) + (big_a - 1) * _cos
  __UpperCAmelCase:					Optional[int]		= (big_a - 1) - (big_a + 1) * _cos
  __UpperCAmelCase:					Any		= (big_a - 1) + (big_a + 1) * _cos
  __UpperCAmelCase:					Union[str, Any]		= 2 * sqrt(_lowercase     ) * alpha

  __UpperCAmelCase:					Union[str, Any]		= big_a * (ppmc + aaa)
  __UpperCAmelCase:					Union[str, Any]		= -2 * big_a * pmpc
  __UpperCAmelCase:					Dict		= big_a * (ppmc - aaa)
  __UpperCAmelCase:					Any		= pmc + aaa
  __UpperCAmelCase:					Dict		= 2 * mpc
  __UpperCAmelCase:					List[Any]		= pmc - aaa

  __UpperCAmelCase:					Union[str, Any]		= IIRFilter(2     )
  filt.set_coefficients([aa, aa, aa]   ,    [ba, ba, ba]     )
  return filt
'''simple docstring'''






def  UpperCamelCase__					(					_lowercase    :				int     )							->	int:

  if not isinstance(_lowercase   ,    _lowercase     ):
    __UpperCAmelCase:					List[str]		= F'''Input value of [number={number}] must be an integer'''
    raise TypeError(_lowercase     )

  if number < 1:
    __UpperCAmelCase:					Dict		= F'''Input value of [number={number}] must be > 0'''
    raise ValueError(_lowercase     )

  __UpperCAmelCase:					int		= 1

  for i in range(1   ,    _lowercase     ):
    current_number *= 4 * i - 2
    current_number //= i + 1

  return current_number


if __name__ == "__main__":
    import doctest

    doctest.testmod()