You have to explain well in order to get help, for example you said :
[ for 200ms cycle time my array look like [27, 200, 27, 27, 27, 27, 276,
27], here count = 27, other values are actually some errors ]
What is [my array]? how we suppose that we know your array? And what are
these numbers? and how you get them? What was the input signal? what was
its frequency, modulation,…etc?
Then post again.