Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DUET find_peaks() function generates an error #48

Closed
kmads opened this issue Apr 26, 2016 · 0 comments
Closed

DUET find_peaks() function generates an error #48

kmads opened this issue Apr 26, 2016 · 0 comments

Comments

@kmads
Copy link

kmads commented Apr 26, 2016

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:
screen shot 2016-04-26 at 4 02 53 pm

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."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants