Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.75 KB | None | 0 0
  1. \section{Interpolation}
  2. a). Linear interpolation means that, in the case of a discrete function, the interpolated continuous function is made up of straight lines between the discrete data points. In this case (assuming that the first value of the function f is at place 0), this corresponds to the image below.
  3.  
  4. \begin{figure}[H]
  5. \centering
  6. \includegraphics[scale=0.30]{Figures/Resultat1.png}
  7. \caption{The function f after linear interpolation}
  8. \label{fig:linintf}
  9. \end{figure}
  10.  
  11. b). For linear interpolation, the function $g(x)$ should be chosen as a triangle pulse function, i.e.
  12.  
  13. \begin{equation}
  14. g(x) = \left \{
  15. \begin{tabular}{cc}
  16. 1 - \mid{x}\mid, & \quad \mid{x}\mid\leq 1\\
  17. 0, & \quad \text{otherwise} .
  18. \end{tabular}
  19. \right.
  20. \label{eq:gx}
  21. \end{equation}
  22.  
  23. c). The interpolated function $F_g(x)$ can be expressed as
  24. \begin{equation}
  25. F_g(x) = \sum_i g(x-i)f(i)
  26. \label{eq:Fg}
  27. \end{equation}
  28. Let us now study this function for the six intervals listed, one interval at a time. Assume each interval is defined between the points $i$ and $i+1$, where $i$ takes on the values $0,1,...,6$. For each individual interval, $F_g(x)$ can then be expressed as (by using eqs.\ref{eq:gx} and \ref{eq:Fg})
  29. \begin{equation}
  30. \begin{aligned}
  31. F_{g,i}(x) = & g(x-i)f(i) + g(x-(i+1))f(i+1) = \\
  32. & f(i)(1-x+i) + f(i+1)(1+x-(i+1)) = \\
  33. & f(i)(1-x+i) + f(i+1)(x-i)
  34. \end{aligned}
  35. \label{eq:Fgi}
  36. \end{equation}
  37. By differentiating eq.\ref{eq:Fgi} with regards to $x$, we get the derivative for each interval:
  38. \begin{equation}
  39. \frac{\partial F_{g,i}}{\partial x}(x) = f(i+1) - f(i)
  40. \label{eq:Fder}
  41. \end{equation}
  42. This can also be clearly seen by looking at fig.\ref{fig:linintf}. Since the distance between each data point is 1, the slope of the curve between two points is simply given by the difference in the function values at the two corresponding data points.
  43.  
  44. Using eqs.\ref{eq:Fgi} and \ref{eq:Fder}, the function intensity as well as derivative could be evaluated at six different points, each point belonging to a different interval.
  45. \begin{table} [H]
  46. \begin{center}
  47. \begin{tabular}{c|c c}
  48. $x$ & $F_{g,i}(x)$ & $\frac{\partial F_{g,i}}{\partial x}(x)$ \\
  49. \hline
  50. 0.5 & 2.5 & 3 \\
  51. 1.5 & 5 & 2 \\
  52. 2.5 & 7 & 2 \\
  53. 3.5 & 7.5 & -1 \\
  54. 4.5 & 6 & -2 \\
  55. 5.5 & 4 & -2 \\
  56. \end{tabular}
  57. \caption{The function intensities and derivatives evaluated at six different points (intervals).}
  58. \label{tab:results1}
  59. \end{center}
  60. \end{table}
  61.  
  62. What is the connection between the derivative of $F_g$, seen in eq.\ref{eq:Fder}, and the 'discrete' differentiation using the convolution $f\ast w$, where $w = [1 -1]$?
  63. As was mentioned previously, in section 1, the convolution between \textit{f} and a filter \textit{w}, $f\ast w$ can be written as the scalar product $f\cdot \hat{w}$, where $\hat{w}$ is the "flipped" version of w. Now, if we evaluate the function $f$ on an interval $i$ to $i+1$, it can be written as [f(i) f(i+1)], as it is a discrete function. This gives us the following result:
  64.  
  65. \begin{equation}
  66. \begin{aligned}
  67. f \ast w = f\cdot \hat{w} &=
  68. \begin{bmatrix}
  69. f(i) & f(i+1)
  70. \end{bmatrix}
  71. \begin{bmatrix}
  72. -1 \\
  73. 1
  74. \end{bmatrix}
  75. = f(i+1)-f(i) \\
  76. & \rightarrow \frac{\partial F_{g,i}}{\partial x} = f \ast w
  77. \end{aligned}
  78. \label{eq:Fconv}
  79. \end{equation}
  80.  
  81. d). Next came the task of showing the following
  82. $$
  83. \frac{\partial g}{\partial x}(k) = w(k)
  84. $$
  85. where $g$ is a interpolation function and $w$ is the differentiating convolution function.
  86. Using the properties of convolution, the following holds true
  87. $$
  88. \frac{\partial F_g}{\partial x} = \frac{\partial}{\partial x}(g \ast f) = f \ast \frac{\partial g}{\partial x}
  89. $$
  90. Now, if we use the result from eq.\ref{eq:Fconv}, we know that the entire expression above should be equal to $f\ast w$, i.e.
  91. $$
  92. f \ast w = f \ast \frac{\partial g}{\partial x}
  93. $$
  94. and from this it is easy to see that
  95. $
  96. \frac{\partial g}{\partial x} = w
  97. $
  98.  
  99. e). As was shown in task 2d, $\frac{\partial g}{\partial x}(k) = w(k)$. Given that $ w_2 = \begin{bmatrix}
  100. -\frac{1}{2} & 0 & \frac{1}{2}
  101. \end{bmatrix} $, we simply have to find a function $g(x)$ so that $g'(x)$ takes on those same values in $x = -1,0,1$. A reasonable approach to this seems to be using a second grade equation, $ax^2 + bx + c$. However, we want the derivative to be 0 in $x=0$, which means that we want no displacement in the x-direction, so $b = 0$. The constant term $c$ doesn't affect the derivative, so we might as well put it to 0. Then we are left with $ax^2$. If we differentiate this, we get $g'(x)=2ax$. $g'(-1) = -\frac{1}{2}$ gives us $a = -\frac{1}{4}$. This value for \textit{a} also gives us the correct value in the other points, so therefore, $g(x) = -\frac{x}{4}$.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement