oscilloscope filter data algorithm

For general discussion related FlowStone
Post Reply
borodadada
Posts: 47
Joined: Sun Jun 02, 2013 5:58 pm

oscilloscope filter data algorithm

Post by borodadada »

Hello guys. The question of the theory than on practice. If I have one million samples, and screen size
1000 pixels wide. How do I display all the data that would not be the maximum and minimum losses? The end result of 1,000 samples.
Perfect Human Interface
Posts: 643
Joined: Sun Mar 10, 2013 7:32 pm

Re: oscilloscope filter data algorithm

Post by Perfect Human Interface »

Not certain where this came from but here's a wave player module that includes a waveform display written in Ruby.
Attachments
Wave Player.fsm
(144.2 KiB) Downloaded 799 times
borodadada
Posts: 47
Joined: Sun Jun 02, 2013 5:58 pm

Re: oscilloscope filter data algorithm

Post by borodadada »

Yes, this is it. Thank you. But I have a poor knowledge of Ruby, in code,

Code: Select all

      0.upto(a.length-1) do |i|
         step += 1
         max = a[i] > max ? a[i] : max
         min = a[i] < min ? a[i] : min
         if step >= epp
            maxA << [i*s,h-max*h]
            minA << [i*s,h-min*h]
            step = 0
            max = -1
            min = 1
         end
      end


Search max and min amplitude on interval (incloming 10 samples, search 2 (min and max))? Result one horizontal line? Ohh... :) Is it possible to make this algorithm in real time?
Post Reply