Skip to content

add edge detection to signal library #45

@LFSaw

Description

@LFSaw

As proposed by @sletz over at #44 and in the slack channel, I'd like to suggest adding functions for edge detection to the signal library.

my proposal would be this naming scheme:

strictRising(x) = x > x';     // 1 for strictly rising, 0 otherwise
strictFalling(x) =  x < x';  // 1 for strictly falling, 0 otherwise
changed(x) = x != x';	  // 1 if signal changes, 0 otherwise
falling(x) = x <= x';   // 1 for falling or unchanged, 0 otherwise
rising(x) = x >= x'; // 1 for rising or unchanged, 0 otherwise
unchanged(x) = x == x';     // 1 for unchanged, 0 otherwise 

I understand that @sletz would like to have edge or front in the names, however, I do not see the need for "edge" (the change can be infinitesimally small for the functions to trigger)...

other naming schemes were (in order of appearance above):

  • upfront / rising_edge
  • downfront / falling_edge
  • edge / front
  • inv_upfront / inv_rising_edge
  • inv_downfront / inv_falling_edge
  • inv_edge / inv_front

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions