Fourier Transform. Prepared by :Eng. Abdo Z Salah

Similar documents
Introduction. A Simple Example. 3. fo = 4; %frequency of the sine wave. 4. Fs = 100; %sampling rate. 5. Ts = 1/Fs; %sampling time interval

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

Laboratory Assignment 4. Fourier Sound Synthesis

Signals A Preliminary Discussion EE442 Analog & Digital Communication Systems Lecture 2

2.1 BASIC CONCEPTS Basic Operations on Signals Time Shifting. Figure 2.2 Time shifting of a signal. Time Reversal.

L A B 3 : G E N E R A T I N G S I N U S O I D S

ELT COMMUNICATION THEORY

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering. EIE2106 Signal and System Analysis Lab 2 Fourier series

EE 215 Semester Project SPECTRAL ANALYSIS USING FOURIER TRANSFORM

MATLAB Assignment. The Fourier Series

Lecture 2: SIGNALS. 1 st semester By: Elham Sunbu

DFT: Discrete Fourier Transform & Linear Signal Processing

EC310 Security Exercise 20

EEL 4350 Principles of Communication Project 2 Due Tuesday, February 10 at the Beginning of Class

5.1 Graphing Sine and Cosine Functions.notebook. Chapter 5: Trigonometric Functions and Graphs

Electrical & Computer Engineering Technology

Department of Electronic Engineering NED University of Engineering & Technology. LABORATORY WORKBOOK For the Course SIGNALS & SYSTEMS (TC-202)

Lab 3 SPECTRUM ANALYSIS OF THE PERIODIC RECTANGULAR AND TRIANGULAR SIGNALS 3.A. OBJECTIVES 3.B. THEORY

Lab 4 Fourier Series and the Gibbs Phenomenon

ENGR 210 Lab 12: Sampling and Aliasing

Lecture 3 Complex Exponential Signals

Log Booklet for EE2 Experiments

ME scope Application Note 01 The FFT, Leakage, and Windowing

EE 470 BIOMEDICAL SIGNALS AND SYSTEMS. Active Learning Exercises Part 2

Frequency Domain Representation of Signals

Introduction. Chapter Time-Varying Signals

The Discrete Fourier Transform. Claudia Feregrino-Uribe, Alicia Morales-Reyes Original material: Dr. René Cumplido

EE 791 EEG-5 Measures of EEG Dynamic Properties

Discrete Fourier Transform (DFT)

EE 422G - Signals and Systems Laboratory

Problem Set 1 (Solutions are due Mon )

Signal Characteristics

Response spectrum Time history Power Spectral Density, PSD

Fourier Signal Analysis

Introduction to Wavelet Transform. Chapter 7 Instructor: Hossein Pourghassem

Fourier Series. Discrete time DTFS. (Periodic signals) Continuous time. Same as one-period of discrete Fourier series

Massachusetts Institute of Technology Dept. of Electrical Engineering and Computer Science Fall Semester, Introduction to EECS 2

Physics 115 Lecture 13. Fourier Analysis February 22, 2018

The Fast Fourier Transform

System analysis and signal processing

Experiments #6. Convolution and Linear Time Invariant Systems

ECE 201: Introduction to Signal Analysis

Wireless Communication Systems Laboratory Lab#1: An introduction to basic digital baseband communication through MATLAB simulation Objective

ME 365 EXPERIMENT 8 FREQUENCY ANALYSIS

Instruction Manual for Concept Simulators. Signals and Systems. M. J. Roberts

The quality of the transmission signal The characteristics of the transmission medium. Some type of transmission medium is required for transmission:

Knowledge Integration Module 2 Fall 2016

LAB #7: Digital Signal Processing

Experiment 8: Sampling

Lecture 7 Frequency Modulation

George Mason University Signals and Systems I Spring 2016

Chapter 1. Electronics and Semiconductors

A Brief Introduction to the Discrete Fourier Transform and the Evaluation of System Transfer Functions

Lab Report #10 Alex Styborski, Daniel Telesman, and Josh Kauffman Group 12 Abstract

1. In the command window, type "help conv" and press [enter]. Read the information displayed.

Topic 2. Signal Processing Review. (Some slides are adapted from Bryan Pardo s course slides on Machine Perception of Music)

Lab P-4: AM and FM Sinusoidal Signals. We have spent a lot of time learning about the properties of sinusoidal waveforms of the form: ) X

Introduction to Wavelets Michael Phipps Vallary Bhopatkar

DIGITAL SIGNAL PROCESSING CCC-INAOE AUTUMN 2015

