Misplaced Pages

Sine and cosine transforms

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
(Redirected from Sine and Cosine transforms) Variant Fourier transforms
The sine and cosine transforms convert a function into a frequency domain representation as a sum of sine and cosine waves. The inverse transform converts back to a time or spatial domain.

In mathematics, the Fourier sine and cosine transforms are integral equations that decompose arbitrary functions into a sum of sine waves representing the odd component of the function plus cosine waves representing the even component of the function. The modern Fourier transform concisely contains both the sine and cosine transforms. Since the sine and cosine transforms use sine and cosine waves instead of complex exponentials and don't require complex numbers or negative frequency, they more closely correspond to Joseph Fourier's original transform equations and are still preferred in some signal processing and statistics applications and may be better suited as an introduction to Fourier analysis.

Definition

Fourier transforms relate a time-domain function (red) to a frequency-domain function (blue). Sine or cosine waves that make up the original function will appear as peaks in the frequency domain functions produced by the sine or cosine transform, respectively.

The Fourier sine transform of f ( t ) {\displaystyle f(t)} is:

Fourier sine transform

f ^ s ( ξ ) = f ( t ) sin ( 2 π ξ t ) d t . {\displaystyle {\hat {f}}^{s}(\xi )=\int _{-\infty }^{\infty }f(t)\sin(2\pi \xi t)\,dt.}

If t {\displaystyle t} means time, then ξ {\displaystyle \xi } is frequency in cycles per unit time, but in the abstract, they can be any dual pair of variables (e.g. position and spatial frequency).

The sine transform is necessarily an odd function of frequency, i.e. for all ξ {\displaystyle \xi } :

f ^ s ( ξ ) = f ^ s ( ξ ) . {\displaystyle {\hat {f}}^{s}(-\xi )=-{\hat {f}}^{s}(\xi ).}

The cosine transform of a simple rectangular function (of height 1 a {\displaystyle {\tfrac {1}{a}}} and width a {\displaystyle a} ) is the normalized sinc ( a ξ ) {\displaystyle (a\xi )} plotted above.


The Fourier cosine transform of f ( t ) {\displaystyle f(t)} is:

Fourier cosine transform

f ^ c ( ξ ) = f ( t ) cos ( 2 π ξ t ) d t . {\displaystyle {\hat {f}}^{c}(\xi )=\int _{-\infty }^{\infty }f(t)\cos(2\pi \xi t)\,dt.}

The cosine transform is necessarily an even function of frequency, i.e. for all ξ {\displaystyle \xi } :

f ^ c ( ξ ) = f ^ c ( ξ ) . {\displaystyle {\hat {f}}^{c}(\xi )={\hat {f}}^{c}(-\xi ).}

Odd and even simplification

Like all even functions, the left half of a Gaussian function is a mirror image of its right half and its sine transform is entirely 0. Gaussians have the form e α t 2 {\displaystyle e^{-\alpha t^{2}}} and their cosine transform:
f ^ c ( ξ ) = π α e ( π ξ ) 2 α {\displaystyle {\hat {f}}^{c}(\xi )={\sqrt {\tfrac {\pi }{\alpha }}}\,e^{-{\frac {(\pi \xi )^{2}}{\alpha }}}}
also is a Gaussian. The plotted Gaussian uses α=π and is its own cosine transform.

The multiplication rules for even and odd functions shown in the overbraces in the following equations dramatically simplify the integrands when transforming even and odd functions. Some authors even only define the cosine transform for even functions f even ( t ) {\displaystyle f_{\text{even}}(t)} . Since cosine is an even function and because the integral of an even function from {\displaystyle {-}\infty } to {\displaystyle \infty } is twice its integral from 0 {\displaystyle 0} to {\displaystyle \infty } , the cosine transform of any even function can be simplified to avoid negative t {\displaystyle t} :

f ^ c ( ξ ) = f even ( t ) cos ( 2 π ξ t ) even·even=even d t = 2 0 f even ( t ) cos ( 2 π ξ t ) d t . {\displaystyle {\hat {f}}^{c}(\xi )=\int _{-\infty }^{\infty }\overbrace {f_{\text{even}}(t)\cdot \cos(2\pi \xi t)} ^{\text{even·even=even}}\,dt=2\int _{0}^{\infty }f_{\text{even}}(t)\cos(2\pi \xi t)\,dt.}

