extreme value filtering
This commit is contained in:
parent
a9a77f2556
commit
cbd29350fe
@ -53,7 +53,11 @@ class PreProcess:
|
||||
os.makedirs(self.wavs16k_dir, exist_ok=True)
|
||||
|
||||
def norm_write(self, tmp_audio, idx0, idx1):
|
||||
tmp_audio = (tmp_audio / np.abs(tmp_audio).max() * (self.max * self.alpha)) + (
|
||||
tmp_max=np.abs(tmp_audio).max()
|
||||
if(tmp_max>2.5):
|
||||
print("%s-%s-%s-filtered"%(idx0,idx1,tmp_max))
|
||||
return
|
||||
tmp_audio = (tmp_audio / tmp_max * (self.max * self.alpha)) + (
|
||||
1 - self.alpha
|
||||
) * tmp_audio
|
||||
wavfile.write(
|
||||
|
Loading…
Reference in New Issue
Block a user