list - Determine "wiggliness" of set of data - Python -
i'm working on piece of software needs implement wiggliness of set of data. here's sample of input receive, merged lightness plot of each vertical pixel strip:
it easy see left margin really wiggly (i.e. has ton of minima/maxima), , want generate set of critical points of image. i've applied gaussian smoothing function data ~ 10 times, seems pretty wiggly begin with.
any ideas?
here's original code, not produce nice results (for wiggliness):
def local_maximum(list, center, delta): maximum = [0, 0] in range(delta): if list[center + i] > maximum[1]: maximum = [center + i, list[center + i]] if list[center - i] > maximum[1]: maximum = [center - i, list[center - i]] return maximum def count_maxima(list, start, end, delta, threshold = 10): count = 0 in range(start + delta, end - delta): if abs(list[i] - local_maximum(list, i, delta)[1]) < threshold: count += 1 return count def wiggliness(list, start, end, delta, threshold = 10): return float(abs(start - end) * delta) / float(count_maxima(list, start, end, delta, threshold))
take @ lowpass/highpass/notch/bandpass filters, fourier transforms, or wavelets. basic idea there's lots of different ways figure out frequency content of signal quantized on different time-periods.
if can figure out wiggliness is, help. leftmost margin wiggly b/c has more high-frequency content, visualize using fourier transform.
if take highpass filter of red signal, you'll high frequency content, , can measure amplitudes , thresholds determine wiggliness. guess wiggliness needs more formalism behind it.
Comments
Post a Comment