And because the integral from {\displaystyle {-}\infty } to {\displaystyle \infty } of any odd function from is zero, the cosine transform of any odd function is simply zero:

f ^ c ( ξ ) = f odd ( t ) cos ( 2 π ξ t ) odd·even=odd d t = 0. {\displaystyle {\hat {f}}^{c}(\xi )=\int _{-\infty }^{\infty }\overbrace {f_{\text{odd}}(t)\cdot \cos(2\pi \xi t)} ^{\text{odd·even=odd}}\,dt=0.}

Odd functions are unchanged if rotated 180 degrees about the origin. Their cosine transform is entirely zero. The above odd function contains two half-sized time-shifted Dirac delta functions. Its sine transform is simply sin ( a ξ ) . {\displaystyle \sin(a\xi ).} Likewise, the sine transform of sin ( a ξ ) {\displaystyle \sin(a\xi )} is the above plot. Thus, the sine wave function and the time-shifted Dirac delta function form a transform pair.

Similarly, because sin is odd, the sine transform of any odd function f odd ( t ) {\displaystyle f_{\text{odd}}(t)} also simplifies to avoid negative t {\displaystyle t} :

f ^ s ( ξ ) = f odd ( t ) sin ( 2 π ξ t ) odd·odd=even d t = 2 0 f odd ( t ) sin ( 2 π ξ t ) d t {\displaystyle {\hat {f}}^{s}(\xi )=\int _{-\infty }^{\infty }\overbrace {f_{\text{odd}}(t)\cdot \sin(2\pi \xi t)} ^{\text{odd·odd=even}}\,dt=2\int _{0}^{\infty }f_{\text{odd}}(t)\sin(2\pi \xi t)\,dt}

and the sine transform of any even function is simply zero:

f ^ s ( ξ ) = f even ( t ) sin ( 2 π ξ t ) even·odd=odd d t = 0. {\displaystyle {\hat {f}}^{s}(\xi )=\int _{-\infty }^{\infty }\overbrace {f_{\text{even}}(t)\cdot \sin(2\pi \xi t)} ^{\text{even·odd=odd}}\,dt=0.}

The sine transform represents the odd part of a function, while the cosine transform represents the even part of a function.

Other conventions

Just like the Fourier transform takes the form of different equations with different constant factors (see Fourier transform § Unitarity and definition for square integrable functions for discussion), other authors also define the cosine transform as f ^ c ( ξ ) = 2 π 0 f ( t ) cos ( 2 π ξ t ) d t {\displaystyle {\hat {f}}^{c}(\xi )={\sqrt {\frac {2}{\pi }}}\int _{0}^{\infty }f(t)\cos(2\pi \xi t)\,dt} and the sine transform as f ^ s ( ξ ) = 2 π 0 f ( t ) sin ( 2 π ξ t ) d t . {\displaystyle {\hat {f}}^{s}(\xi )={\sqrt {\frac {2}{\pi }}}\int _{0}^{\infty }f(t)\sin(2\pi \xi t)\,dt.} Another convention defines the cosine transform as F c ( α ) = 2 π 0 f ( x ) cos ( α x ) d x {\displaystyle F_{c}(\alpha )={\frac {2}{\pi }}\int _{0}^{\infty }f(x)\cos(\alpha x)\,dx} and the sine transform as F s ( α ) = 2 π 0 f ( x ) sin ( α x ) d x {\displaystyle F_{s}(\alpha )={\frac {2}{\pi }}\int _{0}^{\infty }f(x)\sin(\alpha x)\,dx} using α {\displaystyle \alpha } as the transformation variable. And while t {\displaystyle t} is typically used to represent the time domain, x {\displaystyle x} is often instead used to represent a spatial domain when transforming to spatial frequencies.

Fourier inversion

The original function f {\displaystyle f} can be recovered from its sine and cosine transforms under the usual hypotheses using the inversion formula:

