'''simple docstring'''

from math import cos, sin, sqrt, tau

from audio_filters.iir_filter import IIRFilter



def 							UpperCamelCase__			(			a__			,      a__			,      a__ = 1 / sqrt(2      )      ):


						'''simple docstring'''






						_lowerCAmelCase										=tau * frequency / samplerate
						_lowerCAmelCase										=sin(a__      )
						_lowerCAmelCase										=cos(a__      )
						_lowerCAmelCase										=_sin / (2 * q_factor)

						_lowerCAmelCase										=(1 - _cos) / 2
						_lowerCAmelCase										=1 - _cos

						_lowerCAmelCase										=1 + alpha
						_lowerCAmelCase										=-2 * _cos
						_lowerCAmelCase										=1 - alpha

						_lowerCAmelCase										=IIRFilter(2      )
						filt.set_coefficients([aa, aa, aa]			,      [ba, ba, ba]      )
						return filt



def 							UpperCamelCase__			(			a__			,      a__			,      a__ = 1 / sqrt(2      )      ):


						'''simple docstring'''






						_lowerCAmelCase										=tau * frequency / samplerate
						_lowerCAmelCase										=sin(a__      )
						_lowerCAmelCase										=cos(a__      )
						_lowerCAmelCase										=_sin / (2 * q_factor)

						_lowerCAmelCase										=(1 + _cos) / 2
						_lowerCAmelCase										=-1 - _cos

						_lowerCAmelCase										=1 + alpha
						_lowerCAmelCase										=-2 * _cos
						_lowerCAmelCase										=1 - alpha

						_lowerCAmelCase										=IIRFilter(2      )
						filt.set_coefficients([aa, aa, aa]			,      [ba, ba, ba]      )
						return filt



def 							UpperCamelCase__			(			a__			,      a__			,      a__ = 1 / sqrt(2      )      ):


						'''simple docstring'''






						_lowerCAmelCase										=tau * frequency / samplerate
						_lowerCAmelCase										=sin(a__      )
						_lowerCAmelCase										=cos(a__      )
						_lowerCAmelCase										=_sin / (2 * q_factor)

						_lowerCAmelCase										=_sin / 2
						_lowerCAmelCase										=0
						_lowerCAmelCase										=-ba

						_lowerCAmelCase										=1 + alpha
						_lowerCAmelCase										=-2 * _cos
						_lowerCAmelCase										=1 - alpha

						_lowerCAmelCase										=IIRFilter(2      )
						filt.set_coefficients([aa, aa, aa]			,      [ba, ba, ba]      )
						return filt



def 							UpperCamelCase__			(			a__			,      a__			,      a__ = 1 / sqrt(2      )      ):


						'''simple docstring'''






						_lowerCAmelCase										=tau * frequency / samplerate
						_lowerCAmelCase										=sin(a__      )
						_lowerCAmelCase										=cos(a__      )
						_lowerCAmelCase										=_sin / (2 * q_factor)

						_lowerCAmelCase										=1 - alpha
						_lowerCAmelCase										=-2 * _cos
						_lowerCAmelCase										=1 + alpha

						_lowerCAmelCase										=IIRFilter(2      )
						filt.set_coefficients([ba, ba, ba]			,      [ba, ba, ba]      )
						return filt



def 							UpperCamelCase__			(			a__			,      a__			,      a__			,      a__ = 1 / sqrt(2      )			,      ):


						'''simple docstring'''






						_lowerCAmelCase										=tau * frequency / samplerate
						_lowerCAmelCase										=sin(a__      )
						_lowerCAmelCase										=cos(a__      )
						_lowerCAmelCase										=_sin / (2 * q_factor)
						_lowerCAmelCase										=1_0 ** (gain_db / 4_0)

						_lowerCAmelCase										=1 + alpha * big_a
						_lowerCAmelCase										=-2 * _cos
						_lowerCAmelCase										=1 - alpha * big_a
						_lowerCAmelCase										=1 + alpha / big_a
						_lowerCAmelCase										=-2 * _cos
						_lowerCAmelCase										=1 - alpha / big_a

						_lowerCAmelCase										=IIRFilter(2      )
						filt.set_coefficients([aa, aa, aa]			,      [ba, ba, ba]      )
						return filt