Section 8.4: The Equations of Sinusoidal Functions

Lab 6: Building a Function Generator

Fourier Series and Gibbs Phenomenon

TRANSFORMS / WAVELETS

Laboratory Experiment #1 Introduction to Spectral Analysis

Experiment 2 Effects of Filtering

Signal Processing for Digitizers

EECS 216 Winter 2008 Lab 2: FM Detector Part I: Intro & Pre-lab Assignment

SAMPLING THEORY. Representing continuous signals with discrete numbers

Lab 9 Fourier Synthesis and Analysis

5.3-The Graphs of the Sine and Cosine Functions

MASSACHUSETTS INSTITUTE OF TECHNOLOGY /6.071 Introduction to Electronics, Signals and Measurement Spring 2006

Experiment 1 Introduction to MATLAB and Simulink

PART I: The questions in Part I refer to the aliasing portion of the procedure as outlined in the lab manual.

Time Series/Data Processing and Analysis (MATH 587/GEOP 505)

Complex Sounds. Reading: Yost Ch. 4

6.02 Practice Problems: Modulation & Demodulation

speech signal S(n). This involves a transformation of S(n) into another signal or a set of signals

Experiment No. 2 Pre-Lab Signal Mixing and Amplitude Modulation

ELT COMMUNICATION THEORY

Basic Electronics Learning by doing Prof. T.S. Natarajan Department of Physics Indian Institute of Technology, Madras

Noise Measurements Using a Teledyne LeCroy Oscilloscope

LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS

Objectives. Abstract. This PRO Lesson will examine the Fast Fourier Transformation (FFT) as follows:

Memorial University of Newfoundland Faculty of Engineering and Applied Science. Lab Manual

G(f ) = g(t) dt. e i2πft. = cos(2πf t) + i sin(2πf t)

DSP First. Laboratory Exercise #7. Everyday Sinusoidal Signals

CHAPTER 6 INTRODUCTION TO SYSTEM IDENTIFICATION

Notes on Fourier transforms

Fall Music 320A Homework #2 Sinusoids, Complex Sinusoids 145 points Theory and Lab Problems Due Thursday 10/11/2018 before class

DCSP-10: DFT and PSD. Jianfeng Feng. Department of Computer Science Warwick Univ., UK

It is the speed and discrete nature of the FFT that allows us to analyze a signal's spectrum with MATLAB.

Sinusoids. Lecture #2 Chapter 2. BME 310 Biomedical Computing - J.Schesser

The oscilloscope and RC filters

Lab S-8: Spectrograms: Harmonic Lines & Chirp Aliasing

CHAPTER 14 ALTERNATING VOLTAGES AND CURRENTS

Laboratory Assignment 2 Signal Sampling, Manipulation, and Playback

Section 7.6 Graphs of the Sine and Cosine Functions

Introduction to signals and systems

Graphing Sine and Cosine

Islamic University of Gaza. Faculty of Engineering Electrical Engineering Department Spring-2011

Transcription:

Fourier Transform Prepared by :Eng. Abdo Z Salah

What is Fourier analysis?? Fourier Analysis is based on the premise that any arbitrary signal can be constructed using a bunch of sine and cosine waves. See this crazy signal? It looks more like a conglomeration of random points. Believe it or not, we can recreate that signal using a lot of sine and cosine waves (more specifically, we would need an infinite number of waves to make this happen)! So Why is This Useful? All signals inherently have characteristics such as frequency, phase, and amplitude. In applications such as signal processing, image processing, communications, these characteristics are vital and offer invaluable insight. In the time domain, it is difficult to ascertain these qualities. But in the frequency domain, it is much easier. How do we go from the time domain to the frequency domain? The process by which this is done is called the Fourier transform. By representing a signal as the sum of sinusoids, we are effectively representing that same signal in the frequency domain. Okay, so it Sounds Somewhat Useful, but can You Give us a Practical Example? Let s take another look at the crazy signal I showed you earlier:

This is a signal of a building s response during an earthquake. Now, looking at that curve, there isn t very much useful information there. But lets take the Fourier transform of that and see what we get (see graph below). Once we do this, we will begin to get a better idea on why Fourier analysis is so valuable. Okay, so I took the Fourier Transform of the Signal, now What?

