Skip to content

Commit bfee73f

Browse files
authored
Update methods_comparison.py
1 parent bcf5ced commit bfee73f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

dca/methods_comparison.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def make_norm_power(X, T_ent):
2626
"""Calculate the normalize power spectrum."""
2727
Y = F.unfold(X, kernel_size=[T_ent, 1], stride=T_ent)
2828
Y = torch.transpose(Y, 1, 2)
29-
Yf = torch.fft.rfft(Y, 1, onesided=True)
30-
Yp = torch.mean(Yf[:, :, :, 0]**2 + Yf[:, :, :, 1]**2, dim=1)
29+
Yf = torch.fft.rfft(Y, dim=1)
30+
Yp = torch.mean(abs(Yf)**2, dim=1)
3131
return Yp / torch.sum(Yp, dim=1, keepdim=True)
3232

3333

0 commit comments

Comments
 (0)