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

Function strands_from_signal_torch

utils/general_util.py:317–328  ·  view source on GitHub ↗
(signal,norm='backward')

Source from the content-addressed store, hash-verified

315
316
317def strands_from_signal_torch(signal,norm='backward'):
318 N = signal.shape[1]//3
319 F_A = signal[:,:N]
320 F_cos = signal[:,N:2 * N]
321 F_sin = signal[:,2 * N:]
322
323 # phase = F_cos * F_A + 1j*F_sin * F_A
324 phase = F_cos + 1j * F_sin
325 phase = torch.angle(phase)
326 reconstructed_fft_result = F_A * torch.exp(1j * phase)
327 reconstructed_fft_result = torch.fft.irfft(reconstructed_fft_result,dim=-2,norm=norm)
328 return reconstructed_fft_result
329
330
331def strands_from_signal_torch1(signal,input_type,decode_type,norm='ortho'):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected