The XFT Quadrature in Discrete Fourier Analysis

616 33 16MB

English Pages 245

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

The XFT Quadrature in Discrete Fourier Analysis

Citation preview

Applied and Numerical Harmonic Analysis

Rafael G. Campos

The XFT Quadrature in Discrete Fourier Analysis

Applied and Numerical Harmonic Analysis Series Editor John J. Benedetto University of Maryland College Park, MD, USA

Advisory Editors Akram Aldroubi Vanderbilt University Nashville, TN, USA

Gitta Kutyniok Technical University of Berlin Berlin, Germany

Douglas Cochran Arizona State University Phoenix, AZ, USA

Mauro Maggioni Johns Hopkins University Baltimore, MD, USA

Hans G. Feichtinger University of Vienna Vienna, Austria

Zuowei Shen National University of Singapore Singapore, Singapore

Christopher Heil Georgia Institute of Technology Atlanta, GA, USA

Thomas Strohmer University of California Davis, CA, USA

Stéphane Jaffard University of Paris XII Paris, France

Yang Wang Hong Kong University of Science & Technology Kowloon, Hong Kong

Jelena Kovaˇcevi´c Carnegie Mellon University Pittsburgh, PA, USA

More information about this series at http://www.springer.com/series/4968

Rafael G. Campos

The XFT Quadrature in Discrete Fourier Analysis

Rafael G. Campos Science Department University of Quintana Roo Chetumal, Mexico

ISSN 2296-5009 ISSN 2296-5017 (electronic) Applied and Numerical Harmonic Analysis ISBN 978-3-030-13422-8 ISBN 978-3-030-13423-5 (eBook) https://doi.org/10.1007/978-3-030-13423-5 Library of Congress Control Number: 2019934448 Mathematics Subject Classification (2010): 14K25, 26A33, 26A36, 33C45, 33C47, 33E05, 34A08, 35R11, 41A05, 41A55, 42A15, 42A38, 42A85, 42C10, 44A20, 44A35, 44A55, 65D25, 65D30, 65D32, 65L05, 65L20, 65R10, 65T40, 65T50 © Springer Nature Switzerland AG 2019 This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, express or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. This book is published under the imprint Birkhäuser, www.birkhauser-science.com by the registered company Springer Nature Switzerland AG. The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland

ANHA Series Preface

The Applied and Numerical Harmonic Analysis (ANHA) book series aims to provide the engineering, mathematical, and scientific communities with significant developments in harmonic analysis, ranging from abstract harmonic analysis to basic applications. The title of the series reflects the importance of applications and numerical implementation, but richness and relevance of applications and implementation depend fundamentally on the structure and depth of theoretical underpinnings. Thus, from our point of view, the interleaving of theory and applications and their creative symbiotic evolution is axiomatic. Harmonic analysis is a wellspring of ideas and applicability that has flourished, developed, and deepened over time within many disciplines and by means of creative cross-fertilization with diverse areas. The intricate and fundamental relationship between harmonic analysis and fields such as signal processing, partial differential equations (PDEs), and image processing is reflected in our state-of-theart ANHA series. Our vision of modern harmonic analysis includes mathematical areas such as wavelet theory, Banach algebras, classical Fourier analysis, time-frequency analysis, and fractal geometry, as well as the diverse topics that impinge on them. For example, wavelet theory can be considered an appropriate tool to deal with some basic problems in digital signal processing, speech and image processing, geophysics, pattern recognition, biomedical engineering, and turbulence. These areas implement the latest technology from sampling methods on surfaces to fast algorithms and computer vision methods. The underlying mathematics of wavelet theory depends not only on classical Fourier analysis, but also on ideas from abstract harmonic analysis, including von Neumann algebras and the affine group. This leads to a study of the Heisenberg group and its relationship to Gabor systems, and of the metaplectic group for a meaningful interaction of signal decomposition methods. The unifying influence of wavelet theory in the aforementioned topics illustrates the justification for providing a means for centralizing and disseminating information from the broader, but still focused, area of harmonic analysis. This will be a key role of ANHA. We intend to publish with the scope and interaction that such a host of issues demands. v

vi

ANHA Series Preface

Along with our commitment to publish mathematically significant works at the frontiers of harmonic analysis, we have a comparably strong commitment to publish major advances in the following applicable topics in which harmonic analysis plays a substantial role: Antenna theory Prediction theory Biomedical signal processing Radar applications Digital signal processing Sampling theory Fast algorithms Spectral estimation Gabor theory and applications Speech processing Image processing Time-frequency and Numerical partial differential equations time-scale analysis Wavelet theory The above point of view for the ANHA book series is inspired by the history of Fourier analysis itself, whose tentacles reach into so many fields. In the last two centuries Fourier analysis has had a major impact on the development of mathematics, on the understanding of many engineering and scientific phenomena, and on the solution of some of the most important problems in mathematics and the sciences. Historically, Fourier series were developed in the analysis of some of the classical PDEs of mathematical physics; these series were used to solve such equations. In order to understand Fourier series and the kinds of solutions they could represent, some of the most basic notions of analysis were defined, e.g., the concept of “function.” Since the coefficients of Fourier series are integrals, it is no surprise that Riemann integrals were conceived to deal with uniqueness properties of trigonometric series. Cantor’s set theory was also developed because of such uniqueness questions. A basic problem in Fourier analysis is to show how complicated phenomena, such as sound waves, can be described in terms of elementary harmonics. There are two aspects of this problem: first, to find, or even define properly, the harmonics or spectrum of a given phenomenon, e.g., the spectroscopy problem in optics; second, to determine which phenomena can be constructed from given classes of harmonics, as done, for example, by the mechanical synthesizers in tidal analysis. Fourier analysis is also the natural setting for many other problems in engineering, mathematics, and the sciences. For example, Wiener’s Tauberian theorem in Fourier analysis not only characterizes the behavior of the prime numbers, but also provides the proper notion of spectrum for phenomena such as white light; this latter process leads to the Fourier analysis associated with correlation functions in filtering and prediction problems, and these problems, in turn, deal naturally with Hardy spaces in the theory of complex variables. Nowadays, some of the theory of PDEs has given way to the study of Fourier integral operators. Problems in antenna theory are studied in terms of unimodular trigonometric polynomials. Applications of Fourier analysis abound in signal processing, whether with the fast Fourier transform (FFT), or filter design, or the

ANHA Series Preface

vii

adaptive modeling inherent in time-frequency-scale methods such as wavelet theory. The coherent states of mathematical physics are translated and modulated Fourier transforms, and these are used, in conjunction with the uncertainty principle, for dealing with signal reconstruction in communications theory. We are back to the raison d’être of the ANHA series! University of Maryland College Park

John J. Benedetto Series Editor

Preface

The main purpose of this book is to present, in a structured way, some new results on discrete and numerical Fourier analysis which are beyond the standard discrete Fourier transform and to put them in the context of the application-oriented Fourier analysis. This book has two objectives: the first one is of numerical nature, and the second is close to constructive approximation. The first aim is to extend the power of numerical Fourier analysis and to show by means of theoretical examples and many concrete realizations and applications that the usual kernel matrix of the Fourier transform, the discrete Fourier transform (DFT), should be replaced by another kernel matrix, the eXtended Fourier transform (XFT), when computing discrete Fourier transforms of periodic and nonperiodic functions. The XFT kernel appears as a quadrature of a more general transform, the well-known fractional Fourier transform, and furthermore, it can be used as a discretization of the even more general transform, the linear canonical transformation. Our second objective is to present the XFT matrix as a finite-dimensional transformation that links some discrete operators in the same form in which the corresponding continuous operators are related by the Fourier transform, generating sequences of matrix operators representing continuum operators, providing room for studying them from other perspective. Thus, our aim is to present the theory behind the XFT quadrature and to show the way in which it can be applied to solve problems in many areas, extending in this way the range of applications of discrete Fourier analysis. The first part of the book is devoted to the standard discrete Fourier transform. The theory of the discrete XFT kernel is presented in Chap. 3. Some applications of this algorithm are given in Chap. 4, including applications to evolution and fractional differentiation problems. The last chapter is devoted to give some new applications of the XFT as a discretization of the fractional Fourier and linear canonical transforms. The contents are based in part on some results that have been published elsewhere, but most of the examples and much of the theory given here are totally new. Many people have contributed in some way to this book. Among these, Dr. J. Rico-Melgoza and Dr. E. Chavez need a special mention because they are ix

x

Preface

co-developers of the XFT algorithm. Other contributions have come from undergraduate students. I thank all of them for their direct or spontaneous help to solve some of these problems. Some names are Saúl Duarte, Luis Juárez, Lucina Arce, Modesto Pineda, Dionicio Flores, Claudio Meneses, Francisco Mejía, Erick Coronado, Jared Figueroa, Rafael García, Eduardo González, Alejandra Ruiz, Guadalupe Solorio, Marisol López, Paulina Villalón, and Nancy Magaña. Again, thanks to everyone for their help. Another special mention has to be made: the author gratefully acknowledges Prof. H. G. Feichtinger for the critical reading of the manuscript, his observations, and many advices. This work was partially supported by the National Southeast Supercomputing Laboratory, project 2018-01-011n, and by the National Council of Science and Technology, project 99006-CB-2008-01. Chetumal, Mexico 2019

Rafael G. Campos

Contents

1

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . .

1

2 The Ordinary Discrete Fourier Transform . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 2.1 Some Basic Preliminaries .. . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 2.2 Periodic Approximation to the Fourier Transform .. . . . . . . . . . . . . . . . . . . 2.3 Some Properties of the DFT . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 2.3.1 Differentiation Matrices for Trigonometric Polynomials .. . . 2.3.2 Changing the Period .. . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 2.3.3 Discrete Rotations . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 2.3.4 Translations with the DFT . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 2.3.5 Two-Dimensional DFT .. . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 2.4 Some Fun with the DFT. . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 2.4.1 Translations and the Möbius Band.. . . . . . .. . . . . . . . . . . . . . . . . . . . 2.5 Applications to Elliptic Functions . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 2.5.1 A Fractional Partial Differential Equation for Theta Functions .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 2.5.2 Computing Jacobi Elliptic Functions .. . . .. . . . . . . . . . . . . . . . . . . .

3 3 6 13 13 19 19 23 23 25 25 31

3 XFT: A Discrete Fourier Transform . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 3.1 Discrete Hermite Functions and Asymptotics.. . . .. . . . . . . . . . . . . . . . . . . . 3.1.1 Orthogonality Relations .. . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 3.1.2 Parity and Orthogonality . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 3.1.3 A Discrete Schrödinger’s Equation .. . . . . .. . . . . . . . . . . . . . . . . . . . 3.2 Quadrature of the Fractional Fourier Transform ... . . . . . . . . . . . . . . . . . . . 3.3 Discrete Fourier Cosine and Sine Transforms . . . .. . . . . . . . . . . . . . . . . . . . 3.4 Differentiation Matrices and the XFT . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 3.4.1 Discrete Derivatives in L2 (−∞, ∞) . . . . .. . . . . . . . . . . . . . . . . . . . 3.4.2 Parity and Differentiation . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 3.4.3 Derivatives of Functions Not Decreasing at Infinity .. . . . . . . . 3.4.4 Further Properties of Differentiation Matrices . . . . . . . . . . . . . . .

39 40 44 45 47 51 57 61 61 72 75 81

32 35

xi

xii

Contents

3.5

Fast Algorithms for the XFT . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 3.5.1 A Fast XFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 3.5.2 A Fast Discrete Cosine Transform .. . . . . . .. . . . . . . . . . . . . . . . . . . . 3.5.3 Fast Differentiation Matrices. . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . Sampling and Aliasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 3.6.1 Sampling .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 3.6.2 Aliasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . Two-Dimensional XFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . Partial Differentiation Matrices . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . .

83 84 88 90 102 102 109 113 115

4 Applications of the XFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.1 Having Fun with the XFT .. . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.1.1 Translations in the XFT Formalism . . . . . .. . . . . . . . . . . . . . . . . . . . 4.1.2 Autostereograms .. . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.1.3 Steganography . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.2 Similarity of Brain Signals .. . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.3 Edge Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.4 Boundary Value Problems . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.4.1 Nonlinear Second Order Boundary Value Problems .. . . . . . . . 4.4.2 Higher Order Boundary Value Problems .. . . . . . . . . . . . . . . . . . . . 4.4.3 A Solitary Problem . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.5 Initial Value Problems .. . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.5.1 One Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.5.2 Examples .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.5.3 Two Components . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.6 Nonlinear Partial Differential Equations . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.6.1 One-Time Scheme .. . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.6.2 Two-Time Scheme .. . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.6.3 A KdV Equation .. . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.6.4 Vector Burgers’ Equation . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.7 Fractional Differentiation/Integration . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.7.1 Fractional Initial Value Problems .. . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.7.2 Fractional Boundary Value Problems. . . . .. . . . . . . . . . . . . . . . . . . . 4.8 Inversion of Convolution Operators . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.8.1 The Hilbert Transform . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.8.2 A Short-Time Fourier Transform . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.8.3 Dirac Delta Function . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.8.4 The Laplace Transform.. . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 4.8.5 A Last Remark .. . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . .

119 120 120 123 128 131 136 142 143 146 147 149 150 154 156 157 157 159 160 162 166 172 174 176 179 180 181 182 183

5 A Discrete Fractional Fourier Transform . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 5.1 Some Properties of the Discrete Fractional Fourier Transform . . . . . . 5.1.1 Discrete Product Rule . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 5.1.2 Differential Relation .. . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 5.2 Eigenvectors of the Discrete Fractional Fourier Transform . . . . . . . . . . 5.2.1 Discrete Canonical Coherent States . . . . . .. . . . . . . . . . . . . . . . . . . .

185 187 187 188 190 194

3.6

3.7 3.8

Contents

5.3

xiii

The XFT as a Linear Canonical Transform . . . . . . .. . . . . . . . . . . . . . . . . . . . 5.3.1 A Numerical Linear Canonical Transform . . . . . . . . . . . . . . . . . . . 5.3.2 Fast Linear Canonical Transform in Two Variables.. . . . . . . . . 5.3.3 An Application to Digital Steganography .. . . . . . . . . . . . . . . . . . .

198 199 200 200

A Programming in MATHEMATICA. . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . A.1 The Periodic XFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . A.1.1 Algorithm 2.1: A Periodic Fourier Transform . . . . . . . . . . . . . . . A.1.2 A Periodic Fractional Derivative.. . . . . . . . .. . . . . . . . . . . . . . . . . . . . A.2 The XFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . A.2.1 General Direct Case: |z| ≤ 1 . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . A.2.2 A Fast Fractional Fourier Transform . . . . .. . . . . . . . . . . . . . . . . . . . A.2.3 General Inverse XFT: |z| ≤ 1 . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . A.2.4 Algorithm 3.1: The Fast Discrete Fourier Transform .. . . . . . . A.2.5 Algorithm 3.2: Fast Fourier Cosine Transform . . . . . . . . . . . . . . A.2.6 Algorithm 3.3: Fractional Derivatives . . . .. . . . . . . . . . . . . . . . . . . . A.2.7 Algorithm 3.4: XFT of Sampled Data . . . .. . . . . . . . . . . . . . . . . . . . A.2.8 Algorithm 5.1: The Linear Canonical Transform . . . . . . . . . . . .

205 205 205 206 206 206 207 207 208 210 210 211 212

B Programming in MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . B.1 The Periodic XFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . B.1.1 Algorithm 2.1: A Periodic Fourier Transform . . . . . . . . . . . . . . . B.1.2 A Periodic Fractional Derivative.. . . . . . . . .. . . . . . . . . . . . . . . . . . . . B.2 The XFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . B.2.1 General Direct Case: |z| ≤ 1 . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . B.2.2 A Fast Fractional Fourier Transform . . . . .. . . . . . . . . . . . . . . . . . . . B.2.3 General Inverse XFT: |z| ≤ 1 . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . B.2.4 Algorithm 3.1: The Fast Discrete Fourier Transform .. . . . . . . B.2.5 Algorithm 3.2: Fast Fourier Cosine Transform . . . . . . . . . . . . . . B.2.6 Algorithm 3.3: Fractional Derivatives . . . .. . . . . . . . . . . . . . . . . . . . B.2.7 Algorithm 3.4: XFT of Sampled Data . . . .. . . . . . . . . . . . . . . . . . . . B.2.8 Algorithm 5.1: The Linear Canonical Transform . . . . . . . . . . . .

213 213 213 214 215 215 216 216 217 219 220 221 222

References .. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 225 Applied and Numerical Harmonic Analysis (94 volumes) .. . . . . . . . . . . . . . . . . . 231

Chapter 1

Introduction

The Fourier transform is a key concept in many areas of the natural and mathematical sciences. Much work has been done by scientists, mathematicians and technicians to study this integral transform and its properties in order to support its applications in many branches of science as in acoustic, ecology, electromagnetism, diffusion, neurology, oceanography, optics, physiology, quantum physics, seismology, statistics, and many others. The previous list is only to give the reader an idea of the wide range of applications of the Fourier transform and therefore, it can not be exhaustive. Thus, many efforts have been made to calculate the explicit form of the Fourier transform of a given function. An excellent example of this work is given by the Bateman Manuscript Project. The dependence on high technology of the actual form of human life style is due in part to the Fourier transform. In spite of the great amount of work done to calculate as many Fourier transforms as possible, real applications require transforms that necessarily have to be computed numerically. This is why the search of precise and fast algorithms for computing this integral transform has become an important issue. Generically, these algorithms are called FFT (fast Fourier transform) and they have a rich history (see for example the references of the first chapter and references therein). Nowadays, everyone who needs the Fourier transform of a set of data, can use any of the several available optimized FFT algorithms to compute it. However, this computation is not so straightforward to implement in computers, since it requires a connection between the sample frequency and the previously defined set of time abscissas used to approximate this integral by a Riemann sum. Besides, the FFT algorithms have a drawback: their performance on non periodic functions is not as good as their performance on periodic functions. Recently, the author and some colleagues have found an algorithm to compute the Fourier transform (actually, the fractional Fourier transform) on other grounds. This algorithm, called XFT (eXtended Fourier transform), is as fast as the FFT but more accurate than the latter in the case of non periodic functions. It is even © Springer Nature Switzerland AG 2019 R. G. Campos, The XFT Quadrature in Discrete Fourier Analysis, Applied and Numerical Harmonic Analysis, https://doi.org/10.1007/978-3-030-13423-5_1

1

2

1 Introduction

possible to obtain approximations to Fourier transforms of distributions with this new algorithm. One of our purposes is to explain in detail how the XFT works as a discrete Fourier transform and to show the way in which it can be implemented in standard packages as MATLAB or MATHEMATICA. Some examples of interest for the author are presented in this book. The problems which are solved by using the XFT approach can be classified according to: • Discrete Fourier transforms. The basic facts on the discretization of the Fourier transform and the fast XFT algorithm are given. The origin of the XFT as a quadrature of the Fourier transform and its relation to the standard discrete Fourier transform, as well as their differences, are also shown. Some analytical properties of the XFT and its fast O(N log N) implementation are given. • Image processing and pattern recognition. The application of the XFT algorithm is illustrated in digital steganography, random dot stereogram decoding, image contouring, aliasing, signal similarity and brain pathology detection (depression). • Inversion of convolution transforms. The XFT can be used to find a real inverse operator of the convolution transform enabling the inversion of singular convolution transforms and the definition and inversion of fractional convolution transforms. • Boundary value problems. The XFT numerical derivative is applied to find numerical solutions of nonlinear boundary value problems in one and two variables. • Initial value problems. We apply the XFT derivative to obtain numerical solutions of the nonlinear Cauchy problem. • Fractional differential problems. The fractional XFT derivative is introduced. It is used to find numerical solutions of linear and nonlinear fractional initial and boundary value problems. A fractional partial differential equation for Theta functions can be obtained by using the periodic XFT derivative. In all of these cases, the application of the XFT algorithm as a quadrature of the ordinary Fourier transform is crucial. However, the XFT is actually a quadrature of the fractional Fourier transform (“fractional” has another meaning here, different from that of the last item) and it can be transformed as a quadrature of the more general, linear canonical transform, but it should be said that in this work the XFT algorithm is mainly used as a discretization of the ordinary Fourier transform and only in the last chapter of this book the XFT is presented as a fractional Fourier transform and as a linear canonical transform, along with some applications. Thus, as presented above, the use of the XFT quadrature in discrete Fourier analysis is surveyed in this book. Other aspects and techniques in discrete Fourier analysis are surveyed in [153].

Chapter 2

The Ordinary Discrete Fourier Transform

Abstract This chapter is intended to complete the structure of this book. We present in this chapter an overview of the usual discretization of the Fourier transform as given by the discrete Fourier transform (DFT). Some little-known properties and drawbacks of this discretization are shown in this chapter. The cases of discrete rotations and translations are discussed and an unusual application of these operators is given. A fractional partial differential equation for theta functions and a numerical procedure for computing fractional partial derivatives of theta functions and elliptic integrals are presented as new results of this approach. Keywords Fourier transform · Discrete transforms · Fast Fourier transform · Differentiation matrices · Discrete rotations · Discrete translations · Theta functions · Elliptic integrals

The discretization of the Fourier transform is an extensively studied subject and many papers and books have been published elsewhere (see for example [4, 12, 14, 16, 63, 78, 82, 92, 102, 125, 135]). It is known that the product of this matrix and a vector can be done in terms of the constantly encountered FFT algorithm. The construction of the fast discrete Fourier transform (the FFT algorithm) can be found in more specialized books (see for example [102]).

2.1 Some Basic Preliminaries We begin with some important theorems of Fourier analysis. The functions considered here are functions with attributes as periodicity, smoothness or absolute (Lebesgue) integrability. A function f (t) is absolutely integrable, i.e., f (t) ∈ L1 (−∞, ∞), if the condition 

∞ −∞

|f (t)|dt < ∞

© Springer Nature Switzerland AG 2019 R. G. Campos, The XFT Quadrature in Discrete Fourier Analysis, Applied and Numerical Harmonic Analysis, https://doi.org/10.1007/978-3-030-13423-5_2

3

4

2 The Ordinary Discrete Fourier Transform

is satisfied. Versions and proofs of similar theorems for more general cases can be found in [86, 127, 135, 144, 154]. The first theorem establishes the convergence of a Fourier series ∞ 

ck e

i2π kt L

∼ f (t)

(2.1)

k=−∞

to a L-periodic function f (t): Theorem 2.1 Let f (t) be a smooth L-periodic function for −L/2 ≤ t < L/2. Then we have ∞  L/2 2π k 1  ei L (τ −t )f (τ )dτ = f (t). L −L/2

(2.2)

k=−∞

The Fourier transformation is defined as follows. Definition 2.1 Let f (t) be an absolutely Lebesgue integrable function. The Fourier transform g(ω) of f (t) is a function of the real variable ω and is given by  g(ω) =

∞ −∞

eiωt f (t)dt.

(2.3)

The inverse Fourier transformation is given by the following Theorem 2.2 If f (t) ∈ L1 (−∞, ∞) is differentiable on the real line, then 1 2π



∞ −∞

e−iωt g(ω)dω = f (t).

(2.4)

A proof of Theorem 2.2 can be found in [154]. Thus, Eq. (2.3) defines a transformation and Eq. (2.4) defines the inverse transformation. Alternative notations for g(ω) and f (t), are F [f (t), ω] and F −1 [g(ω), t], respectively. Another theorem, called the Integral Fourier theorem, establishes the convergence of the integral representation of a function and can be obtained by using Definition 2.1 and Theorem 2.2. Theorem 2.3 If f (t) ∈ L1 (−∞, ∞) is differentiable on the real line, then 1 2π









−∞ −∞

eiω(τ −t ) f (τ )dτ dω = f (t).

(2.5)

This statement is expected to hold if some considerations on the asymptotic limit of Theorem 2.1 are taken into account. This theorem can also be used to give a definition of the Fourier transform and its inverse.

2.1 Some Basic Preliminaries

5

Another important result is the Plancherel theorem. This theorem states that 

∞ −∞

|f (t)|2 dt =

1 2π



∞ −∞

|g(ω)|2 dω,

(2.6)

where f (t) and g(ω) satisfy (2.3) and (2.4). This relation can be interpreted in terms of the energy of a signal or in terms of the probability of a quantum system. The former is due to the fact that the energy of a signal (a wave signal for example) is proportional to the squared amplitude and the Plancherel theorem says that energy can be measured in the time domain or in the frequency domain. It should be noted that other ways to define these transforms are also possible, provided (2.5) holds. For example, a common choice is to define the functions g(ω) and f (t) as 1 g(ω) = √ 2π



∞ −∞

f (t)e

−iωt

dt,

1 f (t) = √ 2π



∞ −∞

g(ω)eiωt dω.

Note that if the relation between angular and ordinary frequency ω = 2πν is used in Eq. (2.5), we have that 







−∞ −∞

ei2πν(t −τ )f (τ )dτ dν = f (t).

(2.7)

Then, a more symmetric choice for the definition of the Fourier transforms is obtained, since they can be defined as  g(ν) =

∞ −∞

 f (t)ei2πνt dt,

f (t) =

∞ −∞

g(ν)e−i2πνt dν.

(2.8)

Another way of thinking about the pair of transforms (2.3) and (2.4), is that Eq. (2.4) gives the representation or spectral decomposition of f (t) in the system {e−it ω }, where the coefficient function is given by (2.3). This explains why Fourier transform is so important for example, in signal analysis or quantum physics. In the vast majority of the practical cases it is not possible to calculate an exact Fourier transform, therefore, it is necessary to rely on a fast and precise numerical formula to compute this transform as accurately as possible. An important topic in Fourier analysis is to determine the test space of functions on which the Fourier transform acts, i.e., the class of functions belonging to the domain of the Fourier transform as they appear in applications. A very common choice is to include distributions in the domain. Distributions, or generalized functions, are defined as functionals, see for example [91, 154]. Objects like the Dirac delta function or the sign function are distributions. Another kind of objects to

6

2 The Ordinary Discrete Fourier Transform

be included in the domain of the Fourier transform are square-integrable functions. A function f (t) is square-integrable, i.e., f (t) ∈ L2 (−∞, ∞), if the condition 

∞ −∞

|f (t)|2 dt < ∞

is satisfied. This kind of functions are of special importance in applications since they represent signals containing a finite amount of energy, which can be measured in time or in frequency, in accordance with the Plancherel theorem (2.6), therefore, the space of square-integrable functions L2 (−∞, ∞) is a good candidate to be considered as the test space of functions. However, the space of functions for which a Fourier transform can be obtained is L1 (−∞, ∞) (cf. Theorem 2.3). Taking into account that none of these spaces are included in each other,1 it is convenient to consider here the intersection I (−∞, ∞) = L1 (−∞, ∞) ∩ L2 (−∞, ∞), as a good test space of functions. The space of piece-wise continuous, of bounded variation on any finite interval and absolutely integrable functions, or the Schwartz space of rapidly decreasing functions are also used for the study and application of the Fourier transform [5, 136]. Other class of spaces, are also extensively used [53, 54].

2.2 Periodic Approximation to the Fourier Transform A first idea to approximate the Fourier transform of a given function f (t) is to use a standard numerical integration method. But this is a bad idea. As we can see, the Fourier transform is given by an improper integral of an oscillatory kernel. Therefore, an acceptable approximate value for this integral can be obtained by the use of a standard integration algorithm only for “small” values of ω. For example, the Fourier transform of f (t) = 1/(1 + t 2 ) becomes difficult to compute for |ω|  10 by using general-purpose integration algorithms. ∞ A better idea to approximate the Fourier transform −∞ eiωt f (t)dt is the following. Before to begin with, it should be noted that many other approaches to the discretization of the Fourier transform problem can be found elsewhere (see for example [8, 13, 15, 60, 67, 75, 98]). What these methods do, is to connect this discretization with the so called Discrete Fourier Transform (DFT). The approach followed in this section, also establishes the DFT as an approximation of the Fourier transform.

1 For example, the function 1/(1+|t|) belongs to L2 (−∞, ∞) but not to L1 (−∞, ∞). On the other

√ side, the function 1/ |t| for |t| < 1, 0 otherwise, belongs to L1 (−∞, ∞) but not to L2 (−∞, ∞).

2.2 Periodic Approximation to the Fourier Transform

7

Let us write Eq. (2.2) in the form  ∞  N/2 2π k 1  iωk τ e f (τ )dτ e−i N t = f (t), N −N/2

(2.9)

k=−∞

where N is a natural number, and ωk = 2πk/N. If N is large enough, the term within the parentheses can be considered as an approximation of the Fourier ∞ transform g(ωk ) = −∞ eiωk t f (t)dt. Let us assume that N takes odd values in order to write Eq. (2.9) in the approximated and convenient form 1 N

(N−1)/2 

g(ωk )e−i

2π kt N

 f (t).

(2.10)

k=−(N−1)/2

The interval of periodicity of f (t) can be taken as [−L/2, L/2). Thus, if the lefthand side of (2.10) is evaluated at the abscissas tj = j,

j = −n, · · · , n,

(2.11)

where n = (N − 1)/2, we get n 2πjk 1  g(ωk )e−i N  f (tj ), N

j = −n, · · · , n,

(2.12)

k=−n

where ωk =

2πk , N

k = −n, · · · , n.

(2.13)

Equation (2.12) establishes a connection between the discrete Fourier transform and the interpolation problem of periodic functions. It is shown below (cf. Eq. (2.20)) 2πjk that the matrix with elements e−i N /N is the inverse of the kernel matrix Fp defined by (Fp )j k = ei

2πjk N

,

j, k = −n, · · · , n,

(2.14)

where n = (N − 1)/2. By inverting (2.12), an approximation of the Fourier transform gj = g(ωj ) can be written in the form g˜ j =

n  k=−n

(Fp )j k fk ,

j = −n, · · · , n.

(2.15)

8

2 The Ordinary Discrete Fourier Transform

where fk = f (tk ), g˜j  gj , j, k = −n, · · · , n. Here, Fp denotes the periodic discrete Fourier kernel: F stands for Fourier and the subscript p stands for periodic. The inverse relation is given by (cf. Eq. (2.10)) n 1  −i 2πjk f˜j = e N g(ωk ), N

j = −n, · · · , n,

(2.16)

k=−n

where the tilde on f indicates that f˜j is now an approximate value of f (tj ). Note that the abscissas tj and frequencies ωk does not have the same numerical values. Therefore, it is important to distinguish the set of points at which a discrete transform is evaluated, i.e., the set of abscissas has to be given in addition to the kernel matrix when doing a computation in order to define a discrete transform. And this can be done in a matrix notation, as in the following Definition 2.2 Let N be a positive odd integer.2 The periodic discrete Fourier transformation Fp of order N is given by the set Fp ≡ {Wp , Fp , Tp }, where Tp is the diagonal matrix whose diagonal elements are given by the time values (2.11), Fp is the kernel matrix given by (2.14) and Wp = 2πTp /N is the matrix of frequencies. The inverse periodic discrete transformation F−1 p is given by the set {Tp , Fp−1 /N, 2πTp /N}. In spite that (2.15) is a discrete Fourier transform, the acronym DFT and the name discrete Fourier transform are mostly used to denote the matrix-vector product N−1 

ei

2πjk N

fk ,

j = 0, · · · , N − 1.

(2.17)

k=0

By extension, it also denotes the matrix F0 , defined by the elements (F0 )j k = ei

2πjk N

,

j, k = 0, · · · , N − 1.

(2.18)

This is due, in part, to the fact that the signals to be analyzed are given by causal functions, i.e., functions with support on the positive real axis. But it is mostly due to the fast Fourier transform (FFT), an algorithm (in fact a class of algorithms) that computes the above matrix-vector product in O(N log N) operations instead of the O(N 2 ) that it would take to compute (2.17) directly. Note that in (2.17), the sum does not require an odd value of N. In this form, N can be any natural number. At present, the FFT algorithm is implemented in the majority of numerical scientific languages or systems; the reader interested in knowing more about it may consider to consult [102] or any other specialized reference. The FFT algorithm will not be addressed in this book. Any ready-to-use FFT implemented algorithm will be used in this book to compute the product of the matrix F0 times a vector whenever it is needed.

2 It

will be shown in Sect. 2.3.1 that this formalism also holds for N even.

2.2 Periodic Approximation to the Fourier Transform

9

After this digression, let us return to Eq. (2.15). The matrix Fp can be written in terms of F0 by shifting the indexes j and k by n. Thus, the product j k, where j, k = −n, · · · , n, becomes (−n+j )(−n+k) = n2 −nj −nk +j k, j, k = 0, 1, · · · , N −1. Therefore, the matrix element (Fp )j k becomes π (N−1)2 2

ei N

e−iπj

N−1 N

ei

2πjk N

e−iπk

N−1 N

,

j, k = 0, 1, · · · , N − 1,

(2.19)

SF0 S,

(2.20)

and Fp and F0 are related through Fp = ei

π(N−1)2 2N

π(N−1)k

where S is the diagonal matrix whose diagonal elements are e−i N , k = 0, 1, · · · , N − 1, and F0 is the kernel matrix of the discrete Fourier transformation (2.18). This formalism is also valid for N even, as it will be shown below in Sect. 2.3. Although the structure of the matrices Tp and Fp remains the same when N is even, the time values of the diagonal elements of Tp , for example, changes from integers to semi-integers. Some interesting differences between the cases N odd or N even are shown in Sect. 2.3. A simple algorithm to compute (2.15) follows. Algorithm 2.1 To compute a periodic discrete Fourier transform g = (g1 , g2 , . . . , gN )T of the given vector f = (f1 , f2 , . . . , fN )T , formed with experimental data or values of a function f (t). 1. For a given positive integer N, set the evenly spaced time abscissas

tk = k −

N +1 , 2

k = 1, 2, . . . , N.

2. Get the input data, or evaluate the given function f (t) at tk , k = 1, 2, · · · , N. 3. Obtain the approximation g˜j to g( 2π N tj ) by computing π (N−1)2 N

g˜ = Fp f = ei 2

SF0 (Sf ). π(N−1)k

Here, S is the diagonal matrix whose diagonal elements are e−i N , k = 0, 1, · · · , N − 1. The matrix-vector product F0 (Sf ) should be computed by using a standard FFT algorithm.

10

2 The Ordinary Discrete Fourier Transform

In order to test the performance of this algorithm, take the pair of transforms f (t) = −i te−|t | ,

g(ω) =

4ω . (1 + ω2 )2

(2.21)

Figure 2.1 shows the exact transform compared with the discrete Fourier transform computed through Eqs. (2.15) and (2.20) and an FFT algorithm to compute the matrix-product F0 (Sf ). One could be tempted to substitute the kernel matrix Fp by the simpler matrix Fp whose elements are (Fp )j k = ei

πN 2

(−1)j +k (F0 )j k ,

j, k = 0, 1, · · · , N − 1,

(2.22)

if N is large enough. This can be done but the approximation to the Fourier transform lose accuracy if Fp is substituted by the matrix Fp , as it is shown below. Take the above pair of transforms (2.21) as example. Figure 2.2 shows the output of Algorithm 2.1 when Fp is substituted by (2.22) in step 3. Thus, the error arising by substituting Fp by Fp is greater than the one shown in Fig. 2.1. In addition to this, even if it is not shown, there is a spurious imaginary part different from zero in the latter case.

Fig. 2.1 (a) Real part of the approximated Fourier transform (dashed line) of −i te−|t| computed by using Algorithm 2.1, with N = 210 +1 samples, compared with the exact transform (solid line). (b) Absolute error

Fig. 2.2 (a) Real part of the approximated Fourier transform (dashed line) of −i te−|t| computed by using Eq. (2.22) in step 3 of Algorithm 2.1, with N = 210 + 1 samples, compared with the exact transform (solid line). (b) Absolute error

2.2 Periodic Approximation to the Fourier Transform

11

Another example may help to understand why the simplified kernel Fp should not be used, in spite of the fact that Fp is somehow simpler than Fp . The Fourier transform of the simple function f (t) = cos 2 t =

1 i2t 1 −i2t e + e 2 2

is composed by two Dirac delta functions, centered at −2 and 2, respectively. Figure 2.3 shows the output obtained by using Algorithm 2.1. It gives a good account of the expected result. If we now use Fp instead Fp in Algorithm 2.1, a spurious imaginary part appears, as it is shown in Fig. 2.4. Therefore, the use of the simplified kernel matrix Fp instead Fp may lead to erroneous computations in frequency analysis. However, the use of the kernel matrix Fp also presents some disadvantages as a discretization of the Fourier transform. The major disadvantage, is the fact that Fp appears in the restricted context of periodic functions [4]. In fact, the kernel matrix Fp was obtained by using the expansion of periodic functions in a Fourier series (cf. Eq. (2.9)) and thus, it is not expected that this matrix gives good Fourier transforms of non periodic functions. Note that periodicity is present in Definition 2.2, where a global view of the discrete Fourier transform is given. Note that the frequencies ωk = 2πk/N satisfy −π < ω1 < · · · < ωN < π for all N. Therefore, the approximation g˜ of g(ω) given by Algorithm 2.1 is defined only on (−π, π). Thus,

Fig. 2.3 (a) Real part of the approximated Fourier transform of cos 2 t computed through Algorithm 2.1 with N = 210 + 1 samples. (b) Imaginary part

Fig. 2.4 (a) Real part of the approximated Fourier transform of cos 2 t computed by using (2.22) instead Fp in Algorithm 2.1, with N = 210 + 1 samples. (b) Imaginary part

12

2 The Ordinary Discrete Fourier Transform

Fig. 2.5 (a) Real part of the approximated Fourier transform of e−|t| computed according to Algorithm 2.1 with N = 210 + 1 samples. (b) Absolute error

the frequencies |ωk | > π can be approximated by Algorithm 2.1 only if aliasing is taken into account [4, 67]. Aliasing is an effect associated with discretization of periodic continuous systems (cf. Sect. 3.6.2). In a movie, for instance, the wheels of a car can appear to be static or to be rotating backwards. This effect is due to aliasing of the wheel rotation frequency. The fact that Fp is a periodic discrete Fourier transform, generates a loss of accuracy when computing Fourier transforms of non periodic functions, as it is illustrated in Fig. 2.5, where the pair of transforms f (t) = e−|t | ,

g(ω) =

2 1 + ω2

(2.23)

is considered. This example shows the lack of accuracy of Algorithm 2.1 To end this section note that, when N is odd, the action of the discrete Fourier transform on the operator S, as given in Algorithm 2.1 (i.e., the transformation F0 S), becomes equal to the action of the FFTSHIFT command of MATLAB on the FFT. This action can be easily seen by using the matrix Fp given by (2.20) in the case N = 5. In such a case, the FFTSHIFT of the vector F0 f becomes ⎞ ⎛ 4iπ 2iπ 2iπ 4iπ 1 e− 5 e 5 e− 5 e 5 ⎜ − 2iπ − 4iπ 4iπ 2iπ ⎟ ⎜1 e 5 e 5 e 5 e 5 ⎟ ⎟ ⎜ fftshift(F0 f ) = ⎜ 1 1 1 1 ⎟ ⎟f ⎜ 1 2iπ 4iπ ⎟ ⎜ − 4iπ − 2iπ 5 5 5 5 e e e ⎠ ⎝1 e 4iπ 2iπ 2iπ 4iπ 1 e 5 e− 5 e 5 e− 5 whereas ⎛ 1 ⎜ ⎜1 ⎜ F0 Sf = ⎜ ⎜1 ⎜ ⎝1 1

e− 5 2iπ e− 5 1 2iπ e 5 4iπ e 5 4iπ

2iπ

e 5 4iπ e− 5 1 4iπ e 5 2iπ e− 5

e− 5 4iπ e 5 1 − 4iπ e 5 2iπ e 5 2iπ

4iπ

e 5 2iπ e 5 1 − 2iπ e 5 4iπ e− 5

⎞ ⎟ ⎟ ⎟ ⎟ f. ⎟ ⎟ ⎠

2.3 Some Properties of the DFT

13

Note that the subsequent action of S (according to the definition of Fp given by (2.20)), gives a change of sign between the adjacent frequencies (adjacent rows). This fact explains the need to take, for example, absolute values after the use of the FFTSHIFT command in MATLAB.

2.3 Some Properties of the DFT In order to give a complete view of the scheme under which the discrete form of the Fourier transform has been found, let us consider now the interpolation problem of periodic functions. For simplicity, we take 2π-periodic functions, i.e., we make L = 2π in Theorem 2.1. In this section we show some little known properties of the discrete Fourier transform and some operators related to this matrix [33, 35, 38].

2.3.1 Differentiation Matrices for Trigonometric Polynomials Let us consider the space of trigonometric polynomials of degree at most n. It is known (see for example [143]) that any trigonometric polynomial f (t) given by f (t) =

n 

ck eikt ,

(2.24)

k=−n

can be uniquely determined by its values at 2n + 1 arbitrary points 0 ≤ t1 < t2 < · · · < t2n+1 < 2π through the formula f (t) =

2n+1 

f (tk )

k=1

sk (t) , sk (tk )

(2.25)

where sk (t) is given by sk (t) =

2n+1

l =k

sin

t − tl . 2

This result can be extended to the complex plane [35] by using the Hermite interpolation formula for algebraic polynomials of a complex variable (see [106]). Let f (z) the trigonometric polynomial of the complex variable z as given by (2.24) and let G be a domain of the open strip 0 < (z) < 2π, −∞ < z < ∞, containing a closed rectifiable Jordan curve γ . Let I (γ ) denote the interior of γ . The interpolation formula for f (z) can be found by using the Hermite integral formula for an algebraic polynomial [106] as follows.

14

2 The Ordinary Discrete Fourier Transform

Note that (2.24) can be written as s −n q(s), where q(s) is an algebraic polynomial of degree at most 2n in s, under the change of variable s = ϕ(z) = eiz . Let us take N = 2n + 1 different points sk ∈ ϕ(I (γ )), i.e., 2n + 1 different complex numbers zk∈ I (γ ). The set of points sk , k = 1, 2, . . . , N, define the polynomial ω(s) ˜ = N ˜ to f˜(s) = f (ϕ −1 (s)) k=1 (s − sk ). The interpolation p(s) corresponding to the set of N points sk is given by p(s) ˜ =

s −n 2πi



f˜(ζ ) s n ω(ζ ˜ ) − ζ n ω(s) ˜ dζ, ω(ζ ˜ ) ζ −s

γ˜

where γ˜ = ϕ(γ ). Since [s n ω(ζ ˜ ) − ζ n ω(s)]/(ζ ˜ − s) is a polynomial in s of degree N − 1 = 2n, p(s) ˜ has the required form s −n q(s), where q(s) is a polynomial of degree at most 2n, to represent a trigonometric polynomial. ˜ To show that f˜(sk ) = p(s ˜ k ), let us consider the residual function R(s) = f˜(s) − p(s) ˜ which is 

˜ 1 ω(s) ˜ R(s) = 2πi s n

f˜(ζ )ζ n dζ. (ζ − s)ω(ζ ˜ )

γ˜

˜ = ϕ(G) does not contain points sk (mod 2π) other than sk , By definition, G therefore, the integral of the right-hand side of this equation represents an analytic ˜ k ) = 0 and f˜(s) = p(s). function in I (γ˜ ) and we have that R(s ˜ Since s n ω(ζ ˜ )− n ζ ω(s) ˜ is divisible by ζ − s, the poles of the integrand are simple and located at sk . The residue theorem gives f˜(s) =

N 

f˜(sj )

j =1

N

 s n j

k =j (s

− sk )

k =j (sj

− sk )

N

s

,

˜ s∈G

and the trigonometric polynomial of degree n = (N − 1)/2 interpolating to f (z) is f (z) =

N 

N f (zj )e

i(N−1)(zj −z)/2

j =1

iz izk k =j (e − e ) , izj − e izk ) k =j (e

N

z ∈ G,

which can be written as the Gauss interpolation formula (2.25) for a complex value t=z f (z) =

N 

f (zk )

k=1

sk (z) , sk (zk )

(2.26)

where sk (z) =

N

j =k

 sin

z − zj 2

 .

(2.27)

2.3 Some Properties of the DFT

15

A differentiation matrix D is a finite-dimensional representation of the derivative operator. The differentiation matrix D for trigonometric polynomials can be obtained by writing the derivative of f (z) at zj as df (zj )  = Dj k f (zk ). dz N

(2.28)

k=1

Thus, the elements of the matrix D can be found as follows. The differentiation of (2.27) and some manipulation gives

sk (zj ) =

⎧ N  ⎪ zk − zl ⎪

⎪ s , (z ) cot ⎪ k ⎪ ⎨ 2

j = k,

l =k

⎪ ⎪ ⎪ ⎪ ⎪ ⎩s (zj ) csc zj − zk , 2

j = k,

where

z − zk z − zl = , sin 2 2 N

s(z) = sk (z) sin

l=1

and N = 2n + 1. Therefore, f (zj ) takes the form f (zj ) =

  zj − zk f (zk ) 1

1 s (zj ) f (t , + ) cot j zj −zk

2 2 2 s (zk ) sin N

N

k =j

2

(2.29)

k =j

Note that this equation can be written in the matrix form f = Df,

(2.30)

where f and f are the vectors of components f (zj ) and f (zj ), respectively, and D is the matrix given by

Dj k =

⎧   N ⎪ zj − zl 1 ⎪ ⎪ ⎪ , cot ⎪ ⎪ 2 ⎨2

j = k,

l =j

⎪ ⎪   ⎪ ⎪ zj − zk 1 s (zj ) ⎪ ⎪ csc , j = k, ⎩

2 s (zk ) 2

(2.31)

16

2 The Ordinary Discrete Fourier Transform

where {z1 , z2 , · · · , , zN } are N = 2n + 1 different points contained in G, and s(z) =

N

 sin

k=1

z − zk 2

 .

Thus, the matrix D is a projection of d/dz in the subspace of trigonometric polynomials of degree at most (N − 1)/2, which gives the exact derivatives of a trigonometric polynomial of degree at most n = (N − 1)/2, evaluated at different nodes zk . Since the derivative of a trigonometric polynomial is another trigonometric polynomial of the same order, we have that in general, f (n) = D n f,

n = 0, 1, 2, · · · ,

(2.32)

where, f (n) stands for the vector of entries d n f (zk )/dzn . Now consider the trigonometric polynomial Ek (z) = eikz ,

k ∈ Z,

|k| ≤

N −1 . 2

Then, Ek = (eikz1 , eikz2 , · · · , eikzN )T is a unnormalized eigenvector of D with eigenvalue ik, i.e., DEk = ikEk ,

(2.33)

where k = −(N − 1)/2, · · · , (N − 1)/2. The matrix D takes a simpler form if the points zl are selected according to zl+1 =

2πl + iy, N

l = 0, 1, · · · , N − 1,

(2.34)

for a fixed y. Then we have that s (zj ) sj (zj ) =

= (−1)j +k . sk (zk ) s (zk ) Since

N

k =j

cot (j −k)π = 0, the elements of D become N

Dj k =

⎧ ⎪ 0, ⎪ ⎪ ⎨ ⎪ (−1)j +k ⎪ ⎪ ⎩ 2 sin (j −k)π N

j = k, (2.35) j = k.

In this form, iD is a Hermitian matrix with real eigenvalues and orthogonal eigenvectors.

2.3 Some Properties of the DFT

17

In order to make contact with the standard discrete Fourier transform, let us make y = 0 in (2.34). Then, the j th component of the kth eigenvector Ek is now eikzj+1 = ei2πj k/N , where j = 0, 1, · · · , N − 1 and k = −(N − 1)/2, · · · , (N − 1)/2, i.e., (Ek )j = e−iπ

N−1 N j

ei2πj k/N ,

j, k = 0, 1, · · · , N − 1.

Thus, the matrix E whose kth column is the eigenvector Ek is unitary up to a constant. If I stands for the identity matrix and † stands for complex conjugate, we have that 1 † E E = I. N Note that E can be written as E = SF0 = e−i

π(N−1)2 2N

Fp S −1 ,

(2.36)

where F0 stands for the ordinary discrete Fourier transform, Eq. (2.18), Fp is given by (2.20), and S is again the diagonal matrix containing the elements N−1 e−iπ N j along the diagonal. Since E diagonalizes the differentiation matrix D given by (2.35) (cf. Eq. (2.33)), the matrix Fp also diagonalizes D Fp−1 DFp = iΛ,

(2.37)

where Λ is the diagonal matrix whose diagonal elements are given by the set of integers {−

N −1 N −1 , · · · , 0, · · · , }. 2 2

(2.38)

Up to now, we have considered only sets of different points z1 , z2 , . . . , zN with N odd. This is a consequence of the fact that the 2π-periodic trigonometric polynomial (2.24) has an odd number of coefficients. Consider now an even number N = 2n + 2 of points zk in (2.34) and the 2πantiperiodic function g(z) = sin(z/2)f (z),

(2.39)

where f (z) is a 2π-periodic trigonometric polynomial of degree at most (N − 2)/2. For simplicity consider again y = 0 in (2.34). Take the nonzero points z2 , z3 , · · · , zN . This is an odd number of complex numbers at which the polynomial f (z) can be interpolated to give g(z) =

N  k=2

sin(z/2)sk (z)  sin(z/2)sk (z) = , f (zk ) sk (zk ) sin(zk /2)sk (zk ) N

f (zk )

k=2

18

2 The Ordinary Discrete Fourier Transform

and taking into account that z1 = 0, we have that g(z) =

N  k=1

g(zk )

sin(z/2)sk (z) . sin(zk /2)sk (zk )

(2.40)

The previous arguments also hold for functions of the form cos(z/2)p(z), since π is contained in the set of points zk . Therefore, (2.40) is an interpolation formula for functions of the form g(z) = (aeiz/2 + be−iz/2)f (z),

(2.41)

at the N = 2m + 2 points {0, z2 , · · · , π, · · · , zN }. Here, a and b are constants. In this case, the differentiation matrix D is also given by (2.35) and generates the exact derivative of anti-periodic polynomials. By considering a polynomial of the form gk (z) = ei(k±1/2)z ,

k = −N/2 + 1, · · · , N/2 − 1,

one can see that Eq. (2.37) is also valid for this case in which N is even, where Λ is now the diagonal matrix whose diagonal elements are given by the set of semiintegers {−

N −1 N −1 , · · · , −1/2, 1/2, · · · , }, 2 2

(2.42)

Thus we see that, whether N is odd or not, the matrix Fp given by (2.20), is the kernel matrix of the periodic discrete Fourier transformation that diagonalizes the differentiation matrix which gives derivatives of 2π-periodic trigonometric polynomials if N is odd, or derivatives of 2π-antiperiodic polynomials if N is even. Note that the nth-order derivative can be written as D n = Fp (iΛ)n Fp−1 ,

n = 0, 1, 2, · · · .

This expression leads us to the following definition of fractional derivative D α = Fp (iΛ)α Fp−1 ,

α ≥ 0,

where the diagonal entries of Λ are given by (2.42) or (2.38) according to the (anti)periodicity of the trigonometric polynomial. In general, for α ≥ 0, one of the branches of the infinite set of branches of the power function zα has to be selected in this definition. Since D is nonsingular for N even, we can still extend this result to the differentiation/integration matrix D α = Fp (iΛ)α Fp−1 ,

α ∈ R,

where the diagonal entries of Λ are only given by (2.42).

(2.43)

2.3 Some Properties of the DFT

19

Equation (2.43) is an important consequence of the similarity between the differentiation matrix D and the diagonal matrix Λ under the discrete Fourier transform. But in general, if f (z) is an analytic function in an open set of the imaginary axis containing the integers (2.38) (or the semi-integers (2.42)), the matrix function f (D) can be defined [64] by f (D) = Fp f (iΛ)Fp−1 ,

(2.44)

where f (Λ) is the diagonal matrix with diagonal entries given by f (−(N + 1)/2 + k),

k = 1, 2, · · · , N.

2.3.2 Changing the Period On some occasions there is need to compute the derivative of a function f (z) which is τ -periodic with τ = 2π. This can be done easily by changing the interval of periodicity (0, τ ) to (0, 2π) through the change of nodes ζk =

τ zk , 2π

k = 1, 2, · · · , N.

(2.45)

Since d/dζ = (2π/τ ) d/dz, the differentiation matrix Dτ which is suitable for τ -periodic functions is Dτ =

2π D2π , τ

(2.46)

where D2π is the differentiation matrix given by (2.31) for N different points zk of the open strip 0 < (z) < 2π, −∞ < z < ∞. Therefore, the procedure to differentiate a τ -periodic function is simple. First, evaluate f (z) at the N nodes given by (2.45), and then multiply by 2π/τ the differentiation matrix given by (2.31) or by (2.35) according to the case.

2.3.3 Discrete Rotations Additional properties of the discrete Fourier transform are shown in this section. Consider N real numbers γk , k = 1, 2, · · · , N, and the unitary matrix Δ defined by ⎞ ⎛ 0 0 0 · · · 0 eiγ1 ⎜eiγ2 0 0 · · · 0 0 ⎟ ⎟ ⎜ ⎟ ⎜ ⎜ 0 eiγ3 0 · · · 0 0 ⎟ ⎜ Δ=⎜ . (2.47) .. ⎟ .. .. . . .. ⎟. ⎜ .. . ⎟ . . . . ⎟ ⎜ ⎝ 0 0 0 ··· 0 0 ⎠ 0 0 0 · · · eiγN 0

20

2 The Ordinary Discrete Fourier Transform

The action of this operator on a matrix is a displacement: the j th row is moved to the (j + 1)th row multiplied by eiγj+1 and the last row is moved to the first one. The norm of the displaced row remains the same. In other words, Δ acts as a rotation operator. Let us denote by ·, · the inner product. With this notation, the elements of Δ can be written as Δj k = ϕj , Δϕk , and the action of the operator Δ is given by ⎧ iγk+1 ⎪ ϕk+1 , j = N, ⎨e Δϕk = ⎪ ⎩ iγ1 j = N, e ϕ1 , where ϕk , k = 1, 2 · · · , N, is the orthonormal basis where Δ acts. Figure 2.6 depicts this action.  Let Γ be the sum N j =1 γj , then, the determinant of Δ is det Δ = (−1)N+1 eiΓ . Therefore, Δ represents a proper rotation if ⎧ ⎪ N odd, ⎨2mπ, Γ = ⎪ ⎩ (2m + 1)π, N even, with m integer. In this case, the Nth power of Δ becomes ⎧ ⎪ N odd, ⎨I, N Δ = ⎪ ⎩ −I, N even. Fig. 2.6 Schematic representation of the action of the operator Δ defined by (2.47)

2.3 Some Properties of the DFT

21

This shows that the set of powers of Δ is a representation of the cyclic group of order N or 2N for N odd or even respectively (being a two–valued representation of the finite group of rotations in the latter case). Therefore, every eigenvalue of any power of Δ is a rational root of unity. By fixing the phase shifts we obtain the N ×N basic circulant permutation matrix ⎧ ⎪ for j = 1, ⎨δj N , Δj k = (2.48) ⎪ ⎩ δj,k+1 , for j ≥ 2, in the odd case and Δj k =

⎧ ⎪ ⎨−δj N , ⎪ ⎩ δj,k+1 ,

for j = 1, (2.49) for j ≥ 2,

for N even. The eigenvalue problem for Δ can be written in the form N 

Δj l (fk )l = λk (fk )j ,

l=1

or well, as N 

ϕj , Δϕl ϕl , λk  = λk ϕj , λk ,

l=1

where λk is the kth eigenvalue and (fk )j = ϕj , λk  is the j th component of the kth eigenvector. It is not difficult to see that det(Δ − λk I ) = (−λk )N + 1 for any N, and therefore, the eigenvalues of Δ are λk = eiaκ , where aκ = κ is one of the values of the set IN = {−

N −1 N −1 ,··· , }. 2 2

2π N κ,

and

(2.50)

This set of indexes is composed by subsets with the structure of I2n+1 and I2n , which are given by (2.38) and (2.42), respectively. The matrix Δ is unitary and therefore, it defines an hermitian matrix A through Δ = eiA

22

2 The Ordinary Discrete Fourier Transform

with eigenvalues aκ . The eigenvectors fk of Δ and A are the same and we find that the j th component of fk can be written as (fk )j = eij aκ ,

j =−

N −1 N −1 ,··· , . 2 2

Thus, Δ and A are diagonalized simultaneously by the matrix Fp , given by (2.14) where N can be taken as an odd or even number. Therefore, the kth column of Fp can be written as [Fp ]k = fk . The matrix A can be determined by the spectral decomposition 

Aj k = ϕj , Aϕk  =

ϕj , aκ aκ aκ , ϕk .

κ∈IN

Thus, we have that 4π  2πl(j − k) , = − 2i l sin N N n

Aj k

l=1

if N = 2n + 1 and that 4π  2π(l − 1/2)(j − k) = − 2i (l − 1/2) sin N N n

Aj k

l=1

if N = 2n. These sums can be calculated [68] to give

Aj k =

⎧ ⎪ 0, ⎪ ⎪ ⎨

j = k,

⎪ i(−1)j +k π/N ⎪ ⎪ , ⎩ sin π(jN−k)

j = k,

in both cases. Comparing with (2.35), we conclude that A=i

2π D, N

and summarizing, the rotation operator is related to the differentiation matrix D in the form 2π D Δ=e N , −

(2.51)

2.3 Some Properties of the DFT

23

both of them diagonalized by the discrete Fourier transform (2.14). Equation (2.51) indicates that the operator iD, i.e., the discrete quantum rotation operator, is a discrete generator of rotations and that these rotations take place in multiples of 2π/N.

2.3.4 Translations with the DFT The relation between discrete rotations and the DFT leads to a immediate question: what about translations? To give an answer to this question, consider the Fourier transform of the shifted function f (t − t0 ). It is easy to see that  eiωt0 g(ω) =

∞ −∞

eiωt f (t − t0 )dt.

(2.52)

By inverting this equation, we get 1 f (t − t0 ) = 2π





−∞

e−iωt eiωt0 g(ω)dt.

(2.53)

Thus, the shifted function f (t−t0 ) can be obtained by calculating the inverse Fourier ∞ transform of eiωt0 g(ω), where g(ω) = −∞ eiωt f (t)dt. Thus, the discrete version of (2.53) reads as f˜t0 = Fp−1 Et0 Fp f

(2.54)

where Et0 is the diagonal matrix of diagonal elements eiωj t0 . Thus, the matrix Tt0 = Fp−1 Et0 Fp ,

(2.55)

is a representation of the shifting or translation operator in time. Note that (2.55) also holds for the matrix representation Fp of the Fourier transform given by (2.22).

2.3.5 Two-Dimensional DFT So far we have described how to compute an approximation of the one-dimensional Fourier transform by using the DFT (2.14) for either N odd or even. But many times it is necessary to compute Fourier transforms in more than one dimension. We give in this section the basic tools needed to compute a two-dimensional discrete

24

2 The Ordinary Discrete Fourier Transform

Fourier transform. This procedure can be generalized straightforwardly to higher dimensions. Let us consider the Fourier transform of the bivariate function f (x, y)  g(ξ, κ) =







−∞ −∞

ei(ξ x+κy)f (x, y)dx dy.

(2.56)

To generate a discretization of this integral we follow the same steps to obtain (2.15). To this end, let us begin by writing (2.56) as the iterated integral  g(ξ, κ) =



∞ −∞

e





iκy

−∞

e

iξ x

f (x, y)dx

dy,

and let us consider the grid (xj , yk ) defined by the N nodes xj = j,

j =−

N −1 N −1 ,··· , . 2 2

in the x-axis and the M nodes yk = k,

k=−

M −1 M −1 ,··· , . 2 2

in the y-axis. Therefore, the analogue of Eq. (2.15) is now g˜ ml =



(M−1)/2 

e

i 2πNlk



(N−1)/2 

⎞ e

i 2πNmj

fj k ⎠ ,

(2.57)

j =−(N−1)/2

k=−(M−1)/2

where fj k = f (xj , yk ), g˜ml  g(ξm , κl ), and ξm =

N −1 N −1 2πm ,m=− ,··· , , N 2 2

M −1 M −1 2πl , l=− ,··· , . κl = N 2 2

(2.58)

Equation (2.57) can be written in terms of the Kronecker product y

g˜ = (Fp ⊗ Fpx )f y

where (2.14) defines either Fpx or Fp for N or M, respectively, and f and g˜ are the vectors of components fr = fj k ,

g˜r = g˜j k ,

2.4 Some Fun with the DFT

25 y

with r = k + (j − 1)N, k = 1, · · · , N, and j = 1, · · · , M. Note that Fp ⊗ Fpx is a NM × NM matrix and the length of f (or g) ˜ is just NM. Here, the Kronecker product is defined as usual: If A is N × N and B is M × M, the product B ⊗ A is ⎛

⎞ b11 A b12 A · · · b1,M A ⎜ b21 A b22 A · · · b2,M A ⎟ ⎜ ⎟ B ⊗A=⎜ . .. ⎟ . .. . . . ⎝ . . . ⎠ . bM,1 A bM,2 A · · · bM,M A This vector notation is short and adequate for generalization purposes. In spite of this, it is convenient to write (2.57) in a matrix notation, because of the FFT algorithm, which is used to compute the matrix-vector product Fp f . Thus, if G and F stand for the N × M matrices whose entries are fj k , g˜ ml , respectively, then y

y

G = Fpx F (Fp )T = Fpx F Fp ,

(2.59)

where we have made use of Fp = FpT and (·)T stands for transpose. Equivalently,  T y G T = Fp Fpx F .

(2.60)

This expression enables the use of the FFT algorithm for computing the product  T y then. After this, the matrix G will contain an Fpx F first, and Fp Fpx F approximation to the Fourier transform of a bivariate function.

2.4 Some Fun with the DFT This section is about an unusual application of the DFT. It is intended to be more for entertainment than for academic purposes.

2.4.1 Translations and the Möbius Band The perception of translation or displacement of a three-dimensional object in our three-dimensional flat space is clear. However, if the flat space is bent, the displacement of an object follows a non obvious way. For example, translations on a Möbius strip from a given point to the seam will change left-handed objects into right-handed objects, or paraphrasing this sentence, this kind of translation will change black to white or negative to positive.

26

2 The Ordinary Discrete Fourier Transform

Black and white or negative and positive, are just attributes as left and right. However, the attribute “white” or “positive” can be related, better than “right”, to digital images. This is due to the following. A raster digital image is an array of N ×M values. Each of these values represents the scale of gray in a pixel. A color digital image is an array of N × M small tuples. The RGB color model uses arrays of 3-tuples, corresponding to the scales of red, green and blue. Alternatively, a RGB color image can be represented as a set of three images, the color channels, red, green and blue. The number of bits used to represent the scale of color, i.e., to represent the real number which measures the level of color, is known as bit depth or color depth. More about digital image processing can be found elsewhere [65]. The main idea here, is to use the translational property of the two-dimensional Fourier transform (2.56), discussed for one dimension in Sect. 2.3.4. We can proceed in a similar way for one of the variables, x for instance. Thus, the Fourier transform of the function f (x −x0, y) in terms of the Fourier transform of the original function f (x, y) can be written as  eiξ x0 g(ξ, κ) =







−∞ −∞

ei(ξ x+κy)f (x − x0 , y)dx dy.

(2.61)

This equation can be inverted to give 1 f (x − x0, y) = (2π)2









−∞ −∞

e−i(ξ x+κy)eiξ x0 g(ξ, κ)dξ dκ.

(2.62)

Therefore, we can get the shifted function f (x − x0, y) by calculating the inverse Fourier transform of the function eiξ x0 g(ξ, κ). Something similar can be done with the y-variable, but for the moment we only consider displacements along the x-axis. Taking into account that g˜ml = Gml  g(ξm , κl ), it is easy to see that the discrete form of the left-hand side of (2.61) is the matrix Ex0 G, where Ex0 is the diagonal matrix of diagonal elements ei2πmx0 /N , m = −(N − 1)/2, · · · , (N − 1)/2. Thus, Eq. (2.59) can be used to obtain an approximation of (2.61) in the form y

Ex0 G = Fpx Fx0 Fp , where Fx0 is the matrix of entries (fx0 )j k , associated to the value f (xj − x0 , yk ). Therefore, Fx0 = Fpx

−1

y −1

(Ex0 G) Fp

.

2.4 Some Fun with the DFT

27

Taking into account (2.59), we get Fx0 = (Fpx

−1

Ex0 Fpx ) F .

(2.63)

−1

Thus, Fpx Ex0 Fpx is a translation operator in the x-direction that acts on the left, as in the one-dimensional case (cf. Eq. (2.54)). This left-handedness is a consequence of the arbitrary decision of using the columns (and not the rows) of the matrix representation of a bivariate function to set values of the x variable. If this choice is reversed, i.e., the rows (and not the columns) are used to set values of the x variable, then F changes to F T and the translation operator acts on the right-hand side. This can be seen easily by transposing (2.63) to get FxT0 = F T (Fpx Ex0 Fpx

−1

)

(2.64)

where it has been used the fact that Fpx is a symmetric matrix. Going back to Eq. (2.63), we see that the matrix Tx0 = Fpx

−1

Ex0 Fpx ,

(2.65)

is a representation of the translation operator in the x direction, acting on the left if the columns of the matrix representation of a bivariate function are used to set values of the x variable. Similarly, the matrix y −1

Ty0 = Fp

y

Ey0 Fp ,

(2.66)

is a translation operator in the y direction if the rows of the matrix representation of a bivariate function are used to set the values of the y variable, i.e., along the “horizontal” direction of the matrix. Finally, note that whenever the product Tx0 F T can be done, the operator Tx0 can also be used as a translation operator in the y direction by carrying out the transposing operation T  . Tx 0 F T Since a digital raster image can be represented as a N × M matrix F , the product Ty0 F , where Ty0 is given by (2.66), is the representation of a shifted image. But, what does a shifted digital image look like? An image is not but a picture of a finite part of the universe, therefore, what is the meaning of the displacement of an image? We can anticipate a partial answer to this question if we recall that Eq. (2.63), which gives the displaced image, is based on the discrete Fourier transform, thus giving a periodic or antiperiodic transformation according to the parity of the number of nodes. Since an image is represented by a numeric array, we can expect a displacement of this matrix representation around the unit circle, giving the same

28

2 The Ordinary Discrete Fourier Transform

effect of rolling a flat picture into a cylinder and then rotating it around its axis. For example, assuming that y0 is equal to M, the kth diagonal element of Ey0 has the explicit form k=−

ei2πk ,

N −1 N −1 ,··· , . 2 2

Therefore, Ey 0 =

 I, −I,

N odd, N even,

y0 = M,

(2.67)

and the displaced matrix Fy0 becomes the original one in the former case and −Fy0 in the latter case. In general, the matrix (2.65) generates two images, one corresponding to the real part and other corresponding to the imaginary part. Let us consider a visual example. It should be noticed that in all the following computations, the matrix Fp is substituted by Fp , as given in (2.22), in the construction of the translation operators (2.55) and (2.65). The idea of this experiment is to find out what happens when an image like the one given in Fig. 2.7 is shifted along the horizontal direction. This RGB image has a resolution of 239×360 pixels. Note that 360 is the number of pixels in the horizontal direction, so that we have an even number M. Figure 2.8 shows the images corresponding to the real part of the output of the translation operator (2.65) when it is applied to the matrix representation of this image for several values of y0 . The numerical values of the displacement y0 used to obtain the images of Fig. 2.8 are: Top, from left to right: y0 = 0, y0 = N/8, y0 = 2N/8, y0 = 3N/8. Bottom, from left to right: y0 = 5N/8, y0 = 6N/8, y0 = 7N/8, y0 = N. As can be noted from Fig. 2.8, each displacement slides the image over the horizontal axis in such a way that the vanishing edge appears at the opposite side, Fig. 2.7 A test image

2.4 Some Fun with the DFT

29

Fig. 2.8 Real part of the displacements for M even and several values of y0 of the image of Fig. 2.7

like a strip with two opposite edges glued together. On the other hand, the greater the displacement, the darker the images, giving rise to the fact that for M/2 < y0 < M, the displaced images appear all of them in black. This apparently strange output can be explained as a consequence of (2.67), which in turn, is a result of the two-valued representation of the finite group of rotations associated to the discrete rotation operator Δ given by (2.49). As a Möbius strip, which changes “up” to “down” as it is traversed from a given point to the seam, the translation operator (2.65) changes the numerical representation of an image into shifted images whose numerical representations change from positive numbers to negative numbers. This reason explain why the images of Fig. 2.8 with M/2 < y0 < M can not be seen: the numerical representation at a given pixel of any image must contain positive numbers, otherwise, the software used to generate the computer images may display an error or a black pixel. The previous argument is confirmed by the following experiment: take the negative of the 3 numbers representing the RGB color levels at each pixel of the boxed images at the bottom of Fig. 2.8 and convert them back in a new RGB image. The result of this experiment is shown in Fig. 2.9. Therefore, we can conclude that the operator given by (2.65) displaces an image onto a non-orientable, immaterial surface, in such a way that, the first turn after circling generates the “negative” image, i.e., the negative of the corresponding levels of RGB at each pixel, and after the second turn, the original image is recovered. What about the case in which M is odd? What does the output of the translation operator (2.65) look like in such a case? Well, let us do the experiment. We can use the same test image shown in Fig. 2.7. In order to have an odd number of pixels in the horizontal direction, we just delete the last column of its matrix representation. Therefore, we have now 239 × 359 pixels and N = 359. Figure 2.10 shows the result of this experiment. The displacement y0 is given as follows. Top, from left to

30

2 The Ordinary Discrete Fourier Transform

Fig. 2.9 Negative representation of the boxed images at the bottom of Fig. 2.8

Fig. 2.10 Real part of the displacements for M odd and several values of y0 of the image of Fig. 2.7

right: y0 = 0, y0 = N/8, y0 = N × 2/8, y0 = N × 3/8. Bottom, from left to right: y0 = N × 5/8, y0 = N × 6/8, y0 = N × 7/8, y0 = N. As it is shown in Fig. 2.10, the scenario now is different from the even case. In this case the inversion begins at the first displacement giving the impression of a real displacement. Let us take a closer look at the boxed images of Fig. 2.10. Repeating the inversion procedure described above, i.e., taking the negative of the 3 numbers representing the RGB color levels at each pixel of the boxed images, and converting them back in a new RGB image, we obtain the result displayed in Fig. 2.11. To summarize, the apparently strange behavior of the real part (or imaginary part) of the output of the translation operator defined in terms of Fp , or Fp , through (2.55), or (2.65), is a consequence of the periodic or anti-periodic formulation of the discrete Fourier transform (cf. Sect. 2.3.1). In the case of rotations, this formulation give rise to single and double-valued representations of finite rotation groups while it generates displacements on non-orientable surfaces in the case of translations.

2.5 Applications to Elliptic Functions

31

Fig. 2.11 Negative representation of the boxed images at the top and bottom of Fig. 2.10 A

C

B

D

Fig. 2.12 Translation of a vector of positive values for M even (a)–(b) and M odd (c)–(d). Left cases correspond to y0 = 0, N/4, N/2.5 and right cases to y0 = N/1.5, 3N/4, N

This latter case is depicted in Fig. 2.12 for the case of a positive function and one dimension. In this example, the vector f has the entries fk = exp(−tk2 ), where tk = −π + 2πk/N, k = 1, 2 · · · , N.

2.5 Applications to Elliptic Functions The purpose of this section is to show some results on elliptic functions obtained by using the techniques presented in this chapter on the discrete Fourier transform. These results can be considered as an extension of those given in [35] and they are mostly published elsewhere [30].

32

2 The Ordinary Discrete Fourier Transform

2.5.1 A Fractional Partial Differential Equation for Theta Functions We follow here the notation and the series for theta functions given in [50]: ∞ 

ϑ1 (z, q) = i

2

(−1)n q (n+1/2) ei(n+1/2)z ,

n=−∞ ∞ 

ϑ2 (z, q) =

2

q (n+1/2) ei(n+1/2)z ,

n=−∞

(2.68)

∞ 

ϑ3 (z, q) =

n2 inz

q e

,

n=−∞ ∞ 

ϑ4 (z, q) =

2

(−1)n q n einz ,

n=−∞

for |q| < 1. By taking the partial sums of these series one can define trigonometric polynomials as follows. For N = 2m + 2, the 2π-antiperiodic trigonometric polynomials ϑ1N (z, q) and ϑ2N (z, q) in the variable z are defined by the partial sums ϑ1N (z, q) = i

m 

2

(−1)n q (n+1/2) ei(n+1/2)z ,

n=−(m+1)

ϑ2N (z, q)

=

m 

q

(2.69) (n+1/2)2 i(n+1/2)z

e

,

n=−(m+1)

and for N = 2m + 1, the 2π-periodic trigonometric polynomials ϑ3N (z, q) and ϑ4N (z, q) are defined by ϑ3N (z, q) =

m 

2

q n einz ,

n=−m

ϑ4N (z, q)

=

m 

(2.70) n n2 inz

(−1) q e

,

n=−m

We have seen in Sect. 2.3.1, that the derivatives of trigonometric polynomials can be given in terms of differentiation matrices. More generally, it is possible to define differential operators acting on this kind of functions through (2.44). Let us consider the differentiation matrix D given in (2.35) and ϑ3N (z, q) as a sample function. Note

2.5 Applications to Elliptic Functions

33

that −D 2 is a positive-semidefinite matrix for N odd, and a positive-definite matrix for N even. The function f (z) =

Γ (z + 1) Γ (z + 1 − α)

is analytic for (z) > −1. Therefore, according to (2.44), the differential operator f (−D 2 ) can be defined as Γ (−D 2 + I ) Γ (Λ2 + I ) = F F −1 , p Γ (−D 2 + I − αI ) Γ (Λ2 + I − αI ) p

(2.71)

and, acting on ϑ3N (z, q), gives m  Γ (−D 2 + I ) Γ (n2 + 1) 2 N ϑ q n einz . (z, q) = 3 2 2 Γ (−D + I − αI ) Γ (n + 1 − α) n=−m

(2.72)

2

Here, I stands for the identity matrix. The term Γ (n2 + 1)q n /Γ (n2 + 1 − α) appearing in the right-hand side of (2.72) can be split as follows qα

Γ (n2 + 1) 2 q n −α . Γ (n2 + 1 − α)

Note that Γ (n2 + 1)q n −α /Γ (n2 + 1 − α) can be identified with some adequate 2 fractional derivative of the power function q n . Taking into account that the sum of the right-hand side of (2.72) contains a non-null term for n = 0 and (α) < 1, the Riemann-Liouville fractional derivative Dqα (see for example [88]) with the lower terminal at 0, is the fractional derivative to be considered here. We remind the reader that the Riemann-Liouville derivative of a constant does not vanish, and the derivative of a power function q m is given by 2

Dqα q m =

Γ (m + 1) q m−α , Γ (m + 1 − α)

m > −1,

(α) ≥ 0.

(2.73)

Therefore, we have that Eq. (2.72) can be written in the form Γ (−Dz2 + I ) ϑ N (z, q) − q α Dqα ϑ3N (z, q) = 0, Γ (−Dz2 + I − αI ) 3

0 ≤ (α) < 1,

(2.74)

where Dz stands for the differentiation matrix with respect to z for odd N. As it can be proved easily, (2.74) holds for α = 1. This case gives rise to the diffusion equation.

34

2 The Ordinary Discrete Fourier Transform

Since Dz is a representation of the ordinary derivative with respect to z in the subspaces of (anti)periodic trigonometric polynomials, the asymptotic form of Eq. (2.74) for large N is  2  ∂ Γ − ∂z 2 +1  2  ϑ(z, q) − q α Dqα ϑ(z, q) = 0, ∂ Γ − ∂z2 + 1 − α

−1 ≤ (α) ≤ 1.

(2.75)

where ϑ(z, q) can be any of the four theta functions (2.68). This equation is a fractional partial integral equation for theta functions for negative values of α. For example, if α = −1, Eq. (2.75) can be written as −1   1 q ∂2 ϑ(z, r)dr = 0, − 2 + 1 ϑ(z, q) − q 0 ∂z

q = 0.

(2.76)

It is important to notice that the differential operator Γ (Dz2 +I )/Γ (Dz2 +I −αI ) can be implemented numerically in terms of the fast Fourier transform via Eq. (2.71). For instance, take ϑ(z, q) = ϑ1 (z, q) in (2.76) as a test case (see [30] for other examples). The resulting equation can be tested as follows. The discrete form of the inverse operator on the left-hand side of the equation can be written as in (2.71) with α = −1. Since ϑ1 (z, q) can be written in the form (2.41), the implementation of the differentiation matrix D requires an even number of points zk (cf. Eq. (2.34)). The numerical result displayed in Fig. 2.13, was obtained by using N = 27 complex points with a constant imaginary part zk =

π 2πk +i , N 4

k = 1, 2, · · · , N,

and 20 points on a ray for the q-variable qj =

Fig. 2.13 Maximum norm of the vector given by (2.77) against the absolute value of qj = j (1/21 + i/9261) for j = 1, 2, · · · 20

j j +i , 21 9261

j = 1, 2, · · · , 20.

2.5 Applications to Elliptic Functions

35

The max norm of the vector Fp

1 Γ (Λ2 + I ) −1 Fp θ1q − 2 Γ (Λ + 2I ) q



q

ϑ1 (zk , r)dr

(2.77)

0

where θ1q is the vector of entries given by the values of ϑ1 (zk , q) for k = 1, 2, 3, · · · , 27 , is plotted in Fig. 2.13 against the absolute value of qj . The integral is computed by standard numerical techniques.

2.5.2 Computing Jacobi Elliptic Functions The present approach can also be used to calculate Jacobi elliptic functions by computing (and inverting) the Legendre’s elliptic integral of the first kind [50] 

ϕ

F (ϕ, m) = 0



dθ 1 − m sin2 θ

.

The integral has to be inverted to obtain the amplitude ϕ in terms of which the Jacobi functions are given. In order to use (2.43) with α = −1 for computing this integral, we need to select an even number of nodes (otherwise, D becomes singular) and this means integration (or differentiation) of an antiperiodic function. Let f (θ, m) denote the integrand of this integral. This is a π-periodic function that can be differentiated as an antiperiodic function if we subtract the mean value of the minimum and maximum values of f (θ, m) as a function of θ and change the period to π/2 (cf. Sect. 2.3.2). The subtracted terms are not significant for this computation and can be discarded. Let us consider the N = 2n points of the interval of periodicity [0, π) θj =

j −1 π, N

j = 1, · · · , N,

(2.78)

and let f (m) be the vector of entries fj (m) = f (θj , m), j = 1, · · · , N. Thus, according to (2.46), the differentiation matrix for this case reads as 2D, where D is the differentiation matrix given by (2.31). Therefore, the j th component of the vector u(m) =

1 −1 D f (m) 2

(2.79)

gives an approximation to F (θj , m) up to a constant of integration. If θ1 = 0 (as in (2.78)), then for this particular value F (0, m) = 0, and therefore, the vector F (m) of entries Fj (m) = uj (m) − u1 (m), j = 1, 2, · · · , N, is the approximation that we are looking for. If θ1 = 0, this approximation can be written as Fj (m) = uj (m) − u1 (m) + F (θ1 , m),

(2.80)

36

2 The Ordinary Discrete Fourier Transform

  and the set of points θj , Fj (m) can be interpolated to generate a continuous curve to approximate F (ϕ, m). Therefore, the Jacobi amplitude is given by the inverse function, the one interpolating the set of points   Fj (m), θj ,

j = 1, 2, · · · , N.

In other words, the values of the Jacobi amplitude at the non-evenly spaced abscissas Fj (m) are given by θj , as given by (2.78) for j = 1, 2, · · · , N. Once the set of amplitudes is obtained, N accurate values of Jacobi elliptic functions can be computed in O(N log N) operations. A comparison between this procedure and the algorithms for computing elliptic functions provided by MAXIMA running on a 3.4 GHz Intel Core i5 processor using standard machine-number precision is given next. We compute N values sn(uj , m), j = 1, 2, · · · , N, of this Jacobi elliptic function for N = 2k , k = 10, · · · , 18, in two cases: the real case, i.e., the case in which θj is given by (2.78), and the complex case, where θj is given by θj =

i j −1 π+ , N 2

j = 1, · · · , N.

We take m = 0.99999 in the first case, and m = 0.7 in the latter. Only N values of the standard sine function are required in our procedure, i.e., sin θj , however, the N values Fj (m), i.e., the uj (m)-values, are also required. As a measure of the cpu time spent in computing the 2N values Fj (m) (as given by (2.80)) and sin θj , the function elapsed_run_time of MAXIMA has been used in both cases. This cpu time is compared with the time spent by the function elliptic_f. The results are displayed in Tables 2.1 and 2.2. Table 2.1 Comparison of cpu times (in seconds) between (2.80) and the function elliptic_f of MAXIMA when computing N values of sn(u, 0.99999) for N = 2k , k = 10, · · · , 18, with standard machine-number precision. The error corresponds to the maximum absolute value of the difference between outputs

k 10 11 12 13 14 15 16 17 18

MAXIMA real case 0.003 0.05 0.09 0.25 0.75 2.56 9.01 34.05 132.3

This approach real case 0.017 0.19 0.34 0.72 1.48 2.99 5.75 12.14 24.64

Error 0.003 3 × 10−4 1 × 10−4 9 × 10−5 4 × 10−5 2 × 10−5 1 × 10−5 5 × 10−6 2 × 10−6

2.5 Applications to Elliptic Functions Table 2.2 Comparison of cpu times (in seconds) between (2.80) and the function elliptic_f of MAXIMA when computing N values of sn(u, 0.7) for N = 2k , k = 10, · · · , 18, with standard machine-number precision. The error corresponds to the maximum absolute value of the difference between outputs

37

k 10 11 12 13 14 15 16 17 18

MAXIMA complex case 0.01 0.03 0.12 0.33 0.78 2.49 8.96 33.89 132.1

This approach complex case 0.11 0.22 0.48 0.93 1.91 3.75 7.58 15.55 31.22

Error 8 × 10−4 4 × 10−4 2 × 10−4 1 × 10−4 5 × 10−5 2 × 10−5 1 × 10−5 6 × 10−6 3 × 10−6

Chapter 3

XFT: A Discrete Fourier Transform

Abstract We present in this chapter a procedure to obtain a novel discrete Fourier transform. The discrete Fourier transform obtained in this way is called XFT (from eXtended Fourier Transform) in order to distinguish it from the usual discrete Fourier transform DFT, which was studied in Chap. 2. It is shown in this chapter that the XFT appears as a quadrature of the fractional Fourier transform and that the XFT can be applied as a discrete Fourier transform to solve some simple examples. A discrete scheme for the Hermite functions, the Schrödinger equation, the Fourier cosine/sine transform, and for partial fractional differentiation is also given. The aliasing problem is discussed. Keywords Extended discrete Fourier transform · Discrete Hermite functions · Square-integrable functions · Quadrature · Sine/cosine transform · Differentiation matrices · Fast algorithms · Signal processing · Sampling · Aliasing · Partial differentiation matrices

It will next be shown that the XFT arises from a quadrature of the fractional Fourier transform, which is a more general Fourier transformation [112], and that this novel discrete transform computes more accurate numerical approximations of the Fourier transform than the ordinary discrete Fourier transform. Since the XFT can also be computed by using the FFT algorithm, a fast fractional Fourier transform [32] which gives an accurate output in O(N log N) operations will be obtained. The recurrence equation of the Hermite polynomials and some asymptotic formulas are the main ingredients in this quadrature. The procedure used to obtain this quadrature is only a particular case of a general method to obtain integral transforms and their quadrature formulas generated by orthogonal polynomials [34, 36]. A first attempt to obtain a quadrature formula for the Fourier transform was given in [33]. The fast XFT algorithm was given in [32]. Thus, in this chapter we will follow the lines given in [32] to obtain the fast XFT. For other approaches to find discrete schemes for the Fourier transform, see for example [6, 7, 28, 44, 85].

© Springer Nature Switzerland AG 2019 R. G. Campos, The XFT Quadrature in Discrete Fourier Analysis, Applied and Numerical Harmonic Analysis, https://doi.org/10.1007/978-3-030-13423-5_3

39

40

3 XFT: A Discrete Fourier Transform

3.1 Discrete Hermite Functions and Asymptotics The system of Hermite functions {e−t /2 Hn (t)}∞ n=0 , where Hn (t) is the nth Hermite polynomial, is one of the classical orthogonal systems which has many applications in applied mathematics. Many of their properties can be derived from those of the Hermite polynomials [50]. Among these, there are two properties crucial for this work. The first one is that they are eigenfunctions of the Fourier transform, i.e., 2



∞ −∞

eiωt e−t

2 /2

Hn (t)dt =



2πi n e−ω

2 /2

Hn (ω).

(3.1)

The second, is that the system of Hermite functions is a closed system [137] in L2 (−∞, ∞), i.e., any element of this space of functions can be approximated with arbitrary accuracy by a linear combination of that system. Thus, the main idea is to obtain first a discrete form of the elements of this system and then proceed to find a discrete Fourier transform by finding a discrete form of Eq. (3.1). It is important to note that there are other approaches for finding discrete functions (see for example [6, 7, 41, 71–73, 95, 120]). In order to obtain our discrete Hermite functions, let us consider the family of the polynomials Hn (t), n = 0, 1, . . ., which satisfies the recurrence equation Hn+1 (t) + 2nHn−1 (t) = 2tHn (t),

(3.2)

with H−1 (t) ≡ 0. It is well-known [137] that from (3.2) follows the ChristoffelDarboux formula ⎧ H (x)HN−1 (y) − HN−1 (x)HN (y) ⎪ ⎪ N , x = y, ⎪ N−1 ⎨  Hn (x)Hn (y) 2N (N − 1)!(x − y) (3.3) =

⎪ 2n n! HN (x)HN−1 (x) − HN−1 (x)HN (x) ⎪ n=0 ⎪ ⎩ , x = y. 2N (N − 1)! and that (3.2) can be written as the spectral problem ⎛

⎞ ⎞ ⎞⎛ ⎛ 0 1/2 0 · · · H0 (t) H0 (t) ⎜1 0 1/2 · · ·⎟ ⎜H1 (t)⎟ ⎜H1 (t)⎟ ⎜ ⎟ ⎟ ⎟⎜ ⎜ ⎜0 2 0 · · ·⎟ ⎜H (t)⎟ = t ⎜H (t)⎟ . ⎝ ⎠⎝ 2 ⎠ ⎝ 2 ⎠ .. .. .. .. .. . . . . . . . .

(3.4)

3.1 Discrete Hermite Functions and Asymptotics

41

Consider now the eigenproblem associated to the principal submatrix of dimension N of (3.4) ⎛ 0 1/2 0 · · · 0 ⎜1 0 1/2 · · · 0 ⎜ ⎜ ⎜0 2 0 · · · 0 X =⎜ .. ⎜ .. .. .. . . . ⎜. . . . ⎜ ⎝0 0 0 · · · 0 0 0 0 ··· N − 1

0 0 0 .. .



⎟ ⎟ ⎟ ⎟ ⎟. ⎟ ⎟ ⎟ 1/2⎠ 0

Note that the diagonal matrix given by 

1 1 S = diag 1, √ , . . . ,  2 (N − 1)! 2N−1

 ,

generates the Jacobi matrix 



X = SX S −1

0 ⎜ ⎜ 1 ⎜ 2 ⎜ ⎜ ⎜ 0 =⎜ ⎜ .. ⎜ . ⎜ ⎜ ⎜ 0 ⎝ 0



0 ···  2 0 2 ···  2 2 0 ··· .. .. . . . . . 1 2

0

0 ···

0

0 ···

0 0 0 .. . 

0 N−1 2

0

⎟ ⎟ ⎟ ⎟ ⎟ 0 ⎟ ⎟ .. ⎟ . ⎟ . ⎟ N−1 ⎟ ⎟ 2 ⎠ 0 0

(3.5)

Therefore, the eigenproblem associated to X can be written in the form Xuk = tk uk ,

k = 1, 2, . . . , N,

(3.6)

which is a finite-dimensional version of (3.4). This means that if U is defined as the matrix whose kth column is the eigenvector uk , the matrix U is orthogonal since X is symmetric and the eigenvalues are not repeated and therefore, U −1 XU = Λ,

(3.7)

where Λ is the diagonal matrix containing the eigenvalues, i.e., the dimensionless zeros of the Nth Hermite polynomial along its main diagonal, as it is now shown. The last equation of the linear system (3.6) reads as (N − 1)HN−2 (tk ) = tk HN−1 (tk ),

42

3 XFT: A Discrete Fourier Transform

and according to the recurrence equation (3.2), this means that HN (tk ) = 0,

k = 1, 2, · · · , N,

i.e., the eigenvalues tk are the zeros of HN (t). By using again (3.2), the kth eigenvector uk can be found to be ck (s1 H0 (tk ), s2 H1 (tk ), s3 H2 (tk ), · · · , sN HN−1 (tk ))T , where s1 , . . . , sN are the diagonal elements of S and ck is a normalization constant that can be determined from the condition uTk uk = 1, i.e., from ck2

N−1  n=0

Hn (tk )Hn (tk ) = 1. 2n n!

Since HN (tk ) = 0 and HN (tk ) = 2NHN−1 (tk ), the use of (3.3) gives  ck =

2N−1 (N − 1)! N

1/2

1 , |HN−1 (tk )|

or equivalently,  ck =

2N−1 (N − 1)! N

1/2

(−1)N+k , HN−1 (tk )

where we have used the fact that |HN−1 (tk )| = (−1)N+k HN−1 (tk ). Thus, the nth component of the orthonormal vector uk is  unk = (−1)N+k

2N−n−1 (N − 1)! N n!

1/2

Hn (tk ) . HN−1 (tk )

(3.8)

Here, k = 1, 2, · · · , N and n = 0, 1, . . . , N −1. With this result we have completed the solution of the eigenproblem (3.6). It will now be shown that the vector (un1 , un2 , · · · , unN )T is a normalized discrete version of the Hermite function 1 2 √ e−t /2 Hn (t). n n!2 Note that the asymptotic expression for HN (t) in the oscillatory region (Eq. (8.22.8) of [137]) is HN (t) =

 √ Γ (N + 1) t 2/2  cos( 2N + 1 t − Nπ/2) + O(N −1/2 ) . e Γ (N/2 + 1)

(3.9)

3.1 Discrete Hermite Functions and Asymptotics

43

Therefore, if N is large, the zeros tk , k = 1, 2, · · · , N, of HN (t) take the asymptotic form    π 2k − N − 1  1 + O(N −1/2 ) . tk = (3.10) √ 2 2N for every k fixed. Note that Γ (N/2 + 1) Γ (N + 1)et

2 /2

HN−1 (tk ) = − sin

√  2N + 1 tk − Nπ/2 + O(N −1/2 )

Therefore, taking into account the usual standardization of the Hermite polynomials, the use of (3.9) and (3.10) gives HN−1 (tk ) =

Γ (N) Γ ( N+1 2 )

  2 etk /2 (−1)N+k + O(N −1/2 ) ,

(3.11)

where Γ (x) stands for the Gamma function. On the other hand, the use of Stirling’s formula √  2πn  n n  Γ (n + 1) = 1 + O(n−1 ) , e e gives N−1  √ N−1   e N −1 Γ (N) −1 1 + O(N √ ) = N−1 (N − 1)/2  N−1  2 Γ ( N+1 2 ) 2e

 = 2N/2

N −1 e

 N−1   2 1 + O(N −1 ) .

By using again Stirling’s formula we obtain that 

N −1 e

 N−1 2

√  (N − 1)!  −1 1 + O(N = ) . (2π(N − 1))1/4

Therefore, Γ (N) Γ ( N+1 2 )

=2

N/2

√  (N − 1)!  −1 1 + O(N ) . [2π(N − 1)]1/4

(3.12)

44

3 XFT: A Discrete Fourier Transform

The substitution of this expression in (3.11) generates the link, through Eq. (3.8), between the asymptotic form of the element unk and the value of the nth Hermite function at tk : unk

 π 1/4 e−tk2 /2 H (t )   n k = 1 + O(N −1/2 ) . √ 2N 2n n!

(3.13)

This equation can be written in terms of the difference between two consecutive asymptotic Hermite zeros π Δtk = tk+1 − tk  √ , 2N

(3.14)

as 1 e−tk /2 Hn (tk ) √ (Δtk )1/2 . π 1/4 2n n! 2

unk 

(3.15)

3.1.1 Orthogonality Relations As above, let U be the matrix whose kth column is the vector of elements unk , n = 0, 1, · · · , N. Since U is an orthogonal matrix, the relations N−1 

unj unk = δj k ,

j, k = 1, 2, · · · , N,

(3.16)

n, m = 0, 1, · · · , N − 1,

(3.17)

n=0 N 

unk umk = δnm ,

k=1

hold. These orthogonality equations are the discrete forms of very well-known continuous relations. They can be found heuristically. The use of (3.15) and the bilinear generating function of the Hermite polynomials,   ∞  2tj tk z − (tj2 + tk2 )z2 zn 1 , Hn (tj )Hn (tk ) = √ exp 2n n! 1 − z2 1 − z2 n=0

(3.18)

3.1 Discrete Hermite Functions and Asymptotics

45

known as Mehler’s formula [50], gives for (3.16) N−1  n=0



Δtk

(1 + z2 )(tj2 + tk2 ) − 4tj tk z



unj unk  lim  exp − z→1 π(1 − z2 ) 2(1 − z2 )   (tj − tk )2 Δtk = lim  exp − z→1 π(1 − z2 ) 1 − z2 = δ(tj − tk )Δtk ,

if N is large enough. Here, δ(x) is the Dirac delta function. On the other hand, the orthogonality relation (3.17) becomes N 

 1 2 e−tk Hn (tk )Hm (tk )Δtk . n π 2 n! N

unk umk  √

k=1

k=1

The sum of the right-hand side of this equation is a Riemann sum for the integral 



−∞

√ 2 e−t Hn (t)Hm (t)dt = 2n n! πδnm ,

which is the orthogonality relation of the Hermite polynomials.

3.1.2 Parity and Orthogonality A very useful relation satisfied by the elements unk of U can be proved easily. Let N be given and denote by I the matrix with ones on the main anti-diagonal and zeros elsewhere, i.e., Ij k = δj,N−k+1 . This matrix reverses the index order of the elements of a vector. Therefore, it can be used to define odd or even symmetry of a vector f , according to Definition 3.1 Let I the matrix of elements Ij k = δj,N−k+1 . A vector f is even if it satisfies f = If . If f satisfies f = −If , the vector is odd. In either case, the vector f has definite parity. Thus, the action of I on vectors of definite parity is to perform a specular reflection, with or without inversion, about the “central part” of the vector. This happens when I is applied to vm , the mth column of U T . Its effect is to change k by N − k + 1 in (3.8). Taking into account the parity of the Hermite polynomials, the equation Ivm = (−1)m vm ,

46

3 XFT: A Discrete Fourier Transform

holds either N is odd or even. In addition, the orthogonality relation (3.17), gives vnT Ivm = (−1)m vnT vm = (−1)m δnm . Therefore, the diagonal matrix U IU T is composed of the elements 

U IU T

 nm

= (−1)n δnm ,

and as a result of this, the diagonal matrix A± =

1 1 U (I ± I)U T = (I ± U IU T ) 2 2

has the elements given by (A± )nm =

1 (1 ± (−1)m )δnm , 2

n, m = 0, 1, · · · , N − 1.

(3.19)

This proves the following Theorem 3.1 Either N is odd or even, the matrix U , whose elements unk are given by (3.8), satisfies the equation U T A± U =

1 (I ± I), 2

where A± is the diagonal matrix with components given by (3.19) and I and I stand for the identity matrix and the matrix with components Ij k = δj,N−k+1 , respectively. This is equivalent to the following pair of equations [ N−1 2 ]



u2n,j u2n,k =

n=0 [ N−2 2 ]

 n=0

u2n+1,j u2n+1,k =

1 (δj k + δj,N−k+1 ) 2 (3.20) 1 (δj k − δj,N−k+1 ) 2

The former corresponds to A+ whereas the latter to A− . Here, [x] stands for the integral part of x. In the following sections no special notation either for denoting the size of the identity matrix I or for denoting the size of the anti-identity matrix I is used. The size of each one is given by the context in which they operate.

3.1 Discrete Hermite Functions and Asymptotics

47

3.1.3 A Discrete Schrödinger’s Equation There are three important operators in the problem of the one-dimensional harmonic oscillator in classical quantum mechanics: the position, the momentum and the Hamiltonian. It is known that the position operator of the quantum harmonic oscillator is given, up to physical constants, by a hermitian matrix like the one given in (3.5) for X, but infinite [108]. Such a matrix is the representation of the position in the Hamiltonian basis. The momentum operator also has an infinite hermitian matrix representation from which, the principal N × N submatrix  1 0 2 ⎜  ⎜ 1 ⎜− 2 0 ⎜  ⎜ ⎜ 0 − 22 P = −i ⎜ ⎜ .. .. ⎜ . . ⎜ ⎜ ⎜ 0 0 ⎝ 0 0 ⎛



0 ···  2 2 ···

0

0 ··· .. . . . .

0 .. .

0 ···

0 

0 ··· −

0

N−1 2

0

⎟ ⎟ ⎟ ⎟ ⎟ 0 ⎟ ⎟ .. ⎟ , ⎟ . ⎟  N−1 ⎟ ⎟ 2 ⎠ 0 0

(3.21)

generates the eigenproblem P wk = ωk wk ,

k = 1, 2, · · · , N.

(3.22)

This matrix can be obtained in terms of the discrete representation of ladder operators. Other finite representations of quantum operators based on these operators are given in [93]. The eigenproblem (3.22) can be solved by using the solution of the eigenproblem of X. Note that the matrices X and P satisfy the relation M −1 P M = X,

(3.23)

where M is the diagonal matrix whose elements are Mnm = i m δnm , n, m = 0, 1, · · · , N − 1. Therefore, the solution of (3.22) consists of the zeros of the Nth Hermite polynomial as eigenvalues, i.e., HN (ωk ) = 0, and the kth eigenvector wk with components wnk = i n unk ,

n = 0, 1, · · · , N − 1.

This means that the matrix W , whose kth column is the kth eigenvector of P , is related to the matrix U of eigenvectors of X, through W = MU.

48

3 XFT: A Discrete Fourier Transform

This matrix is unitary and diagonalizes P : W −1 P W = U −1 M −1 P MU = Λ,

(3.24)

where Λ is the diagonal matrix containing in its main diagonal the dimensionless zeros of the Nth Hermite polynomial ωk = tk . This matrix was defined above. Both matrices X and P are respective representations of the position and momentum operators in the hamiltonian basis, so that to get the representation P of P in the position basis it is necessary to change P to the basis of X through U , i.e., P = U −1 P U.

(3.25)

The explicit form of the elements of P can be obtained by using the recurrence equation for umk , 

m um−1,k + 2



m+1 um+1,k = tk umk , 2

(3.26)

where m = 0, 1, · · · , N − 1, u−1,k ≡ 0, uN,k ≡ 0. This equation can be derived from (3.5) and (3.6) or from the recurrence equation of the Hermite polynomials. Thus, the use of (3.21) gives N−2   i √ Pj k = √ m + 1 um+1,j umk − umj um+1,k . 2 m=0

For convenience, this equation can be rewritten as N−2 √  √ i  Pj k = √ umj m um−1,k − m + 1 um+1,k 2 m=1  i √ N − 1 uN−1,j uN−2,k − u0j u1k . + √ 2

The use of (3.26) gives tj Pj k =

N−2   i  m(m + 1) um+1,j um−1,k − um−1,j um+1,k 2 m=1

 N−3 N−1  i  + (m + 1) umj umk − m umj umk 2 m=0

m=2

 i (N − 1)uN−2,j uN−2,k − u1j u1k . + 2

3.1 Discrete Hermite Functions and Asymptotics

49

The sum of the last two pair of parentheses become N−2 

umj umk − (N − 1)uN−1,j uN−1,k = δj k − N uN−1,j uN−1,k ,

m=0

where the orthogonality relation (3.17) has been used. According to (3.8), uN−1,k = √ (−1)N+k / N , therefore, tj Pj k

N−2   i  = m(m + 1) um+1,j um−1,k − um−1,j um+1,k 2 m=1

i + (δj k − (−1)j +k ). 2 The product tk Pj k can also be calculated in the same way. It comes out that tk Pj k

N−2   i  = m(m + 1) um+1,j um−1,k − um−1,j um+1,k 2 m=1

i + ((−1)j +k − δj k ), 2 and subtracting the latter from the former, the representation of the momentum operator P in the basis of the position can be obtained as P = −iD where D is the matrix of components ⎧ ⎪ 0, j = k, ⎪ ⎪ ⎨ (D)j k = ⎪ (−1)j +k ⎪ ⎪ , j= k, ⎩ (tj − tk )

(3.27)

(3.28)

where j, k = 1, 2, . . . , N. Since this is a differentiation matrix, i.e., a matrix that can reproduce the derivatives of functions belonging to some subspaces of functions, (see Sect. 3.4 below), Eq. (3.27) shows some resemblance between this discrete representation and −i times the derivative, which is the representation of the momentum operator in quantum mechanics. On the other hand, the hamiltonian, or energy operator, is defined as the hermitian matrix given by the sum of the kinetic and potential energies, i.e., in our case it is given by H =

1 2 1 2 P + X . 2 2

(3.29)

50

3 XFT: A Discrete Fourier Transform

A simple calculation shows that H is a diagonal matrix, whose diagonal entries are given by  n + 1 , n = 0, 1, · · · , N − 2, (3.30) λn = N−1 2 n = N − 1. 2 , The fact that H is a diagonal matrix, indicates that X and P , as given by (3.5) and (3.21) respectively, are operators represented in the basis of orthonormal vectors of the hamiltonian. To find a discrete version of the Schrödinger equation, it is necessary to calculate the representation of H in the basis where the position is diagonal. This can be done by diagonalizing X in (3.29). This gives H = U −1 H U =

1 2 1 2 P + Λ . 2 2

On the other hand, note that U HU −1 = H is the diagonalization of H. This equation, written as HU −1 = U −1 H , means that U −1 = U T is the matrix of eigenvectors of H. In other words, the nth eigenvector of H is given by the nth row of U (denoted here by ϕn ), with entries ϕn (tk ) = unk , k = 1, 2, · · · , N, and the corresponding eigenvalue is λn , as given by (3.30). Therefore, the matrix equation Hϕn = λn ϕn has the explicit form −

N N 1 1   (−1)j +k ϕn (tk ) + tj2 ϕn (tj ) = λn ϕn (tj ). 2 (tj − tl )(tl − tk ) 2

(3.31)

k=1 l =j,k

This is the discrete version of the Schrödinger equation for the harmonic oscillator. It furnishes the exact eigenvalues, except for the Nth eigenvalue, and it gives a discrete version of the exact eigenfunction in the asymptotic limit, as shown by Eq. (3.13). Other approaches for constructing discrete versions of this equation are given in [9, 72]. Just to introduce the next section, note that the conjugation of (3.23) gives the relation MP M −1 = −X, and as a result, (3.24) changes to U −1 MP M −1 U = −Λ.

3.2 Quadrature of the Fractional Fourier Transform

51

The substitution of this equation and (3.27) in (3.25) gives (U −1 MU )D = (−iΛ)(U −1 MU ).

(3.32)

It is known in quantum mechanics that the position and momentum bases are related through a Fourier transform, and this is what (3.32) says. In terms of the integral transform, 

∞ −∞

eiωt

d f (t)dt = −iω dt



∞ −∞

eiωt f (t)dt.

Therefore, (3.32) can be interpreted in this way if the matrix U −1 MU is considered a discrete Fourier transform. Finally, note that the use of (3.23), (3.27) in (3.25) also gives (U −1 M −1 U )D(U −1 MU ) = iΛ.

(3.33)

3.2 Quadrature of the Fractional Fourier Transform √ Let M(z) be the diagonal matrix whose kth nonzero element is 2π zm , where z is a complex number and m = 0, 1, · · · , N √ − 1. Note that the matrix M defined by (3.23) is related to M(z) through M(i) = 2π M. The similarity transformation F (z) = U −1 M(z)U

(3.34)

defines a matrix whose components are given by (F (z))j k

 zn √ (−1)j +k 2N−1 (N − 1)! N−1 Hn (tj )Hn (tk ). = 2π N HN−1 (tj )HN−1 (tk ) 2n n!

(3.35)

n=0

From (3.34), it is clear that the nth column of U −1 = U T , i.e., the vector (un1 , un2 , · · · , unN )T , is the nth eigenvector of F (z) with eigenvalue zn . Therefore, if z = i, Eq. (3.34) is a discrete equation of Eq. (3.1) because the eigenvalues of F (i) are i n and the entries of the eigenvectors approximate the unnormalized continuous Hermite

52

3 XFT: A Discrete Fourier Transform

functions evaluated at tk (cf. Eq. (3.13)). Furthermore, F (i) is a unitary matrix up to a constant, i.e., F −1 (i) =

1 F (i)† , 2π

(3.36)

where † denotes transpose conjugate. Thus, we find again that F (i) is a discrete Fourier transform. In fact, we are going to show next that F (z) is a discrete form of a more general transform: the fractional Fourier transform. The substitution of (3.11) and (3.12) in (3.35) gives (F (z))j k =

  π 1/2  N−1  zn −(t 2 +t 2 )/2 1 + O(N −1/2 ) Hn (tj )Hn (tk ). e j k 2N 2n n! n=0

(3.37) To estimate the sum given in the above expression we proceed as follows. N−1  n=0

∞ ∞   zn zn zn H H Hn (tj )Hn (tk ). (t )H (t ) = (t )H (t ) − n j n k n j n k 2n n! 2n n! 2n n! n=0

n=N+1

(3.38) The first series of the right-hand side of the previous equation is given by the Mehler formula, Eq. (3.18). The second one, i.e. ∞  n=N+1

zn Hn (tj )Hn (tk ), 2n n!

can be estimated by using the asymptotic expressions (3.9) and (3.12). Thus, for n > N,  2 2  Γ (n + 1) 2 etj /2 etk /2  −1/2 ) O(1) + O(N Γ (n/2 + 1) 2n n!   2 tj2 /2 t 2 /2  e ek = O(1) + O(N −1/2 ) . πn

Hn (tj )Hn (tk ) = 2n n!



Therefore, if z = i, ∞  n=N+1

zn Hn (tj )Hn (tk ) = 2n n!



2 tj2/2 t 2 /2 e ek π



∞ 

n=N+1

  in  √ O(1) + O(N −1/2 ) . n (3.39)

3.2 Quadrature of the Fractional Fourier Transform

53

Consider now the series ∞ ∞ ∞    in (−1)k (−1)k +i √ = √ √ n 2k + 1 2k n=1

k=1

k=0

These alternating series contains terms converging to 0 monotonically and therefore, both of them converge. The estimate ∞  m      (−1)k ak  ≤ |am+1 |  (−1)k ak −   k=1

k=1

can be used to show that ∞  n=N+1



N

k=1

n=1

 ik  ik in √ = √ − √ = O(N −1/2 ). n k k

Thus, ∞  n=N+1

in Hn (tj )Hn (tk ) = n 2 n!



2 tj2 /2 t 2 /2 e e k O(N −1/2 ), π

and therefore, for z = i, Eq. (3.38) becomes N−1  n=0



 zn zn Hn (tj )Hn (tk ) = Hn (tj )Hn (tk ) + n 2 n! 2n n!



n=0

2 tj2 /2 t 2/2 e e k O(N −1/2 ). π

As a consequence of the previous equation, Eq. (3.37) becomes (F (z))j k

 ∞  π 1/2    zn −(tj2 +tk2 )/2 −1/2 H = e (t )H (t ) 1 + O(N ) , n j n k 2N 2n n! n=0

(3.40) and Mehler’s formula can be used in this expression. More generally, if z = eiθ , Eq. (3.39) becomes ∞  n=N+1

zn Hn (tj )Hn (tk ) = 2n n!



2 tj2 /2 t 2 /2 e ek π



∞  einθ √ n

n=N+1





 O(1) + O(N −1/2 ) .

54

3 XFT: A Discrete Fourier Transform

Here, the Fourier series ∞  einθ √ = ξ(θ ), n

0 ≤ θ < 2π,

n=N+1

can be estimated by solving the inverse problem 1 2π



2π 0

1 ξ(θ )e−inθ dθ = U (n − N − 1) √ , n

where U (x) is the Heaviside function (step function). This equation can be written as the Fourier transform  ∞ 1 1 U (θ )U (2π − θ )f (θ )e−inθ dθ = U (n − N − 1) √ . 2π −∞ n Therefore,  U (θ )U (2π − θ )f (θ ) =



1 U (x − N − 1) √ eixθ dx, x −∞

and from here we obtain that       π ξ(θ ) = (1 + i) 2(N + 1)θ/π − (i + 1)S 2(N + 1)θ/π , 1 + (i − 1)C 2θ where C(x) and S(x) are the cosine and sine Fresnel integrals respectively. Thus, for  > 0 and  ≤ θ ≤ 2π,  ξ(θ ) = (1 + i)

π O(N −1/2 ), 2θ

and Eq. (3.40) holds again. The use of Mehler’s formula (3.18) in (3.40) gives rise to the asymptotic formula  (F (z))j k 

  (1 + z2 )(tj2 + tk2 ) − 4tj tk z 2 exp − Δtk . 1 − z2 2(1 − z2 )

for z = eiθ , 0 < θ ≤ 2π. Consider now the vector f = (f (t1 ), f (t2 ), . . . , f (tN ))T

(3.41)

3.2 Quadrature of the Fractional Fourier Transform

55

constructed with the values of a given function f (t). Then, the multiplication of the matrix F (z) by the vector f gives the vector g whose entries are given by gj =

N 

(3.42)

(F (z))j k f (tk )

k=1

 

  N  (1 + z2 )(tj2 + tk2 ) − 4tj tk z 2 exp − f (tk )Δtk , 1 − z2 2(1 − z2 ) k=1

for j = 1, 2 . . . , N. Note that this equation is a Riemann sum for the integral  F [f (s); t, z] =

2 1 − z2

  (1 + z2 )(t 2 + s 2 ) − 4 zst exp − f (s)ds, 2(1 − z2 ) −∞ (3.43)





where z = eiθ and  ≤ θ ≤ 2π,  > 0 that is, F [f (s); tj , z] 

N 

(F (z))j k f (tk ),

(3.44)

k=1

if N is large enough. If z = i, in formula (3.44) appears the matrix F (i) which, according to (3.40) and (3.41), is the matrix of components   (F (i))j k = eitj tk Δtk 1 + O(N −1/2 ) .

(3.45)

For simplicity, from now on, the matrix F (i) will be denoted by F . In this case, Eq. (3.44) becomes 

∞ −∞

e

itj t

f (t)dt 

N 

Fj k f (tk ),

(3.46)

k=1

giving thus an approximation to Eq. (2.3), the Fourier transform of the function f (t) at tj . A class of functions for which (3.46) generates point-wise convergence of the quadrature at the nodes tj can be found as follows. Note that Eq. (3.34) can be written as F U −1 = U −1 M(i) for z = i. This means that N  k=1

Fj k unk =



2πi n unj ,

56

3 XFT: A Discrete Fourier Transform

for j = 1, 2, · · · , N, and n = 0, 1, · · · , N − 1. The substitution of unk , as given by Eq. (3.13), gives 

∞ −∞

eitj t un (t)dt =

N 

  Fj k un (tk ) 1 + O(N −1/2 ) ,

(3.47)

k=1

where un (t) stands for the nth Hermite function, i.e., un (t) = e−t /2 Hn (t). Let f (t) be a differentiable and quadratically integrable function in (−∞, ∞) having a Fourier transform. Therefore, exists a series of the Hermite functions converging (in the L2 -sense) to f (t). Let 2

fN (t) =

N 

an un (t)

n=0

be the Nth partial sum of such series. Thus, (3.47) produces 

∞ −∞

eitj t fN (t)dt =

N 

  Fj k fN (tk ) 1 + O(N −1/2 ) .

k=1

If the Fourier transform of f (t) − fN (t), i.e., the rest of the series, satisfies 



−∞

eitj t (f (t) − fN (t)) dt = o(N −1/2 ),

(3.48)

then 

∞ −∞

e

itj t

f (t)dt =

N 

  Fj k f (tk ) 1 + O(N −1/2 ) .

k=1

Therefore, the XFT generates a point-wise convergent scheme to compute the Fourier transform of differentiable square integrable functions f (t) having a Fourier transform satisfying (3.48). Another class of functions for which this scheme is also convergent, can be obtained by using some theorems on equiconvergence of Hermite series [111, 137]. Further properties of the XFT as a discrete Fourier transform will be reviewed in the following sections. Some numerical calculations are also performed.

3.3 Discrete Fourier Cosine and Sine Transforms

57

3.3 Discrete Fourier Cosine and Sine Transforms The matrix structure of the XFT allows to define a discrete formula for the Fourier cosine transform  ∞ cos(ωt)f (t)dt, gc (ω) = −∞

and for the Fourier sine transform in a proper way. Let FR and FI be the real and imaginary parts of the kernel matrix F , respectively, i.e., F = FR + iFI .

(3.49)

According to (3.8) and (3.35), the components of these matrices read as N−1

(FR )j k

[ 2 ]  √ = 2π (−1)n u2n,j u2n,k ,

(3.50)

n=0

and [ 2 ]  √ = 2π (−1)n u2n+1,j u2n+1,k , N−2

(FI )j k

(3.51)

n=0

respectively. Again, [x] stands for the integral part of x. Since F = FR + iFI , the matrices FR and FI are related to the discrete Fourier cosine and sine transforms, defined as 



gc (ω) = 

cos(ωt)f (t)dt,

ω > 0,

(3.52)

sin(ωt)f (t)dt,

ω > 0,

(3.53)

0 ∞

gs (ω) = 0

respectively. In order to find out this relation, some properties of these matrices are given first. Since F −1 = F † /2π, (cf. Eq. (3.36)), the equations FR2 + FI2 = 2πI,

FR FI = FI FR = 0,

(3.54)

can be derived from F † F = 2πI . Here, I stands for the identity matrix. The last equality, can be obtained by using the orthogonality relation (3.17). The first equation of (3.54) can be associated with the sum of the squares of cos and sin, and the second with the orthogonality of these functions. FR and FI also satisfy a pair

58

3 XFT: A Discrete Fourier Transform

of relations that can be associated with the derivatives of cos and sin as it can be seen in Eq. (3.74) below. Another important property of these matrices concerns with parity. The matrix FR2 can be calculated by using (3.50).   FR2

jk

[ N−1 2 ]

= 2π



(−1)n+m u2n,j u2m,k

N 

u2n,k u2m,k

k =1

n,m=0 [ N−1 2 ]

= 2π



u2n,j u2n,k = π(δj k + δj,N−k+1 ),

n=0

where (3.17) and (3.20) have been used. Similarly, for FI2 , the same kind of calculations gives,   FI2

jk

= π(δj k − δj,N−k+1 ).

Taking into account that FR and FI are symmetric matrices, the last two equations become FRT FR = FR2 = π(I + I),

(3.55)

FIT FI = FI2 = π(I − I),

(3.56)

and

respectively. Note that FR2 /2π and FI2 /2π are symmetrization and antisymmetrization discrete operators, i.e., given a vector f , (I + I)f/2 gives the symmetric part of f , whereas (I − I)f/2 gives the anti-symmetric part, in the same way that f (t) + f (−t) , 2

f (t) − f (−t) , 2

gives the even and odd part of a given function f (t), respectively. On the other hand, the odd and even symmetry present in the definitions (3.50) and (3.51) of FR and FI , allows to write these matrices in the partitioned form   IFC I IFC , FR = FC I FC

 IFS I −IFS FI = , −FS I FS 

(3.57)

3.3 Discrete Fourier Cosine and Sine Transforms

59

if N is even. Note that the matrix I used here has size N/2 × N/2. If N is odd, the structure of the real and imaginary part of F are ⎛

⎞ IFC I Iv IFC FR = ⎝ v T I c v T ⎠ , FC I v FC



⎞ IFS I o −IFS FI = ⎝ o T 0 o T ⎠ , −FS I o FS

(3.58)

respectively. If needed, the components of the vector v of length (N − 1)/2 and the value of the constant c, can be calculated from (3.50) and (3.8). The elements of the null vector o are 0, i.e., ok = 0, k = 1, 2, · · · , (N − 1)/2. Assume N is even. The substitution of (3.57) in Eqs. (3.55) and (3.56), produces that the blocks corresponding to FC and FS , satisfy FC2 =

π I, 2

FS2 =

π I. 2

(3.59)

According to these equations, the inverse discrete transforms become FC−1 =

2 FC , π

FS−1 =

2 FS . π

(3.60)

It is well-known that these inverse relations are satisfied by the integral transforms, so that they are desired properties of any discrete cosine and sine Fourier transforms. The case when N is odd is different. The substitution of (3.58) in Eqs. (3.55) and (3.56), gives the equalities 1 π FC2 + vv T = I, 2 2

FS2 =

π I. 2

The latter has the structure of the second equality of (3.59), whereas the former differs by a projection matrix. This means that FC2 acts as the identity matrix I in the subspace orthogonal to the vector v, which is an eigenvalue of FC , since c FC v = − v. 2 This is one of the equalities obtained from the substitution of (3.58) in (3.55). As a by-product, the comparison of the blocks resulting from the product FR2 with those of π(I + I) leads to interesting equations for the Hermite polynomials and their zeros. In spite of the fact that the cosine and sine Fourier transforms can also be defined in the case of N odd, the lack of properties as those given in (3.59), leads to define them only in the case of N even. The choice of N odd has other inconveniences. For example, when N is odd, the set of nodes tk contain the point t(N+1)/2 = 0. This means that a singularity at the origin of the function f (t) to be transformed prevents this set of nodes from given

60

3 XFT: A Discrete Fourier Transform

a finite value of the discrete transform. To discard this possibility, it is convenient to restrict N to be an even integer in some cases. Then, taking into account that FR and FI are the real and imaginary parts of the discrete Fourier transform F and that FC and FS are the blocks of FR and FI corresponding to the positive values of the nodes tj , the following definition makes sense. Definition 3.2 Let N be a positive even integer and FR and FI the real and imaginary part of F , given by (3.50), (3.51), and (3.49), respectively. The submatrix FC of FR as given by (3.57), defines the discrete cosine Fourier transform. Similarly, the block FS defines the discrete sine Fourier transform. In order to show how these transforms can be computed in terms of the product F times a vector, and thus to give a fast algorithm to compute them, consider the block matrices given in (3.57). Let M be a positive integer and put N = 2M. Assume that a vector f of length M is given. Define a vector fˆ+ of length N through   If fˆ+ = , f and apply F to fˆ+ . This gives the vector gˆR = FR fˆ+ , i.e., gˆ R = 2

  IFC f . FC f

Therefore, the discrete Fourier cosine transform g˜C = FC f can be obtained according to (g˜C )k =

1 (gˆR )M+k , 2

k = 1, 2, · · · , M.

To compute the sine transform of a given vector f of length M, define now fˆ− as   −If fˆ− = , f and apply again F to fˆ− to give the vector gˆ I = iFI fˆ− , i.e, gˆI = 2i

  −IFS f . FS f

Therefore, the discrete Fourier sine transform g˜ S = FS f can be obtained from (g˜S )k =

i (gˆI )M+k , 2

k = 1, 2, · · · , M.

3.4 Differentiation Matrices and the XFT

61

An algorithm to compute the cosine transform is given below. The discrete Fourier sine transform can be computed in a similar way. Some numerical examples are also given.

3.4 Differentiation Matrices and the XFT The differentiation matrix given by (2.31) was useful in Chap. 2 to find some properties of the ordinary discrete Fourier transform. It is shown next that the XFT has also associated a useful differentiation matrix. Some further results about differentiation matrices are summarized in this section. Proofs and applications are given elsewhere.

3.4.1 Discrete Derivatives in L2 (−∞, ∞) Let us consider N different complex nodes z1 , z2 , . . . , zN and a polynomial fm (z) of degree m at most N − 1. Then, the N-point derivative of fm (z) obtained in [17, 23–25, 27] can be written in the form fm (zj ) =

N 

Dj k fm (zk ),

(3.61)

k=1

where

Dj k =

⎧ N  ⎪ 1 ⎪ ⎪ ⎪ , ⎪ ⎪ ⎨ l =j zj − zl ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩

j = k, (3.62)

P (zj ) , j = k, (zj − zk ) P (zk )

 and P (z) = N k=1 (z − zk ). See also [26, 35, 38]. The complex-valued Hermite interpolation evaluated at the nodes (see Sect. 2.3.1) can be used to prove that D, as given in (3.62), is a differentiation matrix which gives exact derivatives on the space of polynomials of degree at most N − 1.

62

3 XFT: A Discrete Fourier Transform

Consider now a positive function γ (z) on the interval considered. The derivative of the function um (z) = γ (z)fm (z), evaluated at the node zj becomes   γ (zj )



fm (zj ) um (zj ) = γ (zj ) fm (zj ) + γ (zj ) N   γ (zj ) Dj k + (3.63) = γ (zj ) fm (zk ) γ (zj ) k=1

=

N 

Dj k um (zk ),

k=1

where the elements Dj k , which are given by   γ (zj ) /γ (zk ), Dj k = γ (zj ) Dj k + γ (zj )

(3.64)

define the N × N differentiation matrix D which generates exact derivatives on the space spanned by um (z), m = 0, 1, . . . , N − 1. 2 2 Let γ (t) be the real function e−t /2 . Since the orthogonal system e−t /2 Hm (t) is 2 closed [137] in L (∞, ∞), Eq. (3.64) gives a matrix for approximating derivatives in this space for this choice of γ (t). The diagonal elements of D are given by Djj =

N  l =j

1 − tj . tj − tl

Therefore, if the N zeros t1 , t2 , . . . , tN , of the Hermite polynomial HN (t) are selected as nodes and the electrostatic formulas for the zeros of the classical orthogonal polynomials [137] are used, the diagonal entries Djj vanish and thus, D becomes D = GSD(GS)−1 ,

(3.65)

where S is the diagonal matrix Sj k = (−1)j δj k , G is the matrix whose elements are given by Gj k = e−tj /2 HN (tj )δj k , 2

and

(D)j k =

⎧ ⎪ 0, ⎪ ⎪ ⎨

(3.66)

j = k,

⎪ (−1)j +k ⎪ ⎪ , j = k. ⎩ tj − tk

is the matrix defined in (3.28). In these equations, j, k = 1, 2, . . . , N.

(3.67)

3.4 Differentiation Matrices and the XFT

63

Therefore, the matrix D, as given by (3.65), is a differentiation matrix which 2 generates exact derivatives for functions of the form u(t) = e−t /2 f (t), where f (t) is a polynomial of degree at most N − 1. If f (t) is not a polynomial, D gives an approximated vector to the vector formed with the values u (tj ), j = 1, 2, · · · , N. It has been shown by (3.32) and (3.33) that (U −1 MU )D(U −1 M −1 U ) = (−iΛ) and (U −1 M −1 U )D(U −1 MU ) = iΛ, holds. Here, M = M(i) and Λ is the diagonal matrix whose diagonal elements are the dimensionless Hermite zeros tj = ωj , j = 1, 2, . . . , N. Since F is proportional to U −1 MU , the above equations can be written as F DF −1 = −iΛ and F −1 DF = iΛ, respectively. By using (3.65), these equations become F G−1 SDSGF −1 = −iΛ

(3.68)

F −1 G−1 SDSGF = iΛ,

(3.69)

and

respectively, producing that D is diagonalized by the matrix F up to a similarity transformation with a diagonal matrix. Taking into account Eq. (3.11) and the fact that Hn (x) = 2nHn−1 (x), the diagonal matrix SG becomes a constant times the identity matrix if N is large enough, i.e., (SG)j k  (−1)N

2NΓ (N) Γ ( N+1 2 )

δj k .

(3.70)

Therefore, in this asymptotic limit, (3.65) becomes D  D.

(3.71)

64

3 XFT: A Discrete Fourier Transform

A simple matrix like (3.70), proportional to the identity matrix, leaves invariant an arbitrary matrix under a similarity transformation. Therefore, the asymptotic forms of (3.68) and (3.69) are the equations F DF −1 = −iΛ

(3.72)

F −1 DF = iΛ.

(3.73)

and

These are important equations that have appeared before (cf. Eqs. (3.32) and (3.33)). They mean that if N is large enough, the kernel matrix F of the discrete Fourier transform diagonalizes the differentiation matrix D given in (3.65), which gives approximate derivatives for functions in L2 (∞, ∞). Note that F −1 should be considered as the inverse of the kernel matrix F and not as a discrete inverse Fourier transform. By the way, note that Eqs. (3.72) and (3.73), can be written as DF −1 = −iF −1 Λ and DF = iF Λ, respectively, and therefore, it can be obtained easily that the real and imaginary parts of F , used to define the discrete Fourier cosine and sine transforms in Sect. 3.3, satisfy DFR = −FI Λ,

DFI = FR Λ.

(3.74)

These equations can be associated with the derivatives of the functions cos t and sin t, respectively. Heuristic arguments on the pair of equations (3.72) and (3.73) reveal that one is de dual of the other. Take (3.72) for example. The Fourier transform of the (time) derivative of the inverse Fourier transform of a given function (of the frequency), equals −i times the (frequency) variable. This is a well know fact in Fourier analysis and it can be proved as follows 1 2π



∞ −∞

1 2π



 eiωt ∞



d dt





∞ −∞

 e−iκt g(κ)dκ dt =

eit (ω−κ) (−iκ)g(κ)dκdt =

−∞ −∞  ∞

−∞

(−iκ)g(κ)δ(κ − ω)dκ = −iωg(ω).

and in short notation it is 

 FDt F−1 g(ω) = −iωg(ω),

(3.75)

3.4 Differentiation Matrices and the XFT

65

where  Ff (x) =

∞ −∞

eikx f (x)dx.

Solving for D in (3.73), D = F −1 (−iΛ) F ,

(3.76)

Note the similarity between (3.76) and the equation d f (t) = F−1 (−iωFf (t)) , dt which can be derived from (3.75). The dual relation is   d g(ω) = F ixF−1 g(ω) , dω which can be proved along the same lines: consider 1 2π



∞ −∞

1 2π

e−iωt 



 

d dω ∞

−∞ −∞





∞ −∞

 eiωτ f (τ )dτ dω =

eiω(τ −t )(iτ )f (τ )dτ dω = ∞

−∞

(iτ )f (τ )δ(τ − t)dτ = itf (t),

which can be written in short notation as   F−1 Dω F f (t) = itf (t).

(3.77)

Compare (3.77) with (3.75). One is the dual of the other. In the discrete formalism of the XFT, the nodes tj = ωj are dimensionless, therefore the dual relation of (3.76) is D = F (iΛ) F −1 .

(3.78)

If no need to distinguish time from frequency, or from any other dimension in a derivative, Eqs. (3.78) and (3.76) perform the same approximation. In fact, the matrix given in (3.76) is equal to that given in (3.78). A direct proof of this is now given.

66

3 XFT: A Discrete Fourier Transform

If N is even, the matrix iΛ can be written in the form   I(−iX+ )I 0 0 iX+     0I 0I I(iX+ )I 0 = I 0 0 −iX+ I 0     0I 0I = (−iΛ) , I 0 I 0

iΛ =

(3.79)

where X+ is the diagonal matrix formed with the positive zeros of HN (t), and 0 stands for the null matrix. Therefore, taking into account that  F

0I I 0





 0I I 0       IFS I −IFS 0I IFC I IFC +i = FC I FC −FS I FS I 0 = (FR + iFI )

= FR − iFI = 2πF −1 , the equality F (iΛ) F −1 = F −1 (−iΛ) F follows. If N is odd, the matrix iΛ can be written as ⎛ ⎞ I(−iX+ )I 0 0 iΛ = ⎝ 0 0T ⎠ 0T 0 0 iX+ ⎛ ⎞⎛ 0 0 I I(iX+ )I T T ⎝ ⎠ ⎝ = 0 10 0T I 0 0 0 ⎛ ⎛ ⎞ 0 0 I 0 = ⎝0T 1 0T ⎠ (−iΛ) ⎝0T I 0 0 I

⎞ ⎛ ⎞ 0 0 I 0 0 0 0T ⎠ ⎝0T 1 0T ⎠ 0 −iX+ I 0 0 ⎞ 0 I 1 0T ⎠ , 0 0

(3.80)

3.4 Differentiation Matrices and the XFT

67

where o stands for the vector whose elements are 0, i.e., ok = 0, k = 1, 2, · · · , (N − 1)/2. According to (3.58), ⎛

⎞⎛ ⎞ ⎛ ⎞ 0 0 I 0 0 I IFC I Iv IFC F ⎝0T 1 0T ⎠ = ⎝ v T I c v T ⎠ ⎝0T 1 0T ⎠ I 0 0 FC I v FC I 0 0 ⎛ ⎞⎛ ⎞ IFS I o −IFS 0 0 I + i ⎝ oT 0 oT ⎠ ⎝0T 1 0T ⎠ −FS I o FS I 0 0

(3.81)

= 2πF −1 . Therefore, the equality F (iΛ) F −1 = F −1 (−iΛ) F also holds for N odd. Thus, it has been proved the following Theorem 3.2 Let N be a given positive integer. The N × N matrix D, as given by (3.65), is a differentiation matrix which generates exact derivatives for functions 2 of the form u(t) = e−t /2 f (t), where f (t) is a polynomial of degree at most N − 1, and it gives approximate derivatives for functions in L2 (∞, ∞). If N is large enough, the elements of D take the asymptotic matrix form D (cf. Eq. (3.71)),

Dj k =

⎧ ⎪ 0, ⎪ ⎪ ⎨ ⎪ (−1)j +k ⎪ ⎪ , ⎩ (tj − tk )

j = k, (3.82) j = k,

and D can be given by either D = F −1 (−iΛ) F , or D = F (iΛ) F −1 , where F = F (i) is the discrete Fourier transform given by (3.35), and Λ is the diagonal matrix formed with the N zeros of the Hermite polynomial HN (t). According to Theorem 3.2, the differentiation matrix appearing in (3.76) or the one given in (3.78), can be used to approximate derivatives in unbounded domains. The latter will be used as the expression for the differentiation matrix in the rest of this book.

68

3 XFT: A Discrete Fourier Transform

Just to give an idea of the importance of Eq. (3.78), consider the following generalization. If N is an even integer, the ceros tk = ωk , k = 1, 2, · · · , N, of the Hermite polynomial HN (t), are different from cero. Therefore, Λ−1 is the diagonal matrix whose finite diagonal elements are 1/ωk , and then   D −1 = F −1 −iΛ−1 F This matrix represents the inverse of a derivative, i.e., an antiderivative. In general, the αth power of Eq. (3.76) becomes D α = F −1 (−iΛ)α F ,

α ∈ R.

(3.83)

Note that the power α is not restricted to be a positive integer. It could be any real number. As mentioned above, for α ∈ R, one of the branches of the infinite set of branches of the power function zα has to be selected in this definition. In this way, Eq. (3.84), generalizes the notion of a derivative or integral to fractional derivatives/integrals, not only from the numerical but also from the analytical point of view [29]. The dual equation D α = F (iΛ)α F −1 ,

α ∈ R.

(3.84)

can also be used to give approximations to antiderivatives or derivatives of a given function. Note that F −1 D α F = (iΛ)α and therefore, D α = F −1 (−iΛ)α F , is the discrete representation of the known fact occurring in Fourier analysis about the nth derivative that can be written as F−1 (d n /dωn )F f (t) = (it)n f (t). A similar situation occurs for (3.84). Before continuing, it is necessary to prove that (3.83) and (3.84) gives a real vector D α f if the input vector f is real. Since N is even, the matrix iΛ can be written as in (3.79)   I(−iX+ )I 0 iΛ = . 0 iX+ The action of the matrix I in the product I(−iX+ )I is to reverse the conjugate of the diagonal matrix iX+ , so that the principal branch of the power (iΛ)α can be written in the form (iΛ)α = Φα + iΨα ,

(3.85)

3.4 Differentiation Matrices and the XFT

69

for any real power α. Here, Φα =

  IAα I 0 , 0 Aα

Ψα =

  −IBα I 0 , 0 Bα

and Aα and Bα are diagonal matrices of real numbers. Taking into account that F = FR + iFI , and F −1 = (FR − iFI )/2π, Eq. (3.84) becomes 2πD α = FR Φα FR + FI Φα FI − FI Ψα FR + FR Ψα FI + i(FR Ψα FR + FI Ψα FI − FR Φα FI + FI Φα FR ),

(3.86)

By using the partitioned form of the matrices FR and FI given in Eq. (3.57), the imaginary part of (3.86) becomes  IFC I FC I  IFS I + −FS I  IFC I − FC I  IFS I + −FS I

(2πD α ) =

   −IBα I 0 IFC I IFC FC I FC 0 Bα    −IBα I 0 IFS I −IFS −IFS 0 Bα FS −FS I FS    IFC IAα I 0 IFS I −IFS FC −FS I FS 0 Aα    −IFS IAα I 0 IFC I IFC FS FC I FC 0 Aα IFC FC

(3.87)

A direct calculation of each summand in (3.87) gives a null matrix, (D α ) = 0, and the vector f (α) = D α f is real for any real power α and real f . Note that the case in which N is odd must not be considered because, in such a case, the origin t = 0 is one of the nodes and (iΛ)α becomes a singular matrix for α < 0. Therefore, the following Theorem 3.3 has been proved. Theorem 3.3 If N is a positive even integer, α a real number, and f a real vector of length N generated by experimental data or by the values of a given function at the nodes   N +1 π k− , k = 1, 2, . . . , N, tk = √ 2 2N

70

3 XFT: A Discrete Fourier Transform

then, the vector f (α) , generated by f (α) = D α f, where D α = F (iΛ)α F −1 , is real matrix for any real α. Note that Theorem 3.3 is a particular case of the more general Theorem 3.4 Let N be a positive integer. If Γ is a matrix of the form Γ = Φ + iΨ , where Φ an Ψ are the matrices of definite parity   IAI 0 , Φ= 0 A

  −IBI 0 , Ψ = 0 B

(3.88)

if N is even, and ⎛ ⎞ IAI 0 0 Φ = ⎝ 0 d 0⎠ , 0 0A



⎞ −IBI 0 0 Ψ = ⎝ 0 0 0⎠ , 0 0B

(3.89)

if N is odd, the matrices F Γ F −1

and F −1 Γ F ,

are real. Here, d is a real number. Theorem 3.4 can be proved following the same lines as above. As has been noted above, the case of arbitrary real values of α, Eq. (3.84) generalizes the notion of a derivative or integral to fractional derivatives/integrals. The discussion on this issue will take place in Sect. 4.7 of Chap. 4 and presently, only integer values are considered. Let α = m be an integer. Note that the derivative of a function of the form 2 u(t) = e−t /2 f (t) where f (t) is a polynomial, results in a function of the same class where the degree of the polynomial is increased by one. Therefore, if m > 0 and f (t) is a polynomial of degree at most N − m, Eq. (3.84) gives a differentiation matrix which generates the exact derivatives u(m) (t), m = 1, 2, . . . , m, m ≤ N. The case of a negative power is different since in general the antiderivatives of u(t) does not belong to the same class of functions, however, since D−m is the t inverse of D m , Eq. (3.84) gives exact antiderivatives if u(t) is such that u(x)dx 2 goes to zero at infinity as e−t /2 . This condition can be relaxed since (3.84) can also be used to approximate derivatives of non-square-integrable functions, as shown below in Sect. 3.4.3. Consider the case of a function f (t) which may not belong to L2 (−∞, ∞). Let f and f be the vectors formed with the values of f (t) and df (t)/dt at the

3.4 Differentiation Matrices and the XFT

71

nodes t1 , t2 , · · · , tN , and c be the vector of constant entries. Since D −1 is the first antiderivative, and Dc = 0 (see Eq. (3.96) below), D −1 f determines f up to a numerical value, represented here by c. Thus, the equation D −1 f = f + c

(3.90)

holds in the asymptotic limit. If f (t) is a function of the form u(t) described above, the numerical value c must be zero, otherwise f (t) would not be quadratically integrable.

3.4.1.1 A Quadrature Formula A quadrature is a linear numerical integration formula of the form 

b

f (t)dt 

a

N 

λk f (tk ).

k=1

There is a great number of this kind of formulas where the orthogonal polynomials play an important rule (see for example [61]).  t Here, Eq. (3.90) gives another one. Note that the value of the definite integral tkj f (t)dt, k ≤ j , of a given function f (t) can be computed as 

tj

f (t)dt  (D −1 f )j − (D −1 f )k .

(3.91)

tk

Since (3.91) can be written in the form 

tj tk

f (t)dt 

N    (D −1 )j m − (D −1 )km f (tm ), m=1

the Fourier discrete transformation produces this quadrature formula which is expected to perform well for quadratically integrable functions. This quadrature will be tested later.

3.4.1.2 A Simple Initial Value Problem Just as in the continuous case, Eq. (3.90) gives the solution to the simple initial value problem Dy = f,

y(tj ) = a,

72

3 XFT: A Discrete Fourier Transform

for a given vector f . The solution is given by y = D −1 f − (D −1 f )j + a.

(3.92)

3.4.2 Parity and Differentiation Note that a variant of Eq. (3.80) can be obtained by doing the same steps as before:  0I F −1 = F I 0

 2π

(3.93)

Thus, (3.80) and (3.93) gives 

   0I 0I F = F. I 0 I 0

(3.94)

Note that    0I 0I = F −1 F −1 I 0 I 0



also holds, producing that        0I 0I 0I 0I I(−iX+ )I 0 F −1 . D =F 0 iX+ I 0 I 0 I 0 I 0



Therefore, 

   0I 0I D = −D. I 0 I 0

(3.95)

Assuming that f is a vector of length N (even) with definite parity, i.e., assuming that f satisfies  0I f, f =± I 0 

Eq. (3.95) gives 

   0I 0I f = ±D f =∓ f

I 0 I 0

3.4 Differentiation Matrices and the XFT

73

where f stands for the derivative Df . This equation is another way to say that the derivative of an odd function is an even function and vice versa. In general, if n is a positive integer, the equation 

   0I n 0 I D = (−1)n D n . I 0 I 0

holds, revealing the parity symmetry of higher derivatives. The case of N odd furnishes similar results. Thus the following Theorem 3.5 holds. Theorem 3.5 Let f be a non-null vector of length N with definite parity, i.e., f satisfies  f =±

 0I f, I 0

if N is even, or ⎛

⎞ 0 0 I f = ± ⎝0T 1 0T ⎠ f, I 0 0 if N is odd, and let n be a positive integer. Then, the vector f (n) of derivatives f (n) = D n f = F (iΛ)n F −1 f, has the parity given by the addition of the parity of n and f . It is possible to obtain a more detailed expression for the derivative of a vector with definite parity. In order to do so, it is convenient to prove that the derivative D of a constant equals zero. In terms of Fourier transforms, f  Df can be written as 1 (Df )j  2π



∞ −∞

e

iωtj

  iω

∞ −∞

e

−iωτ

 f (τ )dτ dω.

Therefore, if f (t) = 1, (Df )j  This result will be used below.

i 2π



∞ −∞

eiωtj ωδ(ω)dω = 0.

(3.96)

74

3 XFT: A Discrete Fourier Transform

3.4.2.1 The Case of N Even Suppose that f (t) is an even function. Therefore, the vector f of components fk = f (tk ), k = 1, 2, · · · , N, satisfies f =

 + If , f+

where f + is the vector of components corresponding to positive values of the nodes, i.e., fk+ = f (tN/2+k ), k = 1, 2, · · · , N/2. The differentiation matrix D is real, and the real and imaginary part of Eq. (3.85), are   −IX+ I 0 Ψ1 = , 0 X+

Φ1 = 0,

respectively. Therefore, Eq. (3.86) reads as 2πD = −FI Ψ1 FR + FR Ψ1 FI , where FR and FI are given by (3.57). Since f is an even vector,  FI f =

IFS I −IFS −FS I FS

  + If = 0, f+

therefore, 2πDf = −FI

  −IX+ I 0 FR f. 0 X+

On the other hand, if f (t) is an odd function, the vector f satisfies f =

  −If + , f+

and this gives    IFC I IFC −If + FR f = = 0, FC I FC f+ and therefore,   −IX+ I 0 FI f. 2πDf = FR 0 X+

3.4 Differentiation Matrices and the XFT

75

Summarizing, if N is an even integer, the product Df = F (iΛ)F −1 f becomes  ⎧ +F f + IF X ⎪ S C ⎪ ⎪ , ⎪ + + ⎪ ⎪ ⎨ −FS X FC f

2 Df =   π⎪ ⎪ ⎪ ⎪ IFC X+ FS f + ⎪ ⎪ , ⎩ FC X + FS f +

f (t) even, (3.97) f (t) odd.

3.4.2.2 The Case of N Odd Assume that f (t) is again an even function. The value of f (t) at the origin can be taken apart as f (t) = fˆ(t) + f (0), where fˆ(t) is even and vanish at the origin. Taking into account that D times a constant vector tends to zero (cf. Eq. (3.96)), f (t) can be assumed to vanish at the origin without loss of generality. Proceeding as above, the use of Eq. (3.58) gives rise to the equation ⎞ ⎧⎛ +F f + ⎪ IF X ⎪ S C ⎪ ⎜ ⎟ ⎪ ⎪ ⎜ ⎟ , f (t) even, ⎪ 0 ⎪ ⎝ ⎠ ⎪ ⎪ ⎪ + + ⎪ ⎪ −FS X FC f 2⎨ Df = ⎛ ⎞ π⎪ ⎪ ⎪ +F f + ⎪ IF X S ⎪ ⎪⎜ C ⎟ ⎪ ⎪ T X+ F f + ⎟ , ⎜ ⎪ f (t) odd. v ⎪⎝ S ⎠ ⎪ ⎪ ⎩ + + FC X FS f

(3.98)

3.4.3 Derivatives of Functions Not Decreasing at Infinity So far we have considered the following types of differentiation matrices 1. The matrix D, as given by (3.62) is a differentiation matrix which gives exact derivatives on the space of polynomials of degree at most N − 1, 2. The matrix D, as given by (3.65) and generated by D, is a differentiation matrix 2 which generates exact derivatives for functions of the form u(t) = e−t /2 f (t), where f (t) is a polynomial of degree at most N − 1, 3. The matrix D, as given by (3.84), α = 1, also generated by D and based on the discrete Fourier transform, is a differentiation matrix which gives

76

3 XFT: A Discrete Fourier Transform

approximate derivatives for functions belonging to the test space I (−∞, ∞) = L1 (−∞, ∞) ∩ L2 (−∞, ∞), The third and important case will be implemented later in O(N log N) operations (see Sect. 3.5.3), so that it is desirable to have a scheme where this kind of matrices could also give approximations for derivatives of functions not decreasing at infinity.

3.4.3.1 A First Idea: Regularization Let f (t) be a function not decreasing at infinity. A first idea to get a differentiation scheme based on (3.84), is to introduce a regularization of the function f (t) to be differentiated. This can be done by considering the product rect(t/A)f (t) instead f (t). Here,    t 1, |t| ≤ A/2 rect = A 0, |t| > A/2, and A is a suitable constant. This procedure converts the original function f (t) in a function to which (3.78) can be applied to get an approximation to f (t). However, the regularization necessarily introduces unwanted artifacts. A simple example can explain this. Suppose f (t) = t n . Consider now the Fourier integrals from which (3.84) is an approximation. For α = 1 and the regularized function rect(t/A) t n , the Fourier integrals give 1 2π



∞ −∞

e−iωt (−iω)



A/2 −A/2

 eiωτ τ n dτ dω

 n   1 A −iωt (−1)n e−iAω/2 − eiAω/2 = e 2π −∞ 2 !  A/2 iωτ n−1 e τ dτ dω +n 



−A/2

= n rect(t/A) t n−1 +

 n    ! A A A (−1)n δ t + −δ t − . 2 2 2

Thus, the derivative of the regularized function obtained through Fourier integrals gives two Dirac deltas in addition to what could be considered the expected result. The Dirac deltas are centered at the discontinuity points of the regularized function and they screen the numerical output of the discrete approach, as it is shown in Fig. 3.1 for f (t) = t 3 /100.

3.4 Differentiation Matrices and the XFT

77

Fig. 3.1 Approximate derivatives of rect(t/A) t 3 /100 computed by using (3.84) and the methods of Sect. 3.5.3 with N = 210 for A = 60. The exact derivative is compared with the one obtained by (3.84). (a): Complete output. (b): Close-up of the central part of case (a)

3.4.3.2 Parity Considerations A better idea to approximate derivatives of functions not decreasing at infinity is to exploit the parity of the function f (t). Only the case of first derivatives of functions of definite parity is discussed. According to (3.97) and (3.98), either N is even or odd, the approximation to the derivative f˜ = Df evaluated at positive values of t is determined by 2 (Df )+  π



−FS X+ FC f + FC

X+ F

S

f (t) even,

f +,

f (t) odd.

(3.99)

Keep in mind that D is a differentiation matrix which gives approximate derivatives of functions belonging to L2 (−∞, ∞). It is in this context that (3.99) should be applied. However, we can try to find out if the formula (3.99) can be extended for some kind of non-square-integrable functions. Consider the important case of a power function f (y) = y m , with m a nonnegative integer, and assume that m = 2n. Then, the Fourier integrals corresponding to even case of (3.99) are −

2 π









x sin(ξ x) 0

 cos(xy)y 2ndy dx.

0

Since the cosine Fourier transform satisfies 

∞ 0

d 2n y h(y) cos(xy)dy = (−1) dx 2n 2n





n

h(y) cos(xy)dy, 0

78

3 XFT: A Discrete Fourier Transform

(see [51]), The above integrals become   2n  ∞ n d sin(ξ x)x (−1) cos(xy)dy dx dx 2n 0 0  ∞ = (−1)n+1 2 x sin(ξ x) δ (2n) (x)dx

2 − π





0

= (−1)n+1

  (x sin ξ x)  2n

d 2n dx

x=0

,

where 



δ (m) (x)h(x)dx = (−1)m h(m) (0),

−∞

have been used. Therefore, −

2 π









x sin(ξ x) 0

 cos(xy)y 2ndy dx = 2n ξ 2n−1 .

(3.100)

0

The case m = 2n + 1 follows the same lines. In terms of Fourier integrals, the odd case of (3.99) can be written as 2 π







x cos(ξ x) 0





sin(xy)y

2n+1

dy dx.

0

By using the following property of the Fourier sine transform [51], 



y

2n+1

h(y) sin(xy)dy = (−1)

n+1

0

d 2n+1 dx 2n+1





h(y) cos(xy)dy, 0

it can be obtained that  ∞   2 ∞ 2n+1 x cos(ξ x) sin(xy)y dy dx = (2n + 1) ξ 2n . π 0 0 Note that (3.100) and (3.101) are particular cases of the Fourier integrals 1 2π



∞ −∞

 eiξ x (ix)



−∞

 e−ixy y m dy dx,

which, for f (t) = t m , takes the discrete form F (iΛ)F −1 f,

(3.101)

3.4 Differentiation Matrices and the XFT

79

which in turn is the asymptotic form of the differentiation matrix D applied to f . However, it should be noted that (3.100) and (3.101) were obtained by using the Dirac delta function, which is not even a function and can not be represented as an array of values, so that it is convenient to use another approach to find out how (Df )j approximates to mtjm−1 when f (t) = t m . To this end we can use the simple expression for the entries of D given by Dj k = (−1)j +k (1 − δj k )/(tj − tk ) (cf. Eq. (3.82)). According to (3.71), (3.64), and (3.62), ⎛ Dj k  e

−tj2 /2

⎝Dj k − δj k

N  l =j

⎞ 1 ⎠ etk2 /2 . tj − tl

Since D is a N × N differentiation matrix which gives exact derivatives for 2 polynomials of degree at most N − 1 and the function et /2 t m , can be expanded in a power series when m is integer, we have that 2

(Dg)j  etj /2 (mtjm−1 + tjm+1 ),

(3.102)

t 2 /2

where g is the vector of entries e j tjm , j = 1, 2, · · · , N. Therefore, if f is the vector of entries tjm , (Df )j  mtjm−1 + tjm+1 − tjm

N  l =j

1 . tj − tl

√ Because the set of points tk = (k − (N + 1)/2)π/ 2N are asymptotic values of the zeros of the Hermite polynomial HN (t), they satisfy approximately the relation N  l =j

1 = tj , tj − tl

and the equation (Df )j  mtjm−1 .

(3.103)

follows. The numerical implementation of this equation needs some caution. The 2 nature of the function et /2 t m , expanded in power series to obtain (3.102), requires the use of multiprecision algorithms to give a good approximation. However, simple computations carried out with double precision in floating point operations, shows that the absolute error |(Df )j − mtjm−1 |

80

3 XFT: A Discrete Fourier Transform

Fig. 3.2 Absolute error generated by (3.103) evaluated at the first positive zero, corresponding to j = N/2 + 1 if N is even, or j = (N + 1)/2 + 1 if N is odd. The error is a decreasing function of N if N is even and the power is odd, or if N is odd and the power is even

decreases if N is even and the power m is odd, or if N is odd and the power m is even, and the point tj is close to the origin. This behavior is illustrated in Fig. 3.2. Thus, (3.103) holds when using standard precision in floating point computations if N is even and the power m is odd, or if N is odd and the power m is even. In the case of functions not belonging to L2 (−∞, ∞), other than powers, it is possible to use the above result to get an approximation to the derivative. A given function f (t) can be written in terms of its even and odd parts as f (t) =

f (t) + f (−t) f (t) − f (−t) + , 2 2

3.4 Differentiation Matrices and the XFT

81

so that we can use an odd number of nodes, say N = 2n+1, to differentiate the even part (f (t) + f (−t))/2 and an even number of nodes, say N = 2n, to differentiate the odd part (f (t) − f (−t))/2, and then sum the resulting vectors.

3.4.4 Further Properties of Differentiation Matrices This section is devoted to show some additional properties of the differentiation matrix D given in (3.62). Some temporary changes in notation are required to do this. One of these properties will be used in Sect. 4.5 of Chap. 4. Let D(XN ) be the matrix constructed with the arbitrary set of points x1 < x2 , · · · < xN through (3.62) contained in the main diagonal of the diagonal matrix XN . Let D(XN+1 ) be the matrix constructed with the arbitrary set of points a = x0 < x1 < x2 < · · · < xN , contained in the main diagonal of the diagonal matrix XN+1 , and let D(XN+2 ) be the matrix constructed with the arbitrary set of points a = x0 < x1 < x2 < · · · < xN < xN+1 = b, contained in the main diagonal of the diagonal matrix XN+2 . (1) Let DN be the N × N submatrix of D(XN+1 ) defined by the partition   D00 d2 (3.104) D(XN+1 ) = (1) , d1 DN where d1 is the vector of entries (d1 )j = Dj 0 , and d2 is the one of entries (d2 )j = D0j , j = 1, . . . , N. (2) Let DN be the N × N submatrix of D(XN+2 ) defined by the partition ⎞ d2 D1,N+2 D11 (2) ⎠, D(XN+2 ) = ⎝ d1 DN c1 DN+1,1 c2 DN+2,N+2 ⎛

(3.105)

where d1 , d2 , c1 , c2 are the corresponding border vectors. Then, the following Theorem 3.6 holds (1) Theorem 3.6 The matrix DN defined by (3.104) and the differentiation matrix D(XN ) are related by (1) = (XN − aIN )D(XN )(XN − aIN )−1 + (XN − aIN )−1 , DN

(3.106)

82

3 XFT: A Discrete Fourier Transform

where XN is the diagonal matrix containing the arbitrary set of points x1 < (1) is x2 , · · · < xN in its main diagonal and IN is the N × N identity matrix. DN a differentiation matrix for functions of the form g(x) = (x − a)f (x),

(3.107)

where f (x) is any polynomial of degree at most N − 1. A straightforward proof of Theorem 3.6 can be given. Note that the polynomial P (x) whose derivatives are involved in (3.62) can be written in this case as PN+1 (x) = (x − a)PN (x), where PN (x) =

N

k=1 (x

(xj ) PN+1

PN+1 (xk )

− xk ). Therefore, =

(xj − a) PN (xj ) , (xk − a) PN (xk )

j, k = 1, 2, · · · , N.

In addition, the diagonal element (D(XN+1 ))kk , k = 0 can be written as  1 1 + , xk − a xk − xl N

(D(XN+1 ))kk =

l =k

so that (3.106) follows. On the other hand, the derivative of (3.107) evaluated at the nodes xk , k = 0, is g (xk ) = (xk − a)f (xk ) + f (xk ), and this gives   g = (XN − aIN )D(XN )(XN − aIN )−1 + (XN − aIN )−1 g, where g and g are the vectors of entries g (xk ), and g(xk ), respectively. Therefore, (1) DN is a differentiation matrix for polynomials of the form (3.107). The following Theorem 3.7 can be proved by using similar arguments. (2) Theorem 3.7 The matrix DN defined by (3.105) and the differentiation matrix D(XN ) are related by (2) = (XN − aIN )(XN − bIN )D(XN )(XN − aIN )−1 (XN − bIN )−1 DN

+ (XN − aIN )−1 + (XN − bIN )−1 , (2)

where XN and IN has the same meanings as in theorem 3.6. DN is a differentiation matrix for functions of the form g(x) = (x − a)(x − b)f (x),

(3.108)

3.5 Fast Algorithms for the XFT

83

where f (x) is any polynomial of degree at most N − 1. Another property can be obtained straightforwardly. Write (3.106) in the form (1)

DN (XN − aIN ) = (XN − aIN )D(XN ) + IN .

(3.109)

Since D(XN ) is a differentiation matrix, it generates exact values for the derivatives of a polynomial of degree at most N −1, [24]. Therefore, the derivatives of (x −a)m , m = 0, 1, . . . , N − 1, can be reproduced applying D(XN ) to the vector of entries (xk − a)m , k = 1, 2, . . . , N. Thus, we have that ⎛ ⎞ ⎞ (x1 − a)m (x1 − a)m ⎜ (x2 − a)m ⎟ ⎜ (x2 − a)m ⎟ ⎜ ⎟ ⎟ ⎜ m⎟ ⎜ ⎜ (x3 − a)m ⎟ (XN − aIN )D(XN ) ⎜ ⎟ = m ⎜ (x3 − a) ⎟ , ⎜ ⎟ ⎟ ⎜ .. .. ⎝ ⎠ ⎠ ⎝ . . ⎛

(xN − a)m

(xN − a)m

where m = 0, 1, · · · , N − 1, and the use of (3.109) gives ⎛ ⎞ ⎞ (x1 − a)m (x1 − a)m m⎟ ⎜ (x2 − a)m ⎟ ⎜ ⎜ ⎟   ⎜ (x2 − a) ⎟ m⎟ m⎟ ⎜ ⎜ (1) DN (XN − aIN ) ⎜ (x3 − a) ⎟ = (m + 1) ⎜ (x3 − a) ⎟ , ⎜ ⎟ ⎟ ⎜ .. .. ⎝ ⎠ ⎠ ⎝ . . m m (xN − a) (xN − a) ⎛

(1)

This equation shows that the eigenvalues of DN (XN − aIN ) are the integers (1) 1, 2, . . . , N for any set of points x1 < x2 < . . . < xN . Therefore, DN (XN − aIN )  (1) is invertible and det DN = N!/ N k=1 (xk − a). Since (XN − aIN ) is invertible and N N N!/ k=1 (xk − a) ≥ 1/ , where  = minN k=1 (xk − a) = x1 − a, we have proved the Theorem 3.8 D is invertible and det D ≥ 1/ N . The equality holds if the points tnj are equidistant. This theorem will be of importance in Sect. 4.5 of Chap. 4.

3.5 Fast Algorithms for the XFT Once established more properties of the differentiation matrix D, let us continue with the XFT formalism.

84

3 XFT: A Discrete Fourier Transform

The discrete Fourier transforms F , FC , FS , and the matrix differentiation D for unbounded domains, can be implemented in O(N log N) operations, as follows.

3.5.1 A Fast XFT According to Sect. 3.2, once √ the function f (t) and the set of dimensionless nodes tk = π(2k − N − 1)/(2 2N), k = 1, 2, · · · , N are given, the quadrature formula  g(ωj ) =

∞ −∞

eiωj t f (t)dt 

N 

Fj k f (tk )

(3.110)

k=1

√ holds for ωj = tj and Fj k  πeiωj tk / 2N. If the dimensions of time and frequency are intended to be included, the argument of the exponential should be multiplied by a suitable constant a. This is also the case if the purpose is to obtain a fast algorithm to compute (3.110). Thus, the product of a times ωj t gives  g(a ωj ) =

N π  iaωj tk eiaωj t f (t)dt  √ e f (tk ), 2N k=1 −∞ ∞

(3.111)

where ωj = tj as usual. Let F (a) be the matrix of elements π (F (a))j k = √ eiaωj tk , 2N

(3.112)

  ! aπ 2 π N −1 N −1 exp i = √ j− k− 2N 2 2 2N

(3.113)

that is, (F (a))j k

where now, j, k = 0, 1, 2, . . . , N − 1, and we have used (3.10). As it was said above, the scaling parameter a can also be used to compute the discrete Fourier transform F (a)f in O(N log N) operations. Note that if a = 4/π, then Eq. (3.113) becomes π (N−1)2 N

(F (4/π))j k

πei 2 = √

2N

where j, k = 0, 1, 2, . . . , N − 1.

"

e−iπ

N−1 N j

#"

ei

2πjk N

#"

e−iπ

N−1 N k

# ,

3.5 Fast Algorithms for the XFT

85

In order to simplify the notation, define F as F (4/π). Thus, the kernel matrix F can be written in the form π π F = √ ei 2 2N

(N−1)2 N

SF0 S,

where F0 is given by Eq. (2.18) and S is the diagonal matrix whose nonzero elements are exp(−iπ(N − 1)k/N), k = 0, 1, . . . , N − 1, i.e., π F = √ Fp , 2N

(3.114)

where Fp is given by (2.20). This formulation leads to the following Definition 3.3 Let N be a positive integer. The asymptotic discrete Fourier transformation F of order N is given by the set F ≡ {4W/π, F, T }, where T is the diagonal matrix whose diagonal elements are given by π tk = √ 2N

  N +1 k− , 2

k = 1, 2, . . . , N,

(cf. Eq. (3.10)), F is the kernel matrix given by (3.114) and W = T is the matrix of frequencies. The inverse periodic discrete transformation F−1 is given by the set {T , F −1 , 4W/π}. Some important remarks on this definition: 1. The factor 4/π appears just as a consequence of writing the XFT in terms of F0 , the standard discrete Fourier transform, in order to use the fast algorithm FFT. It is necessary to emphasize that this factor is not necessary if you do not want to compute a fast XFT. Therefore, it should be taken into account only in the fast algorithm to compute the XFT in terms of the FFT. 2. Since the matrix-vector product Fp f can be computed in O(N log N) operations, the matrix-vector product Ff can also be computed in O(N log N) operations. 3. In spite of the fact that the asymptotic kernel matrix F has the same structure as Fp up to a constant, this definition involves completely different matrices for the time and frequency values, correcting thus the drawbacks of the periodic discrete transformation (cf. the end of Sect. 2.2). The most important difference between the DFT and XFT schemes lies in the kind of nodes used to construct the matrix T . The nodes used by the XFT are asymptotic zeros of the Hermite polynomials. 4. According to (3.111), the product Ff gives an approximation to the Fourier transform evaluated at the scaled frequencies aωj , i.e., an approximation to (g(4ω1 /π), g(4ω2 /π), · · · , g(4ωN /π))T .

86

3 XFT: A Discrete Fourier Transform

In the applications, we have to take into account that F is the kernel matrix of a scaled transform. These ideas are incorporated in the following Algorithm 3.1 To compute the asymptotic discrete approximation gj to the Fourier transform g(4ωj /π) given the vector f = (f1 , f2 , . . . , fN )T , formed through experimental data or with values of a function f (t). 1. For given N, set the evenly spaced dimensionless abscissas tj = ωj π tk = √ 2N

  N +1 k− , 2

k = 1, 2, . . . , N.

2. Get the input data, or evaluate the given function f (t) at tk , k = 1, 2, · · · , N. 3. Obtain the approximation g = (g1 , g2 , . . . , gN )T by computing the vector π π g = √ ei 2 2N

(N−1)2 N

SF0 (Sf ),

with a standard FFT algorithm to compute the matrix-vector product F0 (Sf ). Here, S is the diagonal matrix whose nonzero elements are exp(−iπ(N − 1)k/N), k = 0, 1, . . . , N − 1, and F0 is the matrix given by (2.18). You have to plot the vector g˜ versus 4ωk /π, k = 1, 2 · · · , N, if a plot of the approximation g˜ is needed. This step is necessary to take into account that the XFT generates an approximation to the Fourier transform g(ω) evaluated at the points 4ωj /π. Some examples are given in Sect. 3.5.1.1 to contrast the performance of Algorithm 3.1 versus Algorithm 2.1.

3.5.1.1 The XFT Versus the DFT In order to show the performance of the XFT and that of the DFT, we take as example the pair of transforms given by (2.23). Figure 3.3 shows the output of the XFT, according to Algorithm 3.1, compared with the output of the DFT, according to Algorithm 2.1.

3.5 Fast Algorithms for the XFT

87

Fig. 3.3 (a): The upper figure corresponds to the real part of the approximated Fourier transform of e−|t| computed with N = 210 + 1 according to Algorithm 2.1. The lower figures correspond to the output of the XFT and the exact transform respectively. (b): Absolute error. The line on the top corresponds to the error generated by the DFT. The line on the bottom corresponds to the error generated by the XFT

Fig. 3.4 (a): Real part of the approximated Fourier transform of e−|t| computed by the XFT with N = 210 + 1 and compared with the exact transform. (b): Absolute error

Note that the error generated by the XFT appears to be very close to zero because it is compared with the large error produced by the DFT. Figure 3.4 shows only the performance of the XFT on this example. In part B of this figure, the error generated by the XFT can be appreciated. This example illustrates how the drawbacks of the DFT, discussed at the end of Sect. 2.2, are now corrected by the XFT. The XFT is obtained as a quadrature of the (fractional) Fourier transform and not by using the expansion of a periodic function in a Fourier series as the DFT. Therefore, the XFT works for non periodic functions, which is the most common case in applications, and it is more accurate than the DFT.

88

3 XFT: A Discrete Fourier Transform

3.5.2 A Fast Discrete Cosine Transform In Sect. 3.3, the discrete cosine (sine) Fourier transform was defined as the principal block FC of the real (the principal block FS of the imaginary) part of the kernel matrix F (cf. Eq. (3.57)). On the other hand, the relation between F and its fast counterpart F was discussed in Sect. 3.5.1. Thus, we have the following Definition 3.4 Let M be a positive integer. The asymptotic discrete Fourier cosine transformation FC of order M is given by the set FC ≡ {4W/π, FC , T }, where T is the M × M diagonal matrix whose diagonal elements are given by π tk = √ 4M

  1 , k− 2

k = 1, 2, . . . , M,

FC is the kernel matrix given by the diagonal block j, k = M + 1, M + 2, · · · , 2M of the real part of the 2M × 2M matrix F , which is given in Definition 3.3, and W = T is the matrix of frequencies. The inverse periodic discrete transformation F−1 C is given by the set {T , 2FC /π, 4W/π}. The discrete Fourier sine transformation can be defined in a similar way. Definition 3.5 Let M be a positive integer. The asymptotic discrete Fourier sine transformation FS of order M is given by the set FS ≡ {4W/π, FS , T }, where T is the M × M diagonal matrix whose diagonal elements are given by π tk = √ 4M

  1 k− , 2

k = 1, 2, . . . , M,

FS is the kernel matrix given by the diagonal block j, k = M +1, M +2, · · · , 2M of the imaginary part of the 2M × 2M matrix F , which is given in Definition 3.3, and W = T is the matrix of frequencies. The inverse periodic discrete transformation F−1 S is given by the set {T , 2FS /π, 4W/π}. As before, it should be taken into account that FC and FS are kernel matrices of scaled transforms. The ideas given in Sect. 3.3, for N = 2M, are incorporated in the following

3.5 Fast Algorithms for the XFT

89

Algorithm 3.2 To compute the asymptotic discrete approximation gck to the Fourier cosine transform gc (4ωk /π) given the vector f = (f1 , f2 , . . . , fM )T , formed through experimental data or values of a function f (t). 1. Set N = 2M. 2. Get the input data, or evaluate the given function f (t) at the nodes tk = ωk π tk = √ 2N

  1 k− , 2

k = 1, 2, . . . , M,

to give the array fk = f (tk ). 3. Set the vector fˆ   If ˆ f = , f where I is the matrix of elements Ij k = δj,M−k+1 . 4. Compute the vector gˆ through π π gˆ = √ ei 2 2N

(N−1)2 N

SF0 (S fˆ),

by using a standard FFT algorithm to compute the matrix-vector product F0 (S fˆ). Here, N = 2M, S is the diagonal matrix whose nonzero elements are exp(−iπk(N − 1)/N), and F0 is the matrix given by (2.18). 5. Obtain the approximation gc = (gc1 , gc2 , . . . , gcM )T through gck =

1 gˆM+k , 2

k = 1, 2, · · · , M.

As in the case of the discrete exponential Fourier transform, it is necessary to plot the vector g versus 4ωk /π, k = 1, 2 · · · , M, if a plot of the approximation g is needed. A numerical example follows.

90

3 XFT: A Discrete Fourier Transform

Fig. 3.5 (a): Approximated cosine Fourier transform of cos(t 2 /2 − π/8) computed by Algorithm 3.2 with M = 210 and compared with the exact transform. (b): Absolute error

3.5.2.1 Numerical Performance A simple example can show the great performance of the XFT cosine transform as given by Algorithm 3.2. Consider the pair of transforms 

t2 π f (t) = cos − 2 8



 ,

gc (ω) =

 2  ω π π cos − . 2 2 8

Figure 3.5 displays the approximate transform compared with the exact one.

3.5.3 Fast Differentiation Matrices This section is about one of the most important outcomes concerning the XFT: a simple algorithm to compute fast derivatives or antiderivatives of arbitrary order for functions belonging to L2 (−∞, ∞). This algorithm has a broad range of applications. Let N be a even integer. Then, the asymptotic zeros of the Hermite polynomial HN (t), given by (3.10), π tk = √ 2N

  N +1 k− , 2

k = 1, 2, · · · , N.

are different from zero, and therefore, the diagonal values of the diagonal matrix Λ can be raised to arbitrary powers to furnish the differentiation matrix given in Eq. (3.84) D α = F (iΛ)α F −1 ,

α ∈ R.

As has been noted above, this matrix gives derivatives or antiderivatives if α > 0 or α < 0, respectively. Since (3.84) can also be used to approximate derivatives of

3.5 Fast Algorithms for the XFT

91

non-square-integrable functions, it gives accurate results for antiderivatives even if t u(x)dx does not vanish at infinity (see the discussion below Theorem 3.3). In order to incorporate these ideas in a fast algorithm, it is necessary to take into account the fact that the fast version F of the kernel matrix F (cf. Eq. (3.114)) acting on a given vector f whose entries are the values of the function f (t) with transform g(ω) gives an approximation g˜ to the Fourier transform g(4ω/π) (cf. Algorithm 3.1). Thus, when applying the inverse matrix F −1 to a given vector g˜ (in order to recover f ), g˜ is assumed to be formed with exact or approximated values of a function g(4ω/π) at the nodes. Therefore, the fast discrete version of (3.83) under the XFT reads as D α = F −1 (−4iΛ/π)α F,

α ∈ R.

(3.115)

Note the factor 4/π. As said above, this factor should be taken into account only in the fast algorithm to compute the XFT in terms of the FFT, i.e., it is due to the fact that g˜ = Ff gives a scaled Fourier transform with scale parameter 4/π. If this is the case, this factor should be included in order to generate a vector ˜ g˜p = (−4iΛ/π)α g, that can be associated to a function gp (4ω/π). According to the above reasons, F −1 applied to g˜p recovers the vector f˜(α) which is the approximation to f (α) (t). Note that this function appears without any scale at all. The dual equation D α = F (4iΛ/π)α F −1 ,

α ∈ R.

(3.116)

can also be used to generate fast derivatives. In fact, this differentiation matrix is used in the corresponding applications given in Chap. 4. In this case, F should be considered as the inverse matrix of F −1 which in turn, should be considered as the discrete (inverse) Fourier transform, so that the (inverse) XFT gives an approximation to the scaled inverse transform f (4tj /π) which, multiplied by (4iΛ/π)α generates a function of 4tj /π to which the inverse F of F −1 can be applied to obtain an approximation to the function without scaling g(ω). This argument can be used to show that in the more general transformation T = F ϕ(4Λ/π) F −1 ,

(3.117)

where ϕ(t) is a given function and ϕ(4Λ/π) is the corresponding diagonal function matrix, there is no scaling, either. An algorithm to implement Eq. (3.116) and to give a fast differentiation matrix (α > 0) or a fast integration matrix (α < 0) is given next.

92

3 XFT: A Discrete Fourier Transform

Algorithm 3.3 To compute an approximation f (α) = (f1(α) , f2(α), . . . , fN(α))T of the αth fractional derivative (α > 0) or of the αth fractional antiderivative (α < 0) of the vector f = (f1 , f2 , . . . , fN )T , formed through experimental data or with values of a function f (t), by using Eq. (3.116). 1. Get the real number α and the even integer N. 2. Get the input data, or evaluate the given function f (t) at the nodes tk = ωk π tk = √ 2N



 N +1 k− , 2

k = 1, 2, · · · , N.

to generate the array fk = f (tk ). 3. Set the vector s of components sk = exp(−iπk(N − 1)/N), k = 0, 1, . . . , N − 1. 4. Compute the vector w as the inverse FFT of the vector of components fk /sk . 5. Compute the vector v as the FFT of the vector (i4tk /π)α wk . 6. Compute the elements of the output vector f (α) as the products sk vk , k = 1, 2, · · · , N.

3.5.3.1 Numerical Performance Some illustrative examples of the application of Algorithm 3.3 are given next. Derivatives and antiderivatives of integer order of quadratically integrable and nonquadratically integrable functions are given in examples. The case of fractional differentiation is also illustrated. According to the discussion below Eq. (3.115), there is no need to plot the resulting vector f˜(α) against a scaled axis, as in the case of a simple Fourier transform, i.e., if a plot of the approximation is needed, it can be done just plotting f˜(α) against tk in a standard way. Derivatives of quadratically integrable functions The nth derivative of the error function  t 2 2 erf(t) = √ e−y dy π 0

3.5 Fast Algorithms for the XFT

93

Fig. 3.6 (a): Sixth derivative of 5 erf(t/5) computed by using Algorithm 3.3 with N = 212 compared with the exact derivative. (b): Absolute error

is given by 2 dn 2 erf(t) = (−1)n−1 √ Hn−1 (t)e−t . dt n π Here, Hn (t) is the nth Hermite polynomial. Figure 3.6 shows the performance of Algorithm 3.3 for the sixth derivative of 5 erf(t/5). Derivatives of non-quadratically integrable functions An important case is that of a power function f (t) = t m , m integer. According to the discussion below Eq. (3.103), the number N of nodes should be an even integer if m is odd, and it should be an odd number if m is even, otherwise, multiprecision floating point computations are needed to attain convergence. In Fig. 3.7 is illustrated the behavior of Algorithm 3.3 when a power function is differentiated. When an odd number of nodes is used to differentiate an odd power (cf. the top case B of Fig. 3.7), the algorithm does not attain convergence: the output values oscillate about the exact values. The same behavior is presented when an even number of nodes is used to differentiate an even power (cf. the bottom case A of Fig. 3.7). In the case of a function without definite parity, the derivative can be obtained by taking apart the even part and odd part of the given function. In the case of a given vector f , the symmetrization matrices (I ± I) (cf. Eqs. (3.55) and (3.56)) can be used. Thus, the vectors f + and f − , defined by f+ =

1 (I + I)f, 2

f− =

1 (I − I)f, 2

are the even part and odd part of the vector f , respectively. To differentiate once the vector f − through Algorithm 3.3, we take an even number of nodes t1 , t2 , · · · , t2n , to form (f − ) , and for the even part of the function, we take the odd number of nodes given by t1 , t2 , · · · , t2n−1 , to form (f + ) . After that we sum the resulting vectors according to (f − ) j + (f + ) j ,

j = 1, 2, · · · , 2n − 1.

(3.118)

94

3 XFT: A Discrete Fourier Transform

Fig. 3.7 First derivative of t 4 (cases a) and t 3 (cases b) in dashed lines, computed by using Algorithm 3.3 with N = 28 + 1 (top) and N = 28 (bottom). These computations are compared with the exact derivative in each case

Fig. 3.8 (a): First derivative of the function given in Eq. (3.119) computed by using Algorithm 3.3 and Eq. (3.118) with N = 29 compared with the exact derivative. (b): Absolute error

In the following example, the first derivative of the non-square-integrable function f (t) =

1 + 10t − t 2 − t 3 /100 t 2 + 100

(3.119)

is computed. The output generated by Algorithm 3.3 and (3.118) for this case is shown in Fig. 3.8. Antiderivatives: a Fresnel integral Let us consider the integral 

t

cos(y 2 /2)dy =

√ √ πC(t/ π).

3.5 Fast Algorithms for the XFT

95

Fig. 3.9 (a): Numerical integration of f (t) = cos(t 2 /2) by using Algorithm 3.3 with N = 210 compared with the exact solution. (b): Absolute error

Fig. 3.10 (a): and (b): Numerical integration of f (t) = t by using Algorithm 3.3 with N = 210 (dashed line) compared with the exact solution (solid line). A suitable integration constant has been added to the numerical solution in (b)

This integral has a discrete representation given by Eq. (3.116) F (4iX/π)−1 F −1 f, where f is the vector whose entries are fj = cos(tj2 /2). The result of the direct application of Algorithm 3.3 is given in Fig. 3.9. The dual of (3.116), Eq. (3.115), gives the same result. Antiderivatives: power functions As we have seen at the end of Sect. 3.4.1, the antiderivative D −1 f determines f up to a constant c. This is the case of the simple function f (t) = t, illustrated in Fig. 3.10. The dashed line of case A shows the output of Algorithm 3.3, which coincides with the exact result after the addition of a suitable constant (case B). It is known that the integration of a given function f (t) produces a smoothing effect on the function, whereas the differentiation of f (t) performs a roughing action. To differentiate term by term a function expanded in Fourier series, the function must fulfill more conditions than in the case of integration of the series term by term. In other words, integration is more like a gentle operation, differentiation is more like a harsh procedure. This can explain the convergence (up to a integration constant) of the numerical integration of the power function f (t) = t m through

96

3 XFT: A Discrete Fourier Transform

Fig. 3.11 Numerical integration of (a): (t/100)2 , (b): (t/50)3 , (c): (t/20)4 , and (d): (t/15)5 , by using Algorithm 3.3 with N = 210 (dashed line) compared with the exact solution (solid line)

Algorithm 3.3, without considering the parity of m. This is shown in Fig. 3.11, where the integrals of (t/100)2 , (t/50)3 , (t/20)4 , and (t/15)5 , are computed. Quadratures: Definite integrals The quadrature formula (3.91) can be exemplified 11 and tested √ here. To√this end, √ take N = 2 , the set of nodes tk = (k − (N + 1)/2)π/ 2N, and πC(t/ π) as the test function. Consider the definite integral h(tj ) =

√ π



tj t100

√  t j √ √  C(t/ π)dt = πtC(t/ π) − sin(t 2 /2)  , t100

(3.120)

for j = n/2 + 1, n/2 + 2, · · · , n/2 + 20. To have an idea of the intervals of integration, note that if N = 211 , t100  −45.38, tn/2+1  0.02, and tn/2+20  46.65. As shown in Fig. 3.12, the absolute error produced by Eq. (3.91) is bounded by 10−7 in [tn/2+1 , tn/2+20 ]. As anticipated in Sect. 3.4.1.1, the quadrature (3.91) performs well with functions of L2 (−∞, ∞). In Table 3.1 further examples are given. Integrals: Plancherel theorem Another example, with application to analysis of signals, appears when it is desired to find the energy delivered by a sampled signal. A discussion on sampling and aliasing is given below in Sect. 3.6, but in order to explain why a physical or biological signal must be associated to a quadratically integrable function, consider the case of a seismic wave produced by an earthquake. At a fixed point, this wave can be represented by an oscillatory function f (t) of time. Therefore, the movement of a tiny stone on the earth’s surface will be given by a function proportional to f (t), and so do the force on it. Since the velocity of the stone is proportional to df (t)/dt, the power delivered by the earth to the

3.5 Fast Algorithms for the XFT

97

Fig. 3.12 Absolute error of the numerical computation of the integral (3.120) by using Eq. (3.91) with N = 211

Table 3.1 Five square norms of functions belonging to L2 (−∞, ∞) and their approximate values computed through Eq. (3.91) with N = 214 nodes

∞

2 −∞ |f (t)| dt

Eq. (3.91)

Error

8 3

2.66667

8.8×10−16

1 1 + t2

π 2

1.5708

2.3×10−7

e−2|t| sinc(t)

1 π

0.99995 3.13453

5.0×10−5 0.007

1 1 + |t|

2

1.98598

0.014

f (t) 4et (1 + et )2

stone becomes proportional to f (t)df (t)/dt, and so to d(f (t))2 /dt. Therefore, the energy absorbed in time by the stone is proportional to the integral 

∞ −∞

|f (t)|2 dt,

(cf. Eq. (2.6)), and this quantity must be finite, i.e., the function f (t) describing the signal must belong to L2 (−∞, ∞). The purpose of this example is to show that the discrete Fourier transformation given in this book satisfies the Plancherel theorem. This is going to be shown numerically and to this end, we take a brainwave as test function. Consider the 30-s segment of the signal delivered by an electrode in an normal EEG, like the one shown in Fig. 3.13. The values of the signal are normalized to one and the time scale has been modified in such a way that the sample fj corresponds to the node tj , j = 1, 2, · · · , N. In Sect. 3.6 will be shown how to apply the XFT to signals with a given sampling frequency. The absolute value of the Fourier transform of the above brainwave is given in Fig. 3.14.

98

3 XFT: A Discrete Fourier Transform

Fig. 3.13 A segment of 30 seconds of a normal EEG measured in one electrode. The values of the signal are normalized to 1 and the time scale has been modified

Fig. 3.14 (a): Absolute value of the Fourier transform of the EEG signal given in Fig. 3.13. (b): A zoom of |g| for positive values of ω

To show how the Plancherel theorem is fulfilled by the present discrete technique, take the Fourier transform of this brainwave and then make use of the integration formula (3.91) to compute the integrals 



−∞

 |f (t)| dt 2

and

∞ −∞

|g(ω)|2 dω.

First of all, note that

√ √ 1. Since ω1 = t1 ∼ − N and ωN = tN ∼ N , the inferior and superior limits of the above integrals can be substituted by t1 or ω1 , and tN or ωN , respectively if N is large enough. 2. The XFT gives a vector approximation g to the Fourier transform g(4ω/π). Therefore, when the vector |g|2 is given as input to Algorithm 3.3 with α = −1, ω the output is the antiderivative |g(4ω/π)|2 dω, and Eq. (3.91) reads as 

ωN ω1

|g(4ω/π)|2 dω  (D −1 |g|2 )N − (D −1 |g|2 )1 .

3.5 Fast Algorithms for the XFT

99

Taking into account these items, the Plancherel theorem, Eq. (2.6), takes the discrete form (D −1 |f |2 )N − (D −1 |f |2 )1 

 2  −1 2 −1 2 (D . |g| ) − (D |g| ) N 1 π2

(3.121)

−1 2 −1 2 Let  tN E(f ) 2denote the approximated value (D |f | )N − (D |f | )1 of the integral t1 |f (t)| dt. Then the computation of the left and right-hand sides of (3.121) with N = 4498 (the length of the vectors), gives

|E(f ) −

2 E(g)| = 0.00160, π2

indicating good agreement between both sides. Fractional derivatives In spite of the fact that a more detailed discussion on this issue will take place in Sect. 4.7 of Chap. 4, this is a good place to introduce the performance of Algorithm 3.3 when the order α of the derivative is not an integer. As a brief example, the continuity of the differentiation formula (3.116) as a function of the order α of differentiation, 0 < α ≤ 2, is illustrated in Figs. 3.15 and 3.16, where two square-integrable functions are differentiated.

Fig. 3.15 Fractional derivatives of the function f1 (t) = 1/(1 + t 2 ) according to Eq. (3.116). (a): Dotted line, α = 0.2. Dashed line, α = 0.5. Solid line, α = 1. (b): Dotted line, α = 1.2. Dashed line, α = 1.5. Solid line, α = 2

Fig. 3.16 Fractional derivatives of the function f1 (t) = 1/(1 + |t|) according to Eq. (3.116). (a): Dotted line, α = 0.2. Dashed line, α = 0.5. Solid line, α = 1. (b): Dotted line, α = 1.2. Dashed line, α = 1.5. Solid line, α = 2

100

3 XFT: A Discrete Fourier Transform (α)

(α)

Note that according to these figures, f1 (t) and f2 (t) have a greater variation on the positive t-axis and they show the continuous transition from the function itself, α = 0, to the integer cases α = 1 and α = 2.

3.5.3.2 Two Remarks on Algorithm 3.3 First, it should be noted that for certain kind of square-integrable functions, the number N of nodes should be large enough to make this algorithm useful. For 2 example, consider the function f (t) = t m e−t /a , with m integer, a > 0. As it is shown in Fig. 3.17, for α = 3, m = 3, and a = 100, the number N of nodes must be greater than 29 in order to give an acceptable derivative. Secondly, when searching for a spectrum, the user of the XFT should be aware of cases of disparity between the amplitudes of the Fourier components in the frequency space. Consider the following example. Let

f1 (t) =

⎧ ⎪ ⎪ ⎨cos t,

t < 1,

sin(3t), 1 ≤ t < 5, ⎪ ⎪ ⎩cos(10t), 5 ≤ t,

Fig. 3.17 (a): Third derivative of t 3 e−t /100 computed through Algorithm 3.3 (dashed line) with M = 29 (top) and M = 210 (bottom). The solid line corresponds to the exact derivative. (b): Absolute error 2

3.5 Fast Algorithms for the XFT

101

be the function (unknown for the user, of course) to be represented as a Fourier integral. This signal is composed by three concatenated pulses: one finite pulse linking two semi-infinite pulses. It should not be confused with a signal like f2 (t) = cos t + sin(3t) + cos(10t) which is composed by the addition of three Fourier components in the time domain. Since the Fourier transform of f1 (t) is given by 

1

−∞



5

eiωt cos t dt + 1





eiωt sin(3t) dt +

eiωt cos(10t) dt,

5

there are two definite frequencies (ω = 1, 10) to be found in addition to the spectrum corresponding to the finite pulse, which must be centered at ω = 3. Figure 3.18 shows the output of the XFT applied to f1 (t). Note that the spectrum of the finite pulse centered at ω = 3 is apparently missing. Compare with the output of the XFT applied to f2 (t) shown in Fig. 3.19, where ω = 3 is shown up. The explanation of this phenomenon is not difficult to see. As said above, the former case is formed by three independent pulses. Two of them (the semi-infinite pulses) have a Dirac delta function as Fourier transform, whereas the finite pulse has

Fig. 3.18 (a): Real part of the Fourier transform of the above function f1 (t) as given by the Algorithm 3.3 with N = 215 . (b): Imaginary part

Fig. 3.19 (a): Real part of the Fourier transform of the above function f2 (t) as given by the Algorithm 3.3 with N = 213 . (b): Imaginary part

102

3 XFT: A Discrete Fourier Transform

a bounded transform. Therefore, the magnitude of the numerical representation of the Dirac delta functions screens the magnitude of the Fourier transform of the finite pulse. This makes difficult to visualize the important part of the spectrum centered at ω = 3, and the user may get an incomplete idea of the spectrum.

3.6 Sampling and Aliasing 3.6.1 Sampling A sampled signal consists of the set of measurements of certain physical or biological quantity at a finite number of evenly spaced times. It is assumed that such measurements correspond to values of certain time (or space) function f (t). Typical examples are brainwaves and audio signals. The difference τ between two consecutive time values is called the sampling period, and the number of samples measured in one second is called the sampling frequency or sampling rate νs . Therefore, the relation between these two parameters is νs = 1/τ .

3.6.1.1 XFT of Sampled Data Our aim in this section is to show how to use the XFT when a signal is sampled at a sampling rate νs . Let f˜ be the vector f˜ = (s1 , s2 , · · · , sN )

(3.122)

of N samples measured at every 1/νs seconds. This means that sk is measured at k/νs seconds. Let f (t) be a function representing such signal. Without more information about the kind of signal vector s, the sample values can be shifted in such a way that Nτ/2 correspond to the origin of the time scale. Therefore, the samples are assigned to values of the function f (t) such that  f

k − (N + 1)/2 νs

  sk ,

k = 1, 2, · · · , N.

Taking into account the evenly spaced time values used by Algorithm 3.2, i.e, π tk = √ 2N

  N +1 k− , 2

k = 1, 2, . . . , N,

3.6 Sampling and Aliasing

103

the above equation for the sampled values of f (t) reads as f

  tk  sk , w

k = 1, 2, · · · , N,

(3.123)

where πνs w= √ . 2N

(3.124)

Consider now one of the basic properties of the Fourier transform  g(ω) =

∞ −∞

eiωt f (t)dt.

Under a scaling of t, it becomes 1 w



∞ −∞

eiμt f (t/w)dt = g(wμ),

w > 0,

(3.125)

where we have replaced ω by μ for convenience. Note that if t/w is a quantity with dimensions of time, then wμ must be the angular frequency. On one hand, if the XFT is applied to the vector obtained by discretizing f (t/w), i.e, if it is applied to the vector of samples (3.122), it gives an approximation g˜j to 



−∞

ei(4ωj /π)t f (t/w)dt,

where ωj = tj is a dimensionless number. Therefore, according to (3.125), the output g˜ j ofthe XFT should be divided by w in order to obtain an approximation to  g w4ωj /π , i.e.,   1 g˜ j  g 4wtj /π , w

j = 1, 2, · · · , N,

indicating that wtj is an angular frequency. On the other hand, Eq. (3.125) can be used to include dimensions of time and frequency in our scheme, as noted at the beginning of Sect. 3.5.1. Equation (3.123) means that the signal evaluated at tk /w seconds is f (t/w), since the points tk are dimensionless. Therefore, to find an approximation to the Fourier transform g(4wtj /π), of the vector f˜ given by (3.122), with ν given in Hertz, the angular frequency wtj must be divided by 2π, i.e., wtj w νj = = √ 2π 2 2N

  N +1 j− , 2

j = 1, 2, . . . , N,

(3.126)

104

3 XFT: A Discrete Fourier Transform

which in turn means that the XFT scheme generates approximations to g(4wtj /π) = g(8νj ), as a Fourier transform of the vector of samples (3.122). Thus, the procedure given in Algorithm 3.2 to compute a discrete approximation to the Fourier transform becomes Algorithm 3.4 To compute the dependence in Hertz of the asymptotic discrete Fourier transform approximation g˜ = (g˜1 , g˜2 , . . . , g˜N )T of the given vector f˜ = (s1 , s2 , . . . , sN )T , obtained as experimental data sampled at sampling frequency νs given in Hertz. 1. For given N, set the evenly spaced dimensionless abscissas π tk = √ 2N

  N +1 k− , 2

k = 1, 2, . . . , N.

√ 2. Get the input data sampled at times tk /w, where w = πνs / 2N is defined in terms of the sampling frequency νs . 3. Set the frequencies w νj = √ 2 2N

  N +1 j− , 2

j = 1, 2, . . . , N,

4. Obtain an approximation g˜j to g(4wtj /π) by computing the vector g˜ =

1 π/w π Fp f˜ = √ ei 2 w 2N

(N−1)2 N

SF0 (S f˜),

with a standard FFT algorithm to compute the matrix-vector product F0 (S f˜). Here, S is the diagonal matrix whose nonzero elements are exp(−iπ(N − 1)k/N), k = 0, 1, . . . , N − 1. Again, if a plot of the approximation g˜ against Hertz is needed, do not forget to plot g, ˜ the vector given by the XFT, versus 4wtj /π = 8νj , for j = 1, 2 · · · , N, i.e., 2πνj has to be multiplied by the scaling factor 4/π.

3.6 Sampling and Aliasing

105

As simple example of the application of Algorithm 3.4, consider the following pair of transforms    π 2 cos(π 2 ν 2 ) + sin(π 2 ν 2 ) . f (t) = cos t , g(ω) = g(2πν) = (3.127) 2 Assume that f (t) is sampled at a rate νs = 10 Hz generating the vector of approximated values f˜ = (s1 , s2 , . . . , sN )T and length N = 28 .The signal and the points representing the measurements sk are shown in Fig. 3.20. The approximation g˜ to the Fourier transform g(4ν/π) is shown and compared with the exact transform in Fig. 3.21. As a real example of the application of Algorithm 3.4, consider the following frequency decomposition of human voice. This is a very active and large area of research (see for example [58] and references therein). What it is next shown, is a very simple example, where the range of frequencies existing in the cry of a baby of two months and those existing in the voices of a boy and a girl of two and four years respectively, and two adults, male and female, thirty and forty years old, respectively. Figure 3.22 shows the recording of the cry of a baby as an example of a signal sampled at a high frequency. All of the signals were recorded at a frequency rate νs = 44,100 Hz.

Fig. 3.20 Recording of a signal (solid line) sampled at νs = 10 Hz (dotted)

Fig. 3.21 (a): Output of the XFT applied to the signal f˜ plotted in Fig. 3.20 compared with the exact transform. (b): Absolute error

106

3 XFT: A Discrete Fourier Transform

Fig. 3.22 Recording of the cry of a newborn baby sampled at νs = 44,100 Hz

Fig. 3.23 Amplitude and frequencies of the Fourier transform of a segment of the cry of a baby (top) compared with those of the voices of two children, a two years old boy (middle) and a four years old girl (bottom). (a): Real part and (b): imaginary part of the corresponding transforms

The aim of this experiment is to grasp the main changes of the human voice with age and sex. Figure 3.23 shows the real and imaginary part of the Fourier transforms of the signals corresponding to the baby and the two children, plotted for the frequencies lying between 0 and 5 kHz.

3.6 Sampling and Aliasing

107

Fig. 3.24 Amplitude and frequencies of the Fourier transform of a segment of the voice of an adult woman (top) compared with the voice of an adult man (bottom). (a): Real part and (b): imaginary part of the corresponding transforms

Figure 3.23 also shows how the complexity of the voice of a child is increased with age. It also shows that incipient bands of frequency (or formants) are already present in the cry of a baby of two months. The spectrum of the adults is shown in Fig. 3.24. There are two principal bands of frequency present in both cases. The second band is greater in amplitude and shifted to higher frequencies in the case of the woman. Additionally, the female spectrum present formants around higher frequencies.

3.6.1.2 Differintegral Scheme for Sampled Data As exemplified above, sampled signals appear in applications and very often is necessary to differentiate or integrate them. Therefore, to apply the differintegration scheme of Algorithm 3.3 to this kind of signals, a slight modification is needed. Let νs be the sampling frequency and f (t) the sampled signal. Consider the N × N α-differentiation matrix given in Eq. (3.83), D α = F −1 (−iΛ)α F , applied to the vector s of length N of sampled data sk , i.e., f (tk /w) = sk , (cf. Eq. 3.123). Since D α s is the discrete representation of the Fourier transformation (D α s)j 

1 2π





−∞

  e−itj ω (−iω)α

∞ −∞

eiωτ f

τ  w

 dτ dω,

108

3 XFT: A Discrete Fourier Transform

it follows that w (D s)j  2π





α

=

−∞

1 2πwα



e

−itj ω

∞ −∞

  α (−iω)



∞ −∞

  tj e−i w x (−ix)α

e

iωwy

∞ −∞

f (y)dy dω

 eixy f (y)dy dx,

and thus, (D α s)j 

1 d α f (tj /w) . wα dt α

Note that this result can be written as s (α)  wα (D α s),

(3.128)

where s (α) =

d α f (t)   t , dt α t = wj

s = s (0) .

This relation holds for α real. If α > 0 it gives fractional derivatives. If α < 0 it gives fractional antiderivatives. For example, if α = −1, (3.128) should be read as  tj /w 1 f (t)dt + cte  (D −1 s). (3.129) w b In this case, (3.129) can be used in the computation of the definite integral a f (t)dt when f (t) is a sampled signal in (a, b) with sampling frequency νs . To this end, use the affine map t=

(tN − t1 ) y − atN + bt1 , w (b − a)

where t1 and tN are√the endpoints of the set of Hermite asymptotic zeros tk = (k − (N + 1)/2)π/ 2N. This mapping sends the interval (a, b) to the interval (t1 /w, tN /w), and thus,  tN /w  tN /w  b b−a b−a f (y)dy = w f (y(t))dt = w g(t)dt, tN − t1 t1 /w tN − t1 t1 /w a

3.6 Sampling and Aliasing

109

where g(t) = f (y(t)). By noting that  g(tj /w) = f

(b − a)t + atN − bt1 tN − t1



and using (3.129), we obtain that 

b

f (t)dt 

a

 b − a  −1 (D s)N − (D −1 s)1 , tN − t1

(3.130)

where s is the vector of samples     tj (b − a) tj + atN − bt1 sj = g , =f w tN − t1

j = 1, 2, · · · , N.

It is interesting to note that the independence of the final result on w and, therefore, of the sampling frequency νs is apparent. The reason for this is the mapping between the sampling period and the distance between two consecutive Hermite nodes. In other words, the sampling frequency/period and the length of the interval (a, b) defines the number N of nodes to use. In order to test the performance of (3.130), the output of some calculations is shown in Table 3.2.

3.6.2 Aliasing As mentioned above, aliasing is an effect associated with discretization of periodic continuous systems, or periodic discretizations of continuous systems (see for example [60] for a more detailed discussion). This effect consists in a misinterpretation or misleading measurement of a physical oscillatory phenomenon at high frequencies performed in a discrete way by an observer. Such kind of discrete observation is always present in sampling. A Table 3.2 Four working examples of Eq. (3.130) with N = 215 nodes

1

Eq. (3.130)

Error

2(e − 1) e+1

0.924241

6.5×10−6

1 1 + t2

π/4

0.785404

5.4×10−6

e−2|t|

e2 − 1 2e2

0.432337

4.1×10−6

1 1 + |t|

log(2)

0.693153

5.4×10−6

f (t) 4et (1 + et )2

0

f (t)dt

110

3 XFT: A Discrete Fourier Transform

typical example is that of the apparent backward rotation of the wheels of a car in a movie. This effect can be explained through a simple example. Consider the signal (unknown to the observer, of course) f (t) = cos(2πνt), with ν = 5 H z is sampled at two rates: νA = 1.01ν and νB = 2.05ν, generating the vectors fA and fB of samples       2πν 2πν N +1 N +1 (fA )k = cos k− k− , (fB )k = cos , νA 2 νB 2 (3.131) respectively, for k = 1, 2, · · · , N. Figure 3.25 shows a segment of the signal and the sampled signal at N = 210 points in each case. The real representation of the sampling process is shown in Fig. 3.26. This figure shows the same situation of Fig. 3.25, with the only difference that the dots are joined by lines. It can be observed that the case A of Fig. 3.26 shows two completely different signals, i.e., the vector f of samples of the signal sampled at the rate νA = 1.01 ν is a bad candidate to represent the original signal f (t), whereas things go a bit better with case B, where the vector sampled at the rate νB = 2.05 ν seems to be a somewhat better candidate to represent the original signal.

Fig. 3.25 Segment of the signal cos(2πνt) with ν = 5 (solid line). (a): The signal is sampled at rate νA = 1.01ν and represented by dots. (b): The signal is sampled at rate νB = 2.05ν

Fig. 3.26 Same situation as in Fig. 3.25. The only difference is that the samples are now joined by lines

3.6 Sampling and Aliasing

111

Fig. 3.27 Segments of the absolute value of the real part of the Fourier transforms of the vectors fA and fB as given by (3.131) and computed with N = 210 . Case (a): corresponds to νA = 1.01ν, and case (b): to νB = 2.05ν

Fig. 3.28 Output of Algorithm 3.3, when it is applied to N = 212



2 cos(πy 2 ) with (a): N = 210 and (b):

If the XFT is applied to the vectors fA and fB with N = 210 samples, the output of each computation is the one shown in Fig. 3.27. Note that the correct frequency ν = 5 is well approximated only in case B. In case A, a wrong value for the frequency is computed. This is the typical case of aliasing: the correct (and high) frequency is confused with another (and lower) one. In this example the aliased frequency is a very small one. This means that the system associated to the signal f (t) will appear in slow motion. An explanation of this fact can be given in terms of the Nyquist-Shanon sampling theorem: the signal is sampled at a frequency νA < 2ν in case A and sampled at a frequency νB > 2ν in case B. This theorem establishes the conditions for which a continuous signal can be sampled without loss of information. In the above example, the critical frequency 2ν defines the region of sampling frequencies for which the vector of samples f can give, through the XFT, a good approximation to the spectrum of frequencies. A more detailed discussion on aliasing and the sampling theorem can be found elsewhere (see for example [4, 96]). Another example appears when the differintegral formula (3.116) (or (3.115)) is applied to some difficult-to-sample functions of √ rapid  t variation. Consider again a Fresnel integral, in this case the integral C(t) = 2 0 cos(πy 2 )dy. A typical plot of this√function is given in Fig. 3.9, case A:. If the Algorithm 3.3 is applied to the chirp 2 cos(πy 2 ) with N = 212 , the result is the one shown in Fig. 3.28.

112

3 XFT: A Discrete Fourier Transform

Fig. 3.29 Output of Algorithm 3.3, when it is applied to (b): N = 212



2 cos(πy 2 ) with (a): N = 210 and

This is a case of subtle aliasing. To explain these results, first note that√ the set of nodes tA used in case A: and given in general by tk = (k − (N + 1)/2)π/ 2N, are √ different from the set tB used in case B:, so that when the function 2 cos(πy 2 ) is sampled at tA and these sampled points are plotted against the function, the segment shown in case A: of Fig. 3.29, seems the plot of another chirp (cf. Fig. 3.20, where cos t 2 is plotted), centered at approximately t = 14.4, and this point corresponds to the point at which there is a step in the ladder of Fig. 3.28, case A:. This pattern appears several times along the set tA , and due to this aliasing effect, the XFT interprets the sampling data as a set of chirps instead a single one. Something similar occurs in case B:. Going back to the case given at the beginning of this section, that of the apparent backward rotation of the wheels of a car, or the apparent change of rotation of a propeller aircraft in a video, the above example can help to explain this visual paradox. A car is passing in front of you with velocity v. The car has wheels of radius r with nr non-distinguishable spokes (nr = 1 for solid wheels). You are taking a video of the car with a small exposure time in order to avoid blurred images of the spokes. It is known that the rotational ordinary frequency ν is related to v and r by v = 2πνr. However, in a 2π rotation there are nr spokes passing through a fixed point (the point of contact of the tire with the surface, for example), therefore, the frequency ν of passing spokes at the fixed point is given by ν =

nr v . 2πr

This is the frequency of the system. On the other hand, a standard camera uses 25 frames (photograms) per second. This is the sampling frequency νs . Therefore, according to the sampling theorem, if νs < 2ν , the rotation of the wheel is undersampled and this means that aliasing will be present if v > vc , where vc = νs

πr , nr

3.7 Two-Dimensional XFT

113

thus generating small frequencies for velocities v  vc , as it occurs in Fig. 3.27 A:. Note that the values νs = ν , ν /2, ν /3, · · · , or, equivalently, νk = k νs ,

k = 1, 2, · · · ,

satisfy the condition for aliasing. Thus, the frequency of the system equals k times the sampling frequency and therefore, the spokes of the wheel should appear to be static. In terms of velocity, this relation becomes vk = 2kvc ,

k = 1, 2, · · · .

Between two of these values, a wheel will appear to be rolling first with slipping and then backwards. The human eye will detect these movements as a result of the relative “left” or “right” angular position of the spokes with respect to a static position. Typical values of the parameters are r =0.38 m and nr = 5. Thus, v1 = 43 Km/hr and v2 = 85 Km/hr, so that, a video of this wheel speeding at v  64 Km/hr, sampled at 25 frames per second in a bright day, is expected to show this backward rotation.

3.7 Two-Dimensional XFT The computation of discrete two-dimensional (and higher dimensional) Fourier transforms in terms of the XFT, follows the same lines given in Sect. 2.3.5 of Chap. 2. In that section, the formulation to compute a two-dimensional DFT was given, and the same formulation and notation can be used to build a two-dimensional XFT. Since the XFT is also a symmetric matrix, the concluding formulas of Sect. 2.3.5 also hold for the XFT. We only have to take into account the fact that the one-dimensional kernel matrix F gives an approximation g˜ to the Fourier transform g(4ω/π) (cf. Algorithm 3.1). Let G and F be the N × M matrices whose entries are   4 4 g˜ml  g ξm , κl and fj k = f (xj , yk ), π π i.e., the discrete approximated two-dimensional Fourier transform and the bivariate function f (x, y) evaluated at the nodes (xj , yk ), respectively. Here,   π N +1 xj = ξj = j − √ , 2 2N

j = 1, 2, · · · , N,

114

3 XFT: A Discrete Fourier Transform

and   π M +1 y k = κk = k − , √ 2 2M

k = 1, 2, · · · , M,

as usual. Thus, the discrete Fourier transform G, written as the NM × 1 vector g˜ can be written in terms of the Kronecker product g˜ = (Fy ⊗ Fx )f

(3.132)

where (3.114) defines either Fx or Fy for N or M, respectively (see also Algorithm 3.1), and f and g˜ are the vectors of components fr = fj k ,

g˜r = g˜j k ,

with r = j + (k − 1)N, j = 1, · · · , N, and k = 1, · · · , M. Thus, the two dimensional XFT is given by the matrix F = Fy ⊗ Fx .

(3.133)

The vector notation generated by the Kronecker product is adequate for generalization purposes, as we will see in the next section. However, it is convenient sometimes to write (3.132) in a matrix notation (see Sect. 2.3.5 of Chap. 2). In this form, (3.132) can be written as G = Fx F FyT = Fx F Fy ,

(3.134)

G T = Fy (Fx F )T .

(3.135)

or equivalently, by

Here, Fx and Fy are the symmetric kernel matrices of the respective onedimensional XFTs. In order to test the performance of Eq. (3.135), consider the following par of transforms:      2 + κ2 3 J ξ 2 2 1 1, x + y ≤ 3,  f (x, y) = . (3.136) g(ξ, κ) = 6π 0, otherwise, ξ2 + κ2 Here, J1 (x) is a Bessel function of the first kind (see Figs. 3.30 and 3.31). The computation of the approximated Fourier transform through the twodimensional XFT, Eq. (3.135) is shown in Fig. 3.31. The max norm of the difference

3.8 Partial Differentiation Matrices

115

Fig. 3.30 The function f (x, y) given in Eq. (3.136)

Fig. 3.31 (a): Exact Fourier transform of f (x, y) as given by Eq. (3.136). (b): Approximated Fourier transform, given by the two-dimensional XFT, as given by Eq. (3.135), with N = M = 28

between the exact transform evaluated at the nodes (4ξm /π, 4κl /π) and the approximated output of the XFT is computed to be       4 4  ξm , κl − g˜ml  = 0.23, max g m,l π π when N = M = 28 .

3.8 Partial Differentiation Matrices In the case of differential problems where more that one variable are involved, it is necessary to consider partial differentiation matrices. In this section we present the formalism required for the numerical analysis of space-time integro-differential

116

3 XFT: A Discrete Fourier Transform

problems with three space variables. To this end, it is convenient to set t = x 0 , x = x 1 , y = x 2 , and z = x 3 . 3 ). The Let us consider the four dimensional set of real nodes (xj0 , xk1 , xl2 , xm subscripts run over 1, 2, . . . , Nμ , where Nμ is the number of nodes along the μdirection. Let N be the total number of nodes, i.e., N = N0 N1 N2 N3 . With this set of points we construct the four N × N matrices D0 = D0 ⊗ IN3 ⊗ IN2 ⊗ IN1 , D3 = IN0 ⊗ D3 ⊗ IN2 ⊗ IN1 ,

(3.137)

D2 = IN0 ⊗ IN3 ⊗ D2 ⊗ IN1 , D1 = IN0 ⊗ IN3 ⊗ IN2 ⊗ D1 , where INμ is the identity matrix of dimension Nμ and Dμ is the differentiation matrix defined according to (3.62). Constructed in this way, Dμ is a partial differentiation matrix along the μ-direction for functions f (x 1 , x 2 , x 3 , x 0 ) of the form f (x 1 , x 2 , x 3 , x 0 ) = p(x 0 )q(x 1)r(x 2 )s(x 3 ), where p(ξ ), q(ξ ), r(ξ ), and s(ξ ) are polynomials of degree at most N0 − 1, N1 − 1, N2 − 1, and N3 − 1, respectively. Thus, if f denotes the N × 1 vector of components 0 ), fr = f (xj1 , xk2 , xl3 , xm

r = 1, 2, · · · , N,

(3.138)

ordered according to r = j + (k − 1)N1 + (l − 1)N1 N2 + (m − 1)N1 N2 N3 ,

(3.139)

where j runs over j = 1, . . . , N1 , then k over k = 1, . . . , N2 , then l over l = 1, . . . , N3 , and finally m over m = 1, . . . , N0 , the vector denoted by f,μ , given by f,μ = Dμ f 0 )/∂x μ in its contains the exact values of the partial derivatives ∂f (xj1 , xk2 , xl3 , xm entries. μ Let the points xk be zeros of the Hermite polynomial HNμ (ξ ). If the matrices D1 , D2 , and D3 are replaced in (3.137) by D1 , D2 , and D3 respectively, where D, is defined in (3.65), then the matrix Dμ is a projection of the partial derivative ∂/∂x μ in the subspace of functions U spanned by products of the form

un (ξ ) = exp(−ξ 2 /2)Hn (ξ ),

n = 0, 1, . . . , Nμ − 1,

(3.140)

3.8 Partial Differentiation Matrices

117

with ξ = x μ and μ = 0, 1, 2, 3. This means that such matrices are exact nonlocal representations of the partial derivatives for functions in U . Therefore, whenever Nμ → ∞ we will get convergent approximations to the partial derivatives of a function u(x) spanned by products of the form (3.140). Let N1 , N2 , and N3 be large integer numbers. Then, according to the results given in Sect. 3.4.1, the N × N commuting matrices D0 = D0 ⊗ IN3 ⊗ IN2 ⊗ IN1 , D3 = IN0 ⊗ D3 ⊗ IN2 ⊗ IN1 ,

(3.141)

D2 = IN0 ⊗ IN3 ⊗ D2 ⊗ IN1 , D1 = IN0 ⊗ IN3 ⊗ IN2 ⊗ D1 , where D1 , D2 , and D3 have the simple structure

(Dm )j k =

⎧ ⎪ 0, ⎪ ⎪ ⎨

j = k,

⎪ (−1)j +k ⎪ ⎪ , j = k, ⎩ tj − tk

,

m = 1, 2, 3,

are also differentiation matrices (cf. Eq. (3.67)). The matrices given in (3.141) generate approximations to the partial derivatives in the space variables for functions of the form 

u(x 0 , x 1 , x 2 , x 3 ) = e− (x

1 )2 +(x 2 )2 +(x 3 )2

 /2

p(x 0 )q(x 1)r(x 2 )s(x 3 ),

where p(ξ ), q(ξ ), r(ξ ), and s(ξ ) has the same meaning as above. The same replacement can be done for the time differentiation matrix D0 , but as it is shown below, the method to differentiate along time does not require a fast differentiation scheme as the space variables. Note that the αth power of Dm , m = 1, 2, 3, can be given in terms of the fast XFT as α = Fm (4iΛm /π)α Fm−1 , Dm

α ∈ R,

(cf. Eq. (3.116)), where Fm is given as in (3.114), and Λm is the diagonal matrix containing the set of points μ xk = 

π 2Nμ

  Nμ + 1 , k− 2

k = 1, 2, · · · , Nμ ,

118

3 XFT: A Discrete Fourier Transform

along its main diagonal. Therefore, the set of differentiation matrices D1 , D2 , D3 , can be diagonalized simultaneously by the matrix F = IN0 ⊗ F3 ⊗ F2 ⊗ F1 .

(3.142)

This means that Dαm = F(4iΛm /π)α F−1 ,

α ∈ R,

(3.143)

where m = 1, 2, 3 and Λ1 = IN0 ⊗ IN3 ⊗ IN2 ⊗ Λ1 , Λ2 = IN0 ⊗ IN3 ⊗ Λ2 ⊗ IN1 ,

(3.144)

Λ3 = IN0 ⊗ Λ3 ⊗ IN2 ⊗ IN1 . This gives an scheme for fractional partial differentiation is a space domain. If an additional scheme for a fractional differentiation in a time domain is needed, you can replace the time differentiation matrix D0 by D0 and proceed along the same lines.

Chapter 4

Applications of the XFT

Abstract The aim of this chapter is to show some uses and applications of the XFT (as an ordinary Fourier transform) ranging from digital steganography, to nonlinear partial differential equations and fractional differentiation. Most of the given examples are new applications, particularly the ones related to fractional differential problems. A new approach for computing the inversion of convolution operators is given in the last section. Keywords XFT · Translations · Autostereograms · Steganography · Brain signals · Edge detection · Boundary/initial value problems · Solitons · KdV equations · Burgers’ equation · Fractional differentiation/integration · Convolution

The basic facts of the theory of the XFT (the discrete extended Fourier transformation) were presented in Chap. 3. In order to show the performance of the XFT as a plain Fourier transform some examples were also given. The simplicity of the matrix formulation of this discrete transform and its fast numerical accuracy, apart from the inherited matrix formulation of many relations between the continuous operators, converts this scheme into a reliable tool for applications. Before to begin with, it is important to note the remarks 1 and 4 following Definition 3.3 of Chap. 3 (cf. also Sect. 3.5.3), on the use of the factor 4/π whenever a fast computation with the XFT is required, as it happens with most of the computations done in this chapter.

© Springer Nature Switzerland AG 2019 R. G. Campos, The XFT Quadrature in Discrete Fourier Analysis, Applied and Numerical Harmonic Analysis, https://doi.org/10.1007/978-3-030-13423-5_4

119

120

4 Applications of the XFT

4.1 Having Fun with the XFT 4.1.1 Translations in the XFT Formalism Consider a shifted function f (t − t0 ) written in terms of the Fourier transform g(ω) of f (t), as in Eq. (2.53), f (t − t0 ) =

1 2π



∞ −∞

e−iωt eiωt0 g(ω)dt,

indicating that a shifted function can be obtained by calculating the inverse Fourier transform of eiωt0 g(ω). In addition to the differences between the DFT and XFT schemes, we can add another one, slight but important, between translations under the usual DFT, and translations under the XFT. This difference arises from the fact that the kernel matrix F gives an approximation g˜ to the Fourier transform g(4ω/π) (cf. Algorithm 3.1). Thus, when applying the inverse matrix F −1 to a given vector g˜ (in order to recover f ), g˜ is assumed to be formed with exact or approximated values of a function g(4ω/π) (see the discussion previous to Eq. (3.117)). Thus, the discrete version of the above equation (Eq. (2.53)) under the XFT reads as f˜t0 = (F −1 E4t0 /π F )f

(4.1)

where f˜t0 is the approximation to ft0 , the vector formed with the values f (tj − t0 ) and E4t0/π is the diagonal matrix of diagonal elements ei Tt0 = F −1 E4t0 /π F,

4ωj t0 π

. Therefore, the matrix (4.2)

is a finite representation of the translation operator, in the XFT discrete representation of the Fourier transform. Since E4t0 /π is a matrix whose real and imaginary part are matrices of definite parity, Theorem 3.4 asserts that the XFT translation operator Tt0 is a real matrix, contrasting with the fact that the corresponding translation operator produced by the DFT is complex. To compare the performance of the translation operator (4.2) with the one associated to the DFT given in (2.55), the examples given in Sect. 2.4 are worked out again. As it is shown in Fig. 4.1, whenever t0 < maxN j =1 |tj |, the translation operator (4.2) gives the expected results for a given value of the displacement parameter t0 . If t0 > maxN j =1 |tj |, aliasing appears.

4.1 Having Fun with the XFT

121

Fig. 4.1 Translation of the vector of positive values centered at the origin, according to (4.2). (a): N = 2000. (b): N = 2001. For t0 = 20 and t0 = 40 the shifted functions have their peaks at the correct values. For t0 = 60, an aliased shift appears. Here maxN j =1 |tj | 49.6 in both cases

4.1.1.1 Two Variables In the bivariate case (x and y are considered), the same arguments to obtain the translation operator for the DFT given in Sect. 2.4.1 of Chap. 2 can also be given for the XFT. If the displacement of the image occurs along one of the axes, say the y-axis (the horizontal axis), there is no need to compute a two-dimensional discrete transform. We only have to take into account the factor 4/π. Thus, if F stands for the matrix representation of the given image as a bivariate function f (x, y) then, the XFT translation operator acting on the y direction reads as   Fy0 = Fy−1 E4y0 /π Fy F

(4.3)

whenever the rows of the matrix representation F are used to set values of the y variable (the formalism to obtain Eq. (2.66) given in Sect. 2.4.1 of Chap. 2, also applies here). The application of the XFT to obtain shifted images presents a different scenario from the one presented by the DFT. Consider again the picture 2.7 of Sect. 2.4.1, which has a resolution of 360 pixels in the horizontal direction. Figure 4.2 shows the action of the translation operator given by (4.3) applied to the matrix representation of this image for several values of y0 . The numerical values of the displacement y0 used to obtain the images of√Fig. 4.2 are: y0 = {0, 1/2, 5/4, 2, 11/4, 7/2, 4} × yM , where yM = (M − 1)π/2/ 2M. The difference in performance between the XFT and the DFT when shifting an image, can be visualized by contrasting Fig. 4.2 with Figs. 2.8 and 2.10, of Sect. 2.4.1. The translation operator of the XFT computed with an even number M of nodes acts more like the translation produced by the DFT computed with M odd. The difference is that the former does not fade with displacement. This is also the difference between a shifted image under the XFT with M odd and the displaced image under the DFT with M even. Figure 4.3 shows the displacement of the test image when M is odd.

122

4 Applications of the XFT

Fig. 4.2 Displacements obtained by using the XFT for N even and several values of x0 of the picture of Fig. 2.7 of Sect. 2.4.1. Top, from left to right: y0 = 0, y0 = yM /2, y0 = 5yM /4. Center: y0 = 2yM . Bottom, from left to right: y0 = 11yM /4, y0 = 7yM /2, y0 = 4yM

It should be noted that the black zones of the displaced images given by the XFT when M is even (cf. Fig. 4.2), are indeed the negative of the numerical values corresponding to the levels of RGB at each pixel. This effect also appears in the case of displaced images in the DFT case (cf. Fig. 2.11), and it means that if the negative of the numerical matrix representation of the image is displayed, the result is like the one shown in Fig. 4.4.

4.1 Having Fun with the XFT

123

Fig. 4.3 Displacements obtained by using the XFT for M odd and several values of y0 of the picture of Fig. 2.7 of Sect. 2.4.1. Top, from left to right: y0 = 0, y0 = yM /2. Bottom, from left to right: y0 = 5yM /4, y0 = 2yM

Fig. 4.4 Negative representation of the boxed images of Fig. 4.2

4.1.2 Autostereograms This is another section included only for entertainment. The intriguing wallpapers and autostereograms have always attracted the attention of anyone. Figs. 4.5 and 4.6 give examples of a wallpaper and a random dot autostereogram. Staring at a wallpaper produces an unexpected visual effect. After looking fixedly at a wallpaper for a while, a three-dimensional pattern on the wallpaper appears. Something similar occurs in what is called random dot autostereogram. Examples of these images are given in Figs. 4.5 and 4.6. The three-dimensional effect present in Figs. 4.5 and 4.6 has the same roots and explanation (see for example [11, 89, 97, 142] and references therein). This effect

124

4 Applications of the XFT

Fig. 4.5 A wallpaper. Some figures appear floating on the background when the observer looks fixedly at this image for a while

Fig. 4.6 This random dot autostereogram contains an “E” that appears floating on the background when looking fixedly at this image for a while

is difficult to perceive in some images and many persons are not able to see the concealed pictures. Autostereograms can be generated easily. All that is needed is a stripe of noise or a pattern and the image to be concealed of the same height as the pattern. Consider first a grayscale target. The pattern is repeated along according to the depth map of grayscale of the target, which is used to shift the pattern at each pixel of the repeated

4.1 Having Fun with the XFT

125

stripes. The autostereograms used here were generated by using the algorithm given in [89]. Our purpose in this section is to give a procedure based in the discrete Fourier transformation XFT to retrieve the hidden figure in a random dot autostereogram. The basic idea for retrieving the hidden figure in an autostereogram is based in two facts. 1. The human binocular vision. Note that it is not possible to see what a random dot autostereogram conceals by looking at it with an eye closed. 2. The wallpaper (autostereogram) effect is based in horizontal translation and overlapping according to the depth map given by the target image. Thus, accepting that the hidden image appears when the sight lines converge at a far point, i.e., the lines of view are almost parallel lines, we can say that one of the eyes holds a representation of the image and the other holds a shifted representation with respect to the former, or if you prefer, one eye grasps a shifted image with respect to the middle point between the eyes and the other eye grasps another shifted image with respect to this point. Considering the first case, let Il be the image formed in the left-hand side eye (the columns of Il contains the RGB levels values along the x-direction), and let Ir be the image grasped by the right-hand side eye. Since the sight lines are converging at a far point the latter image is displaced with respect the former. This means that Ir = Td Il , where Td is the translation operator given in (4.3), i.e., Td = F −1 E4d/π F , where d is the displacement and, for the sake of simplicity, F stands for Fy . Just as in the previous section, it is not necessary either to use a two-dimensional discrete transform. The difference between what is perceived by the left and right-hand side eyes is the difference between Ir and Il , i.e., Ir − Il = F −1 (E4d/π − I )F Il ,

(4.4)

where I is the identity matrix and Il is the given autostereogram. This expression can be written in a symmetrical form as Ir − Il = F −1 (E2d/π − E−2d/π )F Il , which is the difference with respect to the middle point between the eyes. If d is tuned to a suitable value, the shape of the target image is displayed in the image of the difference (4.4) (Fig. 4.7). As example, take the matrix Il as the numerical representation of the random dot autostereogram shown in Fig. 4.8. The same image of the flower is used to construct a random dot autostereogram, as it is shown next. The difference (4.4) computed with d = 8.78 for Fig. 4.8 is displayed in Fig. 4.9.

126

4 Applications of the XFT

Fig. 4.7 Autostereogram created from a contoured picture of a flower of a geranium and a pattern

Fig. 4.8 Random dot autostereogram created from a contoured picture of a flower of a geranium

Another example consists of the autostereogram given in Fig. 4.10. In this case, the value d = 9.74 gives the difference displayed in Fig. 4.11 A:. The disparity between the values of d can be explained by the fact that (4.4) shifts a image globally, not locally, as the algorithm used to generate the autostereograms. Therefore, d depends in part on the depth map. This fact also explains the absence of volume of the flat surface obtained by this procedure.

4.1 Having Fun with the XFT

127

Fig. 4.9 (a): Output of (4.4) with d = 8.78 for Fig. 4.8. (b): Embedded image in the autostereogram of Fig. 4.8

Fig. 4.10 Random dot autostereogram created from the text “XFT”

Fig. 4.11 (a): Output of (4.4) with d = 9.74 for Fig. 4.10. (b): Embedded image in the autostereogram of Fig. 4.10

128

4 Applications of the XFT

The above examples (and others not shown here) count in favor of a crude model for the wallpaper effect. Note that the difference between the displaced images (4.4) can be interpreted in other way. Models of the human vision involve the Fourier transform, lens, and the ability of converging lens to perform two-dimensional Fourier transforms [66, 146]. Thus, accepting that through our eyes the brain deals with two Fourier transforms, the fact of retrieving through (4.4) the shape of the hidden image in an autostereogram, points to consider the similar operation E4d/π F Il − F Il , as a crude approximation of the brain process.

4.1.3 Steganography The concealing of a message has a long history and the reasons for this should be obvious [123]. Several methods to hide a data file in other one have been developed [57]. The discrete Fourier cosine transform given in Sect. 3.5.2 (cf. Algorithm 3.2) is used in this section to conceal a digital image inside another image for fun purposes. Let It be the matrix representation of the image to conceal (the target), and let Is the matrix representation of the image selected to provide concealment (the screen). We assume that the size of It is equal to the size of Is , and that both images are given in the same color RGB representation. Take, for example, the pair of images of Fig. 4.12. An immediate idea for concealing the target image is to use some sort of code in such a way the coded target can be added to the screen image and produce no visual change on the screen image. This means that the numerical values of the

Fig. 4.12 Two images. The one on the left-hand side is taken as the target It . The one on the right-hand side is selected as the screen Is

4.1 Having Fun with the XFT

129

RGB representation of the coded target must be small enough to leave unchanged the screen. These small values may be negative if the computer system can display negative values as black. Besides, the transformation used to codify the target must be invertible, in order to reverse the process. In a first step, the target image can be coded by the linear transformation It = AIt where A is an invertible matrix. Note that It , A, and It are matrices. We assume that the target (screen) image is given as a N × M array, and that a negative value in a pixel location is displayed in black. Among the linear transformations, the DFT and XFT translation operators, as well as the discrete Fourier cosine transform, are options. The antiderivative matrix with M even, given by (3.116), is another option. One of the cases which is worth to note, corresponds to the real part of the linear transformation given by the DFT translation operator (2.65) when M is even and the displacement parameter y0 is close to 1/2. The image corresponding to y0 = 1/2 is not shown in Fig. 2.8 of Sect. 2.4.1 but the entries of its matrix representation are all of them zero. Therefore, if y0 (or t0 ), is close to 1/2, this DFT translation operator satisfies the above requirements. The simple example given below is based in the discrete Fourier cosine transform given in Sect. 3.5.2 (cf. Algorithm 3.2), i.e., the transformed target image is given by It = κ FC It ,

(4.5)

where κ is a convenient scale factor necessary to get small values in the numerical representation of the transformed target image. This parameter may be taken as κ=

1 , 100A

where A = max |FC It |j k . j,k

The transformation to obtain the “coded” image can be more complicated, of course, but in order to add some difficulty to deal with the inverse process, (4.5) can be substituted by It = κ FC It + N ,

(4.6)

where N is a matrix of noisy and small entries. A very simple algorithm to conceal a target image is given next. The Fourier cosine transform is applied to the matrix It row by row.

130

4 Applications of the XFT

Fig. 4.13 Schematic representation of Algorithm 4.1. (a): Target image It . (b): Horizontal Fourier cosine transform FC It . (c) and (d): Reduction of FC It by κ = 1/(100A) added to the screen

Algorithm 4.1 To conceal a RGB image It of N × M pixels inside a RGB image Is of N × M pixels. 1. Apply the discrete Fourier cosine transform to the target image It , according to Algorithm 3.2, row by row or column by column. 2. Scale the numerical values of the RGB representation of FC It by s (some noise may be added) to furnish the transformed image It (see Eq. (4.6)). 3. Add It to Is to generate the new image Is that conceals the target, i.e., Is = Is + (κ FC It + N )

The result of this algorithm is an image that can not be distinguished from the original screen image, and in spite of this, the resulting image contains all the information about the target image if no noise is added. This procedure is illustrated in Fig. 4.13. The resulting image is given in Fig. 4.14. This procedure can be reversed easily once that the numerical representation of Is and Is are known. If It denote the new matrix obtained by the inversion of Algorithm 4.1, representing the original target image, then

4.2 Similarity of Brain Signals

131

Fig. 4.14 The image Is , concealing It according to Algorithm 4.1 with no noise. When a small noise is added, the resulting image Is looks the same

Fig. 4.15 Retrieved target images from the output of Algorithm 4.1. In the left-hand side case no noise was added. In the right-hand side case, white noise with standard deviation σ = 0.001 was added

It =

2 FC (Is − Is ) πκ

This result will consist in a noisy image if noise is added in Algorithm 4.1, as shown in Fig. 4.15, where the retrieved target images without and with noise are displayed.

4.2 Similarity of Brain Signals The brain signal processing is a fascinating area of great importance in neuroscience where the discrete Fourier analysis have become to be pertinent and useful. One of the tools used to describe and quantify the time evolution of the brain activity as well as the interaction between different lobes of the brain in normal or pathological conditions, is the electroencephalogram (EEG).

132

4 Applications of the XFT

Fig. 4.16 Left-hand side picture: the electrodes are positioned manually. Right-hand side picture: the electrodes are incorporated in the cap layer

Wave patterns as Alpha, Beta, Gamma or Theta or other kind of associated signals like evoked potentials are not considered here since this section is included just as an application of the integration formula given by Eq. (3.91). Due to this reason, only the basic facts of the nature and method of the EEG are given here. The reader interested in a detailed description of the EEG and its uses, should be addressed elsewhere [130]. An electroencephalogram consists of a set of many large sets of time data. Each of these large sets corresponds to the measurements of the difference of voltage at a point on the scalp. The measurement of these voltages are made through electrodes, or channels, positioned on the scalp as shown in Fig. 4.16. The voltage registered by each electrode in this experiment was measured with respect a reference electrode (referential montage). Few (unused) voltages were sampled according to the sequential montage. The sampling frequency of the electroencephalograph was set at 128 Hz and each electrode was positioned according to the international 10–20 system. Figure 4.17 shows the nomenclature for the name and position of each electrode. The results given in this section stems from the observation that in the EEGs of several volunteers, there are channels whose corresponding signals are very similar. Figure 4.18 illustrates this fact. It shows different and similar signals. As it is shown in Fig. 4.18 (see for example cases B1 and B2), there are similar brainwaves which are different in magnitude in the EEG of one person, and the dissipated energy through a point at the scalp is different from person to person. To avoid differences like those shown in the cases B1 and B2 of Fig. 4.18, it is convenient consider only the deviation of a brainwave f (t) with respect to its mean f¯ in the time interval (a, b) of interest. Since our purpose is to give a criterion to determine if two channels produce similar brainwaves (up to an additive constant), that can be used for all the channels, all the signal must be normalized to one by dividing the deviation by the maximum absolute value fM of this deviation in (a, b).

4.2 Similarity of Brain Signals

133

Fig. 4.17 Nomenclature and position in top view of the electrodes when recording an EEG

Fig. 4.18 Segments of 30s of channels FP1, F3, F7, C3, P3, and T3 of the EEGs of subject A and subject B, performing a task. As observed, C3 and T3 are similar in case (a2), and FP1 and F3, and P3 and F7, are similar in cases (b1) and (b2)

134

4 Applications of the XFT

Thus, for a given signal f (t) the normalized deviation f (t) − f¯ , fˆ(t) = fM

(4.7)

where fM = maxt ∈(a,b) |f (t) − f¯|, should be considered for comparison purposes instead the signal itself. A norm also should be used to determine if the distance between two signals is small, i.e., if such a distance is less than a threshold. Due to physical reasons, (see the discussion on the Plancherel theorem in Sect. 3.5.3.1 of Chap. 3), an adequate norm is that of L2 (a, b). This leads to the following Definition 4.1 Two brainwaves, f (t) and g(t), are similar in (a, b) if 

b

|fˆ(t) − g(t)| ˆ 2 dt < δ,

(4.8)

a

where fˆ(t) and g(t) ˆ are defined through (4.7) and δ is a small number less than one. According to this definition, two (or more) channels can be similar in a small time interval if (4.8) is satisfied for some δ. The cases A1 and D1 of Fig. 4.19 show the plots of fˆ and gˆ when f = F P 1 and g = F 7, as given in case A1 of Fig. 4.18, and their difference |fˆ − g| ˆ 2 , respectively. The cases A2 and D2 show the same

Fig. 4.19 (a1) and (d1): Plots of fˆ and gˆ when f = F P 1 and g = F 7, as given in case (a1) of Fig. 4.18, and the respective difference |fˆ − g| ˆ 2 . (a2) and (d2): Plots of fˆ and gˆ when f = C3 and g = T 3, as given in case (a2) of Fig. 4.18, and the respective difference |fˆ − g| ˆ 2 . A time interval where condition (4.8) is met if δ = 0.1 is shown in dashed lines

4.2 Similarity of Brain Signals

135

quantities when f = C3 and g = T 3. This figure also shows a time interval where condition (4.8) is met if δ = 0.1. Note that according to Definition 4.1, globally different brain signals can be considered similar in short time intervals. Therefore, for the m signals (channels) of S = {f1 , f2 , · · · , fm } there are m sampled auxiliary signals fˆ1 , fˆ2 , · · · , fˆm which can be used to establish subsets of similar signals of S. These subsets of similar signals can be determined each Δt seconds. In the following computations the subsets of similar signals are determined each 2 s. On this choice of Δt, it should be said that the mean time human response to some hazards depends on several factors [115], but the characteristic value Δt = 1.6 s can be given. On the other hand, the mean time response to certain recognizing tasks fluctuates between 1 and 3.5 s [94]. Therefore, a length of Δt = 2 s of the interval where similar brainwaves are to be determined makes sense. The threshold to decide if two signals are similar (cf. Eq. (4.8)) is taken as δ = 0.1 and to compute the integral (4.8), the integration formula (3.130) can be used. The purpose of this application, is to give a procedure to distinguish similar channels. Thus, once the m channels have been separated into classes, each class of similar signals can be labeled according to the mean energy delivered by all the components of the class. This procedure gives a set of classes of similar signals. The class number one, corresponds to the most energetic channels (in average), the class number two corresponds to a lower mean energy, and so on. Each class of signals can be labeled with a RGB color to give a picture like that of Fig. 4.21, which is composed by 6 diagrams showing the energy detected by the electrodes each 2 s. Once a class of similar signals is labeled with a RGC color, say (r, g, b), a particular component of the class can be distinguished from the others belonging to the same class according to the energy delivered by such a signal relative to the energy delivered by the most energetic (main) component of the class. Therefore, if σ denotes the quotient of the energy delivered by the particular signal and the energy delivered by the main component, the color assigned to the particular component is σ (r, g, b). In this way, the components of the most energetic class are displayed in shades of red, the components of the second energetic class are displayed in shades of green, and so on, as in Fig. 4.20. This procedure is repeated each 2 s along the Fig. 4.20 Example of the labeling the classes of similar signals by using colors. The upper classes contain the most energetic signals

136

4 Applications of the XFT

interval of interest. The result consists of a series of diagrams like the ones shown in Fig. 4.21. Note that a weak signal will give a small value for σ and therefore, a dark-colored circle. Each of the diagrams shown in Fig. 4.21 can be concatenated into a video stream, producing a picture about the interaction of the brain lobes when the subject is solving a puzzle. The case shown in Fig. 4.22 corresponds to another person solving the same puzzle. It is worth to notice that this visual procedure gives information on which electrode detects more energy delivered by the brain, discriminating the channels with a relative small power performance, enabling this method for detecting some irregular brain activity patterns, as in the case of some moods as depression. In order to contrast this pattern behavior, Fig. 4.23 shows the response of a depressed person to the same puzzle. Clearly in the case of the depressed subject, the number of dark circles, or electrodes detecting weak signals, is greater than the number of dark circles in the case of the first two “normal” subjects. This situation is also present in the case of other two depressed persons which solved the same puzzle when the EEG was sampled. The number of dark dots in these two last cases becomes again greater than the number of dark circles appearing in the normal cases. This fact indicates that this procedure based in the XFT could be developed in more detail to be used successfully as an alternative tool for depression diagnosis.

4.3 Edge Detection Contour detection is an important problem of image processing that has been studied extensively since many years ago. Many algorithms have been developed for this purpose (see for example [103, 105, 107, 138, 156]). This problem is closely related to the problem of segmentation. Edge detection and segmentation have many applications in physical and biological sciences. Our purpose in this section is to show how can be used the XFT as an edge detector. To this end, realize that an edge in an image is essentially a boundary between regions that reflect different amounts of light, i.e., different amounts of energy. Consider first a grayscale image showing a bright object. It could be a picture of the moon in the night, for example. According to the Plancherel theorem, the total energy reflected by the image can be given in the spatial domain or in the frequency domain. Thus, values greater than a threshold value of the Fourier transform of the given image can be truncated by a filter, in order to eliminate the most energetic areas. Afterwards, the inverse transform can be applied to such truncated Fourier transform to obtain a dark image where the edges (and some artifacts) are visible.

4.3 Edge Detection

137

Fig. 4.21 Similarity classes of brain signals. Each diagram corresponds to segments of 2 s during the solution of a puzzle. Top: Initial stages. Bottom: Finding the solution. The channels A1, A2 and Pz are not displayed here

138

4 Applications of the XFT

Fig. 4.22 More similarity classes of brain signals. Each diagram corresponds to segments of 1/4 s during the solution of a puzzle. Top: Initial stages. Bottom: Finding the solution. The channels A1, A2 and Pz are not displayed here

4.3 Edge Detection

139

Fig. 4.23 Similarity classes in the EEG sampled from a depressed person. Each diagram corresponds to segments of 2 s during the solution of a puzzle. Top: Initial stages. Bottom: Finding the solution. The channels A1, A2 and Pz are not displayed here

140

4 Applications of the XFT

Fig. 4.24 The unit box function and its Fourier transform, sinc(κ/2)

To illustrate this idea, consider the edge detection problem in a one-dimensional case. Of course, in such a case, the “edges” consist only of isolated points. Let U (x) the unit box function, equal to 1 for |x| ≤ 1/2 and 0 otherwise. This function can represent a one-dimensional image with a white central part, black the rest. The Fourier transform is sinc(κ/2). These functions are depicted in Fig. 4.24. Now, the sinc function is truncated to a threshold value ν and this new function is transformed back to the spatial domain. The result of this procedure for three values of ν is shown in Fig. 4.25. The cases A of Fig. 4.25 show that the inversion of the truncated Fourier transform gives information on the location of the edges. Recall that only positive values matters in the numerical representation of an image. For example, the second case, the one for which ν = 0.1, gives an image where the edge is more bright than the interior region, highlighting the contour of the object in the original image. In the case of a two-dimensional image, it is necessary to compute the twodimensional XFT of the given data. This can be done by using Eq. (3.135) G T = Fy (Fx F )T , given in Sect. 3.7 of Chap. 3. Recall that Fx and Fy are the kernel matrices of the respective one-dimensional XFTs. As a first example of edge detection, let us take the original picture of the geranium used in the random dot autostereogram of Fig. 4.8, which is shown in Fig. 4.26. According to the procedure sketched above, the absolute values of the twodimensional Fourier transform of the matrix representation of the image Fig. 4.26, are filtered by a threshold level. Values greater than the threshold are set to zero and the inverse Fourier of the filtered transform is computed afterwards. Different threshold levels produce different types of contours, as it is shown in Fig. 4.27. The procedure remains the same for color images. It can be applied to each RGB channel with different threshold levels. In Fig. 4.28 is given an example.

4.3 Edge Detection

141

Fig. 4.25 (a): The unit box function (solid lines) and the inverse Fourier transform of the truncated sinc(κ/2) function (dashed lines). (b): The sinc function (solid lines) and the corresponding truncated function (dashed lines). The values of the threshold are ν = 0.5, 0.1, 0.01, respectively

Fig. 4.26 Problem: Find the contours of the flower

142

4 Applications of the XFT

Fig. 4.27 Contour of the flower shown in Fig. 4.26. (a): The threshold level is set to 30. (b): The threshold level is set to 50

Fig. 4.28 Detection of edges in a RGB image. The above technique is applied to each RGB channel. The threshold levels for Red, Green, and Blue are set to 10, 15, and 5, respectively

4.4 Boundary Value Problems This topic and those of the following sections can not be missed when talking about a fast numerical computation of the Fourier transform. A number of problems in physics and engineering leads to boundary value problems (BVP), in one o more dimensions, linear o nonlinear, with different kind of boundary conditions, which are constraints for the solution of the problem on a given boundary. The boundary is usually defined by points, curves or surfaces in the space domain. Among the many kinds of boundary value problems, those termed two-point boundary value problems form an important class. This kind of problems consists of a system of ordinary differential equations and boundary values at two points of the extended real line. Some typical examples appear in the study of deflection of beams, wave equations, transport phenomena, and evolution equations. Methods of solution and examples are given in [1, 87]. Among the approaches to solve these problems, the spectral and collocation methods [18, 35, 37, 39, 69, 148], can be found.

4.4 Boundary Value Problems

143

We use the XFT in this section to solve some two-point boundary value problems. To explain how the boundary conditions are taken into account in this method, we consider a nonlinear BVP of the 2th order. The generalization of the procedure to higher order BVPs and other kind of boundary conditions is straightforward.

4.4.1 Nonlinear Second Order Boundary Value Problems Consider the BVP   f

(y) = g y, f (y), f (y) ,

f (a) = fa , f (b) = fb .

(4.9)

Here, y ∈ (a, b), g(y, u, v) is Lipschitz in u and v, and fa and fb are the constants which determine the two-point boundary conditions. Let f0 (x) be any second antiderivative of f

(x), as given by (4.9). Then, the function f (x), given by f (x) = f0 (x) + c1 x + c0 ,

(4.10)

satisfies the boundary conditions f (a) = fa , f (b) = fb if c0 =

af0 (b) − bf0 (a) + bfa − afb , b−a

c1 =

f0 (a) − f0 (b) + fb − fa . b−a

The differentiation matrix D and the fast algorithm for computing it in terms of the XFT (cf. Eq. (3.115) or Eq. (3.116), and particularly Algorithm 3.3) along any standard technique to solve algebraic nonlinear equations can be used to find numerical solutions of (4.9), whenever the following items are taken into account. 1. If a = −b = ∞, the usual boundary conditions are f (±∞) = 0. Since D generates accurate derivatives for functions vanishing at ±∞, the following item can be omitted. √ √ 2. If a and b are finite numbers, take a large integer N such that N > 8a/π. This condition implies that [a, b] ⊂ [x1 , xN ], where x1 and xN are the first and last asymptotic Hermite zeros π xk = √ 2N

  N +1 k− , 2

k = 1, 2, · · · , N.

The numerical integration of (4.9), obtained through the XFT, gives a function f˜0 (x) which is an approximation to a second antiderivative of f

(x). Therefore, the interval [x1 , xN ] can be mapped into [a, b] in order to approximate the

144

4 Applications of the XFT

conditions f˜0 (a) = 0, f˜0 (b) = 0, and this function can be substituted in (4.10) to obtain an approximate solution f˜(x) Assume that (a, b) is a finite interval and define the new nodes yj ∈ [a, b] as yk =

(b − a)xk + axN − bx1 , xN − x1

k = 1, 2, · · · , N.

(4.11)

Note that y1 = a, yN = b. Let g be the vector of entries   gj = g yj , fj , fj ,

j = 1, 2, · · · , N,

where fj = f (yj ) and fj = f (yj ) and f (y) satisfies (4.9). Let X be, as usual, the diagonal matrix which contains the nodes xk , k = 1, 2, · · · , N, along its main diagonal. Then, according to (3.116) (see Algorithm 3.3), the entries (f0 )k of the vector given by f0 = κ 2 F (4iX/π)−2 F −1 g,

κ=

b−a , xN − x1

are approximations to a second antiderivative of f (x) evaluated at the nodes yj . This procedure is illustrated with the Picard method as the technique to obtain the successive integrals. Later on there will occasion to show the use of other techniques as Newton’s method. Thus, taking into account (4.10), the Picard method of successive approximations gives (m−1)

f (m) = f0

(m−1)

+ c1

(m−1)

ξ + c0

,

m = 1, 2, . . . ,

(4.12)

where f0(m−1) = κ 2 F (4iX/π)−2 F −1 g (m−1) ,

(4.13)

g (m−1) is the vector of entries (m−1)

gk

  (m−1) (m−1) , = g yk , fk , f k

k = 1, 2, . . . , N,

the vector f (m−1) are given by f

(m−1)

=

1 F (4iX/π)F −1 f (m−1) , κ

(4.14)

4.4 Boundary Value Problems

145 (m−1)

the vector ξ has entries ξj = yj , and finally, the constants c0 given by (m−1)

(m−1)

=

(m−1)

=

c0 c1

a(f0

(m−1)

and c1

are

(m−1)

)N − b(f0 )1 + bfa − afb , b−a

(f0(m−1) )1 − (f0(m−1) )N + fb − fa . b−a

4.4.1.1 A Numerical Example Consider the nonlinear integral stiff equation f

(y) =



y

e−t f 2 (t)dt + 1,

y ∈ (a, b),

(4.15)

0

with the boundary conditions f (a) = ea ,

f (b) = eb .

This problem has the solution f (y) = ey . Note that the function g(y, f (y), f (y)) in (4.9) depends on the integral of the unknown function, instead of the derivative f (y). Thus, in this case, (4.14) becomes (m−1) gk



yk

=

 2 e−t f (m−1) (t) dt + 1.

0

An antiderivative of the integral in this expression can be computed as 

yk

  2  (m−1) e−t f (m−1) (t) dt  κ F (4iX/π)−1 F −1 Ef0 , k

where E is the diagonal matrix formed with the values eyk along its main diagonal. Thus, if ð(m−1) denotes this vector, i.e.,   (m−1) (m−1) ðk = κ F (4iX/π)−1 F −1 Ef0 , k

then 

yk 0

 2 (m−1) (m−1) e−t f (m−1) (t) dt  ðk − ð1 ,

146

4 Applications of the XFT

Fig. 4.29 (a): Numerical solution of (4.15) with a = 0 and b = 2, obtained through (4.12) with N = 212 (dashed line) compared with the exact solution (solid line). (b): Absolute error given by this method

and − ð(m−1) + 1. gk(m−1)  ð(m−1) k 1 Therefore, the mth approximation in the Picard method, Eq. (4.12), becomes   f (m) = κ 2 F (4iX/π)−2 F −1 ð(m−1) − ð(m−1) + 1 + c1(m−1)ξ + c0(m−1), 1 for m = 1, 2, · · · . This formula gives the mth approximation f (m) in terms of (m−1) (0) f0 , which is given by (4.13). The initial approximation f0 can be taken as a null vector. Figure 4.29 illustrates the performance of this procedure when a = 0 and b = 2.

4.4.2 Higher Order Boundary Value Problems This kind of problems appears frequently in some applied sciences [134] and the above technique can be used to solve them. The procedure is illustrated by the fourth order BVP [109] consisting in f (4) (y) = (1 + λ)f

(y) − λf (y) + λy 2 /2 − 1,

y ∈ (0, 1),

(4.16)

and f (0) = 1,

f (1) = 3/2 + sinh(1),

f (0) = 1,

f (1) = 1 + cosh(1).

This problem has the solution f (y) = sinh(y) + y 2 /2 + 1. Note that f (y) does not depend on λ.

4.4 Boundary Value Problems

147

For any given solution f0 (y) of (4.16), the function f (y) = f0 (y) + c3 y 3 + c2 y 2 + c1 y + c0

(4.17)

is also a solution, and that the four boundary conditions determines the four constants c0 , c1 , c2 , and c3 , in terms of a = 0, b = 1, f0 (a), f0 (a), f0 (b), f0 (b), and the boundary conditions. Solving the system generated by the boundary conditions, we obtain c0 = 1 − f0 (a),

c1 = 1 − f0 (a),

c2 = −3/2 − cosh(1) + 3 sinh(1) + 3f0 (a) − 3f0 (b) + 2f0 (a) + f0 (b), c3 = 1 + cosh(1) − 2 sinh(1) − 2f0 (a) + 2f0 (b) − f0 (a) − f0 (b). To compute the mth successive approximation f (m) , the approximation (m)

f0

= (1 + λ)κ 2 F (4iX/π)−2 F −1 f0   − κ 4 F (4iX/π)−4 F −1 λf0(m−1) − λξ 2 /2 + 1 , (m−1)

should be computed first. Then, the constants ck can be computed by using the first (m) (m) and last values of f0 and of (f )0 , where (f )0

(m)

=

1 (m) F (4iX/π)F −1 f0 . κ

Therefore, the mth successive approximation f (m) , i.e., the numerical solution of (4.16) is obtained by the substitution of the constants ck and the approximation f0(m) in (4.17), according to (m)

f (m) = f0

+ c3 ξ 3 + c2 ξ 2 + c1 ξ + c0 .

The error obtained for λ = 10 and λ = 35 with N = 212 nodes is shown in Fig. 4.30.

4.4.3 A Solitary Problem The aim of this section is to find solitary wave solutions (solitons) or solutions with compact support (compactons) of the generalized Korteweg-de Vries equation [76, 126, 128], written as ut + (um )x + (um )xxx = 0,

−∞ < x < ∞,

t > 0.

(4.18)

148

4 Applications of the XFT

Fig. 4.30 (a): Absolute error between the exact vector f solution of (4.16) and the approximation f˜ = f (m) , obtained by the above procedure for λ = 10, with N = 212 and m = 6. (b): Absolute error for λ = 35, with N = 212 and m = 30

The power m is any real number greater than 1. In order to seek wave solutions traveling at speed c we assume that u(x, t) = f (x − ct).

(4.19)

Later, in the next section, we will solve this problem as a partial differential initial value problem. In the meantime, note that (4.19) reduces the partial differential equation (4.18) to the nonlinear boundary value problem (f m (x))

+ f m (x) − cf (x) = 0,

f (±∞) = 0.

(4.20)

The solution to this problem is ⎧  1  m−1 ⎪ 2cm mπ ⎪ 2 m−1 ⎪ x , , |x| ≤ ⎪ ⎨ m + 1 cos 2m m−1 f (x) = ⎪ ⎪ ⎪ mπ ⎪ ⎩ , 0 , |x| > m−1 where m > 1. Note that the length of the support of f (x) depends only on m. The fast implementation of the differentiation matrix (3.116) can be used again to solve numerically this problem. In this occasion, the Newton method will be used instead the successive approximation Picard’s method along the XFT scheme. The boundary conditions allow a straightforward application of (3.116). Because of the support of f (x) depends on m, it is convenient to use a fixed value of N, such that xN − x1 covers the support of f (x) for several values of m. We begin with m = m0 = 2 and the initial guess ) = (f˜m(0) 0 j

3c −xj2/c e , 2.2

j = 1, 2, . . . , N.

4.5 Initial Value Problems

149

Fig. 4.31 (a): Compacton solution of (4.20) obtained by using the XFT and Newton’s method for N = 28 and m = 1.25 (dashed line) compared with the exact solution (solid line). (b): Absolute error produced by this method

Fig. 4.32 (a): Compacton solution of (4.20) obtained by using the XFT and Newton’s method for N = 28 and m = 50 (dashed line) compared with the exact solution (solid line). (b): Absolute error produced by this method

Once computed the approximate solution f˜m0 for m0 , this solution can be used as (0) the initial guess f˜m1 to obtain a new approximate solution f˜m1 for a value m1 close to m0 , and so on. Thus, with this recursive procedure we obtain accurate numerical solutions of (4.20) as it is shown in Figs. 4.31 and 4.32.

4.5 Initial Value Problems This is another important area in applied mathematics. The question about how a given system will evolve with time is an actual and real problem. This kind of problems usually consists of a partial (or ordinary) differential equation for the unknown function and a set of constrictions on the values of this function at the initial time. This section is devoted to the numerical solution of initial value problems of the first order, in one and two variables. The latter case illustrates the method of solution for more variables.

150

4 Applications of the XFT

4.5.1 One Variable We begin by considering the IVP u (t) = H (u, t),

u(a) = ua ,

(4.21)

defined on [a, b], where H (u, t) is Lipschitz in u on [a, b]. Solving this problem is the first step in solving more complicated problems, like those arising in diffusion for example, where derivatives of other variables also appear. The method of solution presented in this section for solving (4.21) is based in the differentiation matrix D (see [37]) which gives exact derivatives on the space of polynomials of degree at most N defined by Eq. (3.62) in Sect. 3.4.1 of Chap. 3, i.e.,

Dj k =

⎧ N  ⎪ 1 ⎪ ⎪ ⎪ , ⎪ ⎪ t − ⎨ l =j j tl ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩

j = k,

P (tj ) , j = k. (tj − tk ) P (tk )

Here, t0 , t1 , · · · , tN , are N + 1 different real numbers. Therefore, D is now (N + 1) × (N + 1). In the notation of the Sect. 3.4.4 of Chap. 3, this matrix corresponds to D(XN+1 ), where now XN+1 is a diagonal matrix containing the time nodes a = t0 < t1 < · · · < tN along its diagonal. Since the time interval [a, b] can be very large, it is convenient to divide it in M subintervals, each of them containing N nodes, as follows {t12 < . . . < t1N }, {t21 < t22 < . . . < t2N }, . . . , {tM1 < tM2 < . . . < tMN }, where a < t1N < t21 , t2N < t31 , . . . , t(M−1)N < tM1 and tMN ≤ b. This subdivision is illustrated in Fig. 4.33.

Fig. 4.33 First subinterval of [a, b] and the corresponding nodes t1k = tk , including the initial point t10 = a

4.5 Initial Value Problems

151

The evaluation of the differential equation at the first N + 1 nodes a < t11 < t12 < . . . < t1N gives ⎞ ⎛ ⎞ H (ua , a) u (a) ⎜ u (t11 ) ⎟ ⎜ H (u1, t11 ) ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ u (t12 ) ⎟ ⎜ H (u2, t12 ) ⎟ ⎜ ⎟=⎜ ⎟. ⎜ . ⎟ ⎜ ⎟ .. ⎝ .. ⎠ ⎝ ⎠ .

u (t1N ) H (uN , t1N ) ⎛

(4.22)

By using the differentiation matrix D, this can be approximated as ⎛

D00 ⎜ D10 ⎜ ⎜ D20 ⎜ ⎜ . ⎝ .. DN0

D01 D02 |D11 D12 |D21 D22 . .. | .. . |DN1 DN2

⎞⎛ ⎞ ⎛ ⎞ ua H (ua , a) · · · D0N ⎜ ⎟ ⎜ ⎟ · · · D1N ⎟ ⎟ ⎜ f1 ⎟ ⎜ H (f1 , t1 ) ⎟ ⎜ ⎜ ⎟ ⎟ · · · D2N ⎟ ⎜ f2 ⎟ = ⎜ H (f2 , t2 ) ⎟ ⎟. ⎜ . ⎟ ⎜ ⎟ .. ⎟ . .. . . ⎠ . . ⎠⎝ . ⎠ ⎝ . · · · DNN fN H (fN , tN )

(4.23)

This system has N unknowns f1 , f2 , . . . , fN , that can be found by solving N 

Dj k fk − H (fj , tj ) = −ua dj ,

j = 1, 2, . . . , N,

(4.24)

k=1

where dj = Dj 0 . This procedure generates approximations fj to u(tj ) in [a, tN ]. Now, choosing fN as a new initial value and the nodes of the second block (see Fig. 4.34), the local problem v (t) = H (v, t),

t ∈ [tN , t2N ],

v(tN ) = fN ,

can be solved numerically following the above lines to give new approximations to u(t2k ), k = 1, 2 · · · , N, in [t21 , t2N ]. This procedure can be repeated in the subintervals [tnN , t(n+1)N ], n = 3, 4, . . ., until the last block of points is reached (cf. [21, 131, 133, 147]).

Fig. 4.34 Second subinterval of [a, b] and the corresponding nodes t2k , including the initial point t20 = tN

152

4 Applications of the XFT (1)

Note that the matrix of the linear part of (4.24), corresponds to DN in the notation of the Sect. 3.4.4 of Chap. 3 (cf. Eq. (3.104)). It is clear that the existence of (1) the solution f of (4.24), depends on the invertibility of DN . Since this is assured by Theorem 3.8 for all N, any linearization technique can be used to solve the system (4.24). Some convergence and stability aspects of this method are addressed in [37]. Here, the way in which (4.24) is solved is reviewed in more detail.

4.5.1.1 One-Time Scheme The simplest case is when N = 1 in (4.24). In this case (4.24) consists of only one equation D11 f1 − H (f1 , t1 ) = −ua D10 ,

(4.25)

which written in detail reads as f1 − ua − (t1 − t0 )H (f1 , t1 ) = 0.

(4.26)

In this simple scheme, given t0 and t1 , this equation has to be solved for f1 . Then t1 and f1 are taken as the new values of t0 and ua respectively, and so on. As it can be identified, the case N = 1 corresponds to the implicit Euler method.

4.5.1.2 Two-Time Scheme The special case where N = 2 is also simple, convergent and stable. According to (3.106), D2(1) takes the form ⎞ 1 1 t1 − a + ⎟ ⎜ = ⎝ t1 − at − ta1 − t2 (t21− a)(t2 −1 t1 ) ⎠ 2 + . (t1 − a)(t1 − t2 ) t2 − a t2 − t1 ⎛

(1)

D2

Let us take evenly spaced nodes in [a, b] with a = 0 and let h be the step. Thus, (1)

D2 =

  1 0 1/2 , h −2 3/2

the system (4.24) becomes f2 − 2hH1 − ua = 0, 4f1 − 3f2 + 2hH2 − ua = 0,

(4.27)

4.5 Initial Value Problems

153

where the notation H1 = H (f1 , t1 ), H2 = H (f2 , t2 ) has been used in order to simplify the notation. Let us also simplify the notation for the partial derivatives ∂H1 =

∂H (f1 , t1 ) , ∂f1

∂H2 =

∂H (f2 , t2 ) . ∂f2

Thus, if Newton’s method is used for solving (4.27), the inverse of the Jacobian J is the matrix   1 3 − 2h∂H2 −1 J −1 = 4 −2h∂H1 4 − 6h∂H1 + 4h2 ∂H1 ∂H2 Therefore, the corresponding Newtonian iteration for solving (4.27) becomes       (l+1) (l) (l) f1 f1 δ1 = − , f2(l+1) f2(l) δ2(l)

(4.28)

(l)

where the components δk are given explicitly by δ1(l) =

(l)

δ2 =

  2f1(l) − 2ua + h H2(l) − 3H1(l) + (ua − f2(l) + 2hH1(l))∂H2(l)

, (l) (l) (l) 2 − 3h∂H1 + 2h2 ∂H1 ∂H2   (l) (l) (l) (l) (l) (l) 2f2 − 2ua − h 4H1 + (ua − 4f1 + 3f2 − 2hH2 )∂H1 2 − 3h∂H1(l) + 2h2 ∂H1(l)∂H2(l)

,

for l = 0, 1, 2, · · · . Take into account that (4.28) should be applied on each block [a,t1 , t2 ], [t20 , t21 , t22 ], [t30 , t31 , t32 ], · · · , where t2 = t20 , t22 = t30 , · · · . Let  fn1 , fn2 denote the solution of (4.27) in the nth block. Then, for n = 1, f11 = ua is the initial value. For n = 2, 3, · · · , the value of ua should be taken as f(n−1)2 . Therefore, the approximation u˜ to u(t) consists in the concatenation of ua and the set of arrays   fn1 , fn2

n = 1, 2, · · · ,

which is the vector T  u˜ = ua , f11 , f12 , f21 , f22 , f31 , f32 , · · · . The particular case of (4.21) in which the function H (u, t) has the form H (u, t) = Au + B,

(4.29)

154

4 Applications of the XFT

with A and B constants, can be solved easily. In this case, the system (4.27) becomes f2 − 2hAf1 − 2hB − ua = 0,

(4.30)

4f1 − 3f2 + 2hAf2 + 2hB − ua = 0, and the solution is fn1 =

2ua − hua A + 2hB − 2h2 AB , 2 − 3hA + 2h2 A2

fn2 =

2ua + hua A + 4hB − 2h2 AB , 2 − 3hA + 2h2 A2

(4.31)

for n = 1, 2, · · · .

4.5.2 Examples The performance of the present method is illustrated with two examples. One is nonlinear and singular. The other is linear and stiff.

4.5.2.1 The Cavity Collapse Problem This is a problem taken from [132]. Therein, the problem in fluid dynamics consisting in the collapse of a spherical cavity in a liquid is referred to [101]. This physical system is modeled by the initial value problem $   2 1 − 1 , r (t) = − 3 r3

r(0) = 1,

(4.32)

where r(t) stands for the radius of the cavity at time t. This problem has the trivial solution r(t) = 1. The solution that produces the collapse has the singularity r (tc ) = −∞ at a critical time tc . We put to test the present method in this problem. The solution of the system (4.27) along the interval (0, 1), gives the trivial solution if the initial guess (f1(0) , f2(0) ) is chosen as (1, 1). However, if this initial guess is set to (0.2, 1), the system (4.27) gives the approximate solution shown in Fig. 4.35, very similar to the one shown in [132].

4.5 Initial Value Problems

155

Fig. 4.35 Radius collapse of a spherical cavity in a liquid as a function of time, computed through (4.27) with h = 0.000015. The value t = 0.9147 is found as an approximate critical time. For this time, the radius is r = 0.0067

Fig. 4.36 (a): Numerical solution of (4.33) obtained by using (4.31) with h = 0.005 (dashed line) compared with the exact solution (solid line). (b): Absolute error produced by this procedure

4.5.2.2 A Stiff Problem Consider now the initial value problem u (t) = −100u(t) + 10,

u(0) = 1.

(4.33)

This is a stiff problem taken from [132], where the function H (u, t) has the form (4.29) and which has the solution u(t) =

1 9 −100 t e + . 10 10

The approximate solution is obtained through (4.31) and it is shown in Fig. 4.36.

156

4 Applications of the XFT

4.5.3 Two Components The vector case is illustrated with only two components. In such a case, Eq. (4.21) becomes u 1 (t) = H1 (u1 , u2 , t),

u1 (a) = u1a ,

u 2 (t) = H2 (u1 , u2 , t),

u2 (a) = u2a ,

(4.34)

and therefore, there are two systems of equations like (4.22), or two of the form (4.24) which can be written as N 

  Dj k fk − H1 fj , gj , tj = −u1a dj ,

(4.35)

k=1 N 

Dlk gk − H2 (fl , gl , tl ) = −u2a dl ,

k=1

where j, l = 1, 2, . . . , N. The vectors f and g are the approximations to u1 (t) and u2 (t), respectively. The solution of this system for given N on each block [tnN , t(n+1)N ], can be accomplished by your favorite nonlinear algebraic system solver. For n = 1, u1a and u2a are the initial  values. For each n = 2, 3, · · · , the actual value of (u1a , u2a ) should be taken as f(n−1)N , g(n−1)N .

4.5.3.1 An Example In order to show the performance of this technique, it is convenient to compare the approximate with the exact solution, so that consider the stiff initial value problem u 1 (t) = 3u1 − u22 ,

u1 (0) = 1,

u 2 (t) = −u1 + u2 (1 + u2 ),

(4.36)

u2 (0) = 1,

which has the solution u1 (t) = e2t ,

u2 (t) = et .

(4.37)

This problem is solved by using the system (4.24) with N = 3. The approximate solutions for u1 (t) and u2 (t) are shown in Fig. 4.37.

4.6 Nonlinear Partial Differential Equations

157

Fig. 4.37 (a): Numerical solution of (4.36) obtained by solving the system (4.24) along [0, 2] with N = 3 and h = 0.001 (dashed line) compared with the exact solution (4.37) (solid line). (b): Absolute errors

4.6 Nonlinear Partial Differential Equations The use of differentiation matrices in the numerical solution of the initial value problem (4.21) can be extended to more complicated problems, where derivatives of other variables also appear. We only consider nonlinear evolution problems in 1 and 2 variables. The time derivative will be approximated by the differentiation matrix D and the space derivatives will be approximated by the formula given by the XFT formalism, Eq. (3.115) or Eq. (3.116), generating a convenient matrix scheme to solve differential problems more complex than (4.21), as it is shown next. This procedure is illustrated with the differential problem ∂u(t, x) = H (t, u, ux , uxx ), ∂t

−∞ < x < ∞,

t > 0,

(4.38)

with the conditions u(0, x) = u0 (x), u(t, ±∞) = 0,

t > 0.

4.6.1 One-Time Scheme With N = 1, the time differentiation matrix generates the equation f1 − f0 − hH (t1 , f1 , f1 , f1

) = 0, which is analogous to (4.26). Here, f0 = u0 (x) and f1 , f1 , and f1

, are vectors of length M whose kth entries f1k ,

f1k ,



f1k ,

158

4 Applications of the XFT

approximate u(t1 , xk ), ux (t1 , xk ), and uxx (t1 , xk ), k = 1, 2, · · · , M respectively. The derivatives f1 and f1

can be computed through the XFT (3.116) to give   fn − hH tn , fn , F (4iX/π)F −1 fn , F (4iX/π)2 F −1 fn = fn−1 ,

(4.39)

for n = 1, 2, · · · . This equation can be solved for the vector f1 , the approximation to u(t1 , x), in terms of f0 , the vector of initial values u0 (xk ). Once obtained f1 , this vector can be used as a new initial vector in (4.39) to give f2 , the approximation to u(t2 , x) at the time t2 = t1 + h, and so on. This procedure gives ⎛

f01 ⎜f11 ⎜ ⎜ u˜ = ⎜f21 ⎜f ⎝ 31 .. .

f02 f12 f22 f32 .. .

⎞ f0M f1M ⎟ ⎟ f2M ⎟ ⎟, f3M ⎟ ⎠ .. ··· . ··· ··· ··· ···

(4.40)

as the approximation u˜ to u(t, x). If the differential problem is given in the finite interval (a, b) ∂u(t, x) = H (t, u, ux , uxx ), ∂t

t > 0,

a < x < b,

(4.41)

with the conditions u(0, x) = u0 (x), u(t, a) = ua (t), u(t, b) = ub (t), the results of Sect. 4.4.1 can be used. Thus, (4.39) is now   1 1 −1 2 −1 fn − hH tn , fn , F (4iX/π)F fn , 2 F (4iX/π) F fn = fn−1 , κ κ

(4.42)

where κ=

b−a . xM − x1

In order to obtain the approximation to u(tn , xk ), n = 1, 2, · · · , the vector fn should be actualized through (cf. (4.10)) fnk ← fnk + cn1 xk + cn0 ,

k = 1, 2, · · · , M,

4.6 Nonlinear Partial Differential Equations

159

once (4.42) has been solved for fn . Here, cn0 and cn1 are given by afnM − bfn1 + bua (tn ) − aub (tn ) , b−a fn1 − fnM + ub (tn ) − ua (tn ) . = b−a

cn0 = cn1

4.6.2 Two-Time Scheme Going back to the differential problem (4.38), let us consider the case in which the time nodes are t0 , t1 , and t2 . This means N = 2, so that the time differentiation matrix D2(1) provides for (4.38) the component equations f2 − 2hH (t1, f1 , f1 , f1

) = f0 , 4f1 − 3f2 + 2hH (t2, f2 , f2 , f2

) = f0 , which are the analogous equations to (4.27). By using the XFT approximation for derivatives, Eq. (3.116), we obtain f2 − 2hH (t1, f1 , F (4iX/π)F −1 f1 , F (4iX/π)2 F −1 f1 ) = f0 , 4f1 − 3f2 + 2hH (t2 , f2 , F (4iX/π)2 F −1 f2 , F (4iX/π)2 F −1 f2 ) = f0 . This system should be solved for the 2 × M arrays   f1nk , f2nk

k = 1, 2, · · · , M,

in each time block [tn0 , tn1 , tn2 ], n = 1, 2, · · · , according to the procedure shown at the end of Sect. 4.5.1, in order to give the approximation u˜ to u(t, x) consisting in the matrix ⎛ ⎞ f01 f02 · · · f0M ⎜f f · · · f ⎟ 11M ⎟ ⎜ 111 112 ⎜ ⎟ ⎜f211 f212 · · · f21M ⎟ ⎟ u˜ = ⎜ ⎜f121 f122 · · · f12M ⎟ . ⎜ ⎟ ⎜f221 f222 · · · f22M ⎟ ⎝ ⎠ .. .. . . . · · · .. The application of this procedure to more complicated problems follows the same lines as above.

160

4 Applications of the XFT

4.6.3 A KdV Equation Consider the nonlinear problem 1 ut + (u2 )x + uxxx = 0, 2

−∞ < x < ∞,

0 < t < b.

(4.43)

with the conditions u(0, x) = 3 sech2 u(t, ±∞) = 0,

x 

2 t > 0.

,

(4.44)

Note that the above initial condition u(0, x) is the particular case of the solution √  c(x − ct) uc (t, x) = 3 c sech , 2 2

(4.45)

for c = 1. The constant c is the velocity of the solitary wave (4.45). The one-point time differentiation scheme (cf. Sect. 4.6.1) and the XFT are used to solve this problem. As explained above, (4.39) has to be solved by any direct or iterative method. It is possible to take advantage of Algorithm 3.3 of Sect. 3.5.3 to compute a fast iterative solution. To this end, note that the equation is given in the form fn +

h F (4iX/π)F −1 fn2 + hF (4iX/π)3 F −1 fn = fn−1 , 2

which can be written as −1  h F (4iX/π) IM + h(4iX/π)3 F −1 fn2 2 −1  + F IM + h(4iX/π)3 F −1 fn−1 .

fn = −

(4.46)

For a given time block, the successive approximation method gives the scheme  −1 h F −1 (fn(l−1))2 + bn−1 , fn(l) = − F (4iX/π) IM + h(4iX/π)3 2 −1 −1  for l = 1, 2, · · · . Here, bn−1 = F IM + h(4iX/π)3 F fn−1 is a vector computed with the solution fn−1 obtained at the previous time block, and the initial vector f0 can be taken as the vector of entries u(0, xk ), k = 1, 2, · · · , M. In Fig. 4.38 is shown the numerical solution for three times. Note that the peaks are located at t = 0, t = 2.5 and t = 5 respectively. This means that the soliton moves to the right at a velocity c = 1.

4.6 Nonlinear Partial Differential Equations

161

Fig. 4.38 Numerical solution of the KdV equation (4.43) with the conditions (4.44) obtained by solving (4.46) with h = 0.01 and M = 28 by successive approximations

Fig. 4.39 Absolute error between the numerical solution produced by (4.46) and the exact solution given by (4.45) for c = 1, h = 0.01, and M = 28 as a function of time

The numerical soliton loose its integrity with time. The absolute error M

max |u1 (tn , xk ) − (fk )n | k=1

between this result and the exact solution given by (4.45) for c = 1 is shown in Fig. 4.39 for several times. As would be expected, the absolute error between the numerical output and the exact solution increases as the number of subintervals M increases. For example, the case M = 212 produces a very similar plot. However, the interaction between two solitons can be visualized. Consider the same equation (4.43), but now with the initial condition u(0, x) = u2 (−7, x) + u1 (−2, x),

(4.47)

where uc (t, x) is given by (4.45). This initial condition consists of two solitons, traveling at different positive speeds. The evolution of this system can be simulated by solving (4.43) subject to (4.47). The numerical solution was obtained by using N = 1 in the time matrix differentiation, i.e., the equation (4.39) was used with M = 28 nodes in space. The result is shown in Fig. 4.40. An interesting feature of

162

4 Applications of the XFT

Fig. 4.40 Numerical simulation of the interaction between two solitons traveling to the right. (a): Initial condition. (b): At this time, t = 2, the right-hand side soliton arrives to the origin. There is no interaction yet. (c): Note that at t = 7, the second peak is not at the origin, as it could be thought. (d): At this time, t = 9.5, one soliton takes the role of the other

this interaction is shown in part D of Fig. 4.40. At a certain time, the solitons can not be distinguished.

4.6.4 Vector Burgers’ Equation The problem presented in this section consists of the well-known nonlinear partial differential equation in 2 variables [10, 20, 83, 113], ∂U + (U · ∇)U − ν∇ 2 U = 0, ∂t

(4.48)

where U(t, x, y) = (u(t, x, y), v(t, x, y)), which is a particular case of the incompressible two-dimensional Navier-Stokes equations, with no pressure gradient nor body forces. The one-dimensional version of this equation ut + uux − νuxx = 0,

4.6 Nonlinear Partial Differential Equations

163

is called Burgers’ equation. This important equation, containing diffusion and nonlinear advection, appears in many applied sciences. It has been used to model traffic flow and also has been used as a test problem for numerical techniques. The aim of this section is to obtain numerical solutions of (4.48) subject to the conditions U(0, x, y) = (u0 (x, y), v0 (x, y)) , U(t, ±∞, ±∞) = (0, 0),

(4.49)

t > 0,

by using the present method, i.e., by using the one-point time differentiation matrix (cf. Sect. 4.6.1) for the time variable and the XFT for the partial derivatives in the x and y directions, according to the formulation given in Sect. 3.8 of Chap. 3. In terms of the velocity components, (4.48) becomes ut + uux + vuy − ν(uxx + uyy ) = 0, vt + uvx + vvy − ν(vxx + vyy ) = 0.

(4.50)

Thus, divide the time interval of interest into a partition of evenly spaced times tn = t0 + nh, n = 1, 2, · · · . Here, t0 and h are the initial time and the time step, respectively. Now, consider the grid defined by the nodes (xj , yk ), where π xj = √ 2N

  N +1 j− , 2

π yk = √ 2M

  M +1 k− , 2

j = 1, 2, · · · , N, k = 1, 2, · · · , M. Let fn and gn the vectors approximating u(tn , xj , yk ) and v(tn , xj , yk ) respectively, i.e, fnr  u(tn , xj , yk ),

gnr  v(tn , xj , yk ),

where r = j + (k − 1)N. According to the one-time scheme (cf. Sect. 4.6.1), fn and gn should be computed from     I − hν(D2x + D2y ) fn = fn−1 − h fn ◦ Dx fn + gn ◦ Dy fn ,   (4.51)   I − hν(D2x + D2y ) gn = gn−1 − h fn ◦ Dx gn + gn ◦ Dy gn . Here, f ◦ g stands for the Hadamard (component-wise) product between the vector f and the vector g, and I denotes the NM × NM identity matrix. In order to take advantage of Algorithm 3.3 of Sect. 3.5.3, these equations are solved here by the iterative successive approximation method.

164

4 Applications of the XFT

The partial differentiation matrices Dx and Dy are given by Dx = F(4iΛx /π)F−1 ,

Dy = F(4iΛy /π)F−1 .

(cf. Eq. (3.143)), where F = Fy ⊗ Fx , (cf. Eq. (3.133)) and Λx = IM ⊗ diag{x1 , · · · , xN }, Λy = diag{y1 , · · · , yM } ⊗ IN . The substitution of these matrices in (4.51) generates the scheme (l)

(l−1)

fn = bn−1 − hfn , (l) (l−1) gn = cn−1 − hgn ,

l = 1, 2, · · · ,

(4.52)

where bn−1 = Mfn−1 , cn−1 = Mgn−1 ,   (l−1) (l−1) (l−1) (l−1) (l−1) , = M fn ◦ Dx fn + gn ◦ Dy fn fn   (l−1) (l−1) (l−1) (l−1) (l−1) gn , = M fn ◦ Dx gn + gn ◦ Dy gn and the matrix M is given by −1  F−1 . M = F I − hν(4iΛx /π)2 − hν(4iΛy /π)2 Whenever it is necessary to compute products of the form (Fy ⊗ Fx )f , it is convenient to shape the NM × 1 vector f into a N × M matrix F and apply formula (3.135) in order to include the ordinary FFT in the calculation.

4.6.4.1 Numerical Example As said above, the Burgers equation has been used as a useful test problem. Particularly, the inviscid (ν = 0) case is important because the shock wave solutions can travel with no diffusion. Consider the Burgers equation (4.48) with ν = 0 and the conditions (4.49), where u0 (x, y) = e−(x +y )/2 , 2 2 v0 (x, y) = −e−(x +y )/2 . 2

2

(4.53)

4.6 Nonlinear Partial Differential Equations

165

Fig. 4.41 Initial condition u0 (x, y) and the numerical approximation of the first component u(x, y) of the vector solution of (4.48) with ν = 0, obtained by the successive approximation scheme (4.52) with N = M = 30 and h = 0.1

Fig. 4.42 Initial condition v0 (x, y) and the numerical approximation of the second component v(x, y) of the vector solution of (4.48) with ν = 0, obtained by the successive approximation scheme (4.52) with N = M = 30 and h = 0.1

We follow the iterative scheme given by (4.52) with a small number of nodes for the x and y variables, even though in such a case, the equations (4.51) can be solved by any standard direct method. The vectors f0r = u0 (xj , yk ),

g0r = v0 (xj , yk ),

are taken as initial approximations. Here, r is related to j and k through r = j + (k − 1)N, j = 1, 2, · · · , N, k = 1, 2, · · · , M, N = M = 30. The initial conditions and the numerical approximations for u(2.5, xj , yk ) and v(2.5, xj , yk ) are shown in Figs. 4.41 and 4.42, respectively, as functions of x and y. The shock wave pattern becomes apparent at t = 2.5. Note that both the initial condition and the approximate values for v(x, y) are plotted according to their negative values. It is illustrative to visualize the numerical approximation to the vector field as a stream plot as in Fig. 4.43. The formation of the shock wave can also be pictured in this type of plots.

166

4 Applications of the XFT

Fig. 4.43 Initial condition (u0 (x, y), v0 (x, y)) and the numerical approximation of the vector field (u(t, x, y), v(t, x, y)), solution of (4.48) with ν = 0 evaluated at t = 2, obtained by the successive approximation scheme (4.52) with N = M = 30 and h = 0.1

4.7 Fractional Differentiation/Integration The extension of the concept of a derivative of integer order to a derivative of fractional order and the study of its consequences in mathematical analysis and applications, is the core of this important topic of current research, which has a long history [22, 84, 104]. Many books and articles have been written about fractional calculus and its applications (see for example [45, 88, 116, 124, 129, 145] and references therein). The purpose of this section is to give a further discussion of the diferintegration formulas given by Eqs. (3.83) and (3.84) of Sect. 3.4.1 of Chap. 3 (and their fast XFT counterparts, Eqs. (3.115) and (3.116) of Sect 3.5.3 of the same chapter), their application to fractional evolution equations, and their connection with the Riemann-Liouvile and the Caputo fractional derivatives. As a by-product, we give a procedure to compute numerical Riemann-Liouvile and Caputo fractional derivatives in terms of the XFT. The expressions for the matrix representation of the derivative given by (3.83) and (3.84) were obtained as the α-powers of the inverse discrete versions of the Fourier integral formulas given by (3.75) and (3.77) respectively, but as shown in [29], they can be obtained as the discrete version of the Fourier fractional differentiation formula  ∞ ∞ 1 (α) f (x) = eixξ (iξ )α e−iξ η f (η) dη dξ, (4.54) 2π −∞ −∞ where α ∈ R and it is assumed that the integral exists for a given function f (z) ∈ L1 (−∞, ∞). A link between (4.54) and the well-known fractional differentiation schemes like the Riemann-Liouvile, the Grünwald-Letnikov and the

4.7 Fractional Differentiation/Integration

167

Caputo definitions, has been established as FDα f (t) = (−iω)α g(ω),

(4.55)

(see [88, 124, 129]), where F, as usual, stands for the Fourier transform,  Ff (x) =

∞ −∞

eikx f (x)dx,

and Dα stands for the left-sided Riemann-Liouville, Grünwald-Letnikov and Caputo fractional derivatives of order α with the (lower) terminal a = −∞, given by Dαx f (x) =

1 Γ (n − α)



x −∞

f (n) (y)dy , (x − y)α−n+1

n = [α] + 1,

where α ≥ 0 and [α] stands for the integral part of α. Note that, in terms of the matrix representation of the fractional derivative introduced here in Chap. 3 (cf. Eqs. (3.83) and (3.84)), the continuous relation (4.55) has the discrete version D α = F −1 (−iΛ)α F ,

α∈R

which is the same expression given by Eq. (3.83). From Theorem 3.2, we know that this matrix and (3.84) are the same matrices, so that any of them can be used as a discrete version of the fractional derivative (4.55). We also have given formulas for the fast computation of each one in O(N log N) flops. The numerical output of the fast formula D α = F (4iΛ/π)α F −1 ,

α ∈ R,

(cf. Eq. (3.116)), for the fractional differentiation matrix (3.84), has been shown in Sect. 3.5.2.1 of Chap. 3 where two examples were given. One interesting feature of this differentiation matrix is its ability to compute values of a fractional derivative at negative values of the x variable and, as mentioned above, it can be used, as well as Eq. (3.115), to compute approximated values for the left-sided Riemann-Liouville, Grünwald-Letnikov and Caputo fractional derivatives with the terminal a = −∞. Also, Eq. (3.115), or (3.116), is a fast numerical implementation of a generalization of the Cauchy’s integral formula [29] from which (4.54) can be derived. The connection between the above fractional derivatives and the XFT through Eq. (4.54) can be extended as follows. To show this relationship, let us first consider the left-sided Riemann-Liouville derivative which is defined by α a Dx f (x)

1 = Γ (n − α)



d dx

n 

x a

f (y)dy , (x − y)α−n+1

(4.56)

168

4 Applications of the XFT

with n = [α] + 1, and a < x. By using the fact that 

x

a

f (y)dy = (x − y)α−n+1



∞ −∞

f (y)H (y − a)

H (x − y)dy (x − y)α−n+1

where H (x) is the Heaviside step function, and the convolution theorem, we obtain that  x    f (y)dy F = F (f (y)H (y − a)) F y n−α−1 H (y) . α−n+1 a (x − y) It is found in [68] that 

∞ 0

Therefore,  F

x a

eiωx dx = (−iω)β−1 Γ (1 − β), xβ

f (y)dy (x − y)α−n+1

0 < (β) < 1.

 = Γ (n − α)(−iω)α−n F (H (y − a)f (y)) .

According to the XFT formalism, the discrete version of this equation can be written as F Ixα = Γ (n − α)(−iΛ)α−n F Ha f, where Ixα is the vector of components  (Ixα )k =

xk

a

f (y)dy (xk − y)α−n+1



and Ha = diag{H (x1 − a), H (x2 − a), · · · , H (xN − a)}. So, the discrete version of the right-hand side of (4.56) becomes 1 F −1 (−iΛ)n F Ixα = F −1 (−iΛ)α F Ha f = D α Ha f. Γ (n − α) Thus, we can write α a Dx f (x)

← D α Ha f,

to indicate that the XFT-discretization of the Riemann-Liouville fractional derivative (4.56) is given by the product of the differentiation matrix D α times the vector

4.7 Fractional Differentiation/Integration

169

whose entries are given by the values of the causal function f (x)H (x − a) at the nodes xk . This result suggests that only in the case in which the function f (x) is a causal function of the form f (x) = g(x)H (x − a), the left Riemann-Liouville derivative of f (x) agrees with the corresponding Cauchy-Fourier fractional derivative given by (4.54). α denote the discrete version of the Riemann-Liouville fractional derivaLet DRL tive (4.56) according to the XFT formalism. Then, it is clear that α DRL = D α Ha .

(4.57)

The relation between the discrete form of the left-sided Riemann-Liouville derivative and the XFT can be handled in the same way. Now let us see the connection between the discrete version of the Caputo fractional derivative and the XFT. The left-sided Caputo derivative is defined by C α a Dx f (x)

=

1 Γ (n − α)



x a

f (n) (y)dy , (x − y)α−n+1

(4.58)

with n = [α] + 1, and a < x. Proceeding as above, we obtain that F



C α a Dx f (x)



  = (−iω)α−n F H (y − a)f (n) (y) .

According to the XFT formalism, the discrete version of the right-hand side of this equation can be written as   (−iΛ)α−n F Ha f (n) = (−iΛ)α−n F Ha F −1 (−iΛ)n F f, where f (n) is the vector whose entries are given by the derivatives f (n) (xk ), k = 1, 2, · · · , N. Therefore, we find that     C α −1 α−n −1 n D f (x) ← F (−iΛ) F H F (−iΛ) F f. a x Let DCα denote the discrete version of the Caputo fractional derivative (4.58) according to the XFT formalism. Then, DCα = D α−n Ha D n ,

n = [α] + 1,

(4.59)

The performance of the XFT, the Riemann-Liouville and the Caputo discrete fractional derivatives, as given by (3.115), (4.57), and (4.59) is shown in Fig. 4.44,

170

4 Applications of the XFT

Fig. 4.44 Fractional derivatives of f (x) = x 2.1 e−x /2 computed through Eqs. (3.115), (4.57), and (4.59) with N = 210 and α = 1/2. (a): This case simulates the case in which a → −∞. The actual value of the lower terminal is a = x1 = −35.5. (b): The value of the lower terminal is a = xN/2 = −0.034 2

Fig. 4.45 Fractional derivatives of f (x) = sin x computed through Eqs. (3.115), (4.57), and (4.59) with N = 210 and a = x422 = −6.28. (a): The order is α = 0.2. (b): The order is α = 0.9

where the dependence on the lower terminal is illustrated, and in Fig. 4.45, where the dependence on the order is shown. The case A of Fig. 4.44 illustrates numerically the equality between (4.54) and the Riemann-Liouvile and the Caputo schemes (cf. (4.55)) when a = −∞. On the other hand, it is known that the Riemann-Liouville derivative (4.56) coincides with the Caputo derivative (4.58) if f (a) = f (a) = · · · = f (n−1) (a) = 0.

(4.60)

α = D α means that In the discrete case, the equality DRL C

D α Ha f = D α−n Ha D n f, or, D n Ha f = Ha D n f,

(4.61)

where it is assumed that an even number of nodes xk has been used to construct the matrix D α in order to be invertible. Since Ha does not commute with D n , the

4.7 Fractional Differentiation/Integration

171

equality (4.61) is only possible for a special vector f . At this point it is convenient to consider the matrix-vector product Ha f as a Hadamard vector product (elementwise product) ha ◦ f , where ha is the vector whose entries are given by H (xk − a), k = 1, 2, · · · , N. Thus, the left-hand side of (4.61) becomes D n (ha ◦ f ) and in the limit N → ∞ becomes  n d n D (ha ◦ f ) → (H (x − a)f (x)) dx  n    n−m  n d H (x − a) f (m) (x) = dx n−m m m=0

= H (x − a)f (n) (x) +

n−1    n (n−m−1) δ (x − a)f (m) (x). m

m=0

The sum of the right-hand side involves the values f (a), · · · , f (n−1) (a), so that it becomes zero if (4.60) holds, and as a consequence, (4.61) also holds in this asymptotic limit. Numerical calculations show how this asymptotic limit is attained as N is increased. To this end, the relation between the Caputo and the RiemannLiouville derivatives   n−1 (k)  f (a) C α α k (x − a) , a Dx f (x) =a Dx f (x) − k! k=0

can be used. Let fC(α) and fˆC(α) the vectors defined by (α)

fC

= D α−n Ha D n f,

and fˆC(α) = D α Ha fˆ, respectively, where fˆ is the vector formed with the values of fˆ(x) = f (x) −

n−1 (k)  f (a) k=0

k!

(x − a)k

at the nodes. Thus, fˆC(α) gives an different form for computing a discrete Caputo derivative in terms of the XFT. To illustrate the difference, we compute the vectors

172

4 Applications of the XFT

Fig. 4.46 Relative error (4.62) for f (x) = x 2 in the interval (10, 60), with α = 0.1, a = xN/2 , and N = 212 , 215 , 218

fC and fˆC error (α)

(α)

for the power function f (x) = x 2 . In Fig. 4.46 is shown the relative    (f (α)) − (fˆ(α) )   C k C k ,  (α)   (fˆ )k

k = 1, 2, · · · , N

(4.62)

C

in a interval of the positive axis. Here, the difference between fC(α) and fˆC(α) tends to diminish as N increases. It is also known that a initial value problem under the Riemann-Liouville scheme has a solution whenever the initial conditions are given in terms of values of Riemann-Liouville derivatives of the unknown function at the initial time, instead of initial conditions given in terms of derivatives of integer order, as it could be expected and as it occurs in the Caputo scheme, or in the XFT scheme, as it is shown in Sects. 4.4.1 and 4.5 of this chapter.

4.7.1 Fractional Initial Value Problems In this section we give an example to illustrate how the XFT derivative can be used to solve fractional initial value problems. A nonlinear initial value problem with exact solution, taken from [47], is addressed.

4.7.1.1 A Nonlinear Problem Consider the initial value problem u(α) (t) = −u(t)3/2 + r(α, t), u(0) = 0

t > 0,

0 {1, 1}]; g] Please note that the time values can also be given as tk = k − (N + 1)/2, k = 1, 2, · · · , N. An example of the use of this module is given next. n = 2∧10; ff = -I # Exp[-Abs[#]] &; gf = 4 #/(1 + #∧2)∧2 &; t = Table[k, {k, -(n - 1)/2, (n - 1)/2}]; w = 2 Pi t/n; f = ff[t]; ge = gf[w]; ga = XFTP[f]; © Springer Nature Switzerland AG 2019 R. G. Campos, The XFT Quadrature in Discrete Fourier Analysis, Applied and Numerical Harmonic Analysis, https://doi.org/10.1007/978-3-030-13423-5

205

206

A

Programming in MATHEMATICA

ng = 40; tger = Table[{w[[k]], Re[ge[[k]]]}, {k, ng, n - ng + 1}]; tgar = Table[{w[[k]], Re[ga[[k]]]}, {k, ng, n - ng + 1}]; terror = Table[{w[[k]], Abs[Re[ge[[k]]] - Re[ga[[k]]]]}, {k, ng, n - ng + 1}]; {ListLinePlot[{tger, tgar}], ListLinePlot[terror]}

A.1.2 A Periodic Fractional Derivative Let f be the vector formed with the N values fk of a 2π-periodic function f (t) at tk = 2kπ/N, k = 0, 1, · · · , N − 1. Then, the fast fractional derivative f (α) (t) of f (t), α ≥ 0, (cf. Eq. 2.43) can be implemented as DXFTP[f_,α_] := Module[{n, S, Teig, fp}, n = Length[f]; S = Table[N[ Exp[-I Pi k (n - 1)/n]], {k, 0, n - 1}]; Teig=Table[N[k-(n+1)/2],{k,n}]; fp = S Fourier[(I Teig)∧α InverseFourier[f/S]]; fp] This module can also be used for α < 0 if Length[f] is restricted to be an even integer. An example of the use of this module is given next. n = 2∧13 + 1; a = Exp[1.]; wx = Pi/a; wy = I/3. ; z = Table[2 wx j/n + .5 wy/10, {j, 0, n - 1}]; {g2, g3} = WeierstrassInvariants[{wx, wy }]; fe = WeierstrassP[z, {g2, g3}]; fep = WeierstrassPPrime[z, {g2, g3}]; fap = (Pi/wx) DXFTP[fe, 1]; Print[{n, N[Max[Abs[fep - fap ]], 5]}]; {ListLinePlot[{Re[fep], Re[fap]}], ListLinePlot[{Im[fep], Im[fap]}]}

A.2 The XFT A.2.1 General Direct Case: |z| ≤ 1 Let f be the vector formed with the N values fk = f (tk ) of a function f (t) at  tk =

π 2N

  N +1 k− , 2

k = 1, 2, · · · , N.

(A.1)

A Programming in MATHEMATICA

207

Then, given the vector f and a complex number z, |z| ≤ 1, the general fast XFT transform (cf. Eq. (5.3)) can be implemented as follows XFTG[f_, z_] := Module[{n, epsi, x, R, S, Sf, fs, c0, A0, g}, n = Length[f]; epsi = N[Pi/Sqrt[2 n]]; x = Table[(k - n/2 - 1/2) epsi, {k, n}]; R = N[2 (1 - z∧2) I/Pi/z]; c0 = N[(1 + z∧2)/(1 - z∧2)/2]; A0 = N[ Sqrt[Pi/( 2 n (1 - z∧2) )] Exp[I Pi/2/n (n - 1)∧2]]; S = Table[N[ Exp[-I Pi j (n - 1)/n - c0 x[[j + 1]]∧2]], {j, 0, n - 1}]; Sf = Table[N[ Exp[-I Pi j (n - 1)/n - c0 (R x[[j + 1]])∧2]], {j, 0, n - 1}]; fs = S f; g = A0 Sf Fourier[fs, FourierParameters -> {1, 1}]; g] The output g of this module is a vector of elements gk approximating the integral transform (5.4) at gk = g(Rxk ), xk = tk . Please note the scale factor R in the assignment of Sf (cf. Sect. 3.5.1).

A.2.2 A Fast Fractional Fourier Transform A fast fractional Fourier transform can be simply obtained by substituting z = eiθ in the above XFT[f_,z_] module. An example of the use of that module to compute a fast fractional Fourier transform is given next. n = 2∧10; tet=Pi/4; z = N[Exp[I tet]]; R = 2 (1 - z∧2) I/Pi/z; epsi = N[Pi/Sqrt[2 n]]; t = Table[(k - n/2 - 1/2) epsi, {k, n}]; f0 := Exp[-#∧2/2 + #] &; g0 = 2∧(1/4) Exp[I Pi/8 - I #∧2/2 - (1/4 - I/4) (-I + Sqrt[2] #)∧2]/Sqrt[1 + I] &; f = f0[t]; ga = XFTG[f, z]; ge = g0[R*t]; ng = 40; tger = Table[{t[[k]], Re[ge[[k]]]}, {k, ng, n - ng + 1}]; tgei = Table[{t[[k]], Im[ge[[k]]]}, {k, ng, n - ng + 1}]; tgar = Table[{t[[k]], Re[ga[[k]]]}, {k, ng, n - ng + 1}]; tgai = Table[{t[[k]], Im[ga[[k]]]}, {k, ng, n - ng + 1}]; terror = Table[{t[[k]], Abs[ge[[k]] - ga[[k]]]}, {k, ng, n - ng + 1}]; {ListLinePlot[{tger, tgar}, PlotRange − > All], ListLinePlot[{tgei, tgai}, PlotRange − > All], ListLinePlot[terror]}

A.2.3 General Inverse XFT: |z| ≤ 1 An inverse formula for the above general XFT computed for a given vector g and a complex number z, |z| ≤ 1, can be implemented in terms of the inverse matrix as

208

A

Programming in MATHEMATICA

follows XFTINV[g_, z_] := Module[{n, epsi, x, Rs, Si, Sfi, fs, c0, A0i, f}, n = Length[g]; epsi = N[Pi/Sqrt[2 n]]; x = Table[(k - n/2 - 1/2) epsi, {k, n}]; R = N[2 (1 - z∧2) I/Pi/z]; c0 = N[(1 + z∧2)/(1 - z∧2)/2]; A0i = N[Sqrt[2 n (1 - z ∧2)/Pi] Exp[-I Pi/2/n (n - 1)∧2]]; Si = Table[N[ Exp[I Pi j (n - 1)/n + c0 x[[j + 1]]∧2]], {j, 0, n - 1}]; Sfi = Table[N[ Exp[I Pi j (n - 1)/n + c0 (R x[[j + 1]])∧2]], {j, 0, n - 1}]; fs = Sfi g; f = A0i Si InverseFourier[fs, FourierParameters -> {1, 1}]; f]

A.2.4 Algorithm 3.1: The Fast Discrete Fourier Transform A fast formula for the ordinary Fourier transform defined as  g(ω) =

∞ −∞

eiωt f (t)dt

(A.2)

can√be obtained by substituting z = i in the above XFT module and multiplying by 2π. However, in this case c0=0 and the code becomes simpler. Thus, if f is a vector formed with N values of a function f (t) at the points tk given by (A.1), the fast discrete Fourier transform of f can be implemented as XFT[f_] := Module[{n, S, A0, g}, n = Length[f]; A0 = N[(Pi/ Sqrt[2 n]) Exp[I Pi (n - 1)∧2/2/n]]; S = Table[N[ Exp[-I k Pi (n - 1)/n]], {k, 0, n - 1}]; g = A0 S Fourier[S f, FourierParameters -> {1, 1}]; g] An example of the use of this module to compute a fast Fourier transform is given next. n = 512; a = 4/Pi; epsi = N[Pi/Sqrt[2 n]]; x = Table[(k - n/2 - 1/2) epsi, {k, n}]; fe[t_] := UnitBox[t/10]; ge[t_] := 10*Sinc[10*t/2]; f = fe[x]; ga = XFT[f]; npm = 140; tra = Table[{a x[[k]], Re[ga[[k]]]}, {k, npm, n - npm + 1}]; tre = Table[{ x[[k]], ge[x[[k]]]}, {k, npm, n - npm + 1}]; ListLinePlot[{tre, tra}, PlotRange − > All, GridLines − > Automatic, Frame − > True, FrameStyle − > Directive[Thick, 20, Bold], PlotStyle − > {Directive[Black, Thick], Directive[Orange, Thick, Dashed]}, FrameLabel − > {"w", "g(w)"}] Norm[ga - Table[ge[a x[[k]]], {k, n}]]

A Programming in MATHEMATICA

209

The inverse of the Fourier transform is also a Fourier transform. If g(ω) is given by (A.2), then f (t) =

1 2π



∞ −∞

e−iωt g(ω)dω.

Therefore, the discrete inversion can be implemented as a slight modification of the above case XFTINV1[g_] := Module[{n, S, A0, f}, n = Length[g]; A0 = N[(Pi/ Sqrt[2 n]) Exp[-I Pi (n - 1)∧2/2/n]]; S = Table[N[ Exp[I k Pi (n - 1)/n]], {k, 0, n - 1}]; f = (1/2/Pi) A0 S Fourier[S g, FourierParameters -> {1, -1}]; f] An example of the use of this module to compute the inverse Fourier transform is given next. n = 512; a = 4/Pi; epsi = Pi/Sqrt[2 n]; x = Table[(k - n/2 - 1/2) epsi, {k, n}]; fe[t_] := UnitBox[t/10]; gev = 10*Sinc[10*a*x/2]; fa = a*XFTINV1[gev]; npm = 180; tra = Table[{x[[k]], Re[fa[[k]]]}, {k, npm, n - npm + 1}]; tre = Table[{ x[[k]], fe[x[[k]]]}, {k, npm, n - npm + 1}]; ListLinePlot[{tre, tra}, PlotRange − > All, GridLines − > Automatic, Frame − > True, FrameStyle − > Directive[Thick, 20, Bold], PlotStyle − > {Directive[Black, Thick], Directive[Orange, Thick, Dashed]}, FrameLabel − > {"t", "f(t)"}] Norm[fa - Table[fe[x[[k]]], {k, n}]] If this module is used, please note that the factor 4/π multiplying XFTINV1 is due to the fact that the function to be inverted is evaluated at 4ω/π (cf. Sect. 3.5.1). The inverse Fourier transform can also be computed as a inverse matrix of the XFT according to XFTINV2[g_] := Module[{n, Si, A0i, f}, n = Length[g]; A0i = N[(Sqrt[2 n]/Pi) Exp[-I Pi (n - 1)∧2/2/n]]; Si = Table[N[ Exp[I k Pi (n - 1)/n]], {k, 0, n - 1}]; f = A0i Si InverseFourier[Si g, FourierParameters -> {1, 1}]; f] If this module is used instead XFTINV1, there is no need of the scale factor 4/π.

210

A

Programming in MATHEMATICA

A.2.5 Algorithm 3.2: Fast Fourier Cosine Transform Let f be the vector formed with the M values fk = f (tk+ ) of a function f (t) at tk+

 =

π 4M

  1 k− , 2

k = 1, 2, · · · , M.

The fast formula for the Fourier cosine transform (cf. Sects. 3.3 and 3.5.2)  ∞ cos(ωt)f (t)dt, gc (ω) = −∞

can be implemented in terms of the XFT algorithm (cf. Algorithm 3.1) as follows. XFTCos[f_] := Module[{m, fhat, ghat, g}, m = Length[f]; fhat = Join[Table[f[[m-k+1]],{k,m}],f]; ghat = XFT[fhat]/2; g = ghat[[m+1;;2 m]]; g] Take into account that the output is an approximation to gc (4tk+ /π) (cf. Sect. 3.5.1). An example of the use of this module to compute the fast Fourier cosine transform is given next. M = 2∧8; n = 2 M; a = 4/Pi; t = Table[(k - 1/2) Pi/Sqrt[4 M], {k, M}]; fe = Sinc[#] &; ge = Pi (1 + Sign[1 - #])/4 &; f = fe[t]; ga = Re[XFTCos[f]]; ng = Floor[M/1.1]; te = Table[{ t[[k]], ge[t[[k]]]}, {k, 1, M - ng}]; ta = Table[{a t[[k]], ga[[k]]}, {k, 1, M - ng}]; terror = Table[{t[[k]], Abs[ga[[k]] - ge[a t[[k]]]]}, {k, 1, M - ng}]; {ListLinePlot[{te, ta}], ListLinePlot[terror]}

A.2.6 Algorithm 3.3: Fractional Derivatives A fast formula for the fractional derivative f (α)(t), α ≥ 0, of a function f (t) based in the Fourier transform (see Sect. 3.5.3), can be implemented by using Eq. (3.116) as follows DXFT[f_,α_] := Module[{n,epsi,t,S,fq}, n = Length[f]; epsi = N[Pi/Sqrt[2 n]]; t = Table[(k - n/2 - 1/2) epsi, {k, n}]; S = Table[N[ Exp[-I Pi k (n - 1)/n]], {k, 0, n - 1}]; fq = S Fourier[(4 I t/Pi)∧α InverseFourier[f/S]]; fq]

A Programming in MATHEMATICA

211

This module can also be used for α < 0 if Length[f] is restricted to be an even integer. An example of the use of this module to compute Fresnel integrals is given next. n = 2∧10; epsi = Pi/Sqrt[2 n]; t = Table[N[(k - n/2 - 1/2) epsi], {k, n}]; f = Cos[Pi t∧2/2]; fa = DXFT[f, -1]; fe = FresnelC[t]; ng = 400; te = Table[{t[[k]], fe[[k]]}, {k, ng, n - ng+1}]; ta = Table[{t[[k]], Re[fa[[k]]]}, {k, ng, n - ng+1}]; terror = Table[{t[[k]], Abs[fa[[k]] - fe[[k]]]}, {k, ng, n - ng+1}]; {ListLinePlot[{te, ta}], ListLinePlot[terror]}

A.2.7 Algorithm 3.4: XFT of Sampled Data A fast formula for the Fourier transform of a signal sampled at a sampling rate nu can be implemented in terms of the XFT algorithm (Algorithm 3.4 above) as follows. XFTSam[f_,nu_] := Module[{n,frem=nu,epsi,W,g}, n = Length[f]; epsi = N[Pi/Sqrt[2 n]]; W = epsi frem; g = XFT[f]/W; g] Take into account that if g(ω) represents the Fourier transform of a function f (t/W ) and that the output of this module gives an approximation to g(8ν) (see Sect. 3.6.1.1). An example of the use of this module is given next. n = 2000; frem = 5; fe := 1/(1 + #∧2)/Pi &; ge := Exp[-Abs[#]] &; epsi = N[Pi/Sqrt[2 n]]; W = epsi*frem; apar = 4./Pi; x = Table[(k - n/2 - 1/2) epsi, {k, n}]; f = fe[x/W]; ga = XFTSam[f, frem]; te = Table[{4 W x[[k]]/Pi, ge[W *apar*x[[k]]]}, {k, n}]; ta = Table[{4 W x[[k]]/Pi, ga[[k]]}, {k, n}]; terror = Table[{4 W x[[k]]/Pi, Abs[ga[[k]] - ge[W *apar*x[[k]]]]}, {k, n}]; {ListLinePlot[{te, ta}], ListLinePlot[terror]}

212

A

Programming in MATHEMATICA

A.2.8 Algorithm 5.1: The Linear Canonical Transform This transform (cf. Eq. 5.35), written as idt 2

{a,b,c,d}

L(t) = L

e 2b [g(ω), t] = √ 2πib



∞ −∞

e−

iωt b

e

iaω2 2b

g(ω)dω,

can be approximated according to Algorithm 5.1 as follows. Let g be the vector √ formed with the N values gk of g(ω) at ωk = π (k − (N + 1)/2) / 2N, k = 1, 2, · · · , N. Then, a fast formula for the linear canonical transform L(t) of g(ω), when b = 0, evaluated at the time values tk = 4bωk /π, is implemented as LCT[g_,a_,b_,d_] := Module[{c, n, epsi, w, t, h, A0, S, L}, n = Length[g]; epsi = N[Pi/Sqrt[2 n]]; w = Table[(k - n/2 - 1/2) epsi, {k, n}]; t = 4 b w/Pi; h = Exp[I a w∧2/2/b] g; A0 = N[Sqrt[Pi/ (4 I b n)] Exp[-I Pi (n - 1)∧2/2/n]] Exp[I d t∧2/2/b]; S=Table[Exp[I Pi k (n-1)/n],{k,0,n-1}]; L = A0 S Fourier[S h, FourierParameters -> {1, -1}]; L] This module follows the lines of XFTINV1 (see above). Please note the factor 4 b/Pi in the assignment of t. The constant 4/π is explained in Sect. 3.5.1 and the additional factor b is due to the fact that the linear canonical transform can be interpreted basically as a Fourier transform evaluated at t/b. Therefore, the argument of this transform should be multiplied by b in order to compare it with the XFT algorithm. An example of the use of this module is given next. n = 2∧10; epsi = Pi/Sqrt[2 n]; x = Table[(k - n/2 - 1/2) epsi, {k, n}]; alf= 1; bet = 2; a = 1.5; d = 1.8; b = 2.5; c = (a d - 1)/b; g:= Exp[-alf x∧2 - 2 bet x]; u = 4 b/Pi*x; fe:=Exp[(I d u∧2)/(2 b) + (I u + 2 b bet)∧2/(2 b (-I a + 2 b alf))]/Sqrt[I b (-I a/b + 2 alf)]; fa = LCT[g,a,b,d]; ng = 400; tra = Table[{x[[k]], Re[fa[[k]]]}, {k, ng, n - ng+1}]; tre = Table[{x[[k]], Re[fe[[k]]]}, {k, ng, n - ng+1}]; tia = Table[{x[[k]], Im[fa[[k]]]}, {k, ng, n - ng+1}]; tie = Table[{x[[k]], Im[fe[[k]]]}, {k, ng, n - ng+1}]; {ListLinePlot[{tre, tra}, PlotRange − > All], ListLinePlot[{tie, tia}, PlotRange − > All]} Norm[fa - fe]

Appendix B

Programming in MATLAB

The numerical implementation in MATLAB of some algorithms presented in this book is given in this appendix. Please be aware that these programs are not optimized. They are written in a very simple, some times redundant style, in order to exemplify how to construct and apply the XFT algorithm. Besides, please note that these programs may be superseded by new versions of the system.

B.1 The Periodic XFT B.1.1 Algorithm 2.1: A Periodic Fourier Transform Let f be the vector formed with the N values fk of a 2π-periodic function f (t) at tk = k, k = −(N − 1)/2, · · · , (N − 1)/2. Then, the fast periodic DFT transform of f (t), evaluated at ωk = 2πtk /N, can be implemented as % This routine computes the periodic XFT of the vector f % % Usage: g = xftp(f); % ——————————————– % %Example: Defining variables: % N=2∧10; t=(-(N-1)/2:(N-1)/2); w=2*pi*t/N; % %Defining the function values and computing the periodic XFT: % fun = -1i*t.*exp(-abs(t)); g=4*w./(1+w.∧2).∧2; ga=xftp(fun); % %Exact and approximate transforms: % figure(1) % plot(w,real(ga),’g’,w,g,’r’); legend(’XFT Output’,’Exact’) % xlabel(’w’); ylabel(’f’); grid on % %Absolute error: © Springer Nature Switzerland AG 2019 R. G. Campos, The XFT Quadrature in Discrete Fourier Analysis, Applied and Numerical Harmonic Analysis, https://doi.org/10.1007/978-3-030-13423-5

213

214

B Programming in MATLAB

% figure(2) % plot(w,abs(real(ga)-g),’r’); legend(’Absolute Error’) % xlabel(’w’); ylabel(’Error’); grid on % ——————————————– % function g = xftp(f) % Defining constants and the phase factors: N = length(f); a0 = exp(1i*pi*(N-1)∧2/N/2); S = exp(-1i*pi*(N-1)*(0:N-1)/N); % Computing the xftp transform: g = N*a0*S.*ifft(S.*f); Please note that in the above example the time values can also be given as tk = k − (N + 1)/2, k = 1, 2, · · · , N.

B.1.2 A Periodic Fractional Derivative Let f be the vector formed with the N values fk of a 2π-periodic function f (t) at tk = 2kπ/N, k = 0, 1, · · · , N − 1. Then, the fast fractional derivative f (α) (t) of f (t), α ≥ 0, (cf. Eq. 2.43) can be implemented as % This routine computes the periodic α-derivative of the vector f % % Usage: g = dxftp(f,α); % ——————————————– % %Example: Defining variables, a pi/2 periodic function and its derivative: % N = 2∧10; w = pi/2; wf = 2*pi/w; t = (2*pi/wf)*(0:N-1)/N; % f = sin (2*t).∧2; fe = 4*cos (2*t).*sin(2*t); % fa = (2*pi/w)*dxftp(f,1); % Computing the xft-derivative % ng = 100; % tp = t(ng:N-ng+1); fep = fe(ng:N-ng+1); fap = fa(ng:N-ng+1); % %Exact and approximate derivatives: % figure(1) % plot(tp,real(fap),’g’,tp,fep,’r’); legend(’XFT Output’,’Exact’) % xlabel(’t’); ylabel(’df/dt’ ); grid on % %Absolute error: % figure(2) %plot(tp,abs(real(fap)-fep),’r’); legend(’Absolute Error’) % xlabel(’t’); ylabel(’Error’); grid on % ——————————————– % function gp = dxftp(f,α) % Defining length, eigenvalues and phase factors:

B Programming in MATLAB

215

N = length(f); Teig = (1:N)-(N+1)/2; S = exp(-1i*pi*(N-1)*(0:N-1)/N); % Computing the periodic α-derivative: gp = S.*ifft((1i*Teig).∧α.*fft(f./S)); The module given above can also be used for α < 0 if Length[f] is restricted to be an even integer.

B.2 The XFT B.2.1 General Direct Case: |z| ≤ 1 Let f be the vector formed with the N values fk = f (tk ) of a function f (t) at  tk =

π 2N

  N +1 k− , 2

k = 1, 2, · · · , N.

(B.1)

Then, given the vector f and a complex number z, |z| ≤ 1, the general fast XFT transform (cf. Eq. (5.3)) can be implemented as follows % This routine computes the XFTG of the vector f % for a given complex number |z| ≤ 1 % % Usage: g = xftg(f,z); % ——————————————– % Example: (see the example below) % ——————————————– % function g = xftg(f,z) % Defining constants and variables: N = length(f); epsi = pi/sqrt(2*N); x = epsi*((1:N)-(N+1)/2); R = 2*(1-z∧2)*1i/pi/z; c0 = (1+z∧2)/(1-z∧2)/2; A0 = sqrt(pi/2/N/(1-z∧2))*exp(1i*pi*(N-1)∧2/2/N); % Defining phase factors: S = exp(-1i*pi*(N-1)*(0:N-1)/N-c0*x.∧2); Sf = exp(-1i*pi*(N-1)*(0:N-1)/N-c0*R∧2*x.∧2); % Computing the xftg transform: g = N*A0*Sf.*ifft(S.*f); The output g of this module is a vector of elements gk approximating the integral transform (5.4) at gk = g(Rxk ), xk = tk . Please note the scale factor R in the assignment of Sf (cf. Sect. 3.5.1).

216

B Programming in MATLAB

B.2.2 A Fast Fractional Fourier Transform A fast fractional Fourier transform can be simply obtained by substituting z = eiθ in the above XFT[f_,z_] module. An example of the use of this module to compute the fast fractional Fourier transform follows. % This m-file computes the fast fractional Fourier transform of a vector f % by using the xftg function % ——————————————– % Example: Defining variables: N=2∧10; tet=pi/4; z=exp(1i*tet); R=2*(1-z∧2)*1i/pi/z; epsi=pi/sqrt(2*N); t = epsi*((1:N)-(N+1)/2); % Example: Defining the vector f and the exact transform: f=exp(-t.∧2/2+t); u=R*t; ge=2∧(1/4)*exp(1i*pi/8-1i*u.∧2/2-(1/4-1i/4)*(-1i+sqrt(2)*u).∧2)/sqrt(1+1i); ga=xftg(f,z); %Computing the xft fractional Fourier transform: ng=400; tp=t(ng:N-ng+1); gep=ge(ng:N-ng+1); gap=ga(ng:N-ng+1); % Exact and approximate transforms: figure(1) plot(tp,real(gap),’g’,tp,real(gep),’r’); legend(’XFT Output’,’Exact’) xlabel(’t’); ylabel(’L’ ); grid on % Absolute error: figure(2) plot(tp,abs(real(gap-gep)),’r’); legend(’Absolute Error’) xlabel(’t’); ylabel(’Error’); grid on

B.2.3 General Inverse XFT: |z| ≤ 1 An inverse formula for the above general XFT computed for a given vector g and a complex number z, |z| ≤ 1, can be implemented in terms of the inverse matrix as follows % This routine computes the inverse XFTG of the vector g % for a given complex number |z| ≤ 1 % % Usage: f = xftginv(g,z); % ——————————————– % function f=xftginv(g,z) % Defining constants and phase factors: N=length(g); epsi=pi/sqrt(2*N); x=epsi*((1:N)-(N+1)/2);

B Programming in MATLAB

217

R=2*(1-z∧2)*1i/pi/z; c0=(1+z∧2)/(1-z∧2)/2; A0i=sqrt(2*N*(1-z∧2)/pi)*exp(-1i*pi*(N-1)∧2/2/N); Si=exp(1i*pi*(N-1)*(0:N-1)/N+c0*x.∧2); Sfi=exp(1i*pi*(N-1)*(0:N-1)/N+c0*R∧2*x.∧2); % Computing the inverse XFTG of g f=A0i*Si.*fft (Sfi.*g)/N;

B.2.4 Algorithm 3.1: The Fast Discrete Fourier Transform A fast formula for the ordinary Fourier transform defined as  g(ω) =

∞ −∞

eiωt f (t)dt

(B.2)

can√be obtained by substituting z = i in the above XFT module and multiplying by 2π. However, in this case c0=0 and the code becomes simpler. Thus, if f is a vector formed with N values of a function f (t) at the points tk given by (B.1), the fast discrete Fourier transform of f can be implemented as % This routine computes the XFT of the vector f % % Usage: g = xft(f); % ——————————————– % %Example: Defining length, constants, and the vector of abscissas: % N = 2∧10; a = 4/pi; epsi = pi/sqrt(2*N); t = epsi*((1:N)-(N+1)/2); % %Defining a function, its Fourier transform, and the xft transform: % f = rectpuls(t,10); ge = 10*sinc(5*a*t/pi); ga = xft(f); % %Displaying the output: % ng = 400; % tp = t(ng:N-ng+1); gep = ge(ng:N-ng+1); gap = ga(ng:N-ng+1); % %Exact and approximate transforms: % figure(1) % plot(tp,real(gap),’g’,tp,gep,’r’); legend(’XFT Output’,’Exact’) % xlabel(’t’); ylabel(’L’ ); grid on % %Absolute error: % figure(2) % plot(tp,abs(real(gap-gep)),’r’); legend(’Absolute Error’) % xlabel(’t’); ylabel(’Error’); grid on % ——————————————– % function g = xft(f) % Defining constants and phase factors: N = length(f); a0 = pi*exp (1i*pi*(N-1)∧2/2/N)/sqrt(2*N);

218

B Programming in MATLAB

S = exp(-1i*pi*(N-1)*(0:N-1)/N); % Computing the XFT transform of f : g = N*a0*S.*ifft(S.*f);

The inverse of the Fourier transform is also a Fourier transform. If g(ω) is given by (B.2), then f (t) =

1 2π



∞ −∞

e−iωt g(ω)dω.

Therefore, the discrete inversion can be implemented as a slight modification of the above case % This routine computes the inverse XFT (as a Fourier Transform) % % Usage: f = xftinv1(g); % ——————————————– % %Example: Defining length, constants, and abscissas: % N = 2∧10; a = 4/pi; epsi = pi/sqrt(2*N); t = epsi*((1:N)-(N+1)/2); % gev = 10*sinc(5*a*t/pi); fa = a*xftinv1(gev); % fep = f(ng:N-ng+1); fap = fa(ng:N-ng+1); % %Exact and approximate functions: % figure(1) % plot(tp,real(fap),’g’,tp,real(fep),’r’); legend(’XFT Output’,’Exact’) % xlabel(’t’); ylabel(’L’ ); grid on % %Absolute error: % figure(2) % plot(tp,abs(real(fap-fep)),’r’); legend(’Absolute Error’) % xlabel(’t’); ylabel(’Error’); grid on % ——————————————– % function f = xftinv1(g) % Defining the length, a constant and the phase factors: N = length(g); a0 = pi*exp (-1i*pi*(N-1)∧2/2/N)/sqrt(2*N); S = exp(1i*pi*(N-1)*(0:N-1)/N); % Computing the inverse XFT: f = a0*S.*fft (S.*g)/2/pi; The fast inverse Fourier transform can also be computed as a inverse matrix of the XFT algorithm. % This routine computes the inverse XFT (as an inverse matrix) % % Usage: f = xftinv2(g);

B Programming in MATLAB

219

% ——————————————– function f = xftinv2(g) % Defining the length, a constant and the phase factors: N=length(g); a0i=sqrt(2*N)*exp (-1i*pi*(N-1)∧2/2/N)/pi; Si=exp(1i*pi*(N-1)*(0:N-1)/N); % Computing the inverse XFT: f=a0i*Si.*fft (Si.*g)/N; If the module XFTINV1 is used, please take into account that the output is an approximation to f (4tk /π) (cf. Sect. 3.5.1).

B.2.5 Algorithm 3.2: Fast Fourier Cosine Transform Let f be the vector formed with the M values fk = f (tk+ ) of a function f (t) at tk+

 =

π 4M

  1 k− , 2

k = 1, 2, · · · , M.

The fast formula for the Fourier cosine transform (cf. Sects. 3.3 and 3.5.2)  gc (ω) =

∞ −∞

cos(ωt)f (t)dt,

can be implemented in terms of the XFT algorithm (cf. Algorithm 3.1) as follows. % This routine computes the XFT cosine transform of the vector f % % Usage: g = xftcos(f); % ——————————————– % %Example: Defining lengths, constants, and abscissas: % M = 2∧8; N = 2*M; a = 4/pi; t = ((1:M)-1/2)*pi/sqrt(4*M); % %Defining the function and computing the cosine transform: % f = sinc(t/pi); ge = pi*(1+sign(1-a*t))/4; ga = real(xftcos(f)); % %Displaying the output: % ng = 230; tp = t(1:M-ng); gep = ge(1:M-ng); gap = ga(1:M-ng); % %Exact and approximate transforms % figure(1) % plot(tp,gap,’g’,tp,gep,’r’); legend(’XFT Output’,’Exact’) % xlabel(’w’); ylabel(’gc’ ); grid on % %Absolute error: % figure(2) % plot(tp,abs(gep-gap),’r’); legend(’Absolute Error’) % xlabel(’w’); ylabel(’Error’); grid on

220

B Programming in MATLAB

% ——————————————– % function g=xftcos(f) % Defining length and vectors: M=length(f); fhat=horzcat(flip(f),f); ghat=xft (fhat)/2; % Computing the XFT cosine transform: g=ghat(M+1:2*M); Take into account that the output is an approximation to gc (4tk+ /π) (cf. Sect. 3.5.1).

B.2.6 Algorithm 3.3: Fractional Derivatives A fast formula for the fractional derivative f (α)(t), α ≥ 0, of a function f (t) based in the Fourier transform (see Sect. 3.5.3), can be implemented by using Eq. (3.116) as follows % This routine computes the α-derivative for a vector f % % Usage: g = dxft(f,α); % ——————————————– % Example: (see the example below) % ——————————————– % function gp = dxft(f,α) % Defining constants, abscissas and phase factors: N=length(f); epsi=pi/sqrt(2*N); t=epsi*((1:N)-(N+1)/2); S=exp(-1i*pi*(N-1)*(0:N-1)/N); % Computing the α-derivative: gp=S.*ifft((4*1i*t/pi).∧α.*fft(f./S)); This module can also be used for α < 0 if Length[f] is restricted to be an even integer. An example of the use of this module to compute Fresnel integrals is given next. % This m-file computes Fresnel integrals % as an application of the dxft function % ——————————————– % Defining constants and abscissas: N = 2∧10; epsi = pi/sqrt(2*N); t = epsi*((1:N)-(N+1)/2); f=cos(pi*t.∧2/2); % function to integrate... % Computing the exact and approximate integrals: fe=fresnelc(t); fa=dxft(f,-1); % Displaying output:

B Programming in MATLAB

221

ng = 300; tp = t(ng:N-ng); fep = fe(ng:N-ng); fap = fa(ng:N-ng); % Exact and approximate integrals figure(1) plot(tp,real(fap),’g’,tp,fep,’r’); legend(’XFT Output’,’Exact’) xlabel(’t’); ylabel(’F(t)’ ); grid on % Absolute error: figure(2) plot(tp,abs(real(fap)-fep),’r’); legend(’Absolute Error’) xlabel(’t’); ylabel(’Error’); grid on

B.2.7 Algorithm 3.4: XFT of Sampled Data A fast formula for the Fourier transform of a signal sampled at a sampling rate frem can be implemented in terms of the XFT algorithm (Algorithm 3.4 above) as follows. % This routine computes the XFT of a vector f of sampled values % at a sampling rate frem by using the xft function % % Usage: g = xftsam(f,frem); % ——————————————– % %Example: % %Defining constants and sampling frequency: % N = 2000; epsi = pi/sqrt(2*N); frem = 5; % x = pi*((1:N)-(N+1)/2)/sqrt(2*N); % Dimensionless abscissas % W = epsi*frem; u = x/W; % frequency and time variable % %Defining the sampled values and computing the XFT: % f = 1./(1+u.∧2)/pi; ga = xftsam(f,frem); % %Exact and approximate transforms: % xw = 4*W*x/pi; % Defining new abscissas % figure(1) % plot(xw,real(ga),’g’,xw,exp(-abs(xw)),’r’); legend(’XFT Output’,’Exact’) % xlabel(’4*W*t/pi’); ylabel(’f’); grid on % %Absolute error: % figure(2) % plot(xw,abs(real(ga)-exp(-abs(xw))),’r’); legend(’Absolute Error’) % xlabel(’4*W*t/pi’); ylabel(’Error’); grid on % ——————————————– % function g = xftsam(f,frem) % Defining constants and frequency: n = length(f); epsi = pi/sqrt(2*n); W = epsi*frem;

222

B Programming in MATLAB

% Computing the XFT of the sampled data: g = xft(f)/W; Take into account that if g(ω) represents the Fourier transform of a function f (t/W ) and that the output of this module gives an approximation to g(8ν) (see Sect. 3.6.1.1).

B.2.8 Algorithm 5.1: The Linear Canonical Transform This transform (cf. Eq. 5.35), written as idt 2

{a,b,c,d}

L(t) = L

e 2b [g(ω), t] = √ 2πib



∞ −∞

e−

iωt b

e

iaω2 2b

g(ω)dω,

can be approximated according to Algorithm 5.1 as follows. Let g be the vector √ formed with the N values gk of g(ω) at ωk = π (k − (N + 1)/2) / 2N, k = 1, 2, · · · , N. Then, a fast formula for the linear canonical transform L(t) of g(ω), evaluated at the time values tk = 4bωk /π, is implemented as % This routine computes the LCT of a vector g (b =0) % % Usage: f = lct(g,a,b,d); % ——————————————– function f = lct(g,a,b,d) % Defining constants and abscissas: N = length(g); epsi = pi/sqrt(2*N); w = epsi*((1:N)-(N+1)/2); t = 4*b*w/pi; h = exp (1i*a*w.∧2/2/b).*g; % Defining function to integrate % Computing factors: a0 = sqrt(pi/(4*1i*b*N))*exp(-1i*pi*(N-1)∧2/2/N)*exp(1i*d*t.∧2/2/b); S = exp(1i*pi*(N-1)*(0:N-1)/N); % Computing the lct of g: f = a0.*S.*fft(S.*h); This module follows the lines of XFTINV1 (see above). Please note the factor 4 b/Pi in the assignment of t. The constant 4/π is explained in Sect. 3.5.1 and the additional factor b is due to the fact that the linear canonical transform can be interpreted basically as a Fourier transform evaluated at t/b. Therefore, the argument of this transform should be multiplied by b in order to compare it with the XFT algorithm. An example of the use of this module is given next.

B Programming in MATLAB

% This m-file gives an example of the use of the lct function % ——————————————– % Defining constants and abscissas: alf = 1; bet = 2; a = 1.5; d = 1.8; b = 2.5; c = (a*d-1)/b; N = 2∧10; epsi = pi/sqrt(2*N); t = epsi*((1:N)-(N+1)/2); % Giving the function to integrate: ge = exp(-alf*t.∧2-2*bet*t); % Computing the exact transform: u = 4*b*t/pi; cf = sqrt(1i*b*(-1i*a/b+2*alf)); fe = exp(1i*d*u.∧2/2/b+(1i*u+2*b*bet).∧2/(2*b*(-1i*a+2*b*alf)))/cf; % Computing the approximate transform: fa = lct(ge,a,b,d); % Displaying the output: ng = 200; tp = t(ng:N-ng+1); fep = fe(ng:N-ng+1); fap = fa(ng:N-ng+1); % Real part of the exact and approximate transforms figure(1) plot(tp,real(fap),’g’,tp,real(fep),’r’); legend(’XFT Output’,’Exact’) xlabel(’t’); ylabel(’L’ ); grid on % Imaginary part of the exact and approximate transforms figure(2) plot(tp,imag(fap),’g’,tp,imag(fep),’r’); legend(’XFT Output’,’Exact’) xlabel(’t’); ylabel(’L’ ); grid on % Absolute error: figure(3) plot(tp,abs(fap-fep),’r’); legend(’Absolute Error’) xlabel(’t’); ylabel(’Error’); grid on

223

References

1. R.P. Agarwal. Boundary Value Problems for Higher Order Differential Equations. World Scientific Publishing, Singapore, 1986. 2. S.T. Ali, J.P. Antoine, and J.P. Gazeau. Coherent States, Wavelets, and Their Generalizations. Springer-Verlag, New York, 2014. 3. L.B. Almeida. The fractional Fourier transform and time-frequency representations. IEEE Trans. Signal Process., 42(11):3084–3091, 1994. 4. I. Amidror. Mastering the Discrete Fourier Transform in One, Two or Several Dimensions. Pitfalls and Artifacts. Springer-Verlag, London, 2013. 5. M. Ya. Antimirov, A.A. Kolyshkin, and Rémi Vaillancourt. Applied Integral Transforms, volume 2 of CMR Monograph Series. AMS, Rhode Island, 1993. 6. N.M. Atakishiyev, L.E. Vicent, and K.B Wolf. Continuous vs. discrete fractional Fourier transforms. J. Comput. Appl. Math., 107:73–95, 1999. 7. L. Auslander and F.A. Grünbaum. The Fourier transform and the discrete Fourier transform. Inverse Problems, 5:149–164, 1989. 8. S. Bagchi and S.K. Mitra. The Nonuniform Discrete Fourier Transform and its Applications in Signal Processing. Springer Science+Business Media, New York, 1999. 9. L. Barker, C. Candan, T. Hakioglu, M.A. Kutay, and H.M. Ozaktas. The discrete harmonic oscillator, Harper’s equation, and the discrete fractional Fourier transform. J. Phys. A: Math. Gen., 33:2209–2222, 2000. 10. E.R. Benton and G.W. Platzman. A table of solutions of the one-dimensional Burgers equation. Quart. Appl. Math., 30:195–212, 1972. 11. A. Bergua and W. Skrandies. An early antecedent to modern random dot stereograms “the secret stereoscopic writing” of Ramón y Cajal. Int. J. Psychophysiology, 36:69–72, 2000. 12. R. Bracewell. The Fourier Transform and its Applications. McGraw-Hill, Singapore, 2000. 13. W.L. Briggs and V.E. Henson. The DFT: An Owners’ Manual for the Discrete Fourier Transform. SIAM, Philadelphia, 1995. 14. E.O. Brigham. The Fast Fourier Transform and its Applications. Prentice-Hall, Inc., New Jersey, 1988. 15. S.A. Broughton and K. Bryan. Discrete Fourier Analysis and Wavelets. Applications to Signal and Image Processing. John Wiley and Sons, New Jersey, 2009. 16. J.W. Brown and R.V. Churchill. Fourier Series and Boundary Value Problems. McGraw-Hill, New York, 2008. 17. M. Bruschi and F. Calogero. Finite-dimensional matrix representations of the operator of differentiation through the algebra of raising and lowering operators: General properties and explicit examples. Nuovo Cimento B, 62:337–351, 1981.

© Springer Nature Switzerland AG 2019 R. G. Campos, The XFT Quadrature in Discrete Fourier Analysis, Applied and Numerical Harmonic Analysis, https://doi.org/10.1007/978-3-030-13423-5

225

226

References

18. M. Bruschi, R.G. Campos, and E. Pace. On a method for computing eigenvalues and eigenfunctions of linear differential operators. Nuovo Cimento B, 105:131–163, 1990. 19. A. Bultheel and H. Martínez-Sulbaran. Computation of the fractional Fourier transform. Appl. Comput. Harmon. Anal., 16:182–202, 2004. 20. J. Burgers. A mathematical model illustrating the theory of turbulence. Adv. Appl. Mech., 1:171–199, 1948. 21. J.C. Butcher. Numerical Methods for Ordinary Differential Equations. John Wiley and Sons, Inc., New Jersey, 2008. 22. D. Cafagna. Fractional calculus: A mathematical tool from the past for present engineers. IEEE Ind. Elect. Mag., 2:35–40, 2007. 23. F. Calogero. Matrices, differential operators and polynomials. J. Math. Phys., 22:919–934, 1981. 24. F. Calogero. Lagrangian interpolation and differentiation. Lett. Nuovo Cimento, 35:273–278, 1983. 25. F. Calogero. Interpolation, differentiation and solution of eigenvalue problems in more than one dimension. Lett. Nuovo Cimento, 39:305–311, 1984. 26. F. Calogero. Classical Many-Body Problems Amenable to Exact Treatments, volume 66 of Lecture Notes in Physics Monographs. Springer-Verlag, Berlin, 2001. 27. F. Calogero and E. Franco. Numerical tests of a novel technique to compute the eigenvalues of differential operators. Nuovo Cimento B, 89:161–208, 1985. 28. W.L. Cameron. Precise expression relating the Fourier transform of a continuous signal to the fast Fourier transform of signal samples. IEEE Trans. Signal Process., 43:2811–2821, 1995. 29. R.G. Campos. Time-reversal breaking in fractional differential problems. Eur. Phys. J. Plus, 130:121–125, 2015. 30. R.G. Campos. A fractional partial differential equation for theta functions. In G.M. Greuel, L.N. Macarro, and S. Xambó-Descamps, editors, Singularities, Algebraic Geometry, Commutative Algebra, and Related Topics, pages 579–591, Berlin, 2018. Springer International Publishing. 31. R.G. Campos and J. Figueroa. A fast algorithm for the linear canonical transform. Signal Process., 91:1444–1447, 2011. 32. R.G. Campos, J.Rico-Melgoza, and E. Chávez. A new formulation of the fast fractional Fourier fransform. SIAM J. Sci. Comput., 34(2):A1110–A1125, 2012. 33. R.G. Campos and L.Z. Juárez. A discretization of the continuous Fourier transform. Nuovo Cimento B, 107:703–711, 1992. 34. R.G. Campos and F. Marcellán. Quadratures and integral transforms arising from generating functions. Appl. Math. Comput., 297:8–18, 2017. 35. R.G. Campos and C. Meneses. Differentiation matrices for meromorphic functions. Bol. Soc. Mat. Mexicana, 12:121–132, 2006. 36. R.G. Campos, F. D. Mota, and E. Coronado. Quadrature formulas for integrals transforms generated by orthogonal polynomials. IMA J. Numer. Anal., 31:1181–1193, 2011. 37. R.G. Campos and F.D. Mota. An implementation of the collocation method for initial value problems. Int. J. Model. Simul. Sci. Comput., 4:1350006, 2013. 38. R.G. Campos and L.O. Pimentel. A finite-dimensional representation of the quantum angular momentum operator. Nuovo Cimento B, 116:31–46, 2001. 39. R.G. Campos and R.G. Ruiz. Fast integration of one-dimensional boundary value problems. Int. J. Mod. Phys. C, 24, 2013. 40. A. Candan, M.A. Kutay, and H.M. Ozaktas. The discrete fractional Fourier transform. IEEE Trans. Signal Process., 48:1329–1337, 2000. 41. C. Candan. On higher order approximations for Hermite-Gaussian functions and discrete fractional Fourier transforms. IEEE Signal Process. Lett., 14:699–702, 2001. 42. S.A. Collins. Lens-system diffraction integral written in terms of matrix optics. J. Opt. Soc. Am., 60:1168–1177, 1970. 43. E.U. Condon. Immersion of the Fourier transform in a continuous group of functional transformations. Proc. Nat. Acad. Sci. (USA), 23:158–164, 1937.

References

227

44. J.W. Cooley, P.A.W. Lewis, and P.D. Welch. Application of the fast Fourier transform to computation of Fourier integrals, Fourier series, and convolution integrals. IEEE Trans. Audio Electroacoustics, pages 79–84, 1967. 45. L. Debnath. Recent applications of fractional calculus to science and engineering. Int. J. Math. Math. Sci., 54:3413–3442, 2003. 46. X. Deng, Y. Li, D. Fan, and Y. Qiu. A fast algorithm for fractional Fourier transform. Opt. Commun., 138:270–274, 1997. 47. K. Diethelma, J.M. Ford, N.J. Ford, and M. Weilbeer. Pitfalls in fast numerical solvers for fractional differential equations. J. Comput. Appl. Math., 186:482–503, 2006. 48. V.V. Dodonov. Nonclassical states in quantum optics: a ’squeezed’ review of the first 75 years. J. Opt. B: Quantum Semiclass. Opt., 4:R1–R33, 2002. 49. Ch. Epstein and J. Schotland. The bad truth about laplace’s transform. SIAM Review, 50:504– 520, 2008. 50. A. Erdélyi, editor. Higher Transcendental Functions, volume I, II. McGraw-Hill, New York, 1953. 51. A. Erdélyi, editor. Tables of Integral Transforms, volume I. McGraw-Hill, New York, 1954. 52. T. Erseghe, P. Kraniauskas, and G. Cariolaro. Unified fractional Fourier transform and sampling theorem. IEEE Trans. Signal Process., 47:3419–3423, 1999. 53. H.G. Feichtinger and N. Kaiblinger. Quasi-interpolation in the Fourier algebra. J. Approx. Theory, 144:103–118, 2007. 54. H.G. Feichtinger, F. Luef, and E. Cordero. Banach Gelfand triples for Gabor analysis. In Pseudo-Differential Operators. Quantization and Signals., volume 1949 of Lecture Notes in Mathematics, pages 1–33, Berlin, 2008. Springer. 55. H.G. Feichtinger and T. Strohmer, editors. Advances is Gabor Analysis. Applied and Numerical Harmonic Analysis. Birkhäuser, Basel, 2003. 56. C. Fox. The inversion of convolution transforms by differential operators. Proc. Amer. Math. Soc., 4:880–887, 1953. 57. J. Fridrich. Steganography in Digital Media: Principles, Algorithms and Applications. Cambridge University Press, New York, 2010. 58. Sean A. Fulop. Speech Spectrum Analysis. Springer-Verlag, Berlin, 2011. 59. D. Galetti and M.A. Marchiolli. Discrete coherent states and probability distributions in finite-dimensional spaces. Ann. Phys. (N. Y.), 249:454–480, 1996. 60. C. Gasquet and P. Witomski. Fourier Analysis and Applications. Filtering, Numerical Computation, Wavelets. Texts in Applied Mathematics. Springer-Verlag, New York, 1999. 61. W. Gautschi. Orthogonal Polynomials, Computation and Approximation. Numerical Mathematics and Scientific Computation. Oxford University Press, Oxford, 2004. 62. J.P. Gazeau. Coherent States in Quantum Physics. Wiley-VCH Verlag, Weinheim, 2009. 63. A.A. Girgis and F.M. Ham. A quantitative study of pitfalls in the FFT. IEEE Trans. Aero. Elect. Sys., 4:434–439, 1980. 64. G.H Golub and C.F. Van Loan. Matrix Computations. The Johns Hopkins University Press, Baltimore, 1996. 65. R.C. Gonzalez, R.E. Woods, and S.L. Eddins. Digital Image Processing Using MATLAB. Pearson Prentice-Hall, New Jersey, 2004. 66. J.W. Goodman. Introduction to Fourier Optics. Roberts and Company Pub., Englewood, 2005. 67. R.W. Goodman. Discrete Fourier and Wavelet Transforms: An Introduction through Linear Algebra with Applications to Signal Processing. World Scientific Publishing, Singapore, 2016. 68. I.S. Gradshteyn and I.M. Ryzhik. Table of Integrals, Series, and Products. Academic Press, San Diego, 1994. 69. L. Greengard. Spectral integration and two-point boundary value problems. SIAM J. Numer. Anal., 28:1071–1080, 1991. 70. K. Gröchening. Foundations of Time-Frequency Analysis. Applied and Numerical Harmonic Analysis. Birkhäuser, Boston, 2001.

228

References

71. F.A. Grünbaum. The eigenvectors of the discrete Fourier transform: A version of the Hermite functions. J. Math. Anal. Appl., 88:355–363, 1982. 72. F.A. Grünbaum. Discrete models of the harmonic oscillator and a discrete analog of Gauss’ hypergeometric equation. Ramanujan J., 5:263–270, 2001. 73. F.A. Grünbaum and E.H. Zarantonello. On the extension of uniformly continuous mappings. Michigan Math. J., 15:65–74, 1968. 74. H. Gzyl, A. Tagliani, and M. Milev. Laplace transform inversion on the real line is truly ill-conditioned. Appl. Math. Comput., 219:9805–9809, 2013. 75. H. Hakimmashhadi. Discrete Fourier Transform and FFT. In C.H. Chen, editor, Signal Processing Handbook, New York, 1988. Marcel Dekker, Inc. 76. H. Han and Z. Xu. Numerical solitons of generalized Korteweg-de Vries equations. Appl. Math. Comput., 186:483–489, 2007. 77. J.J. Healy, M.A. Kutay, H.M. Ozaktas, and J.T. Sheridan, editors. Linear Canonical Transforms. Theory and Applications. Springer Science+Business Media, New York, 2016. 78. P. Henrici. Fast Fourier methods in computational complex analysis. SIAM Rev., 21:460–480, 1979. 79. I.I. Hirschman and D.V. Widder. Generalized inversion formulas for convolution transforms. Duke Math. J., 15:659–696, 1948. 80. I.I. Hirschman and D.V. Widder. Generalized inversion formulas for convolution transforms II. Duke Math. J., 17:391–402, 1950. 81. I.I. Hirschman and D.V. Widder. The Convolution Transform. Princeton University Press, New Jersey, 1955. 82. J.F. James. A Student’s Guide to Fourier Transforms: with Applications in Physics and Engineering. Cambridge University Press, Cambridge, 2011. 83. K.T. Joseph and P.L. Sachdev. Initial boundary value problems for scalar and vector Burgers equations. Stud. Appl. Math., 106:481–505, 2001. 84. F. Mainardi J.T. Machado, V. Kiryakova. A poster about the recent history of fractional calculus. Fract. Calc. Appl. Anal., 13:329–334, 2010. 85. N. Kaiblinger. Approximation of the Fourier transform and the dual Gabor window. J. Fourier Anal. Appl., 11:25–42, 2005. 86. Y. Katznelson. An Introduction to Harmonic Analysis. Cambridge University Press, Cambridge, 2004. 87. H.B. Keller. Numerical Solution of Two-Point Boundary Value Problems. SIAM Regional Conference Series in Applied Mathematics. SIAM, Philadelphia, 1990. 88. A.A. Kilbas, H.M. Srivastava, and J.J. Trujillo. Theory and Applications of Fractional Differential Equations. Elsevier, Amsterdam, 2006. 89. R. Kimmel. 3d shape reconstruction from autostereograms and stereo. J. Vis. Comm. Image Rep., pages 324–333, 2002. 90. J.R. Klauder and B.S. Skagerstam. Coherent States: Applications in Physics and Mathematical Physics. World Scientific Publishing, Singapore, 1985. 91. A.N. Kolmogorov and S.V. Fomin. Introductory Real Analysis. Prentice-Hall, Inc., New Jersey, 1970. 92. T.W. Körner. Fourier Analysis. Cambridge University Press, Cambridge, 1990. 93. H.J. Korsch and K. Rapedius. Computations in quantum mechanics made easy. Eur. J. Phys., 37:055410, 2016. 94. S.M. Kosslyn, W.L. Thompson, I.J. Kim, S.L. Rauch, and N.M. Alpert. Individual differences in cerebral blood flow in area 17 predict the time to evaluate visualized letters. J. Cogn. Neurosci., 8:78–82, 1996. 95. A. Kuznetsov and M. Kwa´snicki. Minimal Hermite-type eigenbasis of the discrete Fourier transform. J. Fourier Anal. Appl., https://doi.org/10.1007/s00041-018-9600-z, 2018. 96. B. P. Lathi and Roger A. Green. Essentials of Digital Signal Processing. Cambridge University Press, Cambridge, 2010. 97. M.S.K. Lau and C.P. Kwong. Analysis of echoes in single-image random-dot-stereograms. J. Math. Imaging Vis., 16:69–79, 2002.

References

229

98. H. Li, J. Sun, and Y. Xu. Discrete Fourier analysis, cubature, and interpolation on a hexagon and a triangle. SIAM J. Numer. Anal., 46:1653–1681, 2008. 99. S. Liberman and K.B Wolf. Independent simultaneous discoveries visualized through network analysis: the case of linear canonical transforms. Scientometrics, 104:715–735, 2015. 100. S. Liberman and K.B Wolf. The structural development of linear canonical transforms. Phys. Atom. Nucl., 80:814–821, 2017. 101. J. Lighthill. An Informal Introduction to Theoretical Fluid Mechanics. Oxford University Press, Oxford, 1988. 102. C. Van Loan. Computational Frameworks for the Fast Fourier Transform. Frontiers in Applied Mathematics. SIAM, Philadelphia, 1992. 103. W.Y. Ma and B.S. Manjunath. Edge flow: a framework of boundary detection and image segmentation. In Computer Vision and Pattern Recognition, pages 744–749. IEEE, 1997. 104. J.T. Machado, V. Kiryakova, and F. Mainardi. Recent history of fractional calculus. Commun. Nonlinear Sci. Numer. Simulat., 16:1140–115, 2011. 105. R. Maini and H. Aggarwal. Study and comparison of various image edge detection techniques. Int. J. Image Process., 3:1–12, 2009. 106. A.I. Markushevich. Theory of Functions of a Complex Variable. AMS Chelsea Publishing, Rhode Island, 2011. 107. D. Marr and E. Hildreth. Theory of edge detection. Proc. R. Soc. London, 207:187–217, 1980. 108. E. Merzbacher. Quantum Mechanics. John Wiley and Sons, Inc., New York, 1998. 109. S. Momani and M. A. Noor. Numerical comparison of methods for solving a special fourthorder boundary value problem. Appl. Math. Comput., 191:218–224, 2007. 110. M. Moshinsky and C. Quesne. Linear canonical transformations and their unitary representations. J. Math. Phys., 12:1772–1783, 1971. 111. B. Muckenhoupt. Equiconvergence and almost everywhere convergence of Hermite and Laguerre series. SIAM J. Math. Anal., 1:295–321, 1970. 112. V. Namias. The fractional order Fourier transform and its application to quantum mechanics. J. Inst. Math. Appl., 25:241–265, 1980. 113. S. Nerney, E.J. Schmahl, and Z.E. Musielak. Analytic solutions of the vector Burgers’ equation. Quart. Appl. Math., 54:63–71, 1996. 114. S. Odake and R. Sasaki. Exactly solvable ’discrete’ quantum mechanics; shape invariance, Heisenberg solutions, annihilation-creation operators and coherent states. Prog. Theor. Phys., 119:663–700, 2008. 115. P.L. Olson and M. Sivak. Perception-response time to unexpected roadway hazards. Hum. Factors, 28:91–96, 1986. 116. M.D. Ortigueira. Fractional Calculus for Scientists and Engineers. Springer-Verlag, Dordrecht, 2011. 117. H.M. Ozaktas, O. Ankan, M.A. Kutay, and G. Bozda˘gi. Digital computation of the fractional Fourier transform. IEEE Trans. Signal Process., 44:2141–2150, 1996. 118. H.M. Ozaktas, Z. Zalevsky, and M.A. Kutay. The Fractional Fourier Transform with Applications in Optics and Signal Processing. John Wiley and Sons, Inc., Chichester, 2001. 119. J.N. Pandey and A.H. Zemanian. Complex inversion for the generalized convolution transformation. Pac. J. Math., 25:147–157, 1968. 120. S.C. Pei, M.H. Yeh, and C.C. Tseng. Discrete fractional Fourier transform based on orthogonal projections. IEEE Trans. Signal Process., 47:1335–1348, 1999. 121. A. Perelomov. Generalized Coherent States and Their Applications. Springer-Verlag, Berlin, 1986. 122. A.M. Perelomov. On the completeness of a system of coherent states. Theor. Math. Phys., 6:156–164, 1971. 123. F.A.P. Petitcolas, R.J. Anderson, and M.G. Kuhn. Information hiding-a survey. In Proceedings of the IEEE, volume 87, pages 1062–1078. IEEE, 1999. 124. I. Podlubny. Fractional Differential Equations. Academic Press, San Diego, 1999.

230

References

125. K.R. Rao, D.N. Kim, and J.J. Hwang. Fast Fourier Transform: Algorithms and Applications. Signals and Communication Technology. Springer-Verlag, New York, 2010. 126. P. Rosenau and J. M. Hyman. Compactons: solitons with finite wavelength. Phys. Rev. Lett., 70:564–567, 1993. 127. W. Rudin. Fourier Analysis on Groups. Interscience Publishers, New York, 1962. 128. F. Rus and F.R. Villatoro. Self-similar radiation from numerical Rosenau-Hyman compactons. J. Comput. Phys., 227:440–454, 2007. 129. S.G. Samko, A.A. Kilbas, and O.I. Marichev. Fractional Integrals and Derivatives: Theory and Applications. Gordon and Breach, Switzerland, 1993. 130. D.L. Schomer and F.H. Lopes da Silva. Niedermeyer’s Electroencephalography. Wolters Kluwer, Pennsylvania, 2011. 131. L.F. Shampine. Numerical Solution of Ordinary Differential Equations. Chapman and Hall, New York, 1994. 132. L.F. Shampine, I. Gladwell, and S. Thompson. Solving ODEs with MATLAB. Cambridge University Press, Cambridge, 2003. 133. L.F. Shampine and H.A. Watts. Block implicit one-step methods. Math. Comp., 23:731–740, 1969. 134. S.S. Siddiqi and M. Iftikhar. Numerical solution of higher order boundary value problems. Abstr. Appl. Anal., 2013. 135. I.N. Sneddon. Fourier Transforms. Dover Publications, New York, 1995. 136. E. M. Stein and R. Shakarchi. Fourier Analysis - An Introduction. Princeton Lectures in Analysis. Princeton University Press, New Jersey, 2003. 137. G. Szegö. Orthogonal Polynomials. Colloquium Publications. AMS, Rhode Island, 1975. 138. R. Szelinski. Computer Vision. Algorithms and Applications. Springer-Verlag, London, 2011. 139. Y. Tanno. On a class of convolution transforms. Tohoku Math. J., 18:156–173, 1966. 140. Y. Tanno. On a class of convolution transforms II. Tohoku Math. J., 19:168–186, 1967. 141. R. Tao, F. Zhang, and Y. Wang. Research progress on discretization of fractional Fourier transform. Sci. China Inf. Sci., 51:859–880, 2008. 142. H.W. Thimbleby, S. Inglis, and I. H.Witten. Displaying 3d images: Algorithms for singleimage random-dot stereograms. Computer, 27:38–48, 1994. 143. A.F. Timan. Theory of Approximation of Functions of a Real Variable. Dover Publications, New York, 1994. 144. G.P. Tolstov. Fourier Series. Dover Publications, New York, 1976. 145. V.V. Uchaikin. Fractional Derivatives for Physicists and Engineers. Springer-Verlag, Berlin, 2013. 146. A.B. Watson and A.J. Ahumada. Model of human visual-motion sensing. J. Opt. Soc. Am. A, 2:322–342, 1985. 147. H.A. Watts and L.F. Shampine. A-stable block implicit one-step methods. BIT Numer. Math., 12:252–266, 1972. 148. J.A.C. Weideman and S.C. Reddy. A MATLAB differentiation matrix suite. ACM Trans. Math. Soft., 26:465–519, 2000. 149. D.V. Widder. Inversion formulas for convolution transforms. Duke Math. J., 14:217–249, 1947. 150. D.V. Widder. The convolution transform. Bull. Amer. Math. Soc, 60:444–456, 1954. 151. N. Wiener. Hermitian polynomials and Fourier analysis. J. Math. Phys. Camb., 8:70–73, 1929. 152. K.B Wolf. Integral Transforms in Science and Engineering. Plenum Press, New York, 1979. 153. M.W. Wong. Discrete Fourier Analysis, volume 5 of Pseudo-Differential Operators. Birkhäuser, Basel, 2011. 154. A.H. Zemanian. Distribution Theory and Transform Analysis. An Introduction to Generalized Functions with Applications. Dover Publications, New York, 1987. 155. A.H. Zemanian. Generalized Integral Transformations. Dover Publications, New York, 1987. 156. D. Ziou and S. Tabbone. Edge detection techniques: an overview. Int. J. Pattern Recogn. Image Anal., 8:537–559, 1998.

Applied and Numerical Harmonic Analysis (94 volumes)

1. A. I. Saichev and W.A. Woyczy´nski: Distributions in the Physical and Engineering Sciences (ISBN 978-0-8176-3924-2) 2. C.E. D’Attellis and E.M. Fernandez-Berdaguer: Wavelet Theory and Harmonic Analysis in Applied Sciences (ISBN 978-0-8176-3953-2) 3. H.G. Feichtinger and T. Strohmer: Gabor Analysis and Algorithms (ISBN 9780-8176-3959- 4) 4. R. Tolimieri and M. An: Time-Frequency Representations (ISBN 978-0-81763918-1) 5. T.M. Peters and J.C. Williams: The Fourier Transform in Biomedical Engineering (ISBN 978-0-8176-3941-9) 6. G.T. Herman: Geometry of Digital Spaces (ISBN 978-0-8176-3897-9) 7. Teolis: Computational Signal Processing with Wavelets (ISBN 978-0-81763909-9) 8. J. Ramanathan: Methods of Applied Fourier Analysis (ISBN 978-0-8176-39631) 9. J.M. Cooper: Introduction to Partial Differential Equations with MATLAB (ISBN 978-0-8176-3967-9) 10. Procházka, N.G. Kingsbury, P.J. Payner, and J. Uhlir: Signal Analysis and Prediction (ISBN 978-0-8176-4042-2) 11. W. Bray and C. Stanojevic: Analysis of Divergence (ISBN 978-1-4612-7467-4) 12. G.T. Herman and A. Kuba: Discrete Tomography (ISBN 978-0-8176-4101-6) 13. K. Gröchenig: Foundations of Time-Frequency Analysis (ISBN 978-0-81764022-4) 14. L. Debnath: Wavelet Transforms and Time-Frequency Signal Analysis (ISBN 978-0-8176- 4104-7) 15. J.J. Benedetto and P.J.S.G. Ferreira: Modern Sampling Theory (ISBN 978-08176-4023-1) 16. D.F. Walnut: An Introduction to Wavelet Analysis (ISBN 978-0-8176-3962-4) 17. Abbate, C. DeCusatis, and P.K. Das: Wavelets and Subbands (ISBN 978-08176-4136-8) 18. O. Bratteli, P. Jorgensen, and B. Treadway: Wavelets Through a Looking Glass (ISBN 978- 0-8176-4280-80 © Springer Nature Switzerland AG 2019 R. G. Campos, The XFT Quadrature in Discrete Fourier Analysis, Applied and Numerical Harmonic Analysis, https://doi.org/10.1007/978-3-030-13423-5

231

232

Applied and Numerical Harmonic Analysis (94 volumes)

19. H.G. Feichtinger and T. Strohmer: Advances in Gabor Analysis (ISBN 978-08176-4239-6) 20. O. Christensen: An Introduction to Frames and Riesz Bases (ISBN 978-0-81764295-2) 21. L. Debnath: Wavelets and Signal Processing (ISBN 978-0-8176-4235-8) 22. G. Bi and Y. Zeng: Transforms and Fast Algorithms for Signal Analysis and Representations (ISBN 978-0-8176-4279-2) 23. J.H. Davis: Methods of Applied Mathematics with a MATLAB Overview (ISBN 978-0-8176- 4331-7) 24. J.J. Benedetto and A.I. Zayed: Sampling, Wavelets, and Tomography (ISBN 978-0-8176-4304-1) 25. E. Prestini: The Evolution of Applied Harmonic Analysis (ISBN 978-0-81764125-2) 26. L. Brandolini, L. Colzani, A. Iosevich, and G. Travaglini: Fourier Analysis and Convexity (ISBN 978-0-8176-3263-2) 27. W. Freeden and V. Michel: Multiscale Potential Theory (ISBN 978-0-81764105-4) 28. O. Christensen and K.L. Christensen: Approximation Theory (ISBN 978-08176-3600-5) 29. O. Calin and D.-C. Chang: Geometric Mechanics on Riemannian Manifolds (ISBN 978-0-8176-4354-6) 30. J.A. Hogan: Time-Frequency and Time-Scale Methods (ISBN 978-0-81764276-1) 31. Heil: Harmonic Analysis and Applications (ISBN 978-0-8176-3778-1) 32. K. Borre, D.M. Akos, N. Bertelsen, P. Rinder, and S.H. Jensen: A SoftwareDefmed GPS and Galileo Receiver (ISBN 978-0-8176-4390-4) 33. T. Qian, M.I. Vai, and Y. Xu: Wavelet Analysis and Applications (ISBN 978-37643-7777-9) 34. G.T. Herman and A. Kuba: Advances in Discrete Tomography and Its Applications (ISBN 978-0-8176-3614-2) 35. M.C. Fu, R.A. Jarrow, J.-Y. Yen, and R.J. Elliott: Advances in Mathematical Finance (ISBN 978-0-8176-4544-1) 36. O. Christensen: Frames and Bases (ISBN 978-0-8176-4677-6) 37. P.E.T. Jorgensen, J.D. Merrill, and J.A. Packer: Representations, Wavelets, and Frames (ISBN 978-0-8176-4682-0) 38. M. An, A.K. Brodzik, and R. Tolimieri: Ideal Sequence Design in TimeFrequency Space (ISBN 978-0-8176-4737-7) 39. S.G. Krantz: Explorations in Harmonic Analysis (ISBN 978-0-8176-4668-4) 40. Luong: Fourier Analysis on Finite Abelian Groups (ISBN 978-0-8176-4915-9) 41. G.S. Chirikjian: Stochastic Models, Information Theory, and Lie Groups, Volume 1 (ISBN 978-0-8176-4802-2) 42. Cabrelli and J.L. Torrea: Recent Developments in Real and Harmonic Analysis (ISBN 978-0- 8176-4531-1) 43. M.V. Wickerhauser: Mathematics for Multimedia (ISBN 978-0-8176-4879-4)

Applied and Numerical Harmonic Analysis (94 volumes)

233

44. B. Forster, P. Massopust, O. Christensen, K. Gröchenig, D. Labate, P. Vandergheynst, G. Weiss, and Y. Wiaux: Four Short Courses on Harmonic Analysis (ISBN 978-0-8176-4890-9) 45. O. Christensen: Functions, Spaces, and Expansions (ISBN 978-0-8176-4979-1) 46. J. Barral and S. Seuret: Recent Developments in Fractals and Related Fields (ISBN 978-0- 8176-4887-9) 47. O. Calin, D.-C. Chang, and K. Furutani, and C. Iwasaki: Heat Kernels for Elliptic and Sub- elliptic Operators (ISBN 978-0-8176-4994-4) 48. C. Heil: A Basis Theory Primer (ISBN 978-0-8176-4686-8) 49. J.R. Klauder: A Modern Approach to Functional Integration (ISBN 978-08176-4790-2) 50. J. Cohen and A.I. Zayed: Wavelets and Multiscale Analysis (ISBN 978-0-81768094-7) 51. Joyner and J.-L. Kim: Selected Unsolved Problems in Coding Theory (ISBN 978-0-8176-8255-2) 52. G.S. Chirikjian: Stochastic Models, Information Theory, and Lie Groups, Volume 2 (ISBN 978-0-8176-4943-2) 53. J.A. Hogan and J.D. Lakey: Duration and Bandwidth Limiting (ISBN 978-08176-8306-1) 54. Kutyniok and D. Labate: Shearlets (ISBN 978-0-8176-8315-3) 55. P.G. Casazza and P. Kutyniok: Finite Frames (ISBN 978-0-8176-8372-6) 56. V. Michel: Lectures on Constructive Approximation (ISBN 978-0-8176-84020) 57. D. Mitrea, I. Mitrea, M. Mitrea, and S. Monniaux: Groupoid Metrization Theory (ISBN 978- 0-8176-8396-2) 58. T.D. Andrews, R. Balan, J.J. Benedetto, W. Czaja, and K.A. Okoudjou: Excursions in Harmonic Analysis, Volume 1 (ISBN 978-0-8176-8375-7) 59. T.D. Andrews, R. Balan, J.J. Benedetto, W. Czaja, and K.A. Okoudjou: Excursions in Harmonic Analysis, Volume 2 (ISBN 978-0-8176-8378-8) 60. D.V. Cruz-Uribe and A. Fiorenza: Variable Lebesgue Spaces (ISBN 978-30348-0547-6) 61. W. Freeden and M. Gutting: Special Functions of Mathematical (Geo- Physics (ISBN 978-3- 0348-0562-9) 62. A. I. Saichev and W.A. Woyczy´nski: Distributions in the Physical and Engineering Sciences, Volume 2: Linear and Nonlinear Dynamics of Continuous Media (ISBN 978-0-8176-3942-6) 63. S. Foucart and H. Rauhut: A Mathematical Introduction to Compressive Sensing (ISBN 978- 0-8176-4947-0) 64. Herman and J. Frank: Computational Methods for Three-Dimensional Microscopy Reconstruction (ISBN 978-1-4614-9520-8) 65. Paprotny and M. Thess: Realtime Data Mining: Self-Learning Techniques for Recommendation Engines (ISBN 978-3-319-01320-6) 66. Zayed and G. Schmeisser: New Perspectives on Approximation and Sampling Theory: Festschrift in Honor of Paul Butzer ’s 85t h Birthday (ISBN 978-3-31908800-6)

234

Applied and Numerical Harmonic Analysis (94 volumes)

67. R. Balan, M. Begue, J. Benedetto, W. Czaja, and K.A Okoudjou: Excursions in Harmonic Analysis, Volume 3 (ISBN 978-3-319-13229-7) 68. Boche, R. Calderbank, G. Kutyniok, J. Vybiral: Compressed Sensing and its Applications (ISBN 978-3-319-16041-2) 69. S. Dahlke, F. De Mari, P. Grohs, and D. Labate: Harmonic and Applied Analysis: From Groups to Signals (ISBN 978-3-319-18862-1) 70. Aldroubi, New Trends in Applied Harmonic Analysis (ISBN 978-3-319-278711) 71. M. Ruzhansky: Methods of Fourier Analysis and Approximation Theory (ISBN 978-3-319- 27465-2) 72. G. Pfander: Sampling Theory, a Renaissance (ISBN 978-3-319-19748-7) 73. R. Balan, M. Begue, J. Benedetto, W. Czaja, and K.A Okoudjou: Excursions in Harmonic Analysis, Volume 4 (ISBN 978-3-319-20187-0) 74. O. Christensen: An Introduction to Frames and Riesz Bases, Second Edition (ISBN 978-3- 319-25611-5) 75. E. Prestini: The Evolution of Applied Harmonic Analysis: Models of the Real World, Second Edition (ISBN 978-1-4899-7987-2) 76. J.H. Davis: Methods of Applied Mathematics with a Software Overview, Second Edition (ISBN 978-3-319-43369-1) 77. M. Gilman, E. M. Smith, S. M. Tsynkov: Transionospheric Synthetic Aperture Imaging (ISBN 978-3-319-52125-1) 78. S. Chanillo, B. Franchi, G. Lu, C. Perez, E.T. Sawyer: Harmonic Analysis, Partial Differential Equations and Applications (ISBN 978-3-319-52741-3) 79. R. Balan, J. Benedetto, W. Czaja, M. Dellatorre, and K.A Okoudjou: Excursions in Harmonic Analysis, Volume 5 (ISBN 978-3-319-54710-7) 80. Pesenson, Q.T. Le Gia, A. Mayeli, H. Mhaskar, D.X. Zhou: Frames and Other Bases in Abstract and Function Spaces: Novel Methods in Harmonic Analysis, Volume 1 (ISBN 978- 3-319-55549-2) 81. Pesenson, Q.T. Le Gia, A. Mayeli, H. Mhaskar, D.X. Zhou: Recent Applications of Harmonic Analysis to Function Spaces, Differential Equations, and Data Science: Novel Methods in Harmonic Analysis, Volume 2 (ISBN 978-3-31955555-3) 82. F. Weisz: Convergence and Summability of Fourier Transforms and Hardy Spaces (ISBN 978-3-319-56813-3) 83. Heil: Metrics, Norms, Inner Products, and Operator Theory (ISBN 978-3-31965321-1) 84. S. Waldron: An Introduction to Finite Tight Frames: Theory and Applications. (ISBN: 978- 0-8176-4814-5) 85. Joyner and C.G. Melles: Adventures in Graph Theory: A Bridge to Advanced Mathematics. (ISBN: 978-3-319-68381-2) 86. B. Han: Framelets and Wavelets: Algorithms, Analysis, and Applications (ISBN: 978-3-319- 68529-8) 87. H. Boche, G. Caire, R. Calderbank, M. März, G. Kutyniok, R. Mathar: Compressed Sensing and Its Applications (ISBN: 978-3-319-69801-4)

Applied and Numerical Harmonic Analysis (94 volumes)

235

88. N. Minh Chong: Pseudodifferential Operators and Wavelets over Real and p-adic Fields (ISBN: 978-3-319-77472-5) 89. A. I. Saichev and W.A. Woyczy´nski: Distributions in the Physical and Engineering Sciences, Volume 3: Random and Fractal Signals and Fields (ISBN: 978-3-319-92584-4) 90. K. Bredies and D. Lorenz: Mathematical Image Processing (ISBN: 978-3-03001457-5) 91. Boggiatto, P., Cordero, E., de Gosson, M., Feichtinger, H.G., Nicola, F., Oliaro, A., Tabacco, A.: Landscapes of Time-Frequency Analysis (ISBN: 978-3-03005209-6) 92. Liflyand, E: Functions of Bounded Variation and Their Fourier Transforms (ISBN: 978-3- 030-04428-2) 93. Abell, M., Iacob, E., Stokolos, A., Taylor, S., Tikhonov, S., Zhu, J.: Topics in Classical and Modern Analysis (ISBN: 978-3-030-12276-8) 94. Campos, R. G.: The XFT Quadrature in Discrete Fourier Analysis (ISBN: 978-3-030-13422-8) For an up-to-date list of ANHA titles, please visit http://www.springer.com/ series/4968