Short Course on Information and Communications Security: Encryption and Information Hiding Tuesday, 10 March Friday, 13 March, 2015 Lecture 5: Signal Analysis
Contents The complex exponential The complex Fourier series The Fourier transform The delta function Fourier transform of important functions Important properties The convolution theorem The sampling theorem
Contents (continued) The DFT Time-frequency sampling relation The Fast Fourier Transform (FFT) Data windowing Spectral leakage Example windows Summary
The complex exponential Fundamental result Euler s equation: i to the power of i:
The complex Fourier series (CFS) Let a function f(t) with period 2T be given by Then
The CFS (continued) Evaluation of the RHS integral gives Complex coefficients given by
The Fourier transform For a signal with period 2T the CFS is given by (with )
Fourier transform (continued) Let Then and
Fourier transform (continued) In the limit as function i.e. for a non-periodic
Lord Kelvin The Fourier transform (Fourier s theorem) is not only one of the most beautiful results of modern analysis, but it may be said to furnish an indispensable instrument in the treatment of nearly every recondite question in modern physics
The (Dirac) delta function First introduced by Paul Dirac in the 1930s for use in quantum mechanics Dirac referred to it as an improper function, i.e. a strictly hypothetical (abstract) function or generalisation Dirac also first introduced the hypothetical idea of anti-matter (a positively charged electron or positron) and won the Nobel prize for Physics in 1933 after experimental verification of his idea
What is d(x) d(x) is not a function of x according to the usual definition, of a function, which requires a function to have a definite value for each point in its domain, but is something more general, which we may call an improper function. Paul Dirac (1902-1984) in The Principles of Quantum Mechanics
Basic definition
Integral representation
Sampling property
The Green s function Suppose a system can be modelled in terms of the linear differential equation The Green s function is the solution of
Green s function solution The Green s function provides a general solution (transformation) of the form The Green s function is the Impulse Response Function (IRF) of the system characterised by the differential operator, e.g. the surface waves produced on a pond when a small stone disturbs it, producing an impulse
George Green: A scientific enigma
The comb function Defines a sequence of delta functions and is used in proving the sampling theorem, i.e. the sample rate required for A-to-D without loss of information
The Kronecker delta The discrete equivalent of the delta function with the following analogous properties:
The Fourier operator Basic definition Real space and Fourier space
Physical interpretation The Fourier transform provides a quantitative statement on the frequency content of a function. The variable w has dimensions that are reciprocal to those of the variable t. If t is time in seconds then w is the temporal (angular) frequency in cycles per second or Hertz (Hz). N.B. w =2pf where f is the frequency proper
Spatial frequency x is length and k is the wave-number given by where l is the wavelength and c is the wave speed
DC value The DC (Direct Current) value is the value of the Fourier transform at zero frequency
Differentiation
Integration
Fourier transform of important functions The Tophat or Square wave function
Fourier transform of important functions (continued) The cosine and sine functions
Fourier transform of important functions (continued) The Gaussian function
Fourier transform of important functions (continued) The sign or sgn function and related functions
Important properties Addition theorem Similarity theorem Shift theorem
Parseval s theorem Important properties (continued) Rayleigh s (the energy) theorem
Band-limited functions A band-limited function is one whose Fourier transform is of limited extent, i.e. of compact support : A band-limited function is given by
The convolution theorem One of the single most important theorems of Fourier analysis Used routinely to process signals in Fourier space The convolution of two function in real space is equivalent to the product of their Fourier transforms in Fourier (frequency) space
The convolution theorem expressed mathematically
The product theorem The product of two function in real space is equivalent to the convolution of their Fourier transforms in Fourier (frequency) space
The correlation and autocorrelation theorems Correlation theorem Autocorrelation theorem
The sampling theorem Used to determine the rate at which an analogue signals need to be sampled into digital form without loss of information. Underpins all A-to-D (& D-to-A) conversion
The comb function Consider a comb function of period T Let a digital function g(t) be written in terms of an analogue function f(t) as
The sampling problem
CFS of the comb function The comb function is a periodic function and can therefore be written as Coefficients are given by
Fourier transform of comb(t) CFS of a comb function is Fourier transform is therefore
Fundamental result
Basic result Sampling a signal at regular interval dt: From the product theorem
Interpretation Sampling a function f(t) creates a new spectrum G(w) which is a periodic replica of the spectrum F(w) spaced at regular intervals If f(t) has a bandwidth W then the total width of the spectrum is W-(-W)=2W and the replicated spectra will overlap if (aliasing)
Sampling intervals To ensure that replicated spectra do not overlap causing aliasing we require that This is equivalent to a sampling rate of
Aliasing
The Nyquist frequency A signal that is sampled according to the condition is known as a Nyquist sampled signal The Nyquist frequency is given by
Nyquist sampling
Derivation of the DFT The CFS is Consider f(t) to be uniformly sampled by Dt so that
Derivation of the DFT (continued) Let Then
DFT and the Fourier transform DFT pair is Discretizing the Fourier transform pair:
Time-frequency sampling relation Let Then, by inspection, i.e. comparing the DFT with the discretized Fourier transform
Example of the discrete time-frequency relation Consider a digital signal composed of 1000 element and a sampling interval of 0.001s Frequency sampling interval is then 2p The more precisely time is determined the less precisely the frequency is known
Discrete spatial frequency relationship x is length and k = w/c = 2p/l is the wave-number where l is the wavelength and c is the wave-speed The more precisely position is determined the less precisely the spatial frequency is known
Standard and Optical versions of the DFT The DFT is usually written in standard form with n=0,1,2,,n-1 where the DC term occurs at n=0, i.e. The optical form sets the DC term in the middle of the array and is compatible with the Fourier transform, i.e.
The Fast Fourier Transform (FFT) Consider the DFT (in standard form) writing it in the form In matrix form
Computational issues Written in matrix form, the DFT is computed by multiplying an N-point vector by a matrix of complex elements This requires N x N multiplications To compute the DFT of a 1000 point digital signal requires 1000 000 multiplications!
Basic idea
Fundamental property Basic result is With e & o representing even and odd component respectively, we have Computation of arrays is now over N/2 elements and not N elements.
Successive doubling We can repeat the trick to obtain 4 arrays Can continue sub-divding the data into odd and even component until we get to the DFT of just 2 points
Base 2 condition Because the data is subdivided into odd and even components, we require to start with a array size of (with k=1,2,3, ) Computing the DFT in this way reduces the number of multiplication to the order of
Example Consider the 4-point array FFT is
Array order Consider 8-point array Decomposition in to odd and even components gives
Bit reversal To obtain output in correct order, original array must be input as Reordering by bit reversing the index:
Computational efficiency FFT reduces number of multiplication from to Can consider decomposition into 3, 4, arrays instead of 2 arrays but reordering of I/O is more complex than bit reversal
MATAB FFT Based on the function FFT output_array=fft(input_array) The inverse transform is IFFT output_array=ifft(input_array) FFT is based on standard form (DC occurs at the first element of the array) MATLAB function for producing output in optical form is FFTSHIFT output_array=fftshift(input_array) DC component occurs at 1+N/2 for array size of N
Data windowing Unlike the Fourier transform the DFT operates on a discrete array of finite length Computing the DFT of a signal consisting of N samples is equivalent to computing the DFT of an infinite run of samples multiplied by a square window function (tophat function) This result allows us to evaluate the effect of operating on a array of finite size
Effect of windowing If then
Effect of windowing (continued) Using the product theorem The discrete spectrum F m is not given by F(w m ) but by F(w m ) convolved with a sinc function Note that
Spectral leakage Each computed sample F m depends on the influence of the sinc function associated with one sample bin on the next The sinc function leaks from one bin to the next producing errors in the values of neighbouring spectral components This is due to the discontinuous nature of the window function
Window functions The larger the size of the array, the less effect spectral leakage has on the output For small arrays, spectral leakage can be reduced by application of a window that approaches zero at the end of the array Many window have been invented for this purpose. They are based on trade-offs between the narrowness and peakedness of the spectral leakage function
Some example window functions Parzan window Welch window Hanning window (cosine taper)
Summary The Fourier transform pair:
Summary (continued) The convolution theorem The product theorem
Summary (continued) Sampling theorem (fundamental result)
Summary (continued) DFT pair Time frequency sampling relation
Summary (continued) Principle of the (base-2) FFT Bit reversal: Reversal of the binary number representation of the position of an element in an array which is used to reorder the data before repeated application of the principle above
Summary (continued) MATLAB FFT function y=fft(x); Inverse FFT function y=ifft(x); Shifting function (to compute spectrum in optical form ) y=fftshift(x);
Summary (continued) DFT approximation to F(w m ) Data windows: Function with edge tapers that reduce the spectral leakage generated by the sinc function in the equation above