Changeset 4679


Ignore:
Timestamp:
09/29/08 02:33:55 (5 years ago)
Author:
werner
Message:

Highlights:

  • new module phosphor.py to view how often patterns repeat
  • example eye.py to plot an eye diagram with phosphor.py

Details:

  • lib/wave.py (analog, digital): moved binary search by time from "get_one" into new method "index"
  • lib/trigger.py (edge.apply): returned a false trigger at the start of the recording when using slope.Both
  • lib/phosphor.py: "phosphor" screen that remembers how often a pixel was drawn
  • demo/eye.py: example for drawing an eye diagram with phosphor.py
Location:
developers/werner/ahrt/host/tmc
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • developers/werner/ahrt/host/tmc/lib/trigger.py

    r4646 r4679  
    110110            return [] 
    111111        if self.slope == slope.Both: 
    112             return wave.data[:] 
     112            return wave.data[1:] 
    113113        res = [] 
    114114        i = int(wave.initial ^ self.slope == slope.Falling)+1 
  • developers/werner/ahrt/host/tmc/lib/wave.py

    r4650 r4679  
    345345        self.data.extend(wave.data) 
    346346 
     347    def index(self, t): 
     348        if len(self.data) == 0 or t < self.data[0][0] or t > self.data[-1][0]: 
     349            raise hell 
     350        return binary(self.data, lambda x: x[0], t) 
     351 
    347352    def get_one(self, t): 
    348         if len(self.data) == 0 or t < self.data[0][0] or t > self.data[-1][0]: 
    349             raise hell 
    350         return self.data[binary(self.data, lambda x: x[0], t)] 
     353        return self.data[self.index(t)] 
    351354 
    352355    def __iter__(self): 
     
    435438        self.t_end = wave.t_end 
    436439 
     440    def index(self, t): 
     441        if len(self.data) == 0 or t < self.data[0] or t > self.t_end: 
     442            raise hell 
     443        return binary(self.data, lambda x: x, t) 
     444 
    437445    def get_one(self, t): 
    438446        if len(self.data) == 0 or t < self.data[0] or t > self.t_end: 
    439447            raise hell 
    440         return int(self.initial ^ 
    441           (binary(self.data, lambda x: x, t) & 1)) 
     448        return int(self.initial ^ (self.index(t) & 1)) 
    442449 
    443450    # experimental 
Note: See TracChangeset for help on using the changeset viewer.