diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 63fe2b62..f4167729 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog `_,
and this project adheres to `Semantic Versioning `_.
+5.6.7 - 2024-08
+---------------
+
+- Fixed impedance feature (frequency index was inconsistent with smooth Z)
+
5.7.1 - 2024-07
---------------
diff --git a/efel/pyfeatures/pyfeatures.py b/efel/pyfeatures/pyfeatures.py
index dc2a6e50..b7cb7b19 100644
--- a/efel/pyfeatures/pyfeatures.py
+++ b/efel/pyfeatures/pyfeatures.py
@@ -171,7 +171,7 @@ def impedance():
)[0]
smooth_Z = gaussian_filter1d(norm_Z[select_idxs], 10)
ind_max = np.argmax(smooth_Z)
- return np.array([freq[ind_max]])
+ return np.array([freq[select_idxs][ind_max]])
else:
return None
else:
diff --git a/tests/test_pyfeatures.py b/tests/test_pyfeatures.py
index 39711e86..943b55df 100644
--- a/tests/test_pyfeatures.py
+++ b/tests/test_pyfeatures.py
@@ -307,7 +307,7 @@ def test_impedance():
"""pyfeatures: Test impedance feature"""
feature_name = "impedance"
- expected_values = {feature_name: 4.615384615384615}
+ expected_values = {feature_name: 4.80769231}
_test_expected_value(feature_name, expected_values)