(signal,norm='backward')
| 315 | |
| 316 | |
| 317 | def 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 | |
| 331 | def strands_from_signal_torch1(signal,input_type,decode_type,norm='ortho'): |
nothing calls this directly
no outgoing calls
no test coverage detected