A program to plot fourier transformations in python3 by Dejan Kostyszyn.
To run the program, the following requirements are necessary to be installed: Python3, NumPy, Matplotlib and Jupyter Notebook
- Change into the folder, where you saved the
FourierTransformation.ipynband runjupyter-notebook. - The Browser will show a menu, where you will find the file
FourierTransformation.ipynb. Click on it. - On the top menu click 'Cell -> Run All'
If you want to calculate another function, simply alter line 13. The functions either have to be NumPy functions, or you must include the according libraries. E.g. the math module.
In case you want to alter f(x), make sure that f(x) fits Dirichlets conditions:
Change
return x
to
return np.exp(-x)
Change return x to
if(x < 0):
return 0
else:
return x
If you want to alter the depth of the approximation, you can simply alter n in line 9. It is required that n is a numpy array, i.e. you can not simply write n = 100. Instead you have to write n = np.array([v]), if you want to use only one value v of datatype int16.
If you find any mistakes, please feel free to contact me.