def 							UpperCamelCase__			(			a__			,      a__			,      a__			,      a__ = 1 / sqrt(2      )			,      ):


						'''simple docstring'''






						_lowerCAmelCase										=tau * frequency / samplerate
						_lowerCAmelCase										=sin(a__      )
						_lowerCAmelCase										=cos(a__      )
						_lowerCAmelCase										=_sin / (2 * q_factor)
						_lowerCAmelCase										=1_0 ** (gain_db / 4_0)
						_lowerCAmelCase										=(big_a + 1) - (big_a - 1) * _cos
						_lowerCAmelCase										=(big_a + 1) + (big_a - 1) * _cos
						_lowerCAmelCase										=(big_a - 1) - (big_a + 1) * _cos
						_lowerCAmelCase										=(big_a - 1) + (big_a + 1) * _cos
						_lowerCAmelCase										=2 * sqrt(a__      ) * alpha

						_lowerCAmelCase										=big_a * (pmc + aaa)
						_lowerCAmelCase										=2 * big_a * mpc
						_lowerCAmelCase										=big_a * (pmc - aaa)
						_lowerCAmelCase										=ppmc + aaa
						_lowerCAmelCase										=-2 * pmpc
						_lowerCAmelCase										=ppmc - aaa

						_lowerCAmelCase										=IIRFilter(2      )
						filt.set_coefficients([aa, aa, aa]			,      [ba, ba, ba]      )
						return filt



def 							UpperCamelCase__			(			a__			,      a__			,      a__			,      a__ = 1 / sqrt(2      )			,      ):


						'''simple docstring'''






						_lowerCAmelCase										=tau * frequency / samplerate
						_lowerCAmelCase										=sin(a__      )
						_lowerCAmelCase										=cos(a__      )
						_lowerCAmelCase										=_sin / (2 * q_factor)
						_lowerCAmelCase										=1_0 ** (gain_db / 4_0)
						_lowerCAmelCase										=(big_a + 1) - (big_a - 1) * _cos
						_lowerCAmelCase										=(big_a + 1) + (big_a - 1) * _cos
						_lowerCAmelCase										=(big_a - 1) - (big_a + 1) * _cos
						_lowerCAmelCase										=(big_a - 1) + (big_a + 1) * _cos
						_lowerCAmelCase										=2 * sqrt(a__      ) * alpha

						_lowerCAmelCase										=big_a * (ppmc + aaa)
						_lowerCAmelCase										=-2 * big_a * pmpc
						_lowerCAmelCase										=big_a * (ppmc - aaa)
						_lowerCAmelCase										=pmc + aaa
						_lowerCAmelCase										=2 * mpc
						_lowerCAmelCase										=pmc - aaa

						_lowerCAmelCase										=IIRFilter(2      )
						filt.set_coefficients([aa, aa, aa]			,      [ba, ba, ba]      )
						return filt






'''simple docstring'''

from __future__ import annotations

lowercase_     		= 10



def 							UpperCamelCase__			(			a__      ):


						'''simple docstring'''






						_lowerCAmelCase										=1
						_lowerCAmelCase										=max(a__      )
						while placement <= max_digit:
												# declare and initialize empty buckets
												_lowerCAmelCase										=[[] for _ in range(a__      )]
												# split list_of_ints between the buckets
												for i in list_of_ints:
																		_lowerCAmelCase										=int((i / placement) % RADIX      )
																		buckets[tmp].append(a__      )
												# put each buckets' contents into list_of_ints
												_lowerCAmelCase										=0
												for b in range(a__      ):
																		for i in buckets[b]:
																								_lowerCAmelCase										=i
																								a += 1
        # move to next
												placement *= RADIX
						return list_of_ints


if __name__ == "__main__":
							import doctest

							doctest.testmod()





