1 Introduction

Numerical differentiation from noisy data is an important issue in a wide range of areas of science and technology. Applications areas include image processing (Wang et al. 2002), inverse heat conduction problems (Bozzoli et al. 2015, 2017), parameter identification (Hanke and Scherzer 1999), viscoelastic mechanics (Sovari and Malinen 2007) and blood glucose predictions (Mhaskar et al. 2013). The main difficulty found in practical applications is that numerical differentiation is an ill-posed problem; hence, small input data errors can produce large errors in the computed derivative. Several numerical schemes for numerical differentiation have been proposed in the past years. These can be roughly organized into two groups: methods based on finite discrete data and methods that work with continuous noise data. Schemes of the first group include difference methods, interpolation methods and discrete mollification methods (Groetsch 1991; Qu 1996; Rivlin 1975; Murio et al. 1998). Methods in the second group include Fourier truncation methods in frequency space (Bernston 1999; Fu 2004; Hào 1994; Qian et al. 2006) and methods based on regularization of linear operator equations (Fu 2004; Lu and Pereverzev 2006; Lu et al. 2013; Zhao et al. 2009). It is worth noting that irrespective of the chosen method some regularization is required to avoid domination of the final result by noise.

This work is closely related with methods that rewrite the differentiation problem of smooth functions as a Volterra integral equation. In fact, for smooth g on [0,1], it is clear that finding \(g'\) is equivalent to solving the ill-posed problem

$$\begin{aligned} K_1f(s) = \int _0^s f(t)\mathrm{d}t = g(s)-g(0), \; s\in [0,1], \end{aligned}$$
(1)

where \(K_1: L_2(0,1)\rightarrow L_2(0,1)\). In this regard, an approach that describes the solution \(f = g'\) in terms of singular functions of the operator \(K_1\), a cosine series of f on [0,1], along with error estimates, can be found in Zhao et al. (2009). In a different framework, based on the concept of Hilbert scales and on the one generated by singular functions of \(K_1\) (Louis 1989, page 25),

$$\begin{aligned} \begin{array}{l} e_k(s) = e_k^I(s) = \sqrt{2}\sin \left( k+\frac{1}{2}\right) \pi s, \;\; k =1,2, \dots , \\ e_k(s) = e_k^{-I}(s) = \sqrt{2}\cos \left( k+\frac{1}{2}\right) \pi s, \;\; k =1,2,\dots , \\ \end{array} \end{aligned}$$
(2)

for deterministic noisy data \(g_\delta \) such that \(\Vert g-g_\delta \Vert _{L_2}\le \delta \), it is reported in Lu et al. (2013) that the error in approximating \(g'\) by the derivative of the n-th partial sum,

$$\begin{aligned} g'(s)\approx \frac{\mathrm{d}}{\mathrm{d}s}\left( \sum _{k=1}^n e_k^I(s)<e_k^I,g_\delta > \right) , \end{aligned}$$
(3)

can be bounded as

$$\begin{aligned} \left\| g'(s)\approx \frac{\mathrm{d}}{\mathrm{d}s}\left( \sum _{k=1}^n e_k^I(s)<e_k^I,g_\delta > \right) \right\| _{L_2} \le c \Vert g\Vert \delta ^{\frac{r-1}{r}}, \end{aligned}$$
(4)

where r denotes the regularity index of the Hilbert scale and the truncation parameter n is chosen such that \(n=\delta ^{-\frac{2}{2r+1}}.\) Other approaches based on the operator Eq. (1) can be found in Lu and Pereverzev (2006) and references therein. However, despite the existence of numerous approaches to the problem, very little is reported about methods for numerical differentiation of periodic functions; two of few existing works on the subject are Dolgopolova (1970), Zhao and Meng (2010). The present paper is motivated by an approach of Zhao and Meng (2010), where the numerical differentiation problem is transformed into a first kind Volterra-type integral equation

$$\begin{aligned} K f = g, \end{aligned}$$
(5)

with K being defined on appropriate spaces and given as

$$\begin{aligned} (K\,f)(s) = \int _0^s f(t)\mathrm{d}t - \int _0^1\int _0^sf(\tau )\mathrm{d}\tau \mathrm{d}s. \end{aligned}$$
(6)

Then, as before, determining the derivative \(g'\) amounts to solving (5) with g as input data. In such a reformulation K is a compact invertible operator whose singular system \(\{\sigma _j,u_j,v_j\}_{j=1}^{\infty }\) is determined in closed form. Hence, for g lying in R(K), the space image of K, the solution of (5) can be determined in terms of the singular system, and only the Fourier coefficients of g with respect to the left singular functions \(u_j\) need to be calculated. However, as pointed out by Zhao and Meng, periodic g does not necessarily belongs to R(K), therefore, Eq. (5) has to be solved with a right hand side \({\overline{g}}(s) \) given by

$$\begin{aligned} {\overline{g}}(s) = g(s)-\int _0^1g(t)\mathrm{d}t, \end{aligned}$$
(7)

and a similar observation applies to the case where instead of g we are given perturbed data \( g_\delta (s)\). Indeed, with noisy data, the differentiation problem is addressed by solving Eq. (5) with a right hand side \({\overline{g}}_\delta \) obtained as in (7). The advantage of formulating the problem of numerical differentiation in this way is that error estimates and convergence rates for the numerical approximation of \(g'\) can be readily obtained using regularization theory. Proceeding in this way, Zhao and Meng derived error estimates based on a truncated singular value expansion (TSVE) technique under Hölder-type source conditions, where the truncation parameter is chosen by the discrepancy principle. We note in passing that these estimates can be viewed as particular cases of general results reported in Nair et al. (2005) in Hilbert scale settings under general smoothing conditions. Note also that since \( g_\delta \) is supplied instead of \( {\bar{g}}_\delta \), bad results can be obtained when the error in \( {\bar{g}}_\delta \) is not estimated accurately; this hinders the application of the method. Therefore, methods that work with the available data \( g_\delta \) are desirable.

In this paper, we propose a method for numerical differentiation of periodic functions from a finite amount (probably small) of noisy data, as occurs in practical applications, therefore contrary to the approach in Zhao and Meng (2010) which deals with continuous data and with \({\bar{g}}_\delta \) instead of \(g_\delta \). For noise-free data, the method is supported by the observation that the series solution of (5) given in terms of the singular system of K, coincides with the Fourier series of \(g'\) (Zhao and Meng 2010), the latter being formally obtained by differentiating the Fourier series of g term-by-term. This last observation not only indicates that the Fourier series of \(g'\) involves Fourier coefficients of g not of \(g'\), but also that the differentiation problem can be treated using only Fourier analysis in appropriate function spaces and without the need for regularization methods for ill-posed problems as done in Zhao and Meng (2010) and in several other works. The noisy data case is more difficult to deal with since \(g_\delta \) needs not be differentiable, so that we cannot compute a derivative. Moreover, even if \(g_\delta \) is differentiable the error in the derivative can be arbitrarily large. Therefore, to construct stable approximations to \(g'\) from noisy data, we consider a Fourier series constructed similarly as that of \(g'\), but with \(g_\delta \) instead of g, and then truncate the series to a finite number of terms to filter out as much as possible the contribution of noise to the result. The number of terms determines how sensitive the truncated series is to the error in g and how close the truncated series is to \(g'\). A similar procedure is followed in high-order differentiation cases. Our numerical differentiation method is based on discrete data and follows the same ideas above, with the sole difference that rather than truncating an infinite Fourier series, we truncate discrete spectral derivatives constructed by the spectral Fourier differentiation matrix.

As main contributions of the present work we quote:

  1. 1.

    An error estimate analogous to that given in (4) obtained via Fourier analysis in a Sobolev space setting. The error bound under consideration can also be derived as a particular case of general results reported in Nair et al. (2005) in Hilbert scale settings. The contribution here lies in the fact that our proof is simpler and less demanding in terms of required assumptions.

  2. 2.

    A method for numerical differentiation of periodic function based on discrete data simple to implement and computationally inexpensive. The method requires a few standard inner products in \({\mathbb {R}}^N\) and a matrix–vector product of a low rank matrix and the vector of noisy data.

  3. 3.

    An error estimate for the case of discrete data that is essentially the same as that mentioned in item 1.

The paper is organized as follows. In Sect. 2, after some preliminary results, we describe the truncated Fourier series method for numerical differentiation, as well as error estimates associated to the approximations obtained with the discrepancy principle as parameter truncation rule. Our filtering matrix differentiation method for numerical differentiation based on discrete noisy data is discussed in Sect. 3, which includes numerical examples. In order to illustrate the effectiveness of our method on a practical application, in Sect. 4, we consider an inverse heat transfer problem based on experimental data. Concluding remarks are described in Sect. 5.

2 Truncated Fourier series method for numerical differentiation

For the sake of simplicity, we will address the numerical differentiation problem of periodic functions within the framework of periodic Sobolev spaces \(H_{\mathrm{p}}^{m}(0,2\pi )\), for positive integer m, consisting of functions whose first \(m-1\) derivatives are periodic in \([0,2\pi ]\). Periodic Sobolev spaces are appropriate in our context since, for any \(g\in H_{\mathrm{p}}^{m}(0,2\pi )\), we can differentiate term-wise the Fourier series of g m times, and ensure convergence in the square mean. In order to formulate the numerical differentiation problem in the Sobolev space setting, we will introduce some notation and a few preliminary results. Let \(L_2(0,2\pi )\) be the space of real valued Lebesgue square-integrable functions on \((0,2\pi )\), with standard inner product and induced norm denoted by \(\langle \cdot ,\cdot \rangle \) and \(\Vert .\Vert _{L_2}\), respectively. It is well known that \(\{u_0,u_1,u_2,\ldots ,v_1,v_2,\ldots \}\) with \(u_0={1}/{\sqrt{2\pi }}\), \( u_j(\theta )={\cos (j\theta )}/{\sqrt{\pi }}\) and \(v_j(\theta )={\sin (j\theta )}/{\sqrt{\pi }}\), is an orthonormal basis for \(L_2(0,2\pi )\), referred from here on as to “the Fourier basis”. As a result, for each \(f\in L_2(0,2\pi )\) we have

$$\begin{aligned} f= \langle f,u_0\rangle + \sum _{j=1}^{+\infty }\left[ \langle f,u_j\rangle u_j+\langle f,v_j\rangle v_j\right] , \end{aligned}$$
(8)

and

$$\begin{aligned} \Vert f\Vert _{L_2}^2= \langle f,u_0\rangle ^2+\sum _{j=1}^{+\infty }[\langle f,u_j\rangle ^2+\langle f,v_j\rangle ^2]<\infty , \end{aligned}$$
(9)

with the observation that the convergence in (8) is in the square mean (or in the \(L_2\)-norm sense). Then, \(H_\mathrm{p}^{m}(0,2\pi )\) consists of functions f with derivatives of order up to \(m-1\) being 2\(\pi \)-periodic, such that

$$\begin{aligned} \sum _{j=1}^{+\infty }j^{2m}(\langle f,u_j\rangle ^2+\langle f,v_j\rangle ^2)<\infty . \end{aligned}$$
(10)

\(H_{\mathrm{p}}^{m}(0,2\pi )\) is a Hilbert space (Kirsch 2011, p. 262) with inner product \(\langle \langle \cdot ,\cdot \rangle \rangle \) and induced norm \(\Vert \cdot \Vert _{H_{\mathrm{p}}^s}\) given by

$$\begin{aligned} \langle \langle f,h\rangle \rangle =\langle f,u_0\rangle \langle h,u_0\rangle + \sum _{j=1}^{+\infty }(1+j^2)^m(\langle f,u_j\rangle \langle h,u_j\rangle +\langle f,v_j\rangle \langle h,v_j\rangle ) \end{aligned}$$

and

$$\begin{aligned} \Vert f\Vert _{H_{\mathrm{p}}^m}^2 = \langle f,u_0\rangle ^2+\sum _{j=1}^{+\infty }(1+j^{2})^m(\langle f,u_j\rangle ^2+ \langle f,v_j\rangle ^2), \end{aligned}$$

respectively. Thus, for \(f\in H_{\mathrm{p}}^{m}(0,2\pi )\) and \(1\le \ell \le m-1\), we can differentiate the Fourier series (8) term-by-term to obtain

$$\begin{aligned} f^{(\ell )}=\left\{ \begin{array}{c} \sum \nolimits _{j=1}^{\infty }(-1)^{\frac{\ell -1}{2}}j^{\ell }[\langle f,v_j\rangle u_j-\langle f,u_j\rangle v_j],\quad \ell \; \text {odd},\\ \sum \nolimits _{j=1}^{\infty }(-1)^{\frac{\ell }{2}}j^{\ell }[\langle f,u_j\rangle u_j+\langle f,v_j\rangle v_j],\quad \ell \; \text {even}, \end{array}\right. \end{aligned}$$
(11)

with convergence in the \(L_2\)-norm sense. This suggests that, for noise-free data, we can construct approximations of \(f^{(\ell )}\) by truncating the Fourier series to a finite number of terms. Indeed, proceeding in this way, the quality of the approximations is known to depend on how fast the Fourier coefficients of \(f^{(\ell )}\) decay to zero, which in turn depend on the regularity properties of f, since from (11) we have

$$\begin{aligned} \langle f^{(\ell )},u_j\rangle= & {} \left\{ \begin{array}{c} (-1)^{\frac{\ell -1}{2}}j^\ell \langle f,v_j\rangle ,\quad \ell \; \text {odd} \\ (-1)^{\frac{\ell }{2}}j^\ell \langle f,u_j\rangle ,\quad \ell \; \text {even}, \end{array}\right. \end{aligned}$$
(12)
$$\begin{aligned} \langle f^{(\ell )},v_j\rangle= & {} \left\{ \begin{array}{c} -(-1)^{\frac{\ell -1}{2}}j^\ell \langle f,u_j\rangle ,\quad \ell \; \text {odd} \\ (-1)^{\frac{\ell }{2}}j^\ell \langle f,v_j\rangle ,\quad \ell \; \text {even}. \end{array}\right. \end{aligned}$$
(13)

We are now in a position to address the numerical differentiation problem. We shall begin with the first-order problem by introducing the linear operator \(T:H_{\mathrm{p}}^{1}(0,2\pi )\subset L_2(0,2\pi )\rightarrow L_2(0,2\pi )\) defined by \(T(u)=u'\), and for the moment, assume that the data are noise-free. Then, it is clear that for given \(g\in H_{\mathrm{p}}^{1}(0,2\pi )\) the goal is to find \(\xi \in L_2(0,2\pi )\) such that

$$\begin{aligned} {Tg=g'=\xi .} \end{aligned}$$
(14)

It is well known that T is a (unbounded) densely defined linear operator with adjoint \(T^{*}: H_{\mathrm{p}}^{1}(0,2\pi )\subset L_2(0,2\pi )\rightarrow L_2(0,2\pi )\) such that \(T^{*}=-T\) (Groetsch 2007, p 31) . Yet we can readily see that associated to the eigenvalue problem \(T^{*}T(v)=\lambda v\) there is a periodic Sturm–Liouville problem defined by

$$\begin{aligned} v''+\lambda v= & {} 0 \quad \text {in}\quad (0,2\pi ) \end{aligned}$$
(15)
$$\begin{aligned} v(0)= & {} v(2\pi ) \end{aligned}$$
(16)
$$\begin{aligned} v'(0)= & {} v'(2\pi ), \end{aligned}$$
(17)

with eigenvalues and corresponding eigenfunctions described in closed form. Indeed, the Sturm–Liouville problem has a simple eigenvalue \(\lambda _0 = 0\) with corresponding eigenfunction \(u_0\) introduced in the previous section, and eigenvalues \(\lambda _j=j, \;j\in {\mathbb {N}}\), with multiplicity two and corresponding eigenfunctions given by \(u_j\) and \(v_j\) (introduced in the previous section too). Consequently, in view of (11) with \(\ell =1\), we get the eigenfunction expansion

$$\begin{aligned} Tg=\xi =\sum _{j=1}^{\infty }[\lambda _j\langle g,v_j\rangle u_j-\lambda _j\langle g,u_j\rangle v_j]. \end{aligned}$$
(18)

Remark 2.1

It is a routine to check that \({\mathcal {R}}(T)\), the image of T, is a closed subspace of \(L_2(0,2\pi )\), therefore \(L_2(0,2\pi )={\mathcal {R}}(T)\oplus {\mathcal {R}}(T)^{\perp }\). Moreover, from the completeness of \(H_{{\mathrm{p}}}^{1}(0,2\pi )\) with respect to the graph norm \(\Vert f\Vert _T:=\Vert f\Vert _{L_2}+\Vert Tf\Vert _{L_2}=\Vert f\Vert _{L_2}+\Vert f'\Vert _{L_2}\), T is a closed operator (Berezansky et al. 1996, p 5). As a result, T has a Moore–Penrose generalized inverse (Groetsch 2007, pp 41–42)

$$\begin{aligned} T^{\dagger }:L_2(0,2\pi )\rightarrow {\mathcal {N}}(T)^{\perp }\cap H_\mathrm{p}^{1}(0,2\pi )\subset L_2(0,2\pi ), \end{aligned}$$
(19)

where \({{{\mathcal {N}}}}(T) \subset H^1_{\mathrm{p}}(0,2\pi ),\) the null subspace of T, is generated by the constant function \(f=1\). Moreover, since \(T^\dag T g= (I-P)g\) for all \(g\in H_{\mathrm{p}}^1(0,2\pi )\) where P denotes the orthogonal projector of \(H^1_{\mathrm{p}}(0,2\pi )\) onto \({{{\mathcal {N}}}}(T)\) (Groetsch 2007, Theorem. 2.12), we conclude that

$$\begin{aligned} T^{\dagger }(g')={\widehat{g}}:=g-\frac{1}{2\pi }\int _{0}^{2\pi }g(s)\mathrm{d}s. \end{aligned}$$
(20)

Then, in terms of the Fourier basis, due to (8), (12) and (13) we have

$$\begin{aligned} \begin{aligned} T^{\dagger }(g')&={\widehat{g}}=\sum _{j=1}^{\infty }[\langle g,u_j\rangle u_j+\langle g,v_j\rangle v_j],\\&= \sum _{j=1}^{\infty }[-j^{-1}\langle g',v_j\rangle u_j+j^{-1}\langle g',u_j\rangle v_j], \end{aligned} \end{aligned}$$
(21)

since \(\langle {\widehat{g}},u_0\rangle =0\), \(\langle {\widehat{g}},v_j\rangle =\langle g,v_j\rangle \) and \(\langle {\widehat{g}},u_j\rangle =\langle g,u_j\rangle \). In addition, classical results (see, e.g., Schatten 1960, p 18, Theorem 7) and (21) ensure that \(T^{\dagger }\) is compact, with singular values \(\eta _j=\lambda _j^{-1}=j^{-1}\) having double multiplicity and associated singular functions given by \((v_j,-u_j\rangle \) and \((u_j,v_j\rangle \). Furthermore, notice that (18) can be viewed as a singular value expansion, i.e.,

$$\begin{aligned} \xi =Tg=\sum _{j=1}^{\infty }[\eta _j^{-1}\langle g,v_j\rangle u_j-\eta _j^{-1}\langle g,u_j\rangle v_j]. \end{aligned}$$
(22)

Turning to the first-order numerical differentiation problem from noisy data, assume that we are given perturbed data \(g_\delta \in L_2(0,2\pi )\) such that

$$\begin{aligned} \Vert g-g_{\delta }\Vert _{L_2}\le \delta _g. \end{aligned}$$
(23)

Since in general \(g_\delta \notin H_{\mathrm{p}}^{1}(0,2\pi )\), we face the difficulty that neither (21) nor (22) can be used for purpose of computing derivatives with \(g_\delta \) as input data. To overcome this let \(\xi _{\delta }\) be the Fourier series defined by

$$\begin{aligned} \xi _{\delta }\sim \sum _{j=1}^{\infty }[\eta _j^{-1}\langle g_{\delta },v_j\rangle u_j-\eta _j^{-1}\langle g_{\delta },u_j\rangle v_j]. \end{aligned}$$
(24)

We will construct stable approximations to \(g'\) by truncating the Fourier series (24) to N terms, regardless of whether this series converges or diverges, giving rise to regularized derivatives given by

$$\begin{aligned} \xi ^N_\delta =\sum _{j=1}^{N}[\eta _j^{-1}\langle g_\delta ,v_j\rangle u_j-\eta _j^{-1} \langle g_\delta ,u_j\rangle v_j]. \end{aligned}$$
(25)

At this point, it is important to remark that a similar approach for first-order differentiation of functions g on \([-1,1]\) has been reported in Lu et al. (2013), Mhaskar et al. (2013), where Legendre polynomials are used instead of the Fourier basis and where the derivative of partial sums of Fourier–Legendre series of g is taken as approximation to the desired derivative \(g'\). For noisy data, a conclusion of the authors in Mhaskar et al. (2013) is that the noise propagation error \(\Vert \xi ^N- \xi ^N_{\delta }\Vert _{L_2}\) spreads with an intensity \({{{\mathcal {O}}}}(N^2\delta _g)\); error estimates are also given. A differential feature of our method is that since orthogonality is not lost by differentiating the Fourier basis, the noise propagation error is \({{{\mathcal {O}}}}(N\delta _g)\), as is easy to verify and seen below in the proof of Theorem. 2.1. Recall that number N determines how sensitive \(\xi ^N_\delta \) is to the error in g and how close \(\xi ^N_\delta \) is to \(g'\). Thus, the determination of a suitable truncation level is thus a crucial part of the solution process. As in Zhao and Meng (2010), we choose \(N\in {\mathbb {N}}\) based on the discrepancy principle (see Engl et al. 1996), i.e., for fixed \(\tau >1\), we choose \(N\in {\mathbb {N}}\) such that

$$\begin{aligned} N=\inf \{k\in {\mathbb {N}};\; \Vert T^{\dagger }\xi _\delta ^{k}-{\widehat{g}}_\delta \Vert _{L_2}\le \tau \delta _g\}, \end{aligned}$$
(26)

where \({\widehat{g}}_\delta :=g_\delta -\frac{1}{2\pi }\int _{0}^{2\pi }g_\delta (s)\mathrm{d}s.\) In other words, the truncation parameter N is the smallest integer such that the residual norm \(\Vert T^{\dagger }\xi _\delta ^{k}-{\widehat{g}}_\delta \Vert _{L_2}\) is of the same order as the norm of the error in the data. This residual norm can be readily computed by observing that

$$\begin{aligned} \langle \xi _\delta ^k,u_j\rangle =\left\{ \begin{array}{ll} \eta _j^{-1} \langle g_\delta ,v_j\rangle ,&{}\quad j\in \{1,2,\ldots , k\} \\ 0,&{}\quad j\in \{k+1,k+2,\ldots \} \end{array}\right. \end{aligned}$$

and

$$\begin{aligned} \langle \xi _\delta ^k,v_j\rangle =\left\{ \begin{array}{ll} -\eta _j^{-1} \langle g_\delta ,u_j\rangle ,&{}\quad j\in \{1,2,\ldots , k\} \\ 0,&{}\quad j\in \{k+1,k+2,\ldots \} \end{array}\right. , \end{aligned}$$

so that (21) and (25) yield

$$\begin{aligned} T^{\dagger }\xi _\delta ^{k}= \sum _{j=1}^{k}[\langle g_\delta ,u_j\rangle u_j+\langle g_\delta ,v_j\rangle v_j]. \end{aligned}$$

The above result together with (8) imply

$$\begin{aligned} \Vert T^{\dagger }\xi _\delta ^{k}-{\widehat{g}}_\delta \Vert _{L_2}^2=\sum _{j=k+1}^{+\infty }[\langle g_\delta ,u_j\rangle ^2+\langle g_\delta ,v_j\rangle ^2]. \end{aligned}$$
(27)

Thus, taking into account the definition of N given in (26) and (27) it follows that

$$\begin{aligned} \sum _{j=N+1}^{+\infty }[\langle g_\delta ,u_j\rangle ^2+\langle g_\delta ,v_j\rangle ^2]\le \tau ^2 \delta _g^2\le \sum _{j=N}^{+\infty }[\langle g_\delta ,u_j\rangle ^2+\langle g_\delta ,v_j\rangle ^2]. \end{aligned}$$
(28)

The error in the approximation to \(g'\) obtained by the truncated Fourier series technique can be stated as follows.

Theorem 2.1

Assume that \(g\in H^{m}_{\mathrm{p}}(0,2\pi )\) for \(m>1\) and let \(g_\delta \in L_2(0,2\pi )\) such that (23) holds. Then, being \(\xi _\delta ^N\) given by (25), \(\tau >1\) and \(N\in {\mathbb {N}}\) satisfying (26), we have the estimate

$$\begin{aligned} {\Vert \xi -\xi _\delta ^N\Vert _{L_2}\le C_\tau \Vert g^{(m)}\Vert _{L_2}^{\frac{1}{m}}\delta _g^{\frac{m-1}{m}},} \end{aligned}$$
(29)

where \(\xi =g'\) and \(C_\tau =(\tau +1)^{\frac{m-1}{m}}+(\tau -1)^{\frac{-1}{m}}\).

Proof

In order to estimate the error \(\xi -\xi _\delta ^N\) we use the triangular inequality to obtain

$$\begin{aligned} \Vert \xi -\xi _\delta ^N\Vert _{L_2}\le \Vert \xi -\xi ^N\Vert _{L_2}+\Vert \xi ^N-\xi _\delta ^N\Vert _{L_2}, \end{aligned}$$
(30)

where

$$\begin{aligned} \xi ^N=\sum _{j=1}^{N}[\eta _j^{-1}\langle g,v_j\rangle u_j-\eta _j^{-1}\langle g,u_j\rangle v_j]. \end{aligned}$$
(31)

It is clear that, from (18) and (31), that

$$\begin{aligned} \Vert \xi -\xi ^N\Vert ^2_{L_2}=\sum _{j=N+1}^{+\infty }j^2[\langle g,v_j\rangle ^2+\langle g,u_j\rangle ^2]. \end{aligned}$$
(32)

Writing

$$\begin{aligned} j^2[\langle g,v_j\rangle ^2 + \langle g,u_j\rangle ^2]= \left( j^2\langle g,v_j\rangle ^{\frac{2}{m}}\right) \left( \langle g,v_j\rangle ^{\frac{2(m-1)}{m}}\right) + \left( j^2\langle g,u_j\rangle ^{\frac{2}{m}}\right) \left( \langle g,v_j\rangle ^{\frac{2(m-1)}{m}} \right) , \end{aligned}$$

Hölder’s inequality and (32) yield

$$\begin{aligned} \begin{array}{ccl} \Vert \xi -\xi ^N\Vert ^2_{L_2} &{} \le &{} \left( \displaystyle \sum _{j=N+1}^{+\infty }j^{2m}\langle g,v_j\rangle ^2\right) ^{\frac{1}{m}} \left( \displaystyle \sum _{j=N+1}^{+\infty }\langle g,v_j\rangle ^2\right) ^{\frac{m-1}{m}}\\ &{} &{}+\left( \displaystyle \sum _{j=N+1}^{+\infty }j^{2m}\langle g,u_j\rangle ^2\right) ^{\frac{1}{m}} \left( \displaystyle \sum _{j=N+1}^{+\infty }\langle g,u_j\rangle ^2\right) ^{\frac{m-1}{m}}. \end{array} \end{aligned}$$
(33)

Using Hölder’s inequality once more, the sum above can be bounded to give

$$\begin{aligned} \begin{aligned} \Vert \xi -\xi ^N\Vert ^2_{L_2}&= \left( \sum _{j=N+1}^{+\infty }j^{2m}[\langle g,v_j\rangle ^2+ \langle g,u_j\rangle ^2]\right) ^{\frac{1}{m}} \left( \sum _{j=N+1}^{+\infty }[\langle g,v_j\rangle ^2+\langle g,u_j\rangle ^2]\right) ^{\frac{m-1}{m}}\\&\le \Vert g^{(m)}\Vert _{L_2}\left( \sum _{j=N+1}^{+\infty } [\langle g,v_j\rangle ^2+\langle g,u_j\rangle ^2]\right) ^{\frac{m-1}{m}}. \end{aligned} \end{aligned}$$
(34)

Let the projector orthogonal of \(L_2(0,2\pi )\) onto the subspace \({\mathrm{span}}\{ v_{N+1}, u_{N+1},v_{N+2}, u_{N+2},\cdots \}\) be denoted by \({{{\mathcal {P}}}}_N\). Then it is clear that

$$\begin{aligned} \sum _{j=N+1}^{+\infty } \langle g,v_j\rangle ^2+\langle g,u_j\rangle ^2 = \Vert {{{\mathcal {P}}}}_N g\Vert ^2_{L_2} \le \left[ \Vert {{{\mathcal {P}}}}_N (g-g_\delta )\Vert _{L_2} + \Vert {{{\mathcal {P}}}}_N g_\delta \Vert _{L_2} |\right] ^2\le (1+\tau )^2\delta _g^2. \end{aligned}$$
(35)

Thus, due to (34) and (35), we get

$$\begin{aligned} \begin{aligned} \Vert \xi -\xi ^N\Vert _{L_2}&\le \Vert g^{(m)}\Vert _{L_2}^{\frac{1}{m}}(1+\tau )^{\frac{m-1}{m}}\delta _g^{\frac{m-1}{m}}. \end{aligned} \end{aligned}$$
(36)

On the other hand, since

$$\begin{aligned} \begin{aligned} \Vert \xi ^N-\xi _\delta ^N\Vert ^2_{L_2}&=\sum _{j=1}^N [j^2\langle g- g_\delta ,v_j\rangle ^2+j^2\langle g-g_\delta ,u_j\rangle ^2] \le N^2 \Vert g-g_\delta \Vert ^2_{L_2} \le N^2 \delta _g^2, \end{aligned} \end{aligned}$$
(37)

arguing as in (35) and using (28), we conclude that

$$\begin{aligned} \begin{aligned} \tau ^2\delta _g^2\le \sum _{j=N}^{+\infty }[\langle g_\delta ,v_j\rangle ^2+\langle g_\delta ,u_j\rangle ^2]&\le \left\{ \left[ \sum _{j=N}^{+\infty }\langle g_\delta -g,v_j\rangle ^2+\langle g_\delta -g,u_j\rangle ^2\right] ^{1/2}\right. \\&\quad \left. +\left[ \sum _{j=N}^{+\infty }\langle g,v_j\rangle ^2+\langle g,u_j\rangle ^2\right] ^{1/2}\right\} ^2. \end{aligned} \end{aligned}$$

Thus

$$\begin{aligned} \begin{aligned} \sum _{j=N}^{+\infty }\langle g,v_j\rangle ^2+\langle g,u_j\rangle ^2\ge (\tau -1)^2\delta _g^2. \end{aligned} \end{aligned}$$
(38)

As a consequence,

$$\begin{aligned} \begin{aligned} (\tau -1)^2\delta ^2\le \frac{1}{N^{2m}} \sum _{j=N}^{+\infty }j^{2m}[\langle g,v_j\rangle ^2+\langle g,u_j\rangle ^2]\le \frac{1}{N^{2m}} \Vert g^{(m)}\Vert _{L_2}^{2} \end{aligned} \end{aligned}$$

and hence

$$\begin{aligned} \begin{aligned} N^2\le \Vert g^{(m)}\Vert _{L_2}^{\frac{2}{m}}(\tau -1)^{\frac{-2}{m}}\delta _g^{\frac{-2}{m}}. \end{aligned} \end{aligned}$$
(39)

Due to (39) and (37), we get

$$\begin{aligned} \begin{aligned} \Vert \xi ^N-\xi _\delta ^N\Vert _{L_2}\le \Vert g^{(m)}\Vert _{L_2}^{\frac{1}{m}}(\tau -1)^{\frac{-1}{m}}\delta _g^{\frac{m-1}{m}}. \end{aligned} \end{aligned}$$
(40)

Finally, (30), (36) and (40) yield (29). \(\square \)

Error estimate (29) is essentially the same as that described by Zhao and Meng (2010), Theorem 3.1 and Corollary 3.2) obtained by applying classical regularization results to the first kind linear equation (5) with \({\bar{g}}_\delta (s)\), a perturbed version of the transformed right hand side \({\bar{g}}(s)\) defined in (7). The advantage of our method over the approach of Zhao and Meng lies in the fact that, neither the derivation of our estimate depends on such transformation, nor the construction of the regularized derivative depends on \(\bar{g}_\delta (s)\). In addition, note that, as already mentioned in the introduction, although this estimate can be seen as a particular case of general results reported in Nair et al. (2005) obtained from a general regularization method in Hilbert scales, it is important to emphasize that in our context the proof of such an estimate is simpler.

We proceed by observing that higher order differentiation can be approached similarly. Let \(T^{m}:H_{\mathrm{p}}^m(0,2\pi )\subset L_2(0,2\pi )\rightarrow L_2(0,2\pi )\) be the linear operator such that \(T^{m}(g) = g^{(m)}\). Then, as before, given \(g\in H^{m}_\mathrm{p}(0,2\pi )\), the goal is to find \(\xi \in L_2(0,2\pi )\) such that

$$\begin{aligned} {g^{(m)}=\xi .} \end{aligned}$$
(41)

Straightforward calculations show that \({T^m}^{\dagger }\) has singular values with double multiplicity, \(\eta _j^{m}=j^{-m}\), and associated singular functions given by \(\{v_j,(-1)^{\frac{m+1}{2}}u_j\},\; \{ u_j,(-1)^{\frac{m-1}{2}}v_j\}\) for odd m and \(\{(-1)^{\frac{m}{2}}u_j,u_j\},\; \{(-1)^{\frac{m}{2}}v_j,v_j\}\) for even m. The implication of this is that a singular value expansion for \(\xi \) exists and that

$$\begin{aligned} \xi =T^{m}g=\left\{ \begin{array}{c}\displaystyle \sum _{j=1}^{\infty }(-1)^{\frac{m-1}{2}}\eta _j^{-m}[\langle g,v_j\rangle u_j-\langle g,u_j\rangle v_j],\quad m\; \text {odd},\\ \displaystyle \sum _{j=1}^{\infty }(-1)^{\frac{m}{2}}\eta _j^{-m}[\langle g,u_j\rangle u_j+\langle g,v_j\rangle v_j],\quad m\; \text {even}. \end{array}\right. \end{aligned}$$
(42)

Analogously,

$$\begin{aligned} \begin{aligned} {T^m}^{\dagger }(g^{(m)})=&{\widehat{g}}=\sum _{j=1}^{\infty }[\langle g,u_j\rangle u_j+ \langle g,v_j\rangle v_j],\\&=\left\{ \begin{array}{c} \displaystyle \sum _{j=1}^{\infty }(-1)^{\frac{m-1}{2}}j^{-m}[-\langle g^{(m)},v_j\rangle u_j+\langle g^{(m)},u_j\rangle v_j],\quad m\; \text {odd},\\ \displaystyle \sum _{j=1}^{\infty }(-1)^{\frac{m}{2}}j^{-m}[\langle g^{(m)},u_j\rangle u_j+\langle g^{(m)},v_j\rangle v_j],\quad m\; \text {even}. \end{array}\right. \end{aligned} \end{aligned}$$
(43)

For perturbed data \(g_\delta \in L_2(0,2\pi )\), the regularized approximate solution of (41) is given by

$$\begin{aligned} \xi _\delta ^{N}=\left\{ \begin{array}{c} \displaystyle \sum _{j=1}^{N}(-1)^{\frac{m-1}{2}}\eta _j^{-m}[\langle g_\delta ,v_j\rangle u_j-\langle g_\delta ,u_j\rangle v_j],\quad m\; \text {odd},\\ \displaystyle \sum _{j=1}^{N}(-1)^{\frac{m}{2}}\eta _j^{-m}[\langle g_\delta ,u_j\rangle u_j+\langle g_\delta ,v_j \rangle v_j],\quad m\; \text {even}, \end{array}\right. \end{aligned}$$
(44)

where \(N\in {\mathbb {N}}\). As in (26), being \(\tau >1\) arbitrary, we choose \(N\in {\mathbb {N}}\) such that

$$\begin{aligned} N=\inf \{k\in {\mathbb {N}};\; \Vert {T^m}^{\dagger }\xi _\delta ^{k}-{\widehat{g}}_\delta \Vert _{L_2}\le \tau \delta _g\}. \end{aligned}$$
(45)

Arguing as in the proof of Theorem 2.1, the error in the approximation to \(g^{(m)} \) obtained by the truncated Fourier series technique can be bounded as follows.

Theorem 2.2

Assume that \(g\in H^{m}_{\mathrm{p}}(0,2\pi )\) for \(m>1\) and let \(g_\delta \in L_2(0,2\pi )\) such that (23) holds. Then, being \(\xi _\delta ^N\) given by (44), \(\tau >1\) and \(N\in {\mathbb {N}}\) satisfying (45), we have the estimate

$$\begin{aligned} \Vert \xi -\xi _\delta ^N\Vert _{L_2}\le C_\tau \Vert g^{(m)}\Vert _{L_2}^{\frac{\ell }{m}}\delta _g^{\frac{m-\ell }{m}}, \end{aligned}$$
(46)

where \(\xi =g^{(\ell )}\) and \(C_\tau =(\tau +1)^{\frac{m-\ell }{m}}+(\tau -1)^{\frac{-\ell }{m}}\), for \( \ell =1,\dots , m\).

Estimate (46) suggests that high-order derivatives are more sensitive to noise than first-order derivatives.

3 Filtered spectral differentiation matrix method

In general, because we only have discrete data rather than continuous functions, inner products \(\langle g_\delta , v_j\rangle \), \(\langle g_\delta , u_j\rangle \), can not be calculated exactly, so the expected performance of the truncation method may not be achieved. The simplest way to overcome this inconvenient is to consider the truncation method in a finite dimensional setting in which inner products are readily computed using the available data. To see how this is done, from here on we assume that the data are of the form \({\tilde{g}}_j=g_j+\epsilon _j\), \(j =0,1, \dots , N\), where \(\epsilon _j\) stands for random errors, \(g_j =g(x_j)\), g is a 2\(\pi \)-periodic real valued function and \(x_j\) are uniformly spaced grid points on \([0,2\pi ]\) defined by

$$\begin{aligned} x_j = 2\pi j/N, \; j=0, 1, \ldots , N. \quad \end{aligned}$$
(47)

Assume for the moment that the data are noise free. The main idea behind the truncation method in a finite setting is that accurate approximations to derivative values \(g^{(m)}(x_j)\) can be constructed by means of matrix–vector products involving the so-called spectral differentiation matrix and the vector of data values. To generate such a matrix, first a trigonometric polynomial that interpolates the data is constructed and then the derivatives of the interpolant at the grid points are taken as approximations to \(g^{(m)}(x_j)\); the differentiation matrix then arises as this is a linear operation. For completeness, and mainly for purposes of motivation, to know more about the differentiation matrix we will show how it is generated. For this purpose, we follow  (Trefethen 2000, Chapter 3) and assume that \(N=2n\) for some positive integer n. Then the trigonometric interpolant can be expressed as

$$\begin{aligned} q(x) = \frac{1}{2\pi }\left[ \sum _{k=-n+1}^{n-1}{\hat{g}}_k e^{{\mathrm{i}} kx} + \frac{1}{2}{\hat{g}}_n(e^{{\mathrm{i}} nx}+ e^{-{\mathrm{i}} nx})\right] , \end{aligned}$$
(48)

where \({\hat{g}}_k\) are discrete Fourier coefficients of \(g_j\), \(j=1,\ldots N\), with \({\hat{g}}_0\) and \({\hat{g}}_n\) real and \(\hat{g}_{-k}\), \({\hat{g}}_{k}\) (\(k=1,\ldots ,n-1\)) complex conjugate as the \(g_j\)s are real. With the interpolant at hand, since \(e^{{\mathrm{i}} nx_j} = e^{-{\mathrm{i}} nx_j}\) as the derivative of \(\left( e^{{\mathrm{i}} nx}+e^{-{\mathrm{i}} nx}\right) \) vanishes at the grid points, it follows from (48) that

$$\begin{aligned} \begin{array}{rl} q^{(\ell )}(x_j)=&{} {\displaystyle \frac{1}{2\pi }}\left[ {\displaystyle \sum _{k=-n+1}^{n-1}} {\hat{g}}_k ({\mathrm{i}} k)^\ell e^{{\mathrm{i}} kx_j} + {\hat{g}}_n ({\mathrm{i}} n)^\ell \left[ \frac{1+(-1)^\ell }{2}\right] e^{{\mathrm{i}} nx_j}\right] ,\\ =&{} {\displaystyle \frac{1}{2\pi }}\left[ [-{\mathrm{i}}(n-1)]^\ell e^{-\mathrm{i}(n-1)x_j},\dots , (-{\mathrm{i}})^\ell e^{-{\mathrm{i}}x_j}, ({\mathrm{i}} 0)^\ell e^{{\mathrm{i}}0x_j}, ({\mathrm{i}})^\ell e^{x_j}, \dots , ({\mathrm{i}} n)^p\left[ \frac{1+(-1)^\ell }{2} \right] e^{{\mathrm{i}} n x_j}\right] \\ &{} \times \left[ \begin{array}{c} {\hat{g}}_{-n+1}\\ \vdots \\ {\hat{g}}_{n} \end{array}\right] . \end{array} \end{aligned}$$

In matrix form, the \(\ell \hbox {th}\) derivative of the interpolant at the grid points can be written as

$$\begin{aligned} \left[ \begin{array}{c} q^{(\ell )}(x_1) \\ q^{(\ell )}(x_2) \\ \vdots \\ q^{(\ell )}(x_{N}) \end{array}\right] = {{{\mathcal {F}}}}^* \varOmega ^{(\ell )} {{{\mathcal {F}}}} \left[ \begin{array}{c} g_1\\ g_2\\ \vdots \\ g_{N}\\ \end{array} \right] , \end{aligned}$$
(49)

where \({{{\mathcal {F}}}}\) denotes the \(N\times N\) Fourier matrix, \({}^*\) denotes complex conjugate transpose and \(\varOmega ^{(\ell )}\) is a diagonal matrix defined by

$$\begin{aligned} \varOmega ^{(\ell )} = {\mathrm{diag}}\left( [-{\mathrm{i}}(n-1)]^\ell ,\dots , (-{\mathrm{i}})^\ell , 0, ({\mathrm{i}})^\ell , ({\mathrm{i}}2)^\ell , \dots ,[\mathrm{i}(n-1)]^\ell , ({\mathrm{i}} n)^\ell \frac{1+(-1)^\ell }{2} \right) . \end{aligned}$$
(50)

The \(\ell \hbox {th}\)-order differentiation matrix is defined as \(D^{(\ell )} = {{{\mathcal {F}}}}^* \varOmega ^{(\ell )} {{{\mathcal {F}}}}\). The important conclusion here is that if g is smooth enough, then the interpolant q(x) is a very accurate approximation of g, and a similar conclusion applies to the derivatives \(q^{(\ell )}(x_j)\) compared to \(g^{(\ell )}(x_j)\), see, e.g., (Gustafsson et al. 1995, Chapter 1).

Based on the factorization above, the following properties hold.

Theorem 3.1

For positive integer \(N=2n\), the spectrum of the \(\ell \)-order differentiation matrix \(D^{(\ell )}\) enjoy the following properties:

  1. 1.

    If \(\ell \) is odd, \(D^{(\ell )}\) is skew-symmetric with eigenvalues 0,  \([(\pm {\mathrm{i}})k]^\ell \) for \(k=1,\dots n-1\), 0 being an eigenvalue with double multiplicity and with eigenvectors formed by grid values of the functions 1 and \(\cos nx.\) Eigenvectors associated to the remaining eigenvalues are columns vectors of matrix \({{{\mathcal {F}}}}^*\).

  2. 2.

    If \(\ell \) is even, \(D^{(\ell )}\) is symmetric with eigenvalues \((-1)^{\ell /2}\times [0, 1^\ell ,2^\ell ,\dots ,n^\ell ]\), the extreme eigenvalues being simple and the remaining having double multiplicity. Eigenvectors, on the other hand, are formed by grid values of the functions \(1, \cos x, \sin x,\dots , \cos (n-1)x\), \(\sin (n-1)x\), \(\cos nx\).

Part of the results of Theorem. 3.1 is stated without proof in an unpublished textbook by Trefethen (Trefethen 1996, Theorem 7.2). The skew-symmetric property of \(D^{(1)})\) and its spectral properties are also quoted in (Gustafsson et al. 1995, Chapter 1). Here a complete description of spectral properties of \(D^{(\ell )}\) is provided together with its singular value decomposition (SVD). Indeed, since \(D^{(\ell )}\) is normal, if p is even, it follows from item ii) that \({\textsf {D}}^{(\ell )}\) has singular values \(\sigma _i\), sorted in non-decreasing order, \(\sigma _1=0, \sigma _2=\sigma _3 = 1^\ell , \ldots ,\sigma _{N-2}=\sigma _{N-1} = (n-1)^p,\; \sigma _N= n^\ell \), and right singular vectors formed by grid values of functions \(1,\,\cos x, \sin x,\) \(\cos (n-1)x, \sin (n-1)x,\dots ,\) \(\cos (nx)\). A similar conclusion follows from item i) for odd \(\ell \). With the assumption that singular values are ordered as before, let \(D^{(\ell )}\) have a SVD

$$\begin{aligned} {\textsf {D}}^{(\ell )}={\textsf {U}}{{{\mathsf{\Sigma }}}}{\textsf {V}}^\mathrm{T}, \end{aligned}$$
(51)

where \({\textsf {U}} = [{\textsf {u}}_1,\dots , {\textsf {u}}_N]\) and \({\textsf {V}} = [{\textsf {v}}_1,\dots , {\textsf {v}}_N]\) are orthogonal \(N\times N\) matrices, and \({{{\mathsf{\Sigma }}}} = {\mathrm{diag}}(\sigma _1,\dots ,\sigma _N)\) is a diagonal matrix of singular values of \(D^{(\ell )}\). Then, if the noise-free data are arranged in a vector \({\textsf {g}}\in {\mathbb {R}}^N\), the vector of \(\ell \)th spectral derivatives of g at the grid points \(x_j\), which we denote here by \({\textsf {q}}^\ell \), can be expressed as

$$\begin{aligned} {\textsf {q}}^{\ell }\doteq {\textsf {D}}^{(\ell )} {\textsf {g}} = \sum _{i =1}^N\sigma _i\left( {\textsf {v}}_i^T{\textsf {g}}\right) {\textsf {u}}_i. \end{aligned}$$
(52)

In particular, for even \(\ell \), pointwise spectral derivative values at \(x_j\) become

$$\begin{aligned} q^{(\ell )}(x_j) = \sum _{i=1}^{n-1} i^{\ell }\left[ ({\textsf {v}}_{2i}^\mathrm{T}{\textsf {g}}){\textsf {a}}_{i}\cos (ix_j)+ ({\textsf {v}}_{2i+1}^\mathrm{T} {\textsf {g}} ){\textsf {b}}_i\sin (ix_j)\right] + i^n {\textsf {a}}_n\cos (nx_j), \end{aligned}$$
(53)

where \({\textsf {a}}_i\) and \({\textsf {b}}_i\) are suitable scaling factors. A similar expression can be written for odd \(\ell \). A remark to be made here is that, for noise-free data, point spectral derivatives described in (53) are essentially point values \(\xi ^N(s_j)\) where \(\xi ^N\) is as in (25) with g instead of \(g_\delta \) and where each term of \(\xi ^N\) involves point derivative values of the Fourier basis. A similar procedure that computes point derivative values from discrete noisy data by evaluating the derivative of partial sums of Fourier–Legendre Expansions can be found in Mhaskar et al. (2013). The difference of these approaches is that the derivative of Legendre polynomials is not as easy to calculate as the derivative of trigonometric polynomials.

Yet with respect to Eq. (53), note that, except for the Fourier coefficients \(\langle g,v_j\rangle \), \(\langle g,u_j\rangle \) in (42), which are replaced here by discrete coefficients, the most important features of the first N terms of the singular value expansion of \(g^{(m)}\) in (42), namely, the “continuous” singular values \({\eta _i}^m\) and corresponding singular functions, \(\{\cos (ix),\;\sin (ix)\}\), are preserved in the finite setting. This explains, to some extent, why spectral derivatives are highly accurate. Note also that small singular values correspond to low-frequency eigenmodes whereas larger singular values correspond to high-frequency eigenmodes. Based on this observation, the main difficulty in numerical differentiation from noisy data becomes clear when computing spectral derivatives using the SVD of \({\textsf {D}}^{(\ell )}\). Indeed, if the available data are arranged in vector form as \(\widetilde{\textsf {g}}= {\textsf {g}}+\varepsilon \in {\mathbb {R}}^N\), and the vector of pointwise \(\ell \)th derivatives of g is denoted by \({\textsf {g}}^{\ell }\), i.e., \( {\textsf {g}}^{\ell }= [g^{(\ell )}(x_1),\ldots , g^{(\ell )}(x_N)]^T\), then in general \({\textsf {D}}^{(\ell )}\widetilde{\textsf {g}} \) will be very different from \({\textsf {g}}^{\ell }\). Of course, since

$$\begin{aligned} {\textsf {D}}^{(\ell )}\widetilde{\textsf {g}} = \sum _{i =1}^N\sigma _i\left( {\textsf {v}}_i^\mathrm{T}\widetilde{\textsf {g}}\right) {\textsf {u}}_i = \sum _{i =1}^N\sigma _i\left( {\textsf {v}}_i^\mathrm{T}{\textsf {g}}\right) {\textsf {u}}_i + \sum _{i =1}^N\sigma _i\left( {\textsf {v}}_i^\mathrm{T} \varepsilon \right) {\textsf {u}}_i, \end{aligned}$$
(54)

it is clear that the second sum on the right equality (contribution of noise) will dominate the final result when the condition \(\sigma _i|{\textsf {v}}_i^\mathrm{T} \varepsilon |>>1\) holds for some i, in which case the \(\ell \hbox {th}\) spectral derivative \({\textsf {D}}^{(\ell )}\widetilde{\textsf {g}} \) will not be a good approximation to the desired derivative \({\textsf {g}}^{\ell }\). Indeed, because the magnitude of the coefficients \({\textsf {v}}_i^\mathrm{T} \varepsilon \) is approximately constant when the noise is random, and because singular values \(\sigma _{2i}\) grow as \( i^\ell \), high-frequency components should start dominating the result very soon. Hence, to mitigate the contribution of these components, the sum should be truncated accordingly.

Our proposal is to filter out high-frequency components of \({\textsf {D}}^{(\ell )}\widetilde{\textsf {g}}\) by truncating the sum (54) to \(k\le N\) terms (or equivalently by computing a matrix–vector product involving a low rank approximation of \({\textsf {D}}^{(\ell )}\) and the vector of data values \(\widetilde{\textsf {g}}\)), giving rise to kth truncated \(\ell \)th spectral derivatives defined by

$$\begin{aligned} {\textsf {g}}_{\delta }^{\ell ,k} = \sum _{i =1}^k\sigma _i\left( {\textsf {v}}_i^\mathrm{T}\widetilde{\textsf {g}}\right) {\textsf {u}}_i. \end{aligned}$$
(55)

A particularly attractive feature of the proposed method (henceforth referred to as FDMA), is that its implementation does not require any effective computation of the SVD of the Fourier differentiation matrix. Indeed, since the truncated spectral derivatives involve quantities that depend on singular vectors \({\textsf {u}}_i,\; {\textsf {v}}_i\), such SVD is not required as the entries of the singular vector are point values of the Fourier basis. Three kth truncated second-order spectral derivatives displayed in Fig. 1 show that while small values of k oversmooth the computed derivative, larger ones yield the opposite effect, therefore the challenge is how to choose a proper truncation parameter.

Fig. 1
figure 1

Truncated second-order derivatives using noisy data such that \(\widetilde{\textsf {g}} = {\textsf {g}}+ 0.01\Vert {\textsf {g}}\Vert _2\). Exact data are generated by sampling the periodic function \(g(x) = e^{\sin (x)}\)

3.1 Error estimate

Our next step is to derive an error estimate to assess how accurate the \(k\hbox {th}\) truncated \(\ell \hbox {th}\) spectral derivative is when the truncation parameter is chosen by the discrepancy principle (DP). Proceeding similarly as in the Sobolev space setting, we notice that if (54) is regarded as the inverse solution of the problem \(B s = \widetilde{\textsf {g}}\) com \(B = {{\textsf {D}}^{(\ell )}}^\dag \) (see (20) and (27)), then the residual and solution norms associated to \({\textsf {g}}_\delta ^{\ell ,k}\) are given by

$$\begin{aligned} \Vert {\textsf {R}}_k\Vert _2^2 = \sum _{i = k+1}^N \left( {\textsf {v}}_i^\mathrm{T}\widetilde{\textsf {g}}\right) ^2, \quad {\mathrm{and}}\;\; \Vert {\textsf {g}}_\delta ^{l,k}\Vert _2^2 = \sum _{i = 1}^k\sigma _i^2\left( {\textsf {v}}_i^\mathrm{T}\widetilde{\textsf {g}} \right) ^2. \end{aligned}$$
(56)

Thus, similar to (45), for chosen \(\tau >1\), the truncation parameter chosen by the discrepancy principle is defined by

$$\begin{aligned} {\widehat{k}}=\inf \{k;\,\Vert {\textsf {R}}_k\Vert _2\le \tau \delta ,\; k=1,\dots , N\}, \end{aligned}$$
(57)

where the data \(\widetilde{\textsf {g}}\) satisfy

$$\begin{aligned} \Vert \widetilde{\textsf {g}} -{\textsf {g}}\Vert _2\le \delta . \end{aligned}$$
(58)

Our error estimate is stated as follows.

Theorem 3.2

Let \({\textsf {g}}_\delta ^{\ell ,{\widehat{k}}}\) be the \({\widehat{k}}\)th truncated \(\ell \)th spectral derivative introduced in (55) with the truncation parameter \({\widehat{k}}\) being chosen by the discrepancy principle (57). Assume that \(g\in H^{m}_{\mathrm{p}}(0,2\pi )\). Then, there exist positive constants C and \(C_\tau \) such that

$$\begin{aligned} \Vert {\textsf {g}}^{\ell }- {\textsf {g}}_{\delta }^{\ell ,{\widehat{k}}}\Vert _2 \le C N^{l+\frac{1}{2}-m}\Vert g^{(m)}\Vert _{L_2} + C_\tau \Vert {\textsf {q}}^{m}\Vert _{2}^{\frac{\ell }{m}}\delta ^{\frac{m-\ell }{m}},\quad \ell =1,2,\ldots ,m. \end{aligned}$$
(59)

Proof

Using the triangular inequality the actual error, \(\Vert {\textsf {g}}^{\ell }- {\textsf {g}}_{\delta }^{\ell ,{\widehat{k}}}\Vert _2\), can be bounded as the sum of the interpolation error, \(I_\mathrm{E}\), plus the error due to the truncation method, \(R_\mathrm{E}\),

$$\begin{aligned} \Vert {\textsf {g}}^{\ell }- {\textsf {g}}_{\delta }^{\ell ,{\widehat{k}}}\Vert _2\le \Vert {\textsf {g}}^{\ell }- {\textsf {q}}^\ell \Vert _2+\Vert {\textsf {q}}^\ell - {\textsf {g}}_{\delta }^{\ell ,{\widehat{k}}}\Vert _2. \end{aligned}$$
(60)

These two errors can be readily estimated based on existing theory and previous results. Indeed, to bound the first term on the right we can use an estimate for the interpolation error (Canuto et al. 1988, p 80) which relates the discrete error 2-norm \(\Vert {\textsf {g}}^{\ell }- {\textsf {q}}^\ell \Vert _2\) to the error \(L_2\)-norm \(\Vert g^{(m)}-q^{(\ell )}\Vert _{L_2}\) so that

$$\begin{aligned} \Vert {\textsf {g}}^{\ell }- {\textsf {q}}^\ell \Vert _2\le C N^{l+\frac{1}{2}-m}\Vert g^{(m)}\Vert _{L_2}, \end{aligned}$$
(61)

where C is a positive constant which does not depend on N. As for the second term on the right of (60), we can proceed as in the proof of Theorem 2.1 to deduce that, for \(g\in H^{m}_{\mathrm{p}}(0,2\pi )\), \(m\in {\mathbb {N}}\), there holds

$$\begin{aligned} \Vert {\textsf {q}}^{\ell }-{\textsf {g}}_{\delta }^{\ell ,{\widehat{k}}}\Vert _2\le C_\tau \Vert {\textsf {q}}^{m}\Vert _{2}^{\frac{\ell }{m}}\delta ^{\frac{m-\ell }{m}}, \;\ell =1,2,\ldots ,m, \end{aligned}$$
(62)

where \(C_\tau =(\tau +1)^{\frac{m-\ell }{m}}+(\tau -1)^{-\frac{\ell }{m}}\), and the proof follows. \(\square \)

Remark 3.1

A particularly important consequence of the above error analysis is that if the error estimate (59) is alternatively written as

$$\begin{aligned} \Vert {\textsf {g}}^{\ell }- {\textsf {g}}_{\delta }^{\ell ,{\widehat{k}}}\Vert _2 = O(h^{m-l-\frac{1}{2}}) + O\left( \delta ^{\frac{m-\ell }{m}}\right) , \end{aligned}$$
(63)

where \(h=2\pi /N\), and if g is sufficiently smooth and N not so small, then the interpolation error is negligible and the actual error is dominated by the error due to the truncation method; that is, in these conditions, the actual error becomes \(O(\delta ^{\frac{m-\ell }{m}})\), which coincides with the error estimate obtained by means of the truncated Fourier series technique in the Sobolev space setting. Numerical results which illustrate this observation are found in the next section. Pointwise error estimates can also be derived from a more general approach based on the so-called summability methods. For an example where the summability method involves partial sums of Fourier–Legendre series and where the truncation parameter is chosen adaptively, see  (Mhaskar et al. 2013).

3.2 Numerical examples

In this section, we describe numerical results obtained by applying FDMA to two test problems taken from Zhao and Meng (2010). The purpose here is to compare the accuracy of our results with that obtained by the truncated Fourier series technique, as described by Zhao and Meng (2010). In both cases we consider \(N=256\) data values,

$$\begin{aligned} {\widetilde{g}}(x_j) = g(x_j)+\epsilon _j, \; |\epsilon _j|<\delta _1, \end{aligned}$$
(64)

where \(x_j\) are uniformly spaced grid points in \([0,2\pi ]\) and \(\epsilon _j\) are uniformly distributed random numbers defined in Matlab as \((2{\mathrm{rand}}(N,1)-1)\delta _1\). In both examples the error norm \(\delta \) is used as input data and the discrepancy principle is implemented with \(\tau = 1.01\).

We will report average relative errors, \(\Vert {\textsf {g}}^{\ell }- {\textsf {g}}_{\delta }^{\ell ,{\widehat{k}}}\Vert _2/ \Vert {\textsf {g}}^{\ell } \Vert _2 \), of 20 realizations for 4 noise levels, as well as the maximum truncation parameter of all realizations which we denote here by \(k_m\).

Example 1

We consider two closely related functions, namely a periodic cubic spline s(x) that interpolates \(g(x) = e^{\cos x}\), \(0\le x\le 2\pi \), i.e, the cubic spline satisfying

$$\begin{aligned} s(0) = s(2\pi ),\;\; s'(0) = s'(2\pi ), \;\; s''(0)= s''(2\pi ), \end{aligned}$$

and the function g itself. The cubic spline used in this experiment has 13 uniformly spaced interpolation knots \({\bar{x}}_j = j{\bar{h}}, \; j=0,\dots ,12\), with \({\bar{h}} = 2\pi /12\), as seen in Fig. 2 (left).

Fig. 2
figure 2

Periodic cubic spline s(x) that interpolates \(g(x) = e^{\cos (x)}\), \(0\le x\le 2\pi \), and derivatives

We consider the numerical differentiation problem for s and g separately in order to illustrate the impact of the periodicity property of these functions on the quality of the results. Notice that s(x) has periodic derivatives up to second order, which means \(s\in H^{3}_p(0,2\pi )\), while g has periodic derivatives of all orders. Hence, the \(L_2\)-norm interpolation error for first -order differentiation becomes \(O(h^2)=O( 4\pi ^2/256^2)\approx 6\times 10^{-4}\) for s(x) and negligible for g(x), as seen in Fig. 3 (first column); second and third columns show that the actual error is dominated by the error due to the truncation method, thus confirming what has been claimed in Remark 3.1.

Fig. 3
figure 3

Interpolation error, error due to the truncation method, and actual error, all associated to the first-order numerical differentiation problem for s(x) (first row) and g(x) (second row). The results correspond to \(\delta _1 =0.0001.\)

Another implication of the regularity properties mentioned above is that for first-order differentiation, the convergence rates of the Fourier series truncation method are \(O(\delta ^{2/3})\) for s(x) and \(O(\delta )\) for g(x), while for second-order differentiation, the convergence rates of the Fourier series truncation method are \(O(\delta ^{1/3})\) for s(x) and \(O(\delta )\) for g(x). This indicates that the numerical differentiation problem associated to g(x) is less sensitive to noise than the numerical differentiation problem associated to s(x); numerical results regarding approximations to first and second-order derivatives which verify this observation are displayed in columns 3, 5, 7 and 9 of Table 1. Indeed, except for the higher noise levels for which the results are very similar, the quality of the results associated to g(x) are significantly better than those associated to s(x). Numerical results regarding approximations to third-order derivative for g(x) are displayed in columns 10 and 11. Results associated to the highest noise level are displayed in Fig. 4.

The numerical results for function g(x) shown in Table 1, as well as in Tables 1 and 3 of Zhao and Meng (2010), show that the accuracy obtained by the discrete differentiation method is essentially the same as that obtained by the method of Zhao and Meng in a Sobolev space setting.

Table 1 Average relative errors of numerical derivatives of functions s(x) and g(x)
Fig. 4
figure 4

First- and second-order derivatives of periodic cubic spline s(x) and \(g(x)= {\mathrm{e}}^{\cos (x)}\), \(0\le x\le 2\pi \), as well as the associated truncated first- and second-order derivatives. The results correspond to the first run for \(\delta _1 = 0.1\)

Example 2

We consider the periodic extension of the function

$$\begin{aligned} \displaystyle g(x) = e^{4 - \frac{4\pi ^2}{x(2\pi -x)}},\;\; 0\le x\le 2\pi , \end{aligned}$$

to all \({\mathbb {R}}\). The derivatives of g satisfy \(g^{(k)}(0) = g^{(k)}(2\pi ) = 0\), \(k=0,1,\dots , \) therefore the function g has all regularity we need to ensure that the actual error of the Fourier series truncation method is \(O(\delta )\). Numerical results corresponding to first-, second-, and third-order differentiation are shown in Table 2 and Fig. 5. Numbers in column 3 and those of Table 4 in Zhao and Meng (2010) show that the results obtained by both methods are very similar.

Table 2 Average relative errors in numerical derivatives for function g(x) of Example 2
Fig. 5
figure 5

First-, second- and third-order derivatives of function g as well as the corresponding truncated derivatives. The data correspond to the first run for \(\delta _1 = 0.1\)

4 Heat flux estimation in coiled tubes

We consider an inverse heat conduction problem (IHCP) defined in a selected cross-section of a coiled tube, shown schematically in Fig. 6, under the laminar flow regime as done by Bozzoli et al. (2014), and the assumption that the temperature T satisfies the 2D heat conduction problem in polar coordinates \(({\textsf {r}},\theta )\) described by

$$\begin{aligned}&\lambda _w\frac{1}{{\textsf {r}}}\frac{\partial }{\partial {{\textsf {r}}}}\left( {{\textsf {r}}}\frac{\partial T}{\partial {{\textsf {r}}}}\right) + \lambda _w\dfrac{1}{{{\textsf {r}}}^2}\dfrac{\partial ^2 T}{\partial \theta ^2}+q_g=0,\;\; 0<{{\textsf {r}}}_{_{ \text{ I }}}< {{\textsf {r}}}< {{\textsf {r}}}_{_{ \text{ E }}}, \; 0\le \theta \le 2\pi , \end{aligned}$$
(65)
$$\begin{aligned}&\lambda _w\frac{\partial T}{\partial {{\textsf {r}}}}({{\textsf {r}}}_{_{ \text{ E }}},\theta )= \alpha (T_{\mathrm{env}}-T({{\textsf {r}}}_{_{ \text{ E }}},\theta )),\; 0\le \theta \le 2\pi , \end{aligned}$$
(66)
$$\begin{aligned}&\quad -\lambda _w\frac{\partial T}{\partial {{\textsf {r}}}}({{\textsf {r}}}_{_{ \text{ I }}},\theta )= Q(\theta ), \; \; 0\le \theta \le 2\pi . \end{aligned}$$
(67)

Physically, \(q_g\) denotes the uniform heat generated by the Joule effect in the wall, \({\textsf {r}}_{_{ \text{ I }}}, {\textsf {r}}_{_{ \text{ E }}}\) denote the internal and external radius of the cross section of the tube, respectively, \(\lambda _\mathrm{w}\) denotes the wall thermal conductivity, \(\alpha \) denotes the reciprocal of the overall heat transfer resistance between the tube wall and the surrounding environment with temperature \(T_{\mathrm{env}}\), and \(Q(\theta )\) denotes the heat-flux distribution at the fluid–internal wall interface.

Fig. 6
figure 6

Geometrical domain

The inverse problem consists in estimating the heat-flux distribution \(Q(\theta )\) from measured temperature values as input data: \({\widetilde{T}}_j = T({\textsf {r}}_{_{ \text{ E }}},\theta _j) + \varepsilon _j\), \(j=1,\dots , M\), where T is assumed to match (65)–(67) and \(\varepsilon _j\) denotes random noise. Given that the solution to the forward problem (65)–(67) depends on Q, a widely used approach consists in estimating a vector of parameters \(\mathbf{Q}\) by requiring that the difference between the temperatures \(T_j(\mathbf{Q})\) and temperatures experimentally measured \({\widetilde{T}}_j\) on the outer wall of the tube is minimized in some sense (Bozzoli et al. 2014). Formally, letting \(\mathbf{Q}^* = [Q_1^*,\dots , Q_M^*]^t\), \(Q_j^*\doteq Q(\theta _j)\), the approach consists in determining an estimate \(\widetilde{\mathbf{Q}}\) for \(\mathbf{Q}^*\) by solving the least squares problem

$$\begin{aligned} \widetilde{\mathbf{Q}} = \arg \min _{\mathbf{Q}\in {\mathbb {R}}^{M}}{ = \dfrac{1}{2} \Vert \mathbf{T}(\mathbf{Q})- \widetilde{\mathbf{T}}\Vert _2^2} = \arg \min _{\mathbf{Q}\in {\mathbb {R}}^{M}}{ \dfrac{1}{2}\sum _{j=1}^M (T_j(\mathbf{Q})-{\widetilde{T}}_j )^2,} \end{aligned}$$
(68)

where \(\mathbf{Q}\) is the vector of unknowns and \( \mathbf{T}(\mathbf{Q}) = [ T_1(\mathbf{Q}), \dots ,T_M(\mathbf{Q})]^t\) is the vector of computed temperatures values satisfying (65)–(67) at \(r={\textsf {r}}_{_{ \text{ E }}}\). Proceeding in this way, it can be readily seen that the estimate \(\widetilde{\mathbf{Q}}\) solves a linear least squares problem with coefficient matrix \(\mathbf{J}\) and right hand side \(\mathbf{T}(0)- \widetilde{\mathbf{T}}\) (Bozzoli et al. 2014), where \(\mathbf{J}\) is the so-called sensitivity matrix and \(\mathbf{T}(0)\) is the solution to (65)–(67) constrained to \(Q=0\). Although the cost of computing the matrix J can become expensive, as we need to solve M forward problems, the approach has been shown to be effective in a number of practical applications (Bozzoli et al. 2015; Sovari and Malinen 2007).

The purpose of this section is to show that the optimization approach described above can be circumvented as far as the thickness tube wall is small and the numerical differentiation problem is solved in a stable way. Indeed, when a thin wall pipe configuration is assumed to hold, which means \({\textsf {r}}_{_{ \text{ I }}}\approx {\textsf {r}}_{_{ \text{ E }}} \), the heat-flux distribution can be estimated by differentiating the temperature distribution at the external tube wall as it can be explained shortly. Integrating (65) in \([{\textsf {r}}_{_{ \text{ I }}},{\textsf {r}}_{_{ \text{ E }}}]\) gives

$$\begin{aligned} { \lambda _w \left( {{\textsf {r}}}_{_{ \text{ E }}}\frac{\partial T}{\partial {{\textsf {r}}}}({{\textsf {r}}}_{_{ \text{ E }}},\theta )-{{\textsf {r}}}_{_{ \text{ I }}} \frac{\partial T}{\partial {{\textsf {r}}}}({{\textsf {r}}}_{_{ \text{ I }}},\theta )\right) =-\lambda _w\int _{{{\textsf {r}}}_{_{ \text{ I }}}}^{{{\textsf {r}}}_{_{ \text{ E }}}} \frac{1}{{\textsf {r}}}\frac{\partial ^2 T}{\partial \theta ^2}\mathrm{d}{{\textsf {r}}}- \left[ \frac{q_g{{\textsf {r}}}^2}{2}\right] _{{{\textsf {r}}}={{\textsf {r}}}_{_{ \text{ I }}}}^{{{\textsf {r}}}={{\textsf {r}}}_{_{ \text{ E }}}}.} \end{aligned}$$
(69)

Since \(1/{\textsf {r}}\) does not change sign in the interval \([{\textsf {r}}_{_{ \text{ I }}},{\textsf {r}}_{_{ \text{ E }}}]\), the weighted mean value theorem for integrals ensures that there exists \({\hat{r}}\) in \([{\textsf {r}}_{_{ \text{ I }}},{\textsf {r}}_{_{ \text{ E }}}]\) such that

$$\begin{aligned} \int _{{{\textsf {r}}}_{_{ \text{ I }}}}^{{{\textsf {r}}}_{_{ \text{ E }}}} \frac{1}{{\textsf {r}}}\frac{\partial ^2 T}{\partial \theta ^2}\mathrm{d}{{\textsf {r}}}= \frac{\partial ^2 T}{\partial \theta ^2}({\hat{r}},\theta ) \int _{{{\textsf {r}}}_{_{ \text{ I }}}}^{{{\textsf {r}}}_{_{ \text{ E }}}} \frac{1}{{\textsf {r}}}\mathrm{d}{{\textsf {r}}}. \end{aligned}$$

Inserting this result into (69), the boundary conditions (66)–(67) can be used to yield

$$\begin{aligned} {\textsf {r}}_{_{ \text{ E }}}\alpha (T_{\mathrm{env}}-T({\textsf {r}}_{_{ \text{ E }}},\theta ))+{\textsf {r}}_{_{ \text{ I }}} Q(\theta ) = -\lambda _w\ln ({\textsf {r}}_{_{ \text{ E }}}/{\textsf {r}}_{_{ \text{ I }}})\frac{\partial ^2 T}{\partial \theta ^2}({\hat{r}},\theta ) -\frac{q_g({\textsf {r}}_{_{ \text{ E }}}^2-{\textsf {r}}_{_{ \text{ I }}}^2)}{2}. \end{aligned}$$
(70)

Thus

$$\begin{aligned} Q(\theta ) = -\dfrac{1}{{\textsf {r}}_{_{ \text{ I }}}}\left[ \lambda _w\ln ({\textsf {r}}_{_{ \text{ E }}}/{\textsf {r}}_{_{ \text{ I }}})\dfrac{\partial ^2T}{\partial \theta ^2}({\hat{r}},\theta )+\frac{q_g({\textsf {r}}_{_{ \text{ E }}}^2-{\textsf {r}}_{_{ \text{ I }}}^2)}{2}+ {\textsf {r}}_{_{ \text{ E }}}\alpha (T_{\mathrm{env}}-T({\textsf {r}}_{_{ \text{ E }}},\theta ))\right] . \end{aligned}$$
(71)

When \({\textsf {r}}_{_{ \text{ I }}}\approx {\textsf {r}}_{_{ \text{ E }}}\) it can be assumed that \(T({\textsf {r}}_{_{ \text{ I }}},\theta )\approx T({\textsf {r}}_{_{ \text{ E }}},\theta )\) and \(\dfrac{\partial ^2T}{\partial \theta ^2}({\hat{r}},\theta )\approx \dfrac{\partial ^2T}{\partial \theta ^2}({\textsf {r}}_{_{ \text{ E }}},\theta ),\) in which case the heat-flux distribution can be estimated as

$$\begin{aligned} Q(\theta ) \approx -\dfrac{1}{{\textsf {r}}_{_{ \text{ I }}}}\left[ \lambda _w\ln ({\textsf {r}}_{_{ \text{ E }}}/{\textsf {r}}_{_{ \text{ I }}})\dfrac{\partial ^2T}{\partial \theta ^2}({\textsf {r}}_{_{ \text{ E }}},\theta )+\frac{q_g({\textsf {r}}_{_{ \text{ E }}}^2-{\textsf {r}}_{_{ \text{ I }}}^2)}{2}+ {\textsf {r}}_{_{ \text{ E }}}\alpha \left( T_{\mathrm{env}}-T({\textsf {r}}_{_{ \text{ E }}},\theta )\right) \right] . \end{aligned}$$
(72)

We note in passing that estimate (72) has been derived differently by Bozzoli et al. Bozzoli et al. 2015, in which second-order derivatives are calculated after the data are preprocessed in order to filter out high-frequency signal components through a Gaussian filter.

Our estimation procedure can be summarized as follows:

  1. 1.

    From the available data \({\widetilde{T}}_j\), use FDMA with DP as truncation parameter choice rule to estimate the second-order derivative \(\dfrac{\partial ^2T}{\partial \theta ^2}({\textsf {r}}_{_{ \text{ E }}},\theta _j)\).

  2. 2.

    With the chosen regularization parameter \({{\widehat{k}}}\), compute filtered data by setting

    $$\begin{aligned} \left[ \begin{array}{c} {T}({\textsf {r}}_E,\theta _1)\\ \vdots \\ {T}({\textsf {r}}_E,\theta _M) \end{array} \right] \approx \sum _{k=1}^{{{\widehat{k}}}} ({\textsf {v}}_k^T\widetilde{\mathbf{T}}) {\textsf {v}}_k. \end{aligned}$$
    (73)
  3. 3.

    Based on the estimates determined at step 1 and step 2 compute \(Q(\theta _j)\) according to (72).

4.1 Heat flux estimation from synthetic data

To illustrate the three-steps procedure described above, we consider as solution of (65)–67) a temperature distribution of the form

$$\begin{aligned} T({\textsf {r}},\theta )=\dfrac{-q_g( {\textsf {r}}^2-{\textsf {r}}_{_{ \text{ E }}}^2)}{4\lambda _w}+A\ln (\dfrac{{\textsf {r}}}{{\textsf {r}}_{_{ \text{ E }}}}) -78\cos (\theta )\left( {\textsf {r}}+\frac{D}{{\textsf {r}}}\right) + 360, \end{aligned}$$
(74)

with

$$\begin{aligned} A=\dfrac{q_g{\textsf {r}}_{_{ \text{ E }}}^2}{2\lambda _w}+ \dfrac{{\textsf {r}}_{_{ \text{ E }}}}{\lambda _w} \alpha (T_{\mathrm{env}}-360), \quad D=\dfrac{{\textsf {r}}_{_{ \text{ E }}}^2(\lambda _w+\alpha {\textsf {r}}_{_{ \text{ E }}})}{\lambda _w-\alpha {\textsf {r}}_{_{ \text{ E }}}}, \end{aligned}$$
(75)

and model parameters as described in Table 3. This solution is chosen because it behaves similarly as experimental data reported in Bozzoli et al. (2014).

Table 3 Physical parameters

For the numerical simulation we take \(N=128\) temperature values at the external tube wall,

$$\begin{aligned} \widetilde{T}_j = {T}({\textsf {r}}_{\mathrm{E}},\theta _j) + \epsilon _j, \quad j=1,\ldots ,128 \end{aligned}$$
(76)

with \(\theta _j\) equally spaced on \([0,2\pi ]\) and where \(\epsilon _j\) are random numbers generated as in (64) and scaled such that \(\Vert \mathbf{T} - \widetilde{\mathbf{T}}\Vert _2/\Vert \mathbf{T}\Vert _2=10^{-2}\times \text {NL}\), where \(\mathbf{T}\) and \(\widetilde{\mathbf{T}}\) are vectors of clean and noisy data, respectively, and where NL stands for a prescribed noise level. Our goal is to illustrate the effectiveness of FDMA in recovering the heat flux distribution for several noise levels, concentrating on assessing the quality of inverse solutions as the tube thickness varies. For this, the heat flux distribution \(Q(\theta )\) will be estimated for three distinct values of \({\textsf {r}}_{_{ \text{ I }}}\), keeping the outer radius unchanged and fixed at \({\textsf {r}}_{_{ \text{ E }}}=0.015\). To assess the effectiveness of FDMA, average norm-wise relative errors, \(E_Q = \dfrac{\Vert \mathbf{Q}^{*}-\widetilde{\mathbf{Q}}\Vert _2}{\Vert \mathbf{Q}^*\Vert _2}\), of 20 realizations are computed. In all cases the noise level \(\delta = 10^{-2}\times {\mathrm{NL}}\Vert \mathbf{T}\Vert _2\) is used as input data and the discrepancy principle is implemented with \(\tau = 1.1\). Numerical results reported in Table 4 show that the reconstruction quality of the heat flux coefficient is remarkably good and rather independent of the inner radius. This observation is also illustrated with results obtained from the first realization for the lowest noise level in Fig. 7. Notice also that in all cases, the maximum truncation parameter in all realizations remains constant and equals \(k_m=3\).

Table 4 Average relative errors in the reconstructions of heat flux coefficient from synthetic data for distinct tube thickness values
Fig. 7
figure 7

Recovered heat flux distribution for three distinct tube thickness values

4.2 Heat flux estimation from experimental data

We now consider the heat flux estimation problem from experimental data acquired by Bozzoli et al. (2014). The data consist of 276 pointwise equality spaced temperature values acquired by a infrared camera on the exterior wall surface of a coiled tube. In this experimental investigation a stainless steel coiled tube was tested under the prescribed condition of uniform heating generated by Joule effect in the wall. The pipe under test consists of a helical profile composed by eight coils, the diameter and the pitch of the helix being approximately 310 mm and 200 mm, respectively, and the tube external diameter measuring 9 mm with a 1-mm wall thickness. The surface temperature distribution was acquired experimentally by means of a FLIR SC7000 infrared camera, with a \(640\times 512\) pixel detector array. Moving the infrared camera around the tube, different images of the test section were acquired: then, thanks to a position reference fixed on the tube wall, the different infrared images were conveniently cropped, processed by perspective algorithms and merged together in Matlab environment. With this data processing procedure, a temperature distribution on the tube wall versus the circumferential angular coordinate was obtained. Experimental data acquired by the infrared camera are displayed in Fig. 8.

Fig. 8
figure 8

Experimental data

The experimental investigation was carried out in laminar regime by using ethylene glycol as a working fluid. For further details about the experimental procedure the reader is referred to Bozzoli et al. (2014). Except for the inner and outer radii, the remaining system parameters are the same as in Table 3. Turning to the estimation procedure, as we know, for the discrepancy principle to work, the noise level \(\delta = \Vert \mathbf{T}-\widetilde{\mathbf{T}}\Vert _2\) has to be estimated. In this experimental investigation, such estimation was made by measuring the surface temperature distribution while maintaining the coil wall under isothermal conditions (Bozzoli et al. 2014), yielding \(\delta \approx 0.34\). As seen in Fig. 9 (right), the results agree well with those obtained in Bozzoli et al. (2014) through Tikhonov regularization supported by the fixed-point method of Bazán (2008), Bazán and Francisco (2009) as parameter choice rule, which are also displayed for comparison.

Fig. 9
figure 9

Filtered temperature data (left) and estimated heat flux distribution (right) both obtained by FDMA and Tikhonov regularization from experimental measurements

Filtered temperature data computed as \(\mathbf{T}_{\mathrm{filtered}} = \mathbf{T}(0)+ \mathbf{J}{} \mathbf{Q}(\cdot )\), where \(\mathbf{Q}(\cdot )\) stands for the heat flux distribution obtained by Tikhonov regularization, as well as filtered temperature data computed as described in (73) through FDMA, are compared to the experimental data in Fig. 9 (left). The results show that both reconstructed temperature distributions fit well the experimental data.

5 Conclusions

A numerical method for numerical differentiation of periodic functions from noisy sampled data has been proposed and illustrated by solving test problems taken from Zhao and Meng (2010), as well as a heat flux estimation problem based on experimental data. The method constructs stable pointwise approximations to high-order derivatives by filtering the high-frequency content of spectral derivatives. Formally, this is achieved by means of a matrix–vector product of a low rank approximation of the spectral Fourier differentiation matrix and the vector of data values, where the rank is determined by the discrepancy principle. Theoretical results show that the accuracy obtained with the proposed method coupled with discrepancy principle is essentially the same as that obtained by the truncated Fourier series approach in a Sobolev space framework.