Fourier inversion (from the sine and cosine transforms)

f ( t ) = f ^ s ( ξ ) sin ( 2 π ξ t ) d ξ odd component of  f ( t ) + f ^ c ( ξ ) cos ( 2 π ξ t ) d ξ even component of  f ( t ) . {\displaystyle f(t)=\underbrace {\int _{-\infty }^{\infty }{\hat {f}}^{s}(\xi )\sin(2\pi \xi t)\,d\xi } _{{\text{odd component of }}f(t)}\,+\underbrace {\int _{-\infty }^{\infty }{\hat {f}}^{c}(\xi )\cos(2\pi \xi t)\,d\xi } _{{\text{even component of }}f(t)}\,.}

Simplifications

Note that since both integrands are even functions of ξ {\displaystyle \xi } , the concept of negative frequency can be avoided by doubling the result of integrating over non-negative frequencies:

f ( t ) = 2 0 f ^ s ( ξ ) sin ( 2 π ξ t ) d ξ + 2 0 f ^ c ( ξ ) cos ( 2 π ξ t ) d ξ . {\displaystyle f(t)=2\int _{0}^{\infty }{\hat {f}}^{s}(\xi )\sin(2\pi \xi t)\,d\xi \,+2\int _{0}^{\infty }{\hat {f}}^{c}(\xi )\cos(2\pi \xi t)\,d\xi \,.}

Also, if f {\displaystyle f} is an odd function, then the cosine transform is zero, so its inversion simplifies to: f ( t ) = f ^ s ( ξ ) sin ( 2 π ξ t ) d ξ ,  only if  f ( t )  is odd. {\displaystyle f(t)=\int _{-\infty }^{\infty }{\hat {f}}^{s}(\xi )\sin(2\pi \xi t)\,d\xi ,{\text{ only if }}f(t){\text{ is odd.}}}

Likewise, if the original function f {\displaystyle f} is an even function, then the sine transform is zero, so its inversion also simplifies to:

f ( t ) = f ^ c ( ξ ) cos ( 2 π ξ t ) d ξ ,  only if  f ( t )  is even. {\displaystyle f(t)=\int _{-\infty }^{\infty }{\hat {f}}^{c}(\xi )\cos(2\pi \xi t)\,d\xi ,{\text{ only if }}f(t){\text{ is even.}}}

Remarkably, these last two simplified inversion formulas look identical to the original sine and cosine transforms, respectively, though with t {\displaystyle t} swapped with ξ {\displaystyle \xi } (and with f {\displaystyle f} swapped with f ^ s {\displaystyle {\hat {f}}^{s}} or f ^ c {\displaystyle {\hat {f}}^{c}} ). A consequence of this symmetry is that their inversion and transform processes still work when the two functions are swapped. Two such functions are called transform pairs.

Overview of inversion proof

Using the addition formula for cosine, the full inversion formula can also be rewritten as Fourier's integral formula: f ( t ) = f ( x ) cos ( 2 π ξ ( x t ) ) d x d ξ . {\displaystyle f(t)=\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }f(x)\cos(2\pi \xi (x-t))\,dx\,d\xi .} This theorem is often stated under different hypotheses, that f {\displaystyle f} is integrable, and is of bounded variation on an open interval containing the point t {\displaystyle t} , in which case 1 2 lim h 0 ( f ( t + h ) + f ( t h ) ) = 2 0 f ( x ) cos ( 2 π ξ ( x t ) ) d x d ξ . {\displaystyle {\tfrac {1}{2}}\lim _{h\to 0}\left(f(t+h)+f(t-h)\right)=2\int _{0}^{\infty }\int _{-\infty }^{\infty }f(x)\cos(2\pi \xi (x-t))\,dx\,d\xi .}