If you notice, there are large spikes at specific frequencies. What does this mean? Those are the resonant frequencies of the building. At those frequencies, the building will sustain the most damage. This is useful information to know, because builders can modify the building so that these resonant frequencies are mitigated. Using this kind of analysis, we can build structures that are able to withstand earthquakes. In areas where earthquakes are a real concern, this is of utmost importance. This simple introduction from http://blinkdagger.com/ Now we will derive the Fourier transform? Introduction: Fourier series and the Fourier transform play a vital role in many areas of engineering such as communications and signal processing. These representations are among the most powerful and most common methods of analyzing and understanding signals. A solid understanding of Fourier series and the Fourier transform is critical to the design of filters and is beneficial in understanding of many natural phenomena. In the last Lab we see that any periodic signal that meet the condition of the Fourier series can be represented in terms of cosines and sins that are related in harmonic or by a complex exponential. We called the plot of Dn as the line spectrum of the function which make an indication about the frequency components that the function consists of. In this Lab we will see hoe the fourier series can be use to represent the aperiodic signal. Aperiodic signal representation by Fourier integral In order to represent aperiodic function in the frequency domain we will first consider that we have a periodic function with period T and then when the period T get larger so that T goes to

the infinity we observe that we have aperiodic function,so our analysis will start with periodic function then increase the period until we reach the aperiodic function. consider we have a pulse train as show in the figure1 with period T 5 4.5 4 3.5 3 2.5 2 1.5 1.5-1 -8-6 -4-2 2 4 6 8 1 T 5 4.5 4 3.5 3 2.5 2 1.5 1.5-2 2 4 6 8 1 12 14

Dn Now if you compute the Fourier coefficient Dn of the periodic function o f () t Dne n jnw t D n T 1 T T 2 2 o f () t e jnw t for our signal D n 5 sin( nw o ) 5 sin c ( nw o ) T nw T o o o now we will plot Dn and note that Dn is real so we will plot the magnitude and the phase in the same figure 1.4 The line spectrum 1.2 1.8 the distance between the two lines is w.6.4.2 -.2 -.4-1 -8-6 -4-2 2 4 6 8 1 nw

Dn now we will see what will happen if we increase T D n 5 sin c ( nw o ) T o 1.4 The line spectrum witht=4 1.2 1.8.6.4.2 -.2 -.4-25 -2-15 -1-5 5 1 15 2 25 nw

Dn Dn.35 The line spectrum witht=16.3.25.2.15.1.5 -.5 -.1-4 -3-2 -1 1 2 3 4 nw.8 The line spectrum witht=64.7.6.5.4.3.2.1 -.1 -.2-1 -8-6 -4-2 2 4 6 8 1 nw

Dn 2 x 1-3 The line spectrum witht=256 15 1 5-5 -3-2 -1 1 2 3 nw So what we see is that as we increase T or decrease the frequency the amplitude of the line spectrum decrease and the line get close and close to each other.the figure below show the decreasing of the amplitude when T increase 1.4 1.2 1 Increasing T,decreasing the amplitude of Dn T=4 T=8 T=12 T=16 T=2.8.6.4.2 -.2 -.4-4 -3-2 -1 1 2 3 4 nw

so when T the amplitude and w o and the spacing between the lines go to zero. so let w o w since w is infinitesimal. now we need another way in order to extract a meaningful information from Dn since it is go to zero as we increase the period of the function. T T 2 2 jn w ot nt T T 2 2 1 Dn f ( t ) e D f ( t ) e T note that D f o n Dn w this quantity is called the Coefficient Density 2 since w T n w w jn w t where W is a continues variable that at every point of the spectrum there is a value of Dn which is infinitesimal, D jwt n T f () t e this is a continues function of w and called X(w) f t e X(w) () jwt FourierTransform o so what we have here is a representation of the an aperiodic signal in the frequency domain.now in the modify the equation of f(t)

jn w 1 ot Dn jn w ot f () t Dne e w n 2 w n 2 Dn X ( w ) w 2 w 1 jnw 1 ot jwt f ( t ) lim X ( w ) e w X ( w ) e dw w 2 2 w jnw ot now we are going to plot F ( w ) e to show that the summation goes to the integral 4 2 Δw -4-2 2 4 6 8-2

1 f ( t ) X ( w ) e 2 or the Fourier Inverse jwt dw called the Fourier Integral We have now succeeded in representation an aperiodic signal x(t) by a Fourier integral rather than a Fourier series.this integral is basically a Fourier series (in the limit ) with fundamental frequency goes to zero X w x t x t X w 1 ( ) [ ( )] ( ) [ ( )] Investigate the Scaling Property 1 w x ( at ) X ( ) a a Note that compression in time by factor a means mean that the signal is varying faster by factor a and to synthesize such a signal the frequencies of its sinusoidal components must be increased by a factor a implying that its frequency spectrum is expanded by factor a. similarly a signal expand in time varies more slowly,hence the frequency of its components are lowered implying that the its spectrum is compressed The graph confirm the reciprocal relationship between signal duration and spectral bandwidth :time compression causes spectral expansion and time expansion causes spectral compression.

