You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function, as written on the page: static find_peaks(data, min_thr=0.5, min_dist=None, max_num=1)
In (#45) I worked an example of find_peaks using Repet. I used the same example in this Duet version. duet = Duet(signal, 2) data = np.array([0,0,.2,.5,1,1,0,1,0,1,0]) peaks_indices = repet1.find_peaks(data)
I assumed this would work exactly like the Repet example; however, this threw the following exception:
The document lists min_dist as an optional parameter, stating that the find_peaks() function handles it on its own by setting min_dist = .25 * matrix dimensions. However, the input data is supposed to be in the form of an np.array, which is inherently one-dimensional (i.e. the above example has a shape of (11,)). Line 252 in the function, the line calling the error, calls for data.shape[1], which in this case is None.
It's possible you copied over the code for find_peaks2() which is designed for matrix input. But find_peaks() asks for "a row vector of positive values (in [0,1]) and finds the peak values and corresponding indices."
The text was updated successfully, but these errors were encountered:
Function, as written on the page:
static find_peaks(data, min_thr=0.5, min_dist=None, max_num=1)
In (#45) I worked an example of find_peaks using Repet. I used the same example in this Duet version.
duet = Duet(signal, 2)
data = np.array([0,0,.2,.5,1,1,0,1,0,1,0])
peaks_indices = repet1.find_peaks(data)
I assumed this would work exactly like the Repet example; however, this threw the following exception:
The document lists min_dist as an optional parameter, stating that the find_peaks() function handles it on its own by setting
min_dist = .25 * matrix dimensions
. However, the input data is supposed to be in the form of an np.array, which is inherently one-dimensional (i.e. the above example has a shape of(11,)
). Line 252 in the function, the line calling the error, calls for data.shape[1], which in this case isNone
.It's possible you copied over the code for
find_peaks2()
which is designed for matrix input. Butfind_peaks()
asks for "a row vector of positive values (in [0,1]) and finds the peak values and corresponding indices."The text was updated successfully, but these errors were encountered: