You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

28 lines
590 B

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
#include "MedianFilter.h"
#define NUM_ELEMENTS 201
static sMedianFilter_t medianFilter;
static sMedianNode_t medianBuffer[NUM_ELEMENTS];
int main() {
medianFilter.numNodes = NUM_ELEMENTS;
medianFilter.medianBuffer = medianBuffer;
MEDIANFILTER_Init(&medianFilter);
int newValue = 1;
while (1) {
newValue++;
int medianValue = MEDIANFILTER_Insert(&medianFilter, newValue);
printf("New value: %d \tMedian value: %d\r\n", newValue, medianValue);
Sleep(1);
}
return 0;
}