sinc function T=1 sec T=2 sec angle(f(w)) angle(f(w))

Similar documents
X. Chen More on Sampling

SEISMIC WAVE PROPAGATION. Lecture 2: Fourier Analysis

Digital Signal Processing: Signal Transforms

ELEN 4810 Midterm Exam

LAB # 5 HANDOUT. »»» The N-point DFT is converted into two DFTs each of N/2 points. N = -W N Then, the following formulas must be used. = k=0,...

LAB 2: DTFT, DFT, and DFT Spectral Analysis Summer 2011

V(t) = Total Power = Calculating the Power Spectral Density (PSD) in IDL. Thomas Ferree, Ph.D. August 23, 1999

Definition. A signal is a sequence of numbers. sequence is also referred to as being in l 1 (Z), or just in l 1. A sequence {x(n)} satisfying

The Discrete Fourier Transform

PART 1. Review of DSP. f (t)e iωt dt. F(ω) = f (t) = 1 2π. F(ω)e iωt dω. f (t) F (ω) The Fourier Transform. Fourier Transform.

FOURIER TRANSFORM AND

Chapter 4 Discrete Fourier Transform (DFT) And Signal Spectrum

Music 270a: Complex Exponentials and Spectrum Representation

Multimedia Signals and Systems - Audio and Video. Signal, Image, Video Processing Review-Introduction, MP3 and MPEG2

Lecture 10. Digital Signal Processing. Chapter 7. Discrete Fourier transform DFT. Mikael Swartling Nedelko Grbic Bengt Mandersson. rev.

!Sketch f(t) over one period. Show that the Fourier Series for f(t) is as given below. What is θ 1?

! Circular Convolution. " Linear convolution with circular convolution. ! Discrete Fourier Transform. " Linear convolution through circular

Review: Continuous Fourier Transform

Tutorial Sheet #2 discrete vs. continuous functions, periodicity, sampling

LABORATORY 1 DISCRETE-TIME SIGNALS

ESE 531: Digital Signal Processing

Math 56 Homework 5 Michael Downs

The Fourier Transform (and more )

x[n] = x a (nt ) x a (t)e jωt dt while the discrete time signal x[n] has the discrete-time Fourier transform x[n]e jωn

! Introduction. ! Discrete Time Signals & Systems. ! Z-Transform. ! Inverse Z-Transform. ! Sampling of Continuous Time Signals

Up-Sampling (5B) Young Won Lim 11/15/12

A523 Signal Modeling, Statistical Inference and Data Mining in Astrophysics Spring 2011

Lecture 20: Discrete Fourier Transform and FFT

TTT4120 Digital Signal Processing Suggested Solutions for Problem Set 2

QUIZ #2 SOLUTION Version A

CMPT 889: Lecture 3 Fundamentals of Digital Audio, Discrete-Time Signals

A3. Frequency Representation of Continuous Time and Discrete Time Signals

1 1.27z z 2. 1 z H 2

VII. Bandwidth Limited Time Series

Lecture 3: Linear Filters

Fast Fourier Transform Discrete-time windowing Discrete Fourier Transform Relationship to DTFT Relationship to DTFS Zero padding

Information and Communications Security: Encryption and Information Hiding

Fundamentals of the DFT (fft) Algorithms

Lecture 3: Linear Filters

EE 224 Signals and Systems I Review 1/10