x() 1.5 Normal(=1) Compressed(=.5) Expanded(=2) 1.5-1 -5 5 1 Parseval's Theorem and essential bandwidth? Parseval's Theorem concisely relates energy between the time domain and the frequency domain 2 1 2 x t dt X ( w ) dw 2 this is too easily verified with Matlab.For example a unit amplitude pulse x(t) with duration tau has energy E,Thus x 2 d 2 x w w letting tau=1 the energy of X(w) is computed using the quad function. >> X_squared = inline('tau.*sinc(tau.*w/(2*pi)).^2','w','tau'); quad(x_squared,-1e6,1e6,[],[],1) ans = 6.2817

Although not perfect,the result of the numerical integration is consistent with the expected value of 2 6.2832,in the quad the tow brackets are for special parameter and we do not concern it, the last parameter is 1 which the value of tau and it should be inserted because of the integration depend on it. Essential Bandwidth? The spectra of all practical signals extend to infinity.however because the energy of any practical signal is finite,the signal spectrum must approach zero as w,so most of the energy is concentrating with a limited band B and the energy contribution by the component beyond B is negligible we can therefore suppress the signal spectrum beyond B Hz with a little effect on the signal energy and shape,so the essential bandwidth is the portion of a signal spectrum in the frequency domain which contains most of the energy of the signal. Say for example 95% or any ratio according to your systems Consider for example finding the essential bandwidth W,in radians per second,that contain s fraction β of the energy of the square pulse x(t).that is,we want to find W such that 1 2 W W 2 X ( w ) dw

Algorithm for finding the essential bandwidth function [W,CE]=EBW(tau,beta,tol) start at W= define the desired energy =Beta*tau define a step with any initial value define the relative error between the desired value and the computed value Desired E relerr Computed E Desired E >> X_squared = inline('tau.*sinc(tau.*w/(2*pi)).^2','w','tau'); CE=quad(X_squared,-W,W,[],[],tau) while (abs(relerr)>tol) 1-compute CE 2-compute relerr W too small that relerr is positive then increase W by a step. W too larg that the step is large then decrase the step by a fraction and then decrease the step recompute 1 and 2

function [W,CE] = EBW(tau,beta,tol) % Function M-file computes essential bandwidth W for square pulse. % INPUTS: tau = pulse width % beta = fraction of signal energy desired in W % tol = tolerance of relative energy error % OUTPUTS: W = essential bandwidth [rad/s] % CE = Energy contained in bandwidth W W = ; step = 2*pi/tau; % Initial guess and step values X_squared = inline('tau.*sinc(tau.*w/(2*pi)).^2','w','tau'); DE = beta*tau; % Desired energy in W relerr = (DE-)/DE; % Initial relative error is 1 percent while(abs(relerr) > tol), if (relerr>), % W too small W=W+step; % Increase W by step elseif (relerr<), % W too large step = step/2; W = W-step; % Decrease step size and then W. end CE = 1/(2*pi)*quad(X_squared,-W,W,[],[],tau);%computed energy relerr = (DE - CE)/DE; end

Fourier Transform and Inverse Fourier in Matlab 2 syms t w f () t e t x=exp(-t^2); fourier(x) 1 X ( w ) syms n 1 jw X=1/(1+j*w); ifourier(x,n) f ( t ) e t u( t ) syms t w x=exp(-t)*heaviside(t); X=fourier(x,w) f () t te t syms x u; f = x*exp(-abs(x)); fourier(f,u)

y(t) Introduction to FFT (Fast Fourier Transform) we will discuss how to use the fft (Fast Fourier Transform) command within MATLAB. A Simple Example 1. Let s start off with a simple cosine wave, written in the following manner: y ( t ) 2sin(2 f t ) o 2. Next, let s generate this curve within matlab using the following commands: fo = 4; %frequency of the sine wave Fs = 1; %sampling rate Ts = 1/Fs; %sampling time interval t = :Ts:1-Ts; %sampling period n = length(t); %number of samples y = 2*sin(2*pi*fo*t); %the sine curve %plot the cosine curve in the time domain plot(t,y) xlabel('time (seconds)') ylabel('y(t)') title('sample Sine Wave') grid 2 Sample Sine Wave 1.5 1.5 -.5-1 -1.5-2.1.2.3.4.5.6.7.8.9 1 time (seconds)