This latter form is a useful intermediate step in proving the inverse formulae for the since and cosine transforms. One method of deriving it, due to Cauchy is to insert a e δ ξ {\displaystyle e^{-\delta \xi }} into the integral, where δ > 0 {\displaystyle \delta >0} is fixed. Then 2 0 e δ ξ cos ( 2 π ξ ( x t ) ) d ξ f ( x ) d x = f ( x ) 2 δ δ 2 + 4 π 2 ( x t ) 2 d x . {\displaystyle 2\int _{-\infty }^{\infty }\int _{0}^{\infty }e^{-\delta \xi }\cos(2\pi \xi (x-t))\,d\xi \,f(x)\,dx=\int _{-\infty }^{\infty }f(x){\frac {2\delta }{\delta ^{2}+4\pi ^{2}(x-t)^{2}}}\,dx.} Now when δ 0 {\displaystyle \delta \to 0} , the integrand tends to zero except at x = t {\displaystyle x=t} , so that formally the above is f ( t ) 2 δ δ 2 + 4 π 2 ( x t ) 2 d x = f ( t ) . {\displaystyle f(t)\int _{-\infty }^{\infty }{\frac {2\delta }{\delta ^{2}+4\pi ^{2}(x-t)^{2}}}\,dx=f(t).}

Relation with complex exponentials

