Analysis and Implementation of Median Type Filters