Hi,

This is my CHOP:

I’m looking for a efficient way (not a Python expression) of selecting samples with values equal to 1 and then finding a median of samples’ positions. For this CHOP the result it should be ~380.

Hi,

This is my CHOP:

I’m looking for a efficient way (not a Python expression) of selecting samples with values equal to 1 and then finding a median of samples’ positions. For this CHOP the result it should be ~380.

The delete CHOP in 099 has some hip features that should let you discard samples outside of a range, info can get you the number of samples, and then some math CHOPs should get you the rest of the way to a statistical median.

An analyze CHOP can give you min/max or mean vals by itself.

I made an example TOX that finds mean, median, and mode of an incoming multi-sample CHOP channel. It is looking at median values of the incoming channel, rather than median indices, but maybe it will be useful once you have processed the data into a list of indices that meet your criteria.

Thanks guys.

I’ve computed my median index by doing:

A = Use analyze to get index of last peak

B = Use Delete and Info, to count amount of values in peak (value = 1)

And then `Result = A - B/2`

.