{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Algorithms of Scientific Computing" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The functions $\\cos$ and $\\sin$ are axially respectively point symmetric to the\n", "ascension of 180 degrees. What can be found for the coefficients $a_k$\n", "and $b_k$ from the last worksheet, if the following conditions hold:\n", "\n", "\\begin{eqnarray*}\n", " X_l = X(\\theta_l) &=& X(360-\\theta_l) = X_{12-l} \\qquad \\mbox{respectively}\\\\\n", " X_l = X(\\theta_l) &=& -X(360-\\theta_l) = -X_{12-l}\n", "\\end{eqnarray*}\n", "\n", "Hint: Which values are allowed for $X_0$ and $X_6$ in the case $X_l = -X_{12-l}$?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In the last worksheet we showed that the $a_k$ and $b_k$ can be computed by\n", "\$$\n", " c_k = \\frac{1}{12} \\sum\\limits_{l=0}^{11} X_l e^{-i2\\pi kl/12},\n", "\$$\n", "i.e. by a DFT.\n", "\n", "Use the idea of the Fast Fourier Transformation, to reduce this DFT of length 12 to the computation of some DFTs of length 6 or 3, respectively.\n", "\n", "Use the fact that all $X_l \\in \\mathbb{R}$.\n", "\n", "Draw a diagram, that shows the needed computation steps or write an appropriate program (for example in Python)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# write your code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 3: DFT of Mirrored data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Assume a dataset $f_n$, $n=0,\\ldots,N-1$. What is the difference of the\n", "Fourier coefficients for this dataset and the \"mirrored\" dataset $\\widetilde{f}_n = f_n(N-n)$\n", "$\\hat{f}_n := f_{N-n}$ ?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 4: DFT and \"Padding\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A dataset $f_n$, $n = 0, \\dots, N-1$ is extended by ''zeros'', which gives\n", "the dataset $\\hat{f}_n$, $n = 0, \\dots, M-1$, with\n", "\$$\n", " \\hat{f}_n = \n", " \\begin{cases}\n", " f_n \\mbox{if} & n \\le N-1, \\\\\n", " 0 \\mbox{if} & N \\le n \\le M-1\n", " \\end{cases}\n", "\$$\n", "What is the difference between the Fourier coefficients of the original\n", "dataset $f_n$ and the Fourier coefficients of the extended one $\\hat{f}_n$?" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.4" } }, "nbformat": 4, "nbformat_minor": 1 }