<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Basic test
Step1:  I am trying to remove white noise from the original wave with different filters.
Define the sine wave with wave number 5 and add white noise.
Step2:  Smooth the signal with a moving averege filter.
Step3:  Smooth the signal with a gaussian filter.
<ASSISTANT_TASK:>
Python Code:
import numpy as np
import matplotlib.pyplot as plt
import scipy.ndimage.filters as scnf
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 gitInformation
gitInformation.printInformation()
% matplotlib inline
Explanation: Basic test: Smoothing the noised signal
2015.10.19 DW
End of explanation
# Creates a sine wave with wave number 5.
data = np.fromfunction(lambda x: np.sin(x/1024*2*np.pi*5), (1024,))
# Creates an array with random values and the same length as the data array.
noise = np.random.normal(0,1.0,len(data)) 
signal = data + noise
signal1 = signal
plt.plot(data)
plt.plot(signal1)
plt.title("Noised sine wave")
Explanation: I am trying to remove white noise from the original wave with different filters.
Define the sine wave with wave number 5 and add white noise.
End of explanation
# Moving averege filter with a length of 30, 5 times calculated.
for i in range (0,5):
    signal = np.convolve(signal, np.ones(30)/30, mode = 'same')  
plt.plot(signal)
plt.title("Result of the moving averege filter")
Explanation: Smooth the signal with a moving averege filter.
End of explanation
# Gaussian filter of the noised signal with a standard deviation for Gaussian kernel of 30.
smoothed = scnf.gaussian_filter(signal1, 30)
plt.plot(smoothed)
plt.title("Result of the gaussian filter")
Explanation: Smooth the signal with a gaussian filter.
End of explanation
<END_TASK>