@@ -29,38 +29,38 @@ def assert_grad(
2929
3030 def test_lfilter_x (self ):
3131 torch .random .manual_seed (2434 )
32- x = get_whitenoise (sample_rate = 22050 , duration = 0.025 , n_channels = 2 )
32+ x = get_whitenoise (sample_rate = 22050 , duration = 0.01 , n_channels = 2 )
3333 a = torch .tensor ([0.7 , 0.2 , 0.6 ])
3434 b = torch .tensor ([0.4 , 0.2 , 0.9 ])
3535 x .requires_grad = True
3636 self .assert_grad (F .lfilter , (x , a , b ), enable_all_grad = False )
3737
3838 def test_lfilter_a (self ):
3939 torch .random .manual_seed (2434 )
40- x = get_whitenoise (sample_rate = 22050 , duration = 0.05 , n_channels = 2 )
40+ x = get_whitenoise (sample_rate = 22050 , duration = 0.01 , n_channels = 2 )
4141 a = torch .tensor ([0.7 , 0.2 , 0.6 ])
4242 b = torch .tensor ([0.4 , 0.2 , 0.9 ])
4343 a .requires_grad = True
4444 self .assert_grad (F .lfilter , (x , a , b ), enable_all_grad = False )
4545
4646 def test_lfilter_b (self ):
4747 torch .random .manual_seed (2434 )
48- x = get_whitenoise (sample_rate = 22050 , duration = 0.05 , n_channels = 2 )
48+ x = get_whitenoise (sample_rate = 22050 , duration = 0.01 , n_channels = 2 )
4949 a = torch .tensor ([0.7 , 0.2 , 0.6 ])
5050 b = torch .tensor ([0.4 , 0.2 , 0.9 ])
5151 b .requires_grad = True
5252 self .assert_grad (F .lfilter , (x , a , b ), enable_all_grad = False )
5353
5454 def test_lfilter_all_inputs (self ):
5555 torch .random .manual_seed (2434 )
56- x = get_whitenoise (sample_rate = 22050 , duration = 0.05 , n_channels = 2 )
56+ x = get_whitenoise (sample_rate = 22050 , duration = 0.01 , n_channels = 2 )
5757 a = torch .tensor ([0.7 , 0.2 , 0.6 ])
5858 b = torch .tensor ([0.4 , 0.2 , 0.9 ])
5959 self .assert_grad (F .lfilter , (x , a , b ))
6060
6161 def test_biquad (self ):
6262 torch .random .manual_seed (2434 )
63- x = get_whitenoise (sample_rate = 22050 , duration = 0.05 , n_channels = 2 )
63+ x = get_whitenoise (sample_rate = 22050 , duration = 0.01 , n_channels = 1 )
6464 a = torch .tensor ([0.7 , 0.2 , 0.6 ])
6565 b = torch .tensor ([0.4 , 0.2 , 0.9 ])
6666 self .assert_grad (F .biquad , (x , b [0 ], b [1 ], b [2 ], a [0 ], a [1 ], a [2 ]))
@@ -72,7 +72,7 @@ def test_biquad(self):
7272 def test_band_biquad (self , central_freq , Q , noise ):
7373 torch .random .manual_seed (2434 )
7474 sr = 22050
75- x = get_whitenoise (sample_rate = sr , duration = 0.05 , n_channels = 2 )
75+ x = get_whitenoise (sample_rate = sr , duration = 0.01 , n_channels = 1 )
7676 central_freq = torch .tensor (central_freq )
7777 Q = torch .tensor (Q )
7878 self .assert_grad (F .band_biquad , (x , sr , central_freq , Q , noise ))
@@ -84,7 +84,7 @@ def test_band_biquad(self, central_freq, Q, noise):
8484 def test_bass_biquad (self , central_freq , Q , gain ):
8585 torch .random .manual_seed (2434 )
8686 sr = 22050
87- x = get_whitenoise (sample_rate = sr , duration = 0.05 , n_channels = 2 )
87+ x = get_whitenoise (sample_rate = sr , duration = 0.01 , n_channels = 1 )
8888 central_freq = torch .tensor (central_freq )
8989 Q = torch .tensor (Q )
9090 gain = torch .tensor (gain )
@@ -98,7 +98,7 @@ def test_bass_biquad(self, central_freq, Q, gain):
9898 def test_treble_biquad (self , central_freq , Q , gain ):
9999 torch .random .manual_seed (2434 )
100100 sr = 22050
101- x = get_whitenoise (sample_rate = sr , duration = 0.05 , n_channels = 2 )
101+ x = get_whitenoise (sample_rate = sr , duration = 0.01 , n_channels = 1 )
102102 central_freq = torch .tensor (central_freq )
103103 Q = torch .tensor (Q )
104104 gain = torch .tensor (gain )
@@ -110,7 +110,7 @@ def test_treble_biquad(self, central_freq, Q, gain):
110110 def test_allpass_biquad (self , central_freq , Q ):
111111 torch .random .manual_seed (2434 )
112112 sr = 22050
113- x = get_whitenoise (sample_rate = sr , duration = 0.05 , n_channels = 2 )
113+ x = get_whitenoise (sample_rate = sr , duration = 0.01 , n_channels = 1 )
114114 central_freq = torch .tensor (central_freq )
115115 Q = torch .tensor (Q )
116116 self .assert_grad (F .allpass_biquad , (x , sr , central_freq , Q ))
@@ -121,7 +121,7 @@ def test_allpass_biquad(self, central_freq, Q):
121121 def test_lowpass_biquad (self , cutoff_freq , Q ):
122122 torch .random .manual_seed (2434 )
123123 sr = 22050
124- x = get_whitenoise (sample_rate = sr , duration = 0.05 , n_channels = 2 )
124+ x = get_whitenoise (sample_rate = sr , duration = 0.01 , n_channels = 1 )
125125 cutoff_freq = torch .tensor (cutoff_freq )
126126 Q = torch .tensor (Q )
127127 self .assert_grad (F .lowpass_biquad , (x , sr , cutoff_freq , Q ))
@@ -132,7 +132,7 @@ def test_lowpass_biquad(self, cutoff_freq, Q):
132132 def test_highpass_biquad (self , cutoff_freq , Q ):
133133 torch .random .manual_seed (2434 )
134134 sr = 22050
135- x = get_whitenoise (sample_rate = sr , duration = 0.05 , n_channels = 2 )
135+ x = get_whitenoise (sample_rate = sr , duration = 0.01 , n_channels = 1 )
136136 cutoff_freq = torch .tensor (cutoff_freq )
137137 Q = torch .tensor (Q )
138138 self .assert_grad (F .highpass_biquad , (x , sr , cutoff_freq , Q ))
@@ -144,7 +144,7 @@ def test_highpass_biquad(self, cutoff_freq, Q):
144144 def test_bandpass_biquad (self , central_freq , Q , const_skirt_gain ):
145145 torch .random .manual_seed (2434 )
146146 sr = 22050
147- x = get_whitenoise (sample_rate = sr , duration = 0.05 , n_channels = 2 )
147+ x = get_whitenoise (sample_rate = sr , duration = 0.01 , n_channels = 1 )
148148 central_freq = torch .tensor (central_freq )
149149 Q = torch .tensor (Q )
150150 self .assert_grad (F .bandpass_biquad , (x , sr , central_freq , Q , const_skirt_gain ))
@@ -156,7 +156,7 @@ def test_bandpass_biquad(self, central_freq, Q, const_skirt_gain):
156156 def test_equalizer_biquad (self , central_freq , Q , gain ):
157157 torch .random .manual_seed (2434 )
158158 sr = 22050
159- x = get_whitenoise (sample_rate = sr , duration = 0.05 , n_channels = 2 )
159+ x = get_whitenoise (sample_rate = sr , duration = 0.01 , n_channels = 1 )
160160 central_freq = torch .tensor (central_freq )
161161 Q = torch .tensor (Q )
162162 gain = torch .tensor (gain )
@@ -168,7 +168,7 @@ def test_equalizer_biquad(self, central_freq, Q, gain):
168168 def test_bandreject_biquad (self , central_freq , Q ):
169169 torch .random .manual_seed (2434 )
170170 sr = 22050
171- x = get_whitenoise (sample_rate = sr , duration = 0.05 , n_channels = 2 )
171+ x = get_whitenoise (sample_rate = sr , duration = 0.01 , n_channels = 1 )
172172 central_freq = torch .tensor (central_freq )
173173 Q = torch .tensor (Q )
174174 self .assert_grad (F .bandreject_biquad , (x , sr , central_freq , Q ))
0 commit comments