<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Error of the Median with different window length, summary
DW 2015.10.27
In this notebook I want to show, that the error of the median filter depends on the window length of the filter and wave number of the sine wave.
Step1:  Visualization of the Error rate with different window lengths and a sine with wave number 5 (128 samples)
Step2:  As you can see, the error is higher when the window is bigger. 
The error rate is the mean of the absolute of the red line. The red line is the difference between the sine wave and the median filtered wave. With a bigger window the difference between median filtered wave and sine wave gets bigger. Thus we can say that the error depends on the size of the window.
Step3:  Visualization of the Error rate with different wave numbers and different window lengths
Step4:  At the beginning you can see the error rises with a higher wave number. But at the end there are some unlikely curves. This is because of the low samples(128).
Visualization of the Error rate with different wave numbers and different window lengths(1024 samples)
<ASSISTANT_TASK:>
Python Code:
import numpy as np
import matplotlib.pyplot as plt
import sys
# Add a new path with needed .py files.
sys.path.insert(0, 'C:\Users\Dominik\Documents\GitRep\kt-2015-DSPHandsOn\MedianFilter\Python') 
import functions
import gitInformation
%matplotlib inline
gitInformation.printInformation()
Explanation: Error of the Median with different window length, summary
DW 2015.10.27
In this notebook I want to show, that the error of the median filter depends on the window length of the filter and wave number of the sine wave.
End of explanation
fig = plt.figure()
for y in range (0, 40):
    if y % 2 == 1:
        functions.ErrorPlotWindow(5, y)
        
plt.savefig('WLError.png')
Explanation: Visualization of the Error rate with different window lengths and a sine with wave number 5 (128 samples)
End of explanation
plt.figure(figsize=(30,20)) 
for x in range(1, 5):
    for y in range(1, 6):
        # Creates different subplots in one figure, with x and y.
        # the window length is calculate.
        plt.subplot(5, 5, x + (y-1)*4)
        windowLength = ((x-1)*2 + (y-1)*8)*8 +1
        functions.medianSinPlot(16, windowLength, 16*128,128*5+1,-128*5-1)
        plt.suptitle('Median filtered sine waves', fontsize = 48)
        plt.xlabel(("Window length (/2 pi) = " + str(windowLength/128.)), fontsize=18)
Explanation: As you can see, the error is higher when the window is bigger. 
The error rate is the mean of the absolute of the red line. The red line is the difference between the sine wave and the median filtered wave. With a bigger window the difference between median filtered wave and sine wave gets bigger. Thus we can say that the error depends on the size of the window.
End of explanation
fig = plt.figure(figsize=(30,20))
for x in range(1, 5):
    for y in range(1, 6):
        for z in range(0,40):
            if z%2 ==1:
                plt.subplot(5, 5, x + (y-1)*4)
                wavenum = (x-1) + (y-1)*4
                functions.ErrorPlotWindow(wavenum, z)
                plt.suptitle(' Error of the Median filter with different wave numbers and window lengths',
                             fontsize = 40)
                plt.xlabel(("Wave number = " + str((x-1) + (y-1)*4)), fontsize = 18)
Explanation: Visualization of the Error rate with different wave numbers and different window lengths
End of explanation
fig = plt.figure(figsize=(30,20))
for x in range(1, 5):
    for y in range(1, 6):
        for z in range(0,160,3):
            if z%2 ==1:
                plt.subplot(5, 5, x + (y-1)*4)
                wavenum = (x-1) + (y-1)*4
                functions.ErrorPlotWindow( wavenum, z, 1024 )
                plt.suptitle(' Error of the Median filter with different wave numbers and window lengths ',
                             fontsize = 40)
                plt.xlabel(("Wave number = " + str((x-1) + (y-1)*4)), fontsize = 18)
plt.savefig('SumErrorWL')
Explanation: At the beginning you can see the error rises with a higher wave number. But at the end there are some unlikely curves. This is because of the low samples(128).
Visualization of the Error rate with different wave numbers and different window lengths(1024 samples)
End of explanation
<END_TASK>