Frequency Domain Characterization of Signals
Total Page:16
File Type:pdf, Size:1020Kb
Frequency Domain Characterization of Signals Yao Wang Polytechnic University, Brooklyn, NY11201 http: //eeweb.poly.edu/~yao Signal Representation • What is a signal • Time-domain description – Waveform representation – Periodic vs. non-periodic signals • Frequency-domain description – Periodic signals – Sinusoidal signals – Fourier series for periodic signals – Fourier transform for non-periodic signals – Concepts of frequency, bandwidth, filtering – Numerical calculation: FFT, spectrogram – Demo: real sounds and their spectrogram (from DSP First) ©Yao Wang, 2006 EE3414: Signal Characterization 2 What is a signal • A variable (or multiple variables) that changes in time – Speech or audio signal: A sound amplitude that varies in time – Temperature readings at different hours of a day – Stock price changes over days – Etc … • More generally, a signal may vary in 2-D space and/or time – A picture: the color varies in a 2-D space – A video sequence: the color varies in 2-D space and in time • Continuous vs. Discrete – The value can vary continuously or take from a discrete set – The time and space can also be continuous or discrete – We will look at continuous-time signal only in this lecture ©Yao Wang, 2006 EE3414: Signal Characterization 3 Waveform Representation • Waveform representation – Plot of the variable value (sound amplitude, temperature reading, stock price) vs. time – Mathematical representation: s(t) ©Yao Wang, 2006 EE3414: Signal Characterization 4 Sample Speech Waveform 0.08 0.08 0.06 0.06 0.04 0.04 0.02 0.02 0 0 -0.02 -0.02 -0.04 -0.04 -0.06 -0.06 -0.08 -0.08 -0.1 -0.1 0 2000 4000 6000 8000 10000 12000 14000 16000 2000 2200 2400 2600 2800 3000 Entire waveform Blown-up of a section. » [y,fs]=wavread('morning.wav'); » figure; plot(x); » sound(y,fs); » axis([2000,3000,-0.1,0.08]); » figure; plot(y); » x=y(10000:25000);plot(x); Signal within each short time interval is periodic Period depends on the vowel being spoken ©Yao Wang, 2006 EE3414: Signal Characterization 5 Sample Music Waveform Entire waveform Blown-up of a section » [y,fs]=wavread(’sc01_L.wav'); »v=axis; » sound(y,fs); » axis([1.1e4,1.2e4,-.2,.2]) » figure; plot(y); Music typically has more periodic structure than speech Structure depends on the note being played ©Yao Wang, 2006 EE3414: Signal Characterization 6 Sinusoidal Signals 2.5 = π +φ 2 s(t) Acos(2 f0t ) 1.5 f0 : frequency 1 0.5 (cycles/second) 0 = -0.5 T0 1/ f0 : period -1 A: Amplitude -1.5 φ : Phase (time shift) -2 -2.5 -1.5 -1 -0.5 0 0.5 1 1.5 • Sinusoidal signals are important because they can be used to synthesize any signal – An arbitrary signal can be expressed as a sum of many sinusoidal signals with different frequencies, amplitudes and phases • Music notes are essentially sinusoids at different frequencies ©Yao Wang, 2006 EE3414: Signal Characterization 7 What is frequency of an arbitrary signal? • Sinusoidal signals have a distinct (unique) frequency • An arbitrary signal does not have a unique frequency, but can be decomposed into many sinusoidal signals with different frequencies, each with different magnitude and phase • The spectrum of a signal refers to the plot of the magnitudes and phases of different frequency components • The bandwidth of a signal is the spread of the frequency components with significant energy existing in a signal • Fourier series and Fourier transform are ways to find spectrums for periodic and aperiodic signals, respectively ©Yao Wang, 2006 EE3414: Signal Characterization 8 Approximation of Periodic Signals by Sum of Sinusoids 2 sinusoids: 1st and 3d harmonics 1 0.5 ∞ = π 0 s(t) ∑ Ak cos(2 kf0t) k =0 -0.5 -1 -1.5 -1 -0.5 0 0.5 1 1.5 View note for matlab code 4 sinusoids: 1,3,5,7 harmonics With many more sinusoids with appropriate magnitude, we will get the square wave exactly ©Yao Wang, 2006 EE3414: Signal Characterization 9 Line Spectrum of Square Wave Magnitude Spectrum for Square Wave 1.4 Each line corresponds to one 1.2 harmonic frequency. The line magnitude (height) indicates the contribution of that 1 4 = = k 1,3,5,... frequency to the signal. Ak πk 0 k = 0,2,4,... 0.8 The line magnitude drops exponentially, which is not very fast. The very sharp Amplitude 0.6 transition in square waves calls for very high frequency 0.4 sinusoids to synthesize. 0.2 0 1 3 5 7 9 11 13 15 k,f =f *k k 0 ©Yao Wang, 2006 EE3414: Signal Characterization 10 Period Signal • Period T: The minimum interval on which a signal repeats – Sketch on board • Fundamental frequency: f0 =1/T • Harmonic frequencies: kf0 ©Yao Wang, 2006 EE3414: Signal Characterization 11 Approximation of Periodic Signals by Sinusoids • Any periodic signal can be approximated by a sum of many sinusoids at harmonic frequencies of the signal (kf0 ) with appropriate amplitude and phase. • The more harmonic components are added, the more accurate the approximation becomes. • Instead of using sinusoidal signals, mathematically, we can use the complex exponential functions with both positive and negative harmonic frequencies ©Yao Wang, 2006 EE3414: Signal Characterization 12 Complex Exponential Signals • Complex number: A = A exp( jφ) = A cosφ + j A sinφ = Re+ j Im • Complex exponential signal = π = π +φ + π +φ s(t) Aexp( j2 f0t) A cos(2 f0t ) j A sin(2 f0t ) • Euler formula exp( jωt) + exp(− jωt) = 2cos(ωt) exp( jωt) − exp(− jωt) = j2sin(ωt) ©Yao Wang, 2006 EE3414: Signal Characterization 13 Fourier Series Representation of Periodic Signals Fourier Series Synthesis (inverse transform) : ∞ = + π +φ s(t) A0 ∑ Ak cos(2 kf0t k ) (single sided, for real signal only) k =1 ∞ = π ∑ Sk exp( j2 kf0t) (double sided, for both real and complex) k =−∞ Fourier series analysis (forward transform) : = 1 T0 − π = ± S k ∫ s(t) exp( j2 kf0t) dt;k 0, 1,2,... 0 T0 S k is in general a complex number * For real signals, Sk=S -k |Sk|=|S-k| (Symmetric spectrum) ©Yao Wang, 2006 EE3414: Signal Characterization 14 Fourier Series Representation of Square Wave • Applying the Fourier series analysis formula to the square wave, we get 2 = ± = k 1,3,5,... S k jπk 0 k = 0,±2,4,... • Do the derivation on the board ©Yao Wang, 2006 EE3414: Signal Characterization 15 Line Spectrum of Square Wave Magnitude Spectrum for Square Wave 1.4 1.2 4 = = k 1,3,5,... 1 Ak πk 0 k = 0,2,4,... 0.8 Amplitude 0.6 0.4 Only the positive frequency 0.2 side is drawn on the left (single sided spectrum), with twice the magnitude of the 0 double sided spectrum. 1 3 5 7 9 11 13 15 k,f =f *k k 0 ©Yao Wang, 2006 EE3414: Signal Characterization 16 Fourier Transform for Non-Periodic Signals → = ∞ → = → Aperiodic signal T 0 f0 0 uncountable number of harmonics → integral instead of sum Fourier synthesis (inverse transform) : ∞ s(t) = ∫ S( f )exp( j2πft)df −∞ Fourier analysis (forward transform) : ∞ S(f) = ∫ s(t)exp(− j2πft)dt −∞ For real signals, |S(f)| =|S(-f)| (Symmetric magnitude spectrum) ©Yao Wang, 2006 EE3414: Signal Characterization 17 Pulse Function: Time Domain A Rectangular Pulse Function 1.2 1 0.8 s(t) 0.6 0.4 T 0.2 0 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 t 1 −T / 2 < t < T / 2 s(t) = Derive Fourier transform on the board 0 otherwise ©Yao Wang, 2006 EE3414: Signal Characterization 18 Pulse Function: Spectrum Magnitude Spectrum of Rectangular Pulse 1.2 1 0.8 0.6 The peaks of the FT magnitude drops slowly. 0.4 This is because the pulse |S(f)| function has sharp 0.2 transition, which 0 contributes to very high frequency in the signal. -0.2 -0.4 -10 -8 -6 -4 -2 0 2 4 6 8 10 f 1 −T / 2 < t < T / 2 sin(πTf ) s(t) = ⇔ S( f ) = T = T sinc(Tf ) 0 otherwise πTf ©Yao Wang, 2006 EE3414: Signal Characterization 19 Exponential Decay: Time Domain 1 s(t)=exp(-α t), t>0); α=1 0.9 0.8 0.7 0.6 0.5 s(t) 0.4 0.3 0.2 0.1 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 t exp(−αt) t > 0 1 1 s(t) = ⇔ S( f ) = ; S( f ) = 0 otherwise α + j2πf α 2 + 4π 2 f 2 ©Yao Wang, 2006 EE3414: Signal Characterization 20 Exponential Decay: Spectrum 1 S(f)=1/(α+j 2π f),α=1 0.9 0.8 0.7 0.6 0.5 |S(f)| 0.4 The FT magnitude drops much faster than for the 0.3 pulse function. This is 0.2 because the exponential decay function does not 0.1 has sharp transition. 0 -10 -8 -6 -4 -2 0 2 4 6 8 10 f exp(−αt) t > 0 1 1 s(t) = ⇔ S( f ) = ; S( f ) = 0 otherwise α + j2πf α 2 + 4π 2 f 2 ©Yao Wang, 2006 EE3414: Signal Characterization 21 (Effective) Bandwidth 1 • fmin (fma): lowest 0.9 (highest) frequency where 0.8 the FT magnitude 0.7 is above a 0.6 threshold • Bandwidth: 0.5 B=fmax-fmin 0.4 0.3 • The threshold is often chosen with respect to 0.2 the peak magnitude, B expressed in dB 0.1 • dB=10 log10(ratio) 0 • 10 dB below peak = -10 -8 -6 -4 -2 0 2 4 6 8 10 1/10 of the peak value • 3 dB below=1/2 of the fmin fmax peak ©Yao Wang, 2006 EE3414: Signal Characterization 22 More on Bandwidth • Bandwidth of a signal is a critical feature when dealing with the transmission of this signal • A communication channel usually operates only at certain frequency range (called channel bandwidth) – The signal will be severely attenuated if it contains frequencies outside the range of the channel bandwidth – To carry a signal in a channel, the signal needed to be modulated from its baseband to the channel bandwidth – Multiple narrowband signals may be multiplexed to use a single wideband channel ©Yao Wang, 2006 EE3414: Signal Characterization 23 How to Observe Frequency Content from Waveforms? • A constant -> only zero frequency component (DC compoent) • A sinusoid -> Contain only a single frequency component • Periodic signals -> Contain the fundamental frequency and harmonics -> Line spectrum • Slowly varying -> contain low frequency