[ ], [ ] [ ] [ ] = [ ] [ ] [ ]{ [ 1] [ 2]

Fast Fourier Transform Discrete-time windowing Discrete Fourier Transform Relationship to DTFT Relationship to DTFS Zero padding

ECG782: Multidimensional Digital Signal Processing

Final Exam January 31, Solutions

Discrete Fourier Transform

Chapter 4 The Fourier Series and Fourier Transform

EE482: Digital Signal Processing Applications

16.362: Signals and Systems: 1.0

ESE 531: Digital Signal Processing

In this Lecture. Frequency domain analysis

E2.5 Signals & Linear Systems. Tutorial Sheet 1 Introduction to Signals & Systems (Lectures 1 & 2)

EEL3135: Homework #3 Solutions

Discrete Fourier Transform

CMPT 318: Lecture 5 Complex Exponentials, Spectrum Representation

8/19/16. Fourier Analysis. Fourier analysis: the dial tone phone. Fourier analysis: the dial tone phone

Discrete Time Fourier Transform (DTFT) Digital Signal Processing, 2011 Robi Polikar, Rowan University

Chap 4. Sampling of Continuous-Time Signals

EEO 401 Digital Signal Processing Prof. Mark Fowler

E : Lecture 1 Introduction

Multirate Digital Signal Processing

ECE 301 Fall 2010 Division 2 Homework 10 Solutions. { 1, if 2n t < 2n + 1, for any integer n, x(t) = 0, if 2n 1 t < 2n, for any integer n.

BME 50500: Image and Signal Processing in Biomedicine. Lecture 2: Discrete Fourier Transform CCNY

EE482: Digital Signal Processing Applications

A Note on Upsampling by Integer Factors Using the DFT

Each of these functions represents a signal in terms of its spectral components in the frequency domain.

Chapter 6: Applications of Fourier Representation Houshou Chen

Module 3. Convolution. Aim

ELEN E4810: Digital Signal Processing Topic 11: Continuous Signals. 1. Sampling and Reconstruction 2. Quantization

Chirp Transform for FFT

Computational Methods for Astrophysics: Fourier Transforms

ENT 315 Medical Signal Processing CHAPTER 2 DISCRETE FOURIER TRANSFORM. Dr. Lim Chee Chin

Lecture 8: Signal Reconstruction, DT vs CT Processing. 8.1 Reconstruction of a Band-limited Signal from its Samples

UNIVERSITY OF OSLO. Please make sure that your copy of the problem set is complete before you attempt to answer anything.

Subband Coding and Wavelets. National Chiao Tung University Chun-Jen Tsai 12/04/2014

Contents. Signals as functions (1D, 2D)

DCSP-2: Fourier Transform

Frequency-domain representation of discrete-time signals

Fourier Series and Transforms

University of Illinois at Urbana-Champaign ECE 310: Digital Signal Processing

Section 3 Discrete-Time Signals EO 2402 Summer /05/2013 EO2402.SuFY13/MPF Section 3 1

Scientific Computing: An Introductory Survey

Chapter 5. Fourier Analysis for Discrete-Time Signals and Systems Chapter

Problem Value Score No/Wrong Rec

G52IVG, School of Computer Science, University of Nottingham

Homework 4. May An LTI system has an input, x(t) and output y(t) related through the equation y(t) = t e (t t ) x(t 2)dt

Computational Methods CMSC/AMSC/MAPL 460

Discrete-Time Signals: Time-Domain Representation

Summary of lecture 1. E x = E x =T. X T (e i!t ) which motivates us to define the energy spectrum Φ xx (!) = jx (i!)j 2 Z 1 Z =T. 2 d!

I. Signals & Sinusoids

Lecture 5. The Digital Fourier Transform. (Based, in part, on The Scientist and Engineer's Guide to Digital Signal Processing by Steven Smith)

Discrete-Time Signals: Time-Domain Representation

Contents. Signals as functions (1D, 2D)

Contents. Signals as functions (1D, 2D)

MEDE2500 Tutorial Nov-7

EE Homework 13 - Solutions

Correlation, discrete Fourier transforms and the power spectral density

Wavenumber-Frequency Space

Introduction to Signal Analysis Parts I and II

EE 225D LECTURE ON DIGITAL FILTERS. University of California Berkeley

Images have structure at various scales

Transcription:

T=1 sec sinc function 3 angle(f(w)) T=2 sec angle(f(w)) 1

A quick script to plot mag & phase in MATLAB w=0:0.2:50; Real exponential func b=5; Fourier transform (filter) F=1.0./(b+j*w); subplot(211), plot(w, abs(f)); title( Real Exp *Step ); xlabel( frequency (rad/sec) ); ylabel( F(w) ); subplot(212), plot(w, angle(f)); title( Real Exp *Step ); xlabel( frequency (rad/sec) ); ylabel( phase angle ); 2

2D Fourier Transform (2DFT) Wave Equation (2D) 2 u(x,t) x 2 = 1 v 2 2 u(x,t) t 2 A particularly useful class of solutions: u(x,t) = Ae i(ωt ±kx) = A[cos(ωt ± kx) + isin(ωt ± kx)] k=wavenumber, v=speed, ω=angular frequency In fact, k could be a vector k in 3D, then we have several dimensions! v = w k (k expressed in radians/sec) This cons)tute a func)on of both wave number and frequency. To analyze the spectral characteris)cs we need to use a 2D Fourier Transform. Defini:on: The 2DFT of a func:on f(x,y) is defined as F(k x,k y ) = f (x, y) = 1 (2π) 2 Then inverse 2DFT is f (x, y)e j(k x x +k y y ) dxdy F(k x,k y )e j(k xx +k yy ) dk x dk y 3

