Anda di halaman 1dari 7

FOURIER ANALYSIS

Fourier analysis is the process of representing a function in terms of sinusoidal components. It is widely employed in many areas of engineering, science, and applied mathematics. It provides information as to what frequency components represent a function

Fourier analysis is as a mathematical technique for transforming our view of the signal from time-based to frequency-based. The attempt to understand functions (or other objects) by breaking them into basic pieces that are easier to understand is one of the central themes in Fourier analysis named after Joseph Fourier

Fourier Series
When the function is a function of time and represents a physical signal, the transform has a standard interpretation as the frequency spectrum of the signal. The magnitude of the resulting complex-valued function F at frequency represents the amplitude of a frequency component whose initial phase is given by the phase of F. However, it is important to realize that Fourier transforms are not limited to functions of time, and temporal frequencies. They can equally be applied to analyze spatial frequencies, and indeed for nearly any function domain.

Fourier Transform
A theorem of mathematics says, roughly, that any function can be represented as a sum of sinusoids of different amplitudes and frequencies. The Fourier transform is the mathematical technique of finding the amplitudes and frequencies of those sinusoids. The Discrete Fourier Transform (DFT) is an algorithm that calculates the Fourier transform for numerical data. The Fast Fourier Transform is an efficient implementation of the DFT.

The following functions are available in matlab to do Fourier transforms and related operations:
fft fft2 fftn fft ifft ifft2 ifftn abs angle cplxpair nextpow2 unwrap One-dimensional fast Fourier transform Two-dimensional fast Fourier transform N-dimensional fast Fourier transform shift Move zeroth lag to centre of transform Inverse one-dimensional fast Fourier transform Inverse two-dimensional fast Fourier transform inverse N-dimensional fast Fourier transform Absolute value (complex magnitude) Phase angle Sort complex numbers into complex conjugate pairs Next power of two Correct phase angles

The FFT of the column vector y = [2 0 1 0 2 1 1 0]; is

>> Y = fft(y) Y= 7.0000 -0.7071+ 0.7071i 2.0000- 1.0000i 0.7071+ 0.7071i 5.0000 0.7071- 0.7071i 2.0000+ 1.0000i -0.7071- 0.7071i The first value of Y is the sum of the elements of y, and is the amplitude of the zero-frequency, or constant, component of the Fourier series. Terms 2 to 4 are the (complex) amplitudes of the positive frequency Fourier components. Term 5 is the amplitude of the component at the Nyquist frequency, which is half the sampling frequency. The last three terms are the negative frequency components, which, for real signals, are complex conjugates of the positive frequency components. The fftshift function rearranges a Fourier transform so that the negative and positive frequencies lie either side of the zero frequency.
Companion M-Files Feature 4 The function fftfreq gives you a two-sided frequency vector for use with fft and fftshift. For example, the frequency vector corresponding to an 8-point FFT assuming a Nyquist frequency of 0.5 is >> fftfreq(.5,8) ans = -0.5000 -0.3750 -0.2500 -0.1250 0 0.1250 0.2500 0.3750

We combine fftshift and fftfreq to plot the two-sided FFT: plot(fftfreq(.5,8) ,fftshift(abs(Y))) axis([-.5 .5 0 7]) zeroaxes

Type of Fourier Transform:


Continuous Fourier Transform (CFT)
Most often, the unqualified term Fourier transform refers to the transform of functions of a continuous real argument, such as time (t). In this case the Fourier transform describes a function (t) in terms of basic complex exponentials of various frequencies. In terms of ordinary frequency , the Fourier transform is given by the complex number:

Evaluating this quantity for all values of produces the frequency-domain function.

Discrete Fourier Transform (DFT)


Working with the Fourier transform on a computer usually involves a form of the transform known as the discrete Fourier transform (DFT). A discrete transform is a transform whose input and output values are discrete samples, making it convenient for computer manipulation. There are two principal reasons for using this form of the transform:

The input and output of the DFT are both discrete, which makes it convenient for computer manipulations. There is a fast algorithm for computing the DFT known as the fast Fourier transform (FFT).

Visualizing the Discrete Fourier Transform


1. Construct a matrix f that is similar to the function f(m,n). Remember that f(m,n) is equal to 1 within the rectangular region and 0 elsewhere. Use a binary image to represent f(m,n).
f = zeros(30,30); f(5:24,13:17) = 1; imshow(f,'InitialMagnification','fit')

2.) Compute and visualize the 30-by-30 DFT of f with these commands.
F = fft2(f); F2 = log(abs(F)); imshow(F2,[-1 5],'InitialMagnification','fit'); colormap(jet); colorbar

Discrete Fourier Transform Computed Without Padding This plot differs from the Fourier transform displayed in Visualizing the Fourier Transform. First, the sampling of the Fourier transform is much coarser. Second, the zerofrequency coefficient is displayed in the upper left corner instead of the traditional location in the center.

-1

3.)To obtain a finer sampling of the Fourier transform, add zero padding to f when computing its DFT. The zero padding and DFT computation can be performed in a single step with this command.
F = fft2(f,256,256);

This command zero-pads f to be 256-by-256 before computing the DFT.


imshow(log(abs(F)),[-1 5]); colormap(jet); colorbar

Discrete Fourier Transform Computed with Padding


5 4 3 2 1 0 -1

4.)The zero-frequency coefficient, however, is still displayed in the upper left corner rather than the center. You can fix this problem by using the function fftshift, which swaps the quadrants of F so that the zero-frequency coefficient is in the center.
F = fft2(f,256,256);F2 = fftshift(F); imshow(log(abs(F2)),[-1 5]); colormap(jet); colorbar
5 4 3 2 1 0 -1

