<s> import numpy as np <EOL> from scipy . signal import sawtooth <EOL> from acoustics . cepstrum import * <EOL> from numpy . testing import ( assert_array_almost_equal ) <EOL> def test_complex_cepstrum ( ) : <EOL> """<STR_LIT>""" <EOL> duration = <NUM_LIT> <EOL> fs = <NUM_LIT> <EOL> samples = int ( fs * duration ) <EOL> t = np . arange ( samples ) / fs <EOL> fundamental = <NUM_LIT> <EOL> signal = sawtooth ( <NUM_LIT> * np . pi * fundamental * t ) <EOL> ceps , _ = complex_cepstrum ( signal ) <EOL> assert ( fundamental == <NUM_LIT:1.0> / t [ ceps . argmax ( ) ] ) <EOL> def test_inverse_complex_cepstrum ( ) : <EOL> """<STR_LIT>""" <EOL> x = np . arange ( <NUM_LIT:10> ) <EOL> ceps , ndelay = complex_cepstrum ( x ) <EOL> y = inverse_complex_cepstrum ( ceps , ndelay ) <EOL> assert_array_almost_equal ( x , y ) </s>