Back to 1D seismic wave solution (assume propagating in +x direction): F(k,ω) = Ae j(ωt kx ) e j(ωt kx ) dxdt k=spatial frequency, ω=angular frequency=2π/t Other examples: Image compression or blurring/deblurring Image decompression: For a digital image, it is usually much simpler to save the coefs of number of discrete frequencies rather than the whole image. If need to reconstruct image, do Inv FT. As simple as doing these: (1) Load the image into a 2D matrix (2) Perform fft (2D) on this matrix (3) Multiplying frequencies with a function (of frequency), or simply remove small coefficients (4) Fft back to the space-time domain 4

2D FT seismic example: Velocity filter (I.e. F-k filter or dip filter) A seismic line contains 24 receivers, with 25 m spacing between two adjacent stations. The time shift is 15 ms/ trace. The total length of each seismogram is 1 sec, with sampling rate of 0.001 sec. Find the seismic velocity (or propagation speed) of the medium using 12 Hz wavelet. f k = v = 12 cycles/s 7.2 cycles/km =1.67 km/sec (phase vel)

2D fft Numerical example (dip filter) 25 m (see program fkdip.m) 15 ms w = 3.14159*2.0*12.0; % w=2*pi*freq Sample code: delta = 0.001; % sampling interval ss = -0.015; % phase delay between adjacent seismographs Y=[]; time=(0:delta:1.0); m=length(time); % number of time points for i=1:24 Computes w*(t-phi) ss = ss+0.015; xx=w*time-ss*w; y = cos(xx); Fill matrix columns by 6 Y = [Y y']; sinusoids end

2D FFT Algorithm: 1D FT a column of Y Save the coef in the same column Once columns all become coefs, do 1D transform a row at a time, replace old coefs with new coefs Matlab function: fft2() Spatial wavenumber (cycles/km) Now, to compute velocity, do f/k = (12 cycles/sec) / (7.2 cycles/km) = 1.67 km/s = phase vel Why the artifact? 7

Discretization and Discrete Signals So far, we have talked about continuous functions and Fourier Series/Transforms for them. Realistically, observations are better stored and operated on as discrete sample points. An infinite discrete signal f s (t) is obtained by sampling f(t) every Δt seconds, f s (t) = f (t) k= δ(t kδt) Where Δt is called the sampling interval (or sample rate). Time series: Discrete time function discrete step function 8

t=-4:6; % time axis, discrete at 1 sec per sample ft=[0-3 1 0 1 2 1 0-1 0 0]; % make a function f(t) figure; % start figure environment subplot(2,2,1); % make a figure with 4 subfigs, % 2 rows, 2 columns, plot 1st. stem(t,ft, 'filled'); % make a stem plot with filled circles title('any discrete function'); xlabel('t(sec)'); ylabel('f(t)'); subplot(2,2,2); % set up second panel delta=[]; % declare delta to be an array for i=1: length(t) if(t(i)<0) discrete_sig.m delta(i)=0.0; else delta(i)=1; end end stem(t,delta, 'filled'); % make a stem plot with filled circles title('discrete delta function'); xlabel('t(sec)'); ylabel('f(t)'); subplot(2,2,3); % set up 3rd panel for i=1: length(t) if(t(i)<0) delta(i)=0.0; else delta(i)=t(i); end end stem(t,delta, 'filled'); % make a stem plot with filled circles title('discrete unit ramp function'); xlabel('t(sec)'); ylabel('f(t)'); subplot(2,2,4); % set up 4th panel delta=cos(t); 9 stem(t,delta, 'filled'); % make a stem plot with filled circles title('discrete unit cosine function'); xlabel('t(sec)'); ylabel('f(t)');

Idea of Nyquist Frequency: A continuous signal can be well restored by a discrete signal with sampling interval Δt --->0. For a given time series with sampling interval Δt, the highest frequency that can be restored is 1/(2Δt) which is the Nyquist Frequency of the time series. f Nyquist = 1 2Δt ; Δt = sampling interval = f s /2; f s = 1/Δt = sampling frequency To be authentic f Nyquist f max f max = max frequency of a bandlimitted signal f s 2 f max f s 2 f max i.e.: f s must be greater or equal to twice the f max of the signal! What happens otherwise? ALIASING! Aliasing Problem 10

See provided matlab code nyquist_spec.m P 0.1 sec sampling S Rayleigh 0.2 sec sampling 0.8 sec sampling 11

Folding Frequency and Aliasing Example of sampling without aliasing: (see adached Matlab code nyquist_gt_fmax_4panels.m) Experiment Setup: Sinosoidal, signal frequency = 25 Hz Fn =1/(2*0.002)=250 Hz Fn =125 Hz Example of sampling causing aliasing: (see adached Matlab code nyquist_150hz. m). Signal freq=150 Hz 12

Effect of Undersampling: (1) Bandlimit the spectrum of a con:nuous signal, with the highest frequency equals the Nyquist frequency. (2) Introduce aliasing, I.e., frequencies above the Nyquist are lost ater sampling, but reappears at frequencies below the Nyquist. The high frequencies are not lost per say, but actually folded back onto the spectrum as low frequencies. --> contamina:on of low frequencies. Computa:on of Alias frequency f a = 2mf N f s f a is the folding (aliasing) frequency, f s is the signal (or input) frequency, m is the smallest integer such that f a < f N Example: Suppose f s =65 Hz, f N =62.5 Hz, find alias frequency. Graphically, Guess m=0, f a = 65 Hz > f N, no Guess m=1, f a = 60 Hz < f N, yes f a =60 f n =62.5 f s =65 FREQ (Hz) Solu)on to undersampling: (1) Nothing can be done about effect (1) (2) People typically use some type of filter to remove high 13 frequency signals above Nyquist. Then do Fourier spectrum.

