MCPcopy Create free account
hub / github.com/dangf15/THLNet / test_fft

Function test_fft

conv_stft.py:103–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101 return outputs
102
103def test_fft():
104 torch.manual_seed(20)
105 win_len = 320
106 win_inc = 160
107 fft_len = 512
108 inputs = torch.randn([1, 1, 16000*4])
109 fft = ConvSTFT(win_len, win_inc, fft_len, win_type='hanning', feature_type='real')
110 import librosa
111
112 outputs1 = fft(inputs)[0]
113 outputs1 = outputs1.numpy()[0]
114 np_inputs = inputs.numpy().reshape([-1])
115 librosa_stft = librosa.stft(np_inputs, win_length=win_len, n_fft=fft_len, hop_length=win_inc, center=False)
116 print(np.mean((outputs1 - np.abs(librosa_stft))**2))
117
118def test_fft():
119 torch.manual_seed(20)

Callers

nothing calls this directly

Calls 1

ConvSTFTClass · 0.85

Tested by

no test coverage detected