Fast Fourier Transform (FFT)


Fast Fourier Transform (FFT) algorithms have computational complexity O(n log n) instead of O(n2). If n is a power of 2, a one-dimensional FFT of length n requires less than 3n log2 n floating-point operations (times a proportionality constant). For n = 220, that is a factor of almost 35,000 faster than 2n2.

The MATLAB fft function returns the DFT y of an input vector x using a fast Fourier transform algorithm:
y = fft(x);

In this call to fft, the window length m = length(x) and the transform length n = length(y) are the same. The transform length is specified by an optional second argument:
y = fft(x,n);

In this call to fft, the transform length is n. If the length of x is less than n, x is padded with trailing zeros to increase its length to n before computing the DFT. If the length of x is greater than n, only the first n elements of x are used to compute the transform.

Example: Basic Spectral Analysis


The FFT allows you to efficiently estimate component frequencies in data from a discrete set of values sampled at a fixed rate. Relevant quantities in a spectral analysis are listed in the following table. For space-based data, replace references to time with references to space.
Quantity
x m = length(x) fs dt = 1/fs t = (0:m-1)/fs y = fft(x,n) abs(y) (abs(y).^2)/n fs/n f = (0:n-1)*(fs/n) fs/2

Description

Sampled data Window length (number of samples) Samples/unit time Time increment per sample Time range for data Discrete Fourier transform (DFT) Amplitude of the DFT Power of the DFT Frequency increment Frequency range Nyquist frequency

For example, consider the following data x with two component frequencies of differing amplitude and phase buried in noise:
fs = 100; t = 0:1/fs:10-1/fs; x = (1.3)*sin(2*pi*15*t) ... + (1.7)*sin(2*pi*40*(t-2)) ... + (2.5)*randn(size(t)); % % % % % Sample frequency (Hz) 10 sec sample 15 Hz component 40 Hz component Gaussian noise;

Use fft to compute the DFT y and its power:


m = length(x); n = pow2(nextpow2(m)); y = fft(x,n); f = (0:n-1)*(fs/n); power = y.*conj(y)/n; % % % % % Window length Transform length DFT Frequency range Power of the DFT

nextpow2 finds the exponent of the next power of two greater than or equal (ceil(log2(m))), and pow2 computes the power. Using a power of two for

to the window length the transform length optimizes the FFT algorithm, though in practice there is usually little difference in execution time from using n = m.

To visualize the DFT, plots of abs(y), abs(y).^2, and log(abs(y)) are all common. A plot of power versus frequency is called a periodogram:
plot(f,power) xlabel('Frequency (Hz)') ylabel('Power') title('{\bf Periodogram}')

The first half of the frequency range (from 0 to the Nyquist frequency fs/2) is sufficient to identify the component frequencies in the data, since the second half is just a reflection of the first half. In many applications it is traditional to center the periodogram at 0. The fftshift function rearranges the output from fft with a circular shift to produce a 0-centered periodogram:
y0 = fftshift(y); f0 = (-n/2:n/2-1)*(fs/n); power0 = y0.*conj(y0)/n; % Rearrange y values % 0-centered frequency range % 0-centered power

plot(f0,power0) xlabel('Frequency (Hz)') ylabel('Power') title('{\bf 0-Centered Periodogram}')

The rearrangement makes use of the periodicity in the definition of the DFT Use the MATLAB angle and unwrap functions to create a phase plot of the DFT:

phase = unwrap(angle(y0)); plot(f0,phase*180/pi) xlabel('Frequency (Hz)') ylabel('Phase (Degrees)') grid on

Component frequencies are mostly hidden randomness in phase at adjacent values. upward trend in the plot is due to the unwrap function, which in this case adds 2 to the phase more often than it subtracts it.

by the The

OPTIMIZATION
Optimization Toolbox provides widely used algorithms for standard and large-scale optimization. These algorithms solve constrained and unconstrained continuous and discrete problems. The toolbox includes functions for linear programming, quadratic programming, binary integer programming, nonlinear optimization, nonlinear least squares, systems of nonlinear equations, and multiobjective optimization. You can use them to find optimal solutions, perform tradeoff analyses, balance multiple design alternatives, and incorporate optimization methods into algorithms and models Functions of the Matlab Optimization Toolbox
Linear and Quadratic Minimization problems. linprog - Linear programming. quadprog - Quadratic programming. Nonlinear zero finding (equation solving). fzero - Scalar nonlinear zero finding. fsolve - Nonlinear system of equations solve (function solve). Linear least squares (of matrix problems). lsqlin - Linear least squares with linear constraints. lsqnonneg - Linear least squares with nonnegativity constraints. Nonlinear minimization of functions. fminbnd - Scalar bounded nonlinear function minimization. fmincon - Multidimensional constrained nonlinear minimization. fminsearch - Multidimensional unconstrained nonlinear minimization fminunc - Multidimensional unconstrained nonlinear minimization. fseminf - Multidimensional constrained minimization, semi-infinite constraints. Nonlinear least squares (of functions). lsqcurvefit - Nonlinear curvefitting via least squares (with bounds). lsqnonlin - Nonlinear least squares with upper and lower bounds. Nonlinear minimization of multi-objective functions. fgoalattain - Multidimensional goal attainment optimization fminimax - Multidimensional minimax optimization.

Anda mungkin juga menyukai