Non-Matlab issues: A few important points Input is a real function, so symmetric amp spectrum (why? As proved before F(-w)=F*(w), which yields same F(w) ) As demonstrated, nonzero average --> 0 frequency (this is one of the reasons that seismologists detrend the data before doing fft or filter, see nyquist_spec_const.m, see next page). Nonzero frequencies seem to shift to lower end (close to 0) when under-sampled due to Aliasing. F(k) = N Matlab issues: FFT(x) returns the discrete Fourier transform (DFT) of vector x. For length N input vector x, the DFT is a length N vector F, with elements x(n) e j*2π *(k 1)*(n 1)/ N where 1 k N n=1 n is t in the discrete sense, 2π(k-1)/N is related to frequency ω.! Examples: dft_simple.m, dft_simple_odd.m, dft_fftshift.m f (n) = 1 N N X(k) e j*2π *(k 1)*(n 1)/ N where 1 n N k=1 Do you see a potential problem in this formulation?

The code is different from the earlier version by this line: ff=load('regional_eq.v'); t=ff(:,1); ft=ff(:,2); ft=ft+2e-6; Adds a constant shift to the original time series. Gets back an average (actually, Matlab gives SUM, I divided by the number of data to get the average) at the zero freq! 15

Ins and Outs of Discrete Fourier Transform (DFT) 1. In mathematics, the Discrete Fourier Transform (DFT) is a specific kind of Fourier transform. 2. Requires a continuous function being Sampled at specific time/spatial points. 3. Only evaluates enough frequency samples to reconstruct the time-segmented finite samples 4. Assumes the limited time samples are from 1 period (hence the range is limited from 0à2 PI (or PI to PI) and this periodicity repeats forever. A window function is often added to remove high-freq contamination (recall: time limited signal cannot be band-limited)-à a little bit of artifacts Not too big since the frequencies at super high freq usually have small amps. 5. For the same reason as 4, inverse DFT (IFFT) will not be able to reconstruct the infinite time series from a non-infinite time series. 16

The DFT maps a discrete signal into the frequency domain where the limit of ω is [0, 2π). π N=8 Suppose: time series has N points, then the ω axis can be discretised as ω 0 2π ω k = k 2π N, k = 0, 1,..., N -1 N= length of Fourier Transform, and X(ω k ) = N 1 x n e jω kn, n= 0 k = 0, 1, 2,.., (N -1) So the DFT maps the N-point time series to N-point coefficients X k = X(ω k ) in frequency domain! Nyquist at ω=π complex coefficient ordering in Matlab. Matlab considers frequencies from 0 ---> 2π π/2 after fftshift, move 0 freq to center π 0 (-π) 0 π-df (-π) (2π) 1 N/2+1 N 3π/2 (-π/2) Check program dft_simple.m for unshifted frequency storage, useful for visualization (careful here!). 17 Questions: (1) What does it say about the coefficients (complex vs. real)? (2) What can I say about the time series?

Unshifted DFT storage in matlab >> type dft_simple.m % this little code finds DFT of a simple time series. z=[1, 2, 3, 4, 5, 6]; w=fft(z) >> dft_simple w = Columns 1 through 3 21.0000-3.0000 + 5.1962i -3.0000 + 1.7321i Columns 4 through 6-3.0000-3.0000-1.7321i -3.0000-5.1962i shifted DFT storage in matlab >> type dft_simple_shift.m % this little code finds shifted DFT of a simple time series. z=[1, 2, 3, 4, 5, 6]; w=fft(z); w=fftshift(w) >> dft_simple_shift w = Columns 1 through 3-3.0000-3.0000-1.7321i -3.0000-5.1962i Columns 4 through 6 21.0000-3.0000 + 5.1962i -3.0000 + 1.7321i 18

Symmetric function input/fourier symmetry (see code symmetry_fft.m) % this program demonstrates the input pattern for matlab, % as well as symmetry of Fourier transforms for real even and real odd functions z=[4 1 0 1 4] fft(z) Output: (Not symmetric due to MATLAB corkiness, this input is actually regarded as a shifted symmetric func, which is multiplication of F(w) by a complex exponential 10.0000 4.7361 + 3.4410i 0.2639 + 0.8123i 0.2639-0.8123i 4.7361-3.4410i Replace the input by z=[0 1 4 4 1] fft(z) Output: 10.0000-5.8541 0.8541 0.8541-5.8541 (which is real symmetric spectrum!!) Real Odd func z=[0 1 4-4 -1] fft(z) Output: 0 0-6.6044i 0 + 6.4329i 0-6.4329i 0 + 6.6044i (Complex Odd Spectrum!!) 19