MCPcopy Create free account
hub / github.com/NVIDIA/DALI / window

Function window

dali/test/python/test_audio_decoder_utils.py:28–31  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

26 X = np.arange(n, dtype=np.float32)
27
28 def window(x):
29 x = 2 * x / length - 1
30 np.clip(x, -1, 1, out=x)
31 return 0.5 * (1 + np.cos(x * math.pi))
32
33 wave = np.sin(X[:, np.newaxis] * (np.array(frequencies) * (2 * math.pi)))
34 return wave * window(X)[:, np.newaxis]

Callers 6

FillGaussianFunction · 0.85
get_windowFunction · 0.85
generate_waveformsFunction · 0.85
__init__Method · 0.85
ResampleCPUImplFunction · 0.85
InitTriangleWindowFunction · 0.85

Calls 1

cosMethod · 0.80

Tested by

no test coverage detected