(signal,norm='ortho')
| 367 | return reconstructed_fft_result |
| 368 | |
| 369 | def strands_from_signal_torch2(signal,norm='ortho'): |
| 370 | N = signal.shape[1]//2 |
| 371 | F_cos = signal[:,: N] |
| 372 | F_sin = signal[:,N:2 * N] |
| 373 | |
| 374 | # phase = F_cos * F_A + 1j*F_sin * F_A |
| 375 | phase = F_cos + 1j * F_sin |
| 376 | F_A = torch.abs(phase) |
| 377 | |
| 378 | phase = torch.angle(phase) |
| 379 | reconstructed_fft_result = F_A * torch.exp(1j * phase) |
| 380 | reconstructed_fft_result = torch.fft.irfft(reconstructed_fft_result,dim=-2,norm=norm) |
| 381 | return reconstructed_fft_result |
| 382 | |
| 383 | |
| 384 | def compute_crop_size(mask): |
nothing calls this directly
no outgoing calls
no test coverage detected