The complex exponential form of the Fourier transform used more often today is f ^ ( ξ ) = f ( t ) e 2 π i ξ t d t {\displaystyle {\begin{aligned}{\hat {f}}(\xi )&=\int _{-\infty }^{\infty }f(t)e^{-2\pi i\xi t}\,dt\\\end{aligned}}\,} where i {\displaystyle i} is the square root of negative one. By applying Euler's formula ( e i x = cos x + i sin x ) , {\textstyle (e^{ix}=\cos x+i\sin x),} it can be shown (for real-valued functions) that the Fourier transform's real component is the cosine transform (representing the even component of the original function) and the Fourier transform's imaginary component is the negative of the sine transform (representing the odd component of the original function): f ^ ( ξ ) = f ( t ) ( cos ( 2 π ξ t ) i sin ( 2 π ξ t ) ) d t Euler's Formula = ( f ( t ) cos ( 2 π ξ t ) d t ) i ( f ( t ) sin ( 2 π ξ t ) d t ) = f ^ c ( ξ ) i f ^ s ( ξ ) . {\displaystyle {\begin{aligned}{\hat {f}}(\xi )&=\int _{-\infty }^{\infty }f(t)\left(\cos(2\pi \xi t)-i\,\sin(2\pi \xi t)\right)dt&&{\text{Euler's Formula}}\\&=\left(\int _{-\infty }^{\infty }f(t)\cos(2\pi \xi t)\,dt\right)-i\left(\int _{-\infty }^{\infty }f(t)\sin(2\pi \xi t)\,dt\right)\\&={\hat {f}}^{c}(\xi )-i\,{\hat {f}}^{s}(\xi )\,.\end{aligned}}} Because of this relationship, the cosine transform of functions whose Fourier transform is known (e.g. in Fourier transform § Tables of important Fourier transforms) can be simply found by taking the real part of the Fourier transform: f ^ c ( ξ ) = R e [ f ^ ( ξ ) ] {\displaystyle {\hat {f}}^{c}(\xi )=\mathrm {Re} {}} while the sine transform is simply the negative of the imaginary part of the Fourier transform: f ^ s ( ξ ) = I m [ f ^ ( ξ ) ] . {\displaystyle {\hat {f}}^{s}(\xi )=-\mathrm {Im} {}\,.}

Pros and cons

Adding a sine wave (red) and a cosine wave (blue) of the same frequency results a phase-shifted sine wave (green) of that same frequency, but whose amplitude and phase depends on the amplitudes of the original sine and cosine wave. Hence, at a particular frequency, the sine transform and the cosine transform together essentially only represent one sine wave that could have any phase shift.

An advantage of the modern Fourier transform is that while the sine and cosine transforms together are required to extract the phase information of a frequency, the modern Fourier transform instead compactly packs both phase and amplitude information inside its complex valued result. But a disadvantage is its requirement on understanding complex numbers, complex exponentials, and negative frequency.

The sine and cosine transforms meanwhile have the advantage that all quantities are real. Since positive frequencies can fully express them, the non-trivial concept of negative frequency needed in the regular Fourier transform can be avoided. They may also be convenient when the original function is already even or odd or can be made even or odd, in which case only the cosine or the sine transform respectively is needed. For instance, even though an input may not be even or odd, a discrete cosine transform may start by assuming an even extension of its input while a discrete sine transform may start by assuming an odd extension of its input, to avoid having to compute the entire discrete Fourier transform.

Numerical evaluation

Using standard methods of numerical evaluation for Fourier integrals, such as Gaussian or tanh-sinh quadrature, is likely to lead to completely incorrect results, as the quadrature sum is (for most integrands of interest) highly ill-conditioned. Special numerical methods which exploit the structure of the oscillation are required, an example of which is Ooura's method for Fourier integrals This method attempts to evaluate the integrand at locations which asymptotically approach the zeros of the oscillation (either the sine or cosine), quickly reducing the magnitude of positive and negative terms which are summed.

See also

Notes

  1. The sine transform is sometimes denoted with F s ( f ) {\displaystyle {\mathcal {F}}_{s}(f)} instead of f ^ s {\displaystyle {\hat {f}}^{s}} .
  2. While this article uses ordinary frequency for ξ {\displaystyle \xi } in cycles per unit time, which typically uses the Hertz and the second as units, these transforms are sometimes expressed using angular frequency in angular units (e.g. radians) per unit time, where ω {\displaystyle \omega }  radians per second equals 2 π ξ {\displaystyle 2\pi \xi } .
  3. The cosine transform is sometimes denoted with F c ( f ) {\displaystyle {\mathcal {F}}_{c}(f)} instead of f ^ c {\displaystyle {\hat {f}}^{c}} .
  4. The usual hypotheses are that f {\displaystyle f} and both of its transforms should be absolutely integrable. For more details on the different hypotheses, see Fourier inversion theorem.
  5. The more general modern Fourier transform has this symmetry even when the original functions aren't even or odd. A notation to denote Fourier transform pairs is f ( t )   F   f ^ ( ξ ) . {\displaystyle f(t)\ {\stackrel {\mathcal {F}}{\longleftrightarrow }}\ {\widehat {f}}(\xi ).}

References

  • Whittaker, Edmund, and James Watson, A Course in Modern Analysis, Fourth Edition, Cambridge Univ. Press, 1927, pp. 189, 211
  1. Mary L. Boas, Mathematical Methods in the Physical Sciences, 2nd Ed, John Wiley & Sons Inc, 1983. ISBN 0-471-04409-1
  2. Nyack, Cuthbert (1996). "Fourier Transform, Cosine and Sine Transforms". cnyack.homestead.com. Archived from the original on 2023-06-07. Retrieved 2018-10-08.
  3. Coleman, Matthew P. (2013). An Introduction to Partial Differential Equations with MATLAB (Second ed.). Boca Raton. p. 221. ISBN 978-1-4398-9846-8. OCLC 822959644.{{cite book}}: CS1 maint: location missing publisher (link)
  4. Poincaré, Henri (1895). Theorie analytique de la propagation de la chaleur. Paris: G. Carré. pp. 108ff.
  5. Edwin Titchmarsh (1948), Introduction to the theory of the Fourier integral, Oxford at the Clarendon Press, p. 1
  6. Whittaker, Edmund Taylor; Watson, George Neville (1927-01-02). A Course Of Modern Analysis: An Introduction to the General Theory of Infinite Processes and of Analytic Functions; with an Account of the Principal Transcendental Functions (4th ed.). Cambridge, UK: Cambridge University Press. p. 189. ISBN 0-521-06794-4. ISBN 978-0-521-06794-2.
  7. Valentinuzzi, Max E. (2016-01-25). "Highlights in the History of the Fourier Transform". IEEE Pulse. Archived from the original on 2024-05-15. Retrieved 2024-09-09.
  8. Williams, Lance R. (2011-09-06). "Even and odd functions" (PDF). www.cs.unm.edu/~williams/. Archived (PDF) from the original on 2024-05-02. Retrieved 2024-09-11.
  9. Takuya Ooura, Masatake Mori, A robust double exponential formula for Fourier-type integrals, Journal of computational and applied mathematics 112.1-2 (1999): 229-241.
Categories: