Skip to content

Commit 2c610ca

Browse files
committed
Fix log scale handling in magnitude spectrum function
Fix #169
1 parent ffe9d5c commit 2c610ca

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ See DataLab [roadmap page](https://datalab-platform.com/en/contributing/roadmap.
66

77
🛠️ Bug fixes:
88

9+
* Fixed [Issue #169](https://github.com/DataLab-Platform/DataLab/issues/169) - Signal / Fourier analysis: magnitude spectrum feature does not work as expected with logarithmic scale enabled
910
* Fixed [Issue #168](https://github.com/DataLab-Platform/DataLab/issues/168) - Average profile visualization: empty profile is displayed when the target rectangular area is outside the image area (this has been fixed upstream, in PlotPy v2.7.4, and so requires the latest version of PlotPy)
1011

1112
## DataLab Version 0.19.1 ##

cdl/algorithms/signal.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ def magnitude_spectrum(
119119
x1, y1 = fft1d(x, y)
120120
if log_scale:
121121
y_mag = 20 * np.log10(np.abs(y1))
122-
y_mag = np.abs(y1)
122+
else:
123+
y_mag = np.abs(y1)
123124
return x1, y_mag
124125

125126

0 commit comments

Comments
 (0)