NLMSvariants/src/ansi_c_implementation
gurkenhabicht 486bc83403 some fixes 2018-06-11 14:27:48 +02:00
..
Makefile
NLMSvariants.c some fixes 2018-06-11 14:27:48 +02:00
README.md Update README.md 2018-05-31 11:34:25 +02:00
graphResults_template.html
nlms_types.h

README.md

Installation

Use $ make or compile it anywhere else, $ make win does the trick on windows and cygwin/gitbash. However if you use Visual Studio use the C++ implementation in ../src/cpp_implementation. It's a carbon copy of the *.c file but VS wants to use a *.cpp file. Both versions are multiplatform.

Features

This little piece of code compares 3 different implementations of a least mean square filter.

  • local mean
  • direct predecessor
  • differential predecessor

PPM files can be used for input at this iteration. Output will be generated as .txt files with predicted value generated by the filter and its error value as well as given actual value from the PPM file. Furthermore there is an output as an svg graph to compare the implementatiosn on a visual level. These graphical results are build from graphResults_template.html which creates the actual output to graphResults.html. Open this file to see the results. You can hide graphs by clicking on its name for better visibility.

Use $ ./lms -h for help.

Usage

There are a bunch of options you can predefine but do not have to. The only parameter needed is -i which is the inputfile.

Parameter Description StdVal
-i The inputfile, has to be PPM. none
-n Amount of input data used. 500
-w Size of M (window). 5
-c Choose RGB color channel, green has least noise. green
-l Learnrate of machine learning. 0.4
-g include graph building. Choose for amount of input data lower than 1200. If the template is located in another folder use its path otherwise use true. Do not use whitespace in path to folder. none
-s Seed randomizing weights. Choose for repoducability. time(NULL)

This code is ANSI aka C89 compatible. No POSIX, C99, C11 or GNU libs, because it had to be windows compatible . There are way easier methods like getline() for file parsing or getopt() as an args parser, because of compatibility reasons things have been kept simple.