3. When we take the fft of this curve, we would ideally expect to get the following spectrum in the frequency domain (based on fourier theory, we expect to see one peak of amplitude 1 at -4 Hz, and another peak of amplitude 1 at +4 Hz): 4. So now that we know what to expect, let s use MATLAB s built in fft command to try to recreate the frequency spectrum: Y = fft(y); %take the fft of our sin wave, y(t) stem(y); %use abs command to get the magnitude %similary, we would use angle command to get the phase plot! xlabel('sample Number') ylabel('amplitude') title('using the Matlab fft command') grid 1 Using the Matlab fft command 5-5 -1-15 1 2 3 4 5 6 7 8 9 1 Sample Number

This doesn t quite look like what we predicted above. If you notice, there are a couple of things that are missing. The x-axis gives us no information on the frequency. How can we tell that the peaks are in the right place? The amplitude is all the way up to 1 The spectrum is not centered around zero and is not even You can see that a problem exists due to the fact that the output of the FFT function is a complex valued vector. MATLAB plots complex numbers on the two-dimensional complex plane, which is not the plot you are trying to generate. What is usually significant in communications is the magnitude of the frequency domain representation. You can plot the magnitude of the FFT by using MatLab's abs function: >> plot ( abs ( Y ) ) Matlab sets axes automatically unless a user defines them. To define the x- and y-axis in order to see the plot in detail: axis([,1,,12]) Fs = 1/Ts is the sampling rate given in sample per second Hence that highest possible analogue frequency is Fmax = Fs /2 Now the graph looks like a frequency domain plot. However it still does not look like what we would expect to see. This is because MATLAB presents frequency components from f = to f = fs (i.e. from DC to the sampling frequency). However, we are used to seeing the plots range from f = -fs/2 to f = +fs/2. This problem can be overcome by using the fftshift function. To get help on this function type: >> help fftshift Plot the magnitude using the fftshift function to move the dc component to the center of the display: >> plot ( abs ( fftshift ( Y ) ) ) Now the plot is starting to look like the expected Fourier transform. However, the x-axis is still not correct. The x-axis should be scaled to display frequencies from -fs/2 to fs/2. >>f=-fs/2:fs/length(y):fs/2-fs/length(y); so the complete code Y=fft(y); Y=Y/length ( Y ) ; f=-fs/2:fs/length(y):fs/2-fs/length(y); stem (f, fftshift ( abs ( Y ) ) )

FFT using the oscilloscope As part of the experiment, the FFT has to be obtained using the oscilloscope. In order to obtain the FFT, the following steps should be carried out. First the time domain signal should be set properly by the following steps: a. Press AUTOSET to display the time domain waveform. b. Position the time domain waveform vertically at center of the screen to get the true DC value. c. Position the time domain waveform horizontally so that the signal of interest is contained in the center eight divisions. d. Set the YT waveform SEC/DIV to provide the resolution you want in the FFT waveform. This decides how high the frequency content of the transform will be. The smaller the time scale used the higher the frequency content. Then the FFT can be performed as follows: e. Locate the math button on the front panel of the oscilloscope. f. On pressing it you will enter the Math menu g. In function choose fft. h. The following screen will appear. (Clearly the waveform in your case will be different.) i.then use the curser in order to compute the frequency For all FFT s in this experiment always use the Hanning window, as it is best suited among the given options for a periodic signal. A windowing function is basically a function used to cut out a part of the signal in time domain so that an FFT can be carried out on it. Thus basically it is multiplication by some kind of rectangular pulse in time domain, which implies convolution with some kind of a sinc in frequency domain. Using a windowing function affects the transform but is the only practical method for obtaining it.

Lab homework For the following function 1-calculate the Fourier transform (by hand calculations) at f ( t ) e u( t ) 2-plot the spectrum for different values of a (.5,1,2,3) and comment on your results? 3-calculate the total energy of the signal 4- write a function that computes the essential bandwidth and computes the energy in that bandwidth for 95% of the total energy. 5- for the following functions plot the functions and use fft to plot the spectrum of the function? a. y ( t ) sin(2 8 t ) b. y ( t ) sin(28 t ) cos(216 t ) c. y ( t ) sin(21 t ) 5cos(22 t ).2randn ( 1, length ( t ) ); note :.2*randn ( 1, length ( t ) ); is AWGN(Additive White Gaussian Noise) to the time domain signal in order to make the output more like the practical output of oscilloscope: Comment the results