MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / get_window

Function get_window

utils/general_util.py:271–289  ·  view source on GitHub ↗

Return a window function. Args: win_type (str): Window type. Can either be one of the window function provided in PyTorch ['hann_window', 'bartlett_window', 'blackman_window', 'hamming_window', 'kaiser_window'] or any of the windows provided by [SciPy](https://do

(win_type: str, win_length: int)

Source from the content-addressed store, hash-verified

269 return count
270
271def get_window(win_type: str, win_length: int):
272 """Return a window function.
273
274 Args:
275 win_type (str): Window type. Can either be one of the window function provided in PyTorch
276 ['hann_window', 'bartlett_window', 'blackman_window', 'hamming_window', 'kaiser_window']
277 or any of the windows provided by [SciPy](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.windows.get_window.html).
278 win_length (int): Window length
279
280 Returns:
281 win: The window as a 1D torch tensor
282 """
283
284 try:
285 win = getattr(torch, win_type)(win_length)
286 except:
287 win = torch.from_numpy(scipy.signal.windows.get_window(win_type, win_length))
288
289 return win
290
291
292# https://github.com/facebookresearch/pytorch3d/blob/main/pytorch3d/transforms/rotation_conversions.py

Callers 2

compute_stftFunction · 0.90
compute_istftFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected