Implantable medical device fast median filter
First Claim
1. A method for median filtering in an implantable medical device, comprising:
- receiving a new sample value into a buffer;
identifying an oldest sample value location in a MIN-heap and a MAX-heap;
identifying a new sample value location in either the MIN-heap or the MAX-heap by comparing the new sample value to a median value;
placing the new sample value into the oldest sample value location, if the MIN-heap or MAX-heap identified for the new sample value location is the same as the MIN-heap or MAX-heap identified for the oldest sample value location;
moving a MIN-heap top or MAX-heap top from the heap not containing the oldest value into the location of the oldest sample and placing the new sample into the location of the MIN-heap top or MAX-heap top moved from the heap not containing the oldest value, if the heap identified for the new sample is not the same as the heap identified for the oldest sample;
rebalancing the MAX-heap so the MAX-heap top contains the highest value in the MAX-heap and rebalancing the MIN-heap so the MIN-heap top contains the lowest value in the MIN-heap; and
, calculating the median value by averaging the MIN-heap top plus the MAX-heap top.
1 Assignment
0 Petitions
Accused Products
Abstract
A method for fast median filtering in an implantable medical device is disclosed that provides rapid filtering using computational mechanisms with following elements. A new sample value is received into a buffer. An oldest sample value location is identified in a MIN-heap and a MAX-heap. A new sample value location is identified in either the MIN-heap or the MAX-heap by comparing the new sample value to a median value. The new sample value is placed into the oldest sample value location, if the MIN-heap or MAX-heap identified for the new sample value location is the same as the MIN-heap or MAX-heap identified for the oldest sample value location. A MIN-heap top or MAX-heap top is moved from the heap not containing the oldest value into the location of the oldest sample and the new sample is placed into the location of the MIN-heap top or MAX-heap top moved from the heap not containing the oldest value, if the heap identified for the new sample is not the same as the heap identified for the oldest sample. The MAX-heap is rebalanced so the MAX-heap top contains the highest value in the MAX-heap and the MIN-heap is rebalanced so the MIN-heap top contains the lowest value in the MIN-heap. The median value is calculated by averaging the MIN-heap top plus the MAX-heap top. The method for fast median filtering in an implantable medical device can also be expressed as a computer software product that includes a medium readable by a processor.
-
Citations
9 Claims
-
1. A method for median filtering in an implantable medical device, comprising:
-
receiving a new sample value into a buffer;
identifying an oldest sample value location in a MIN-heap and a MAX-heap;
identifying a new sample value location in either the MIN-heap or the MAX-heap by comparing the new sample value to a median value;
placing the new sample value into the oldest sample value location, if the MIN-heap or MAX-heap identified for the new sample value location is the same as the MIN-heap or MAX-heap identified for the oldest sample value location;
moving a MIN-heap top or MAX-heap top from the heap not containing the oldest value into the location of the oldest sample and placing the new sample into the location of the MIN-heap top or MAX-heap top moved from the heap not containing the oldest value, if the heap identified for the new sample is not the same as the heap identified for the oldest sample;
rebalancing the MAX-heap so the MAX-heap top contains the highest value in the MAX-heap and rebalancing the MIN-heap so the MIN-heap top contains the lowest value in the MIN-heap; and
, calculating the median value by averaging the MIN-heap top plus the MAX-heap top. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method for median filtering in an implantable medical device, comprising:
-
means for receiving a new sample value into a buffer;
means for identifying an oldest sample value location in a MIN-heap and a MAX-heap;
means for identifying a new sample value location in either the MIN-heap or the MAX-heap by comparing the new sample value to a median value;
means for placing the new sample value into the oldest sample value location, if the MIN-heap or MAX-heap identified for the new sample value location is the same as the MIN-heap or MAX-heap identified for the oldest sample value location;
means for moving a MIN-heap top or MAX-heap top from the heap not containing the oldest value into the location of the oldest sample and placing the new sample into the location of the MIN-heap top or MAX-heap top moved from the heap not containing the oldest value, if the heap identified for the new sample is not the same as the heap identified for the oldest sample;
means for rebalancing the MAX-heap so the MAX-heap top contains the highest value in the MAX-heap and rebalancing the MIN-heap so the MIN-heap top contains the lowest value in the MIN-heap; and
, means for calculating the median value by averaging the MIN-heap top plus the MAX-heap top.
-
-
9. A computer software product that includes a medium readable by a processor, the medium having stored thereon instructions for median filtering in an implantable medical device, comprising:
-
a first sequence of instruction when executed by the processor, causes the processor to receive a new sample value into a buffer;
a second sequence of instruction when executed by the processor, causes the processor to identify an oldest sample value location in a MIN-heap and a MAX-heap;
a third sequence of instruction when executed by the processor, causes the processor to identify a new sample value location in either the MIN-heap or the MAX-heap by comparing the new sample value to a median value;
a forth sequence of instruction when executed by the processor, causes the processor to place the new sample value into the oldest sample value location, if the MIN-heap or MAX-heap identified for the new sample value location is the same as the MIN-heap or MAX-heap identified for the oldest sample value location;
a fifth sequence of instruction when executed by the processor, causes the processor to move a MIN-heap top or MAX-heap top from the heap not containing the oldest value into the location of the oldest sample and placing the new sample into the location of the MIN-heap top or MAX-heap top moved from the heap not containing the oldest value, if the heap identified for the new sample is not the same as the heap identified for the oldest sample;
a sixth sequence of instruction when executed by the processor, causes the processor to rebalance the MAX-heap so the MAX-heap top contains the highest value in the MAX-heap and rebalancing the MIN-heap so the MIN-heap top contains the lowest value in the MIN-heap; and
,a seventh sequence of instruction when executed by the processor, causes the processor to calculate the median value by averaging the MIN-heap top plus the MAX-heap top.
-
Specification