Skip to content

Commit 7dc74d9

Browse files
committed
fixed small issue on vca
1 parent 152733b commit 7dc74d9

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

ipython/vca.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
import sys
3-
import os
43
import struct
54
import time
65
import math
@@ -32,7 +31,7 @@ def estimate_snr(Y: np.ndarray, r_m: np.ndarray, x: np.ndarray) -> float:
3231

3332
P_y = np.sum(np.square(Y)) / float(N)
3433
P_x = np.sum(np.square(x)) / float(N) + np.sum(np.square(r_m))
35-
snr_est = 10 * math.log10((P_x - p / L * P_y) / (P_y - P_x))
34+
snr_est = 10 * math.log10((P_x - p / L * P_y) / np.absolute(P_y - P_x))
3635
return snr_est
3736

3837

python/vca.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
import sys
3-
import os
43
import struct
54
import time
65
import numpy as np

0 commit comments

Comments
 (0)