Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit ff75107

Browse files
AurelienJaquierJaquier Aurélien Tristan
andauthored
fix impedance freq indexing (#407)
* fix impedance freq indexing * fix test * update Changelog --------- Co-authored-by: Jaquier Aurélien Tristan <[email protected]>
1 parent f1c89c2 commit ff75107

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
66
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
77

8+
5.6.7 - 2024-08
9+
---------------
10+
11+
- Fixed impedance feature (frequency index was inconsistent with smooth Z)
12+
813
5.7.1 - 2024-07
914
---------------
1015

efel/pyfeatures/pyfeatures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def impedance():
171171
)[0]
172172
smooth_Z = gaussian_filter1d(norm_Z[select_idxs], 10)
173173
ind_max = np.argmax(smooth_Z)
174-
return np.array([freq[ind_max]])
174+
return np.array([freq[select_idxs][ind_max]])
175175
else:
176176
return None
177177
else:

tests/test_pyfeatures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def test_impedance():
307307
"""pyfeatures: Test impedance feature"""
308308
feature_name = "impedance"
309309

310-
expected_values = {feature_name: 4.615384615384615}
310+
expected_values = {feature_name: 4.80769231}
311311
_test_expected_value(feature_name, expected_values)
312312

313313

0 commit comments

Comments
 (0)