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.
|
|
#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);
while (1) { int newValue = rand() % 100; int medianValue = MEDIANFILTER_Insert(&medianFilter, newValue); printf("New value: %d \tMedian value: %d\r\n", newValue, medianValue);
Sleep(1); }
return 0; }
|