### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# Introductn to Signal Analysis ECE 201

Mason

GPA 3.94

### View Full Document

## 16

## 0

## Popular in Course

## Popular in ELECTRICAL AND COMPUTER ENGINEERING

This 254 page Class Notes was uploaded by Antonina Wuckert on Monday September 28, 2015. The Class Notes belongs to ECE 201 at George Mason University taught by Bernd-Peter Paris in Fall. Since its upload, it has received 16 views. For similar materials see /class/215014/ece-201-george-mason-university in ELECTRICAL AND COMPUTER ENGINEERING at George Mason University.

## Reviews for Introductn to Signal Analysis

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/28/15

E QE 1139 Hmitmxdmrm 1mt Shgma 57513 Prof Paris Last updated October 9 2007 Part r1 Nnr M d v r 3 gxgmnwm 1R11 ltxamp a ihom a Sigma Lecture Sums of Sinusoids of different frequency limit 0 To this point we have focused on sinusoids of identical frequency f N Xt Z Acos27rft i1 0 Note that the frequency 1 does not have a subscript i 0 Showed in phasor addition rule that the above sum can always be written as a single sinusoid of frequency f 0 We will consider sums of sinusoids of different frequencies N X ZAcos27rf t gti i1 0 Note the subscript on the frequencies f o This apparently minor difference has dramatic consequences ram x 35 n a 1 mz nm cam 71f m I ncs nuns mm mm ante n mm Dam nnm nnm n 1115137 Xt 2 COS27r2n71 i 7r2 n0 0002 0004 0006 0008 0 Times 1318mm mmw quot signals as Sums of Sinusoids o If we allow infinitely many sinusoids in the sum then the result is a square wave signal 0 The example demonstrates that general nonsinusoidal signals can be represented as a sum of sinusoids o The sinusods in the summation depend on the general signal to be represented o For the square wave signal we need sinusoids o of frequencies 2n 7 1 f and o amplitudes 2km o This is not obvious A at l i wb im W I i ignals as Sums of Sinusoids o The ability to express general signals in terms of sinusoids forms the basis for the frequency domain or spectrum representation 0 Basic idea list the ingredientsquotof a signal by specifying amplitudes and phases as well as frequencies of the sinusoids in the sum A grams mmw Sum of Sinusoids 0 Begin with the sum of sinusoids introduced earlier N Xt A0 ZAcos27rft gti i1 where we have broken out a possible constant term 0 The term A0 can be thought of as corresponding to a sinusoid of frequency zero 0 Using the inverse Euler formula we can replace the sinusoids by complex exponentials V X X Xt X0 Z 3 expozwm eXpi27rft i1 where X0 A0 and X i willlg mmm The gag mrgfsa Sum of Sinusoids cont d 0 Starting with V X X Xt X0 E exp27rft j exp727rft where X0 A0 and X Aie Z i o The spectrum representation simply lists the complex amplitudes and frequencies in the summation Xm X0707X17 l xir k7XN7fN7Xilr v r it Mr Erasing mmam E 0 Consider the signal Xt 3 5C0207r1 7 7r2 7cos507rt 7r4 0 Using the inverse Euler relationship Xt 3 gefWz expijr10t Edi2 exp7j27r1Ot 2 e i4 expijr251 ge M i exp7j27r251 0 Hence X 370 gefVZJOLgeWHOL eM4725 e quot4 25 Exercise 0 Find the spectrum of the signal Xt 6 4C01O7r1 7r3 5C0207r1 7 7r7 Lecture From TimeDomain to FrequencyDomain and back sand Frequencydomain o Signals are naturally observed in the timedomain 0 A signal can be illustrated in the timedomain by plotting it as a function of time 0 The frequencydomain provides an alternative perspective of the signal based on sinusoids 0 Starting point arbitrary signals can be expressed as sums of sinusoids or equivalently complex exponentials o The frequencydomain representation of a signal indicates which complex exponentials must be combined to produce the signal 0 Since complex exponentials are fully described by amplitude phase and frequency it is sufficient to just specify a list of theses parameters 0 Actually we list pairs of complex amplitudes A6 and frequencies f and referto this list as Xf o It is possible but not necessarily easy to find Xf from Xt this is called Fourier or spectrum analysis 0 Similarly one can construct Xt from the spectrum Xf this is called Fourier synthesis 0 Notation Xt lt gt Xf 0 Example from last time o Timedomain signal Xt 3 5cos207rt 7 7r2 7cos507rt7r4t 0 Frequency Domain spectrum XU 370 gear2 1ogevjr2r1o aw425gear47725 0 To illustrate the spectrum of a signal one typically plots the magnitude versus frequency 0 Sometimes the phase is plotted versus frequency as well 3 l 25 u m 393 a l l E 2 39 l 515 39 E y l l l 05 l l l o 20 u 20 40 o 20 o 20 40 Frequency Frequency Mme swam Wt w Why it the FrequencyD main 0 In many applications the frequency contents of a signal is very important a For example in radio communications signals must be limited to occupy only a set of frequencies allocated by the FCC 0 Hence understanding and analyzing the spectrum of a signal is crucial from a regulatory perspecti o Often features of a signal are much easier to understand in the frequency domain Example on next slides 0 We will see later in this class that the frequencydomain interpretation of signals is very useful in connection with linear timeinvariant systems 0 Example A lowpass filter retains low frequenc components of the spectrum and removes highfrequency components i wwmm WWQEW 2 05V 04 1 03 o 02 w 391 014 J 505 1 2 u95 500 Times Frequency Hz mm iw WWWWM WWQEW r 19 w W um HH Cthtupted sighal o 2 4n 6W 8W 1 Frequency Hz Tlmes Frequency to TimeDomain 0 Synthesis is a straightforward process it is a lot like following a recipe Ingredients are given by the spectrum XU X0707X17f17 X141 7 XNva7Xi7 fN Each pair indicates one complex exponential component by listing its frequency and complex amplitude lnstructionstor combining the ingredients and producing the timedomain signal 0 0 N Xt Z XnexpjZ7rfnt n7 N 0 You should simplify the expression you obtain E 0 Problem Find the signal Xt corresponding to Xf 30 e 7 2 10 I 7 eW27 10L EM4725 W4 725 lt1 mm 0 Solution X 3 elij7r239e27r10tgeiWZeii27r10t el7r4e27r25t geijw4eij27r25t 0 Which simplifies to Xt 3 5C0207r1 7 7r2 7C05O7r1 7r4 Exercise 0 Find the signal with the spectrum X0 570 267W10729T477107 gem415 geili4 15 Fm iammma mmm quot 39Tlme to FrequencyDomain o The objective of spectrum or Fourier analysis is to find the spectrum of a timedomain signal 0 We will restrict ourselves to signals Xt that are sums of sinusoids N Xt A0 ZACOS27rfT gt i1 c We have already shown that such signals have spectrum 1 1 1 1 Xm Xolor 5X1 f1 Exam EXN IN 5X1 4N where X0 A0 and X Aie Z i 0 We will investigate some interesting signals that can be written as a sum of sinusoids 0 Consider the signal Xt 2 COS27r5T cos27r4OOt 0 This signal does not have the form of a sum of sinusoids hence we can not determine its spectrum immediately will llmhl I ll nil l Hlvgh l l l1 Ill 0J5 02 quot1 llllll l l39 llm m m Tlmes lm BearVere 7 pur and pay a bear nure Wavefurm Parameters s 8192 dur NP roundUs5 H 12 A 2 rme aXs 0 113 duh xx Acos2piu1n cos2pi12n plolH1NPgtltgtlt1NP Xlabe Tmes soundscgtltgtlt1s 0 Using the inverse Euler relationships we can write COS27r5T cos27r4OOt 2 2 e2W5t 6727r5t e2W400t 6727r400t39 XU o Multiplying out yields 1 1 X E927r405t 6727r405t E612395 6727r395t39 0 Applying Euler39s relationship lets us write Xt COS27r405T COS27r395T 1 in Hmlgma mmm 0 We were able to rewrite the beat notes as a sum of sinusoids Xt COS27r405T COS27r395T 0 Note that the frequencies in the sum 395 Hz and 405 Hz are the sum and difference of the frequencies in the original product 5 Hz and 400 Hz 0 It is now straightforward to determine the spectrum of the beat notes signal Xf 4057 17 7405 13957 17 7395 2 2 2 Lecture Amplitude Modulation and Periodic Signals o Amplitude Modulation is used in communication systems 0 The objective of amplitude modulation is to move the spectrum of a signal mt from low frequencies to high frequencies 0 The message signal mt may be a piece of music its spectrum occupies frequencies below 20 KHZ o For transmission by an AM radio station this spectrum must be moved to approximately 1 MHZ 0 Conventional amplitude modulation proceeds in two steps 0 A constant A is added to mt such that A mt gt 0 for all t o ihe sum signal A mt is multiplied by a sinusoid COS27rfcf where fc is the radio frequency assigned to the station 0 Consequently the transmitted signal has the form Xt A mt COS27rch 0 We are interested in the spectrum of the AM signal 0 However we cannot compute X f for arbitrary message signals mt o For the special case mt cos27rfmt we can find the spectrum 0 To mimic the radio case fm would be a frequency in the audible range 0 As before we will first need to express the AM signal Xt as a sum of sinusoids quotUdf gt o For mt cos27rfmt the AM signal equals Xt A cos27rfmt COS27rch 0 This simplifies to Xt A COS27rch COS27r fmt COS27rch 0 Note that the second term of the sum is a beat notes signal with frequencies fm and fc 0 We know that beat notes can be written as a sum of sinusoids with frequencies equal to the sum and difference of fm and f0 Xt ACOS27rfcf COS27rfc fmt COS27rfci fmt Spectrum of Amplitude Modulated Signal o The AM signal is given by Xt ACOS27rch COS27rfc fmt COS27rfci fmt 0 Thus its spectrum is Xquot 7ch 77ch 17 C fm7 7 ifc 7 fm7 7 0 7 fm7 7 7f For A 2 fm 50 and fa 400 the spectrum of the AM signal is plotted below 1 EM E31 litude Modulated Signal 0 It is interesting to compare the spectrum of the signal before modulation and after multiplication with COS27rch o The signal 31 A mt has spectrum sir Aioii 750 7 750 0 The modulated signal Xt has spectrum X0 3400 g 7400 17 450 17 7450 117350 7 7350 0 Both are plotted on the next page 500 00 O 0 Frequency Hz Frequency Hz 0 Comparison of the two spectra shows that amplitude module indeed moves a spectrum from low frequencies to high frequencies 0 Note that the shape of the spectrum is precisely preserved o Amplitude modulation can be described concisely by stating a Half of the original spectrum is shifted by fc to the right and the other half is shifted by fc to the left 0 Question How can you get the original signal back so that you can listen to it o This is called demodulation Mam 39S Qdic Signals O A signal Xt is called periodic if there is a constant To such that Xt Xt To for all t o In other words a periodic signal repeats itself every To seconds 0 The interval To is called the fundamental period of the signal 0 The inverse of To is the fundamental frequency of the signal 0 Example 0 A sinusoidal signal of frequency f is periodic with period 0 1 l gkml a w m ni rquot 0 Consider a sum of sinusoids N Xt A0 ZAcos27rft gti i1 o A special case arises when we constrain all frequencies f to be integer multiples of some frequency f0 fiifo o The frequencies f are then called harmonic frequencies of f0 0 We will show that sums of sinusoids with frequencies that are harmonics are periodic Mamme Wm 39Sighgisare Periodic 0 To establish periodicity we must show that there is To such Xt Xt To 0 Begin with Xt To A0 211Acos27rrt To A0 291 ACOS27rft 27rfiTo 0 Now let f0 1To and use the fact that frequencies are harmonics f i f0 i eum figggl Sare Periodic 0 Then f Toifo Toiandhence Xt To A0 211Acos27rrt 27rfTo A0 211Acos27rrt 27ri 0 We can drop the 27ri terms and conclude that Xt To Xt 0 Conclusion A signal of the form N Xt A0 ZACOS27ri 01 gt i1 is periodic with period To 1f0 Migmmns undamental Frequency 0 Often one is given a set of frequencies f1 f2 fN and is required to find the fundamental frequency f0 0 Specifically this means one must find a frequency f0 and integers n1 n2 nN such that all of the following equations are met 1 n1lro f2 nz fo fN nNf0 0 Note that there isn39t always a solution to the above problem 0 However if all frequencies are integers a solution exists 0 Even if all frequencies are rational a solution exists Mwmmsz E pl 0 Find the fundamental frequency for the set of frequencies f1 121 2 27f3 51 0 Set up the equations 12 I71 0 27 I72 0 51 I73 0 0 Try the solution n1 1 this would imply f0 12 This cannot satisfy the other two equations 0 Try the solution n1 2 this would imply f0 6 This cannot satisfy the other two equations 0 Try the solution n1 3 this would imply f0 4 This cannot satisfy the other two equations 0 Try the solution n1 4 this would imply f0 3 This can satisf the other two e uations with 172 9 and n3 17 d m E 0 Note that the three sinusoids complete a cycle at the same time at T0 1f0 133 Twmoi Exercise 0 Find the fundamental frequency for the set of frequencies 1 2 f2 351 3 5 Fourier Se 39 0 We have shown that a sum of sinusoids with harmonic frequencies is a periodic signal 0 One can turn this statement around and arrive at a very important result Any periodic signal can be expressed as a sum of sinusoids with harmonic frequencies 0 The resulting sum is called the Fourier Series of the signal 0 Put differently a periodic signal can always be written in the form Xt Ao V1Acos2wifot gtI X0 Xie27rif9t IfeiIZWI39fgt with X0 A0 and X gem Eaum 3mm Fourier Semi o For a periodic signal the complex amplitudes X can be computed using a relatively simple formula 0 Specifically for a periodic signal Xt with fundamental period To the complex amplitudes X are given by 1 To T X i Xte 2quot t 0dr To 0 0 Note that the integral above can be evaluated over any interval of length To Example Square Wave 0 A square wave signal 5 Xt1 0 tlt2 1 1ltTo Xt 2 COS27r2n71 7 7r2 Xt 2 COS27r2n71 i 7r2 n0 0002 0004 0006 0008 0 s Lecture TimeFrequency Spectrum mamas av gnawt mwm39 gme l 4239 Umiiag ofSinusoid Signals 0 So far we have considered only signals that can be written as a sum of sinusoids N Xt A0 ZAcos27rft gti i1 o For such signals we are able to compute the spectrum 0 Note that signals of this form a are assumed to last forever ie for 700 lt tlt oo o and their spectrum never changes 0 While such signals are important and useful conceptually they don39t describe realworld signals accurately o Realworld signals a are of finite duration 0 their spectrum changes over time 7 My it 0 Musical notation sheet musicquot provides a way to represent realworld signals a piece of music 0 As you know sheet music 0 places notes on a scale to reflect the frequency of the tone to be played 0 uses differently shaped note symbols to indicate the duration of each tone 0 provides the order in which notes are to be played 0 In summary musical notation captures how the spectrum of the musicsignal changes over time 0 We cannot write signals whose spectrum changes with time as a sum of sinusoids o A static spectrum is insufficient to describe such signals 0 Alternative timefrequency spectrum Note C i i ii DiEiFiGiAiBiC iFrequencyHzH262i294i330i349i392i440i494i523 Table Musical Notes and their Frequencies o If we play each of the notes for 250 ms then the resulting signal can be summarized in the timefrequency spectrum below m 8 h g 1 E i3400 3 U39 2 u 300 o 8 o MATLAB has a function spectrogram that can be used to compute the timefrequency spectrum for a given signal 0 The resulting plots are similar to the one for the musical scale on the previous slide 0 Typically you invoke this function as spectrogram XX 256 128 256 fs where xx is the signal to be analyzed and fs is the sampling frequency 0 The spectrogram tor the musical scale is shown on the next slide Tm e t gram 0 The color indicates the magnitude of the spectrum at a given time and frequency 600 501 00 00 Frequency Hz 8 o 1 Time mm mrlug lgyrga 0 Objective construct a signal such that its frequency increases with time 0 Starting Point A sinusoidal signal has the form Xt Acos27rfot gt 0 We can consider the argument of the cos as a timevarying phase function IJt 27rfot gt 0 Question What happens when we allow more general functions for WI 0 For example let w 7007a2 4407rf 15 w Frequency Hz mll g39gl t ia o For a regular sinusoid IJt 27rfot gt and the frequency equals f0 0 This suggests as a possible relationship between IJt and f0 1 d f0 aw o It the above derivative is not a constant it is called the instantaneous frequency of the signal ft 0 Example For IJt 70071391 2 440m gt we find 1 131 E7007r12 440m gt 7001 220 o This describes precisely the red line in the spectrogram on the previous slide mll gglglh ia 0 Objective Construct a signal such that its frequency is initially f1 and increases linear to f2 after T seconds 0 Solution The above suggests that ifzi i T ft 1 f1 0 Consequently the phase function IJt must be if w 27r12 27rf11 gt a Note that 425 has no influence on the spectrum it is usually set to 0 Ti Constructing a Linear Chirp 0 Example Construct a linear chirp such that the frequency decreases from 1000 Hz to 200 Hz in 2 seconds 0 The desired signal must be Xt cos727r2001 2 27r10001 ECE 201 Introduction to Signal Analysis Dr BP Paris Dept Electrical and Comp Engineering George Mason University Last updated April 14 2009 U N I V E I S l TV Paris ECE 201 Intro to Signal Analysis 1 Part Introduction ECE 201 Intro to Signal Analysis Lecture Introduction ECE 201 Intro to Signal Analysis Course Overview Learning Objectives V Intro to Electrical Engineering via Digital Signal Processing Develop initial understanding of Signals and Systems Learn MATLAB Note Math is not very hard just algebra V V V ECE 201 Intro to Signal Analysis Course Overview DSP Digital processing via computers and digital hardware we will use PC s Signal Principally signals are just functions of time gt Entertainmentmusic gt Communications gt Medical Processing analysis and transformation of signals we will use MATLAB U N I V E I S l TV Paris ECE 201 Intro to Signal Analysis 5 Course Overview Outline of Topics gt Sinusoidal Signals gt MATLAB gt Time and Frequency representation of gures Signals gt Homework gt Sampling gt Filtering ECE 201 Intro to Signal Analysis Course Overview Sinusoidal Signals gt Fundamental building blocks for describing arbitrary signals gt General signals can be expresssed as sums of sinusoids Fourier Theory gt Bridge to frequency domain gt Sinusoids are special signals for linear filters eigenfunctions U N I V E I S l TV Paris ECE 201 Intro to Signal Analysis 7 Course Overview Time and Frequency gt Closely related via sinusoids gt Provide two different perspectives on signals gt Many operations are easier to understand in frequency domain ECE 201 Intro to Signal Analysis Course Overview Sampling Conversion from continuous time to discrete time Required for Digital Signal Processing Converts a signal to a sequence of numbers samples Straightforward operation gt with a few strange effects VVVV Paris ECE 201 Intro to Signal Analysis 9 Course Overview Filtering gt A simple but powerful class of operations on signals gt Filtering transforms an input signal into a more suitable output signal gt Often best understood in frequency domain Input Output ECE 201 Intro to Signal Analysis Course Overview Relationship to other ECE Courses gt Next steps after ECE 201 gt ECE 220320 Signals and Systems gt ECE 280 Circuits gt Core courses in controls and communications gt ECE 421 Controls gt ECE 460 Communications gt Electives gt ECE 410 DSP gt ECE 450 Robotics gt ECE 463 Digital Comms gt ECE 464 Filter Design masons Paris ECE 201 Intro to Signal Analysis 11 Part II Sinusoids Complex Numbers and Complex Exponentials ECE 201 Intro to Signal Analysis Sinusoidal Signals Con39lplev Exponential Signals OGGCD Lecture Introduction to Sinusoids ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Exponential Signals Complex Numbers 000 1 C c o cocoooooooo oooooooooo SQW QOQDQ The Formula for Sinusoidal Signals gt The general formula for a sinusoidal signal is Xt A cos2m t qb gt A f and qb are parameters that characterize the sinusoidal sinal gt A Amplitude determines the height of the sinusoid gt f Frequency determines the number of cycles per second gt qb Phase determines the location of the sinusoid ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex lxlumbers COll lplEEK Exponential Signals 000 c cocooo L JOCK FOODCDQQQ i iv 53OGDC39D 34000000009 xt A cos215 ft 1 Amplitude l l l l l l 0 001 002 003 004 005 0 06 007 008 009 01 Time s gt The formula for this sinusoid is Xt 3 COS27 C 500 t 714 ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers Corr lax Exponential Signals 000 00 Wm 00 36062500 QCEOCIIQQQC OQC ED QQOGDQQQOODDGQDQ OQQQQQDC DG 3000C The Significance of Sinusoidal Signals gt Fundamental building blocks for describing arbitrary signals gt General signals can be expresssed as sums of sinusoids Fourier Theory gt Provides bridge to frequency domain gt Sinusoids are special signals for linear filters eigenfunctions gt Sinusoids occur naturally in many situations gt They are solutions of differential equations of the form d2Xt W aXt O gt Much more on these pomts as we proceed M16520 ECE 201 Intro to Signal Analysis Sinusoidal Signals 0000000 Background The cosine function gt The properties of sinusoidal signals stem from the properties of the cosine function gt Periodicity cosX 27139 cosX gt Eveness cos X cosX gt Ones of cosine cos27rk 1for all integers k gt Minus ones of cosine COS7 C2K 1 1 for all integers k Zeros of cosine cos2k 1 O for all integers k gt Relationship to sine function sin X cosX 712 and cosX sinx 712 V Paris ECE 201 Intro to Signal Analysis 17 Sinusoidal Signals 0608000 Amplitude gt The amplitude A is a scaling factor gt It determines how large the signal is gt Specifically the sinusoid oscillates between A and A ECE 201 Intro to Signal Analysis Sinusoidal Signals Con39lplex Numbers x Exponential Signals U QOOG JTJUQQOGGOOODQQQ OOGOQQDDOGDGD QQQOQQQOOQ OQOO Frequency and Period gt Sinusoids are periodic signals gt The frequency f indicates how many times the sinusoid repeats per second gt The duration of each cycle is called the period of the sinusoid It is denoted by T gt The relationship between frequency and period is 1 1 fandT7 ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers Complex Exponential Signals ooo oooooe 000 00000 QQQQQOOO GQQQQOD 0000 CQOQDQQQOOODOQDQ GODQDQQGOCODQ OQOQQQOQDO Q0000 Phase and Delay gt The phase qb causes a sinusoid to be shifted sideways gt A sinusoid with phase qb O has a maximum at t O gt A sinusoid that has a maximum at t t1 can be written as Xt A cos27rft 13 gt Expanding the argument of the cosine leads to Xt A cos27rft 271171 gt Comparing to the general formula for a sinusoid reveals P q 271m and t1 2W In P1GEOR unrvsnsn lt Paris ECE 201 Intro to Signal Analysis 20 Sinusoidal Signals Commie lxlun39tloers Con39lplex Experiential Sigl lals smusoMaISbnab ooo a 00000 d 39 o QQGQ e oooeooeooooeo oooooooooo 4 Exercise 1 Plot the sinusoid Xt 2cos27r 10 t 712 between t O1 and t 02 2 Find the equation for the sinusoid in the following plot Amplitude 4 G 0 n G E 0 0001 0002 0003 0004 0005 0006 0007 0008 0009 001 Time s Paris ECE 201 Intro to Signal Analysis 22 39 QOQOOQQ Vectors and Matrices gt MATLAB is specialized to work with vectors and matrices gt Most MATLAB commands take vectors or matrices as arguments and perform looping operations automatically gt Creating vectors in MATLAB directly using the increment operator X 1210 produces a vector with elements 1 3 5 7 9 using MATLAB commands For example to read a wav file x fs wavread musicwav RjiT Paris ECE 201 Intro to Signal Analysis 23 smusoMaISbnab r39er39s a 5quot Plot a Sinusoid o0 parameters 3 50 6 phi pi4 l hCD fs 50f generate signal 5 cycles with 50 samples per cycle tt O lfs 5f XX Acos2piftt phi o 6 o 6 plot 16 plotttxx x1abel Timeus labels for X and y axis ylabel Amplitude tit1e XtHHAHCOS2pinHtHHphi ECE 201 Intro to Signal Analysis smusoMaISbnaB ooo oooooo oooo oooooooooo Con39lple lxlurnloers Exercise gt The sinusoid below has frequency f 10 Hz gt Three of its maxima are at the the following locations t1 0075 3 t2 0025 3 t3 0125 s gt Use each of these three delays to compute a value for the phase qb via the relationship qb 27rft gt What is the relationship between the phase values qb you obtain Amp itude U N l V E R S l T 0 005 01 015 02 025 03 035 05 Time s smusoMaISbnab Cmn exmumbem 39 0 con aorgnals mo coo ore OQQGD SQQOGQDOQDQ OD QQQDC DQ QCQDQ Lecture Continuous time and Discrete Time Signals Paris ECE 201 Intro to Signal Analysis 26 Sinusoidal Signals Complex Numbers Complex Exponential Signals 000 000 000000 000000 00000000 0000000 GOOU O OQQOGOODODQQQ 0000000300600 0000000000 0000 ContinuousTime Signals gt So far we have been refering to sinusoids of the form Xt A cos2m t qb gt Here the independent variable t is continuous ie it takes on a continuum of values gt Signals that are functions of a continuous time variable t are called continuoustime signals or sometimes analog signals ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers Complex Exponential Signals 000 000000 000 QGQQQQ GQQOOOOO GQQQQOD 0000 GQOQDQQQOOODOGQQ GODQDQQGOODDQ OOOOOOOOOO Q0000 Sampling and DiscreteTime Signals gt MATLAB and other digital processing systems can not process continuoustime signals gt Instead MATLAB requires the continuoustime signal to be converted into a discretetime signal gt The conversion process is called sampling gt To sample a continuoustime signal we evaluate it at a discrete set of times tn 2 nTS where gt n is a integer gt TS is called the sampling period time between samples gt fS 1TS is the sampling rate samples per second gt In MATLAB the set of sampling times tn is usually defined by a command like sampling times between 0 and 5 with sampling period Ts tt O Ts 5 Mi Paris ECE 201 Intro to Signal Analysis 28 Sinusoidal Signals Sampling and DiscreteTime Signals gt Sampling means evaluating Xt at time instances nTS and results in a sequence of samples XnTS A cos27rfnTS qb gt Note that the independent variable is now n not 1 gt To emphasize that this is a discretetime signal we write Xn A cos27rfnTS qb gt Sampling is a straightforward operation gt But the sampling rate fS must be chosen with care MGESORGE Paris ECE 201 Intro to Signal Analysis 29 Sinusoidal Signals I3 l lumloers Plot a Sinusoid Improved Parameters of sinusoid A 3 Amplitude 5 f 10 Frequency phi pi4 Phase Parameters controlling plot SamplesPerCycle 50 10 CyclesToPlot 5 StartTime O2 fs f SamplesPerCycle EndTime StartTime CyclesToPlotf 15 plot tt StartTime lfs EndTime XX Acos2piftt phi Time axis sampled signal 0 6 o 6 20 ttrxxr O PLGEORGE x1abel Time s ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers COfT39lplGK Exponential Signals coo n oeool oooooo ODOuOOUG oocoooo QO QC Q OOQGOOCDQQQ oooooooooopoo 11 0000000000 0000 Resulting Plot Amplitude o 3 Aquot l l r l 39 O2 O15 O1 005 O O 05 01 015 O 2 O 25 O 3 Time s gt The solid line indicates the continuoustime signal Xt gt The circles represent the samples that make up the MAS ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers Complex Exponential Signals ooo mooonm ODD QGC JQQQ GODOQOQC 3 GOOD QOOQDC QQOOODOQOQ QDQQGOCODC 0000000000 30000 Deciphering the MATLAB code gt The code is written to plot a specified number of cycles CyclesToPlot with a given number of samples per cycle SamplesPerCycle gt This implies that the sampling rate fS equals the product of SamplesPerCycle and frequency f gt The duration of the signal follows from the specification of the number of cycles to plot CyclesToPlot f gt With a given starting time StartTime the discrete set of time instances tn is constructed by tt StartTime lfs EndTime gt The cos function can be called with a vector as its argument to compute all desired values no loops XX 2 Acos2piftt phi mas Paris ECE 201 Intro to Signal Analysis 32 Sinusoidal Signals Complex Numbers x Exponential Signals coo ooeooo U QOOU 3r JUQQOGGOOCDQQQ OOHOQQDDOGDGD OOOOOOOOOO OQOO Some Tips for MATLAB programming gt Comment your code comments start with Oo gt Use descriptive names for variables SamplesPerCycle gt Avoid loops gt If the above MATLAB code is stored in a file say PlotSinusoidm then it can be executed by typing PlotSinusoid gt Filename must end in m gt File must be in your working directory gt or more generally in MATLAB s search path gt Type help path to learn about setting MATLAB S search path ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers Complex Exponential Signals coo ooo oooooe eeeooo eoeooooo oeeoooo oooe oeeeeeocoooeooeo ooeeoeeeocoeo 0000000000 0000 Reducing the Sampling Rate gt What happens if we reduce the sampling rate Eg by setting SamplesPerCycle 5 Amplitude 015 01 005 0 005 01 015 02 025 03 Time s gt The sampling rate is not high enough to create an accurate plot Use at least 20 samples per cycle to get goodlookinglyfg sm UNIVERSlYV ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers COlT39lplGK Exponential Signals ooo oooooo coauoooo c a moon ooeoaooeooooooeo r oeoeoeo 0000000000 00000 Very Low Sampling Rates gt The plot on the previous plot does not look nice but it still captures the essence of the sinusoidal signal gt A much more serious problem arises when the sampling rate is chosen smaller than twice the frequency of the sinusoid fS lt 21 gt Example assume we try to plot a sinusoidal signal with the following parameters Parameters of sinusoid A 3 Amplitude f 475 Frequency phi pi4 Phase Parameters controlling plot fs 500 StartTime O ampOME EndTime 02 Rg ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers Complex Exponential Signals 000 000 000080 000000 00000000 0000000 0000 CQQQDQQQOOODOGQQ 0000000000000 0000000000 00000 Very Low Sampling Rates Amplitude 0 002 004 006 008 01 012 014 016 018 02 Time s gt The resulting plot shows a sinusoid of frequency f 25Hz and phase qb 7r4 gt This is called aliasing and occurs when fS lt 21 Paris ECE 201 Intro to Signal Analysis 36 Complex Numbers UN Lecture Introduction to Complex Numbers Paris ECE 201 Intro to Signal Analysis 37 Complex Numbers 000 GDDC QQO Why Complex Numbers gt Complex numbers are closely related to sinusoids gt They eliminate the need for trigonometry gt and replace it with simple algebra gt Complex algebra is really simple this is not an oxymoron gt Complex numbers can be represented as vectors gt Used to visualize the relationship between sinusoids Paris ECE 201 Intro to Signal Analysis 38 Sinusmdal Signals Complex Numbers Complex Exponential Signals Murat a r quot39 f u Owe uu COOL 30000000 00 00000000 00000 An unpleasant Example gt A typical problem Express Xt 3 cos27rft 4 cos2m t 712 in the form A cos27rft qb gt Solution Use trig identity cosX y cosx cosy sinx siny on second term gt This leads to Xt 3cos2m t 4 COS27 C COS7 C2 4 sin2m t sinnZ 3 COS27 C 4 Sih27 gt Compare to what we want W A 00827Tftltb More Unpleasantness gt We can conclude that A and qb must satisfy A cosqgt 3 and A sinqb 4 We can find A from A2 cos2qgt A2 sin2qb A2 V 9 16 25 gt Thus A 5 gt Also sin qb 4 COS tanqgt 3 gt Hence qb s 530 7 C gt And Xt 50027 Cftl 530 V With complex numbers problems of this type are much IVYKiri U N I V E I 5 I 1V ECE 201 Intro to Signal Analysis Complex Numbers Con39lplex Exponential Signals quotDGODCOQQQ 03300 The Basics gt Complex unity j 1 gt Complex numbers can be written as ZXjy This is called the rectangular or cartesian form gt X is called the real part of z X Rez gt y is called the imaginary part of z y mz gt 2 can be thought of a vector in a twodimensional plane gt Cordinates are X and y gt Coordinate system is called the complex plane ECE 201 Intro to Signal Analysis Complex Numbers goo CQt 0000000 0 OQQQQQCQDQ npiex Exponenti al Signals ooocoooooooooooo Illustration The Complex Plane lm l jr l ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers Con39iplex EXpOl iei illal Signals ooo coo cocooo oooooooo L n JQQU CiOGGOOODGODCDQQQ i iv 58013000 0000000009 00000 Euler s Formulas gt Euler s formula provides the connection between complex numbers and trigonometric functions eP COSlt j singb gt Euler s formula allows conversion between trigonometric functions and exponentials gt Exponentials have simple algebraic rules gt Inverse Euler s formulas el e jq cosgb 2 Compbeumbem coo oooooooo oooooooooooooooo ooooo Polar Form gt Recallzxjy gt From the diagram it IT follows that 1r 2 rcosgb jr Singb gt And by Euler s y rsingb relationship l gt Re I r X rcosgb z r cow 1smlt gtgt Z r E gt This is called the polar jr form Paris ECE 201 Intro to Signal Analysis 44 Sinusoidal Signals Complex Numbers x Exponential Signals coo coo oooooo oooooooo GOOU oooooooooooooooo ooooooooooooo doc oooooo ooooo Converting from Polar to Cartesian Form gt Some problems are best solved in rectangular coordinates while others are easier in polar form gt Need to convert between the two forms gt A complex number polar form 2 r ell5 is easily converted to cartesian form 2 rcosc jrsinltgb gt Example 4e7T3 4COS7 C3 j4Sin7 C3 4j4 2j39239 masons ECE 201 Intro to Signal Analysis Sinusoidal nals Complex Numbers Complex Exponential Signals 39 GOO cocoon DC QQIZ JQQQ OOOOOOOO GIZ JQQQOD 03th CQOQDQQQOOODOGDQ 3000003000000 OQQQQQOQDO QOQQQ Converting from Cartesian to Polar Form gt A complex number 2 X jy in cartesian form is converted to polar form via tangb and gt The computation of the angle qb requires some care gt One must distinguish between the cases X lt O and X gt O arctan if X gt 0 9b 2 z arctanX7t IfXltO gt If X O qb equals 7 C2 or 739C2 depending on the sign of y unnvsnsltv ECE 201 Intro to Signal Analysis Complex Numbers 1 1 Slgrlals 53 J 00000000 3 r r v Exercise gt Convert to polar form 1 Z1j 2 23j 3 Z 1 j gt Convert to oartesian form 1 z 3e f37t4 Paris ECE 201 Intro to Signal Analysis 47 Complex Numbers Lecture Complex Algebra ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers x Exponential Signals ooo coo oooooo oooooooo goon oooooooooooooooo ooooooooooooo dooooooooo ooooo Introduction V All normal rules of algebra apply to complex numbers One thing to look for j j 1 Some operations are best carried out in rectangular coordinates gt Addition and subtraction gt Multiplication and division aren t very hard either Others are easier in polar coordinates gt Multiplication and division gt Powers and roots V V V gt New operation conjugate complex A little more subtle absolute value V ECE 201 Intro to Signal Analysis Sinusoidal nals Complex Numbers Complex Exponential Signals 39 GOO oooooo DC QQC JQQQ 30000000 3060000 C3300 OOOOOOOOOOOOOOOO 3000003000000 OQOQQQOQDO QOQOQ Conjugate Complex gt The conjugate complex 2 of a complex number 2 has gt the same real part as 2 Re2 Re2 and gt the opposite imaginary part lm2 lm2 gt Rectangular form lfzzxjythen 2 X jy gt Polar form lf2 reqj then 2 re kP gt Note 2 and 2 are mirror images of each other in the complex plane with respect to the real axis ECE 201 Intro to Signal Analysis SmummhlsmnMs Compbeumbms ooo ooo oooooo oooooodo 1 n Exponential Sigl lals J OOOOOOOOOOOOOOOO 1 I DU331300 CAUUDQQDQOQ 7101300 Illustration Conjugate Complex lm jr Compbeumbem goo oooooooo oooooooooooooooo ooooo Addition and Subtraction gt Addition and subtraction can only be done in rectangular form gt If the complex numbers to be added are in polar form convert to rectangular form first Le f Z1 X1 IY1 and Z2 X2 IY2 gt Addition Z1 Z2 X1X2Y1Y2 gt Subtraction Z1 Z2 X1 X2 104 Y2 EORGE gt Complex addition works like vector addition Paris ECE 201 Intro to Signal Analysis 52 SmummhlsmnMs Compbeumbms ooo oooooo GOG OOOOOOOOOOOOOOOO QQDQ QC QC JQODOGQ Illustration Complex Addition lm Z2 Z1Z2 gtRe ECE 201 Intro to Signal Analysis Compbeumbem ooo oooooooo oooooooooooooooo ooooo Multiplication gt Multiplication of complex numbers is possible in both polar and rectangular form gt Polar Form Let Z1 2 r1 ell and 22 r2 ei 2 then 2122 r1 r2 39 expjqgt1 gt Rectangular Form Let 21 x1 jy1 and 22 X2 IY2 then Z1 3922 2 X1 x1x2 12y1y2 131 y2 jX2y1 X1X2 Y1Y2 1ltX1Y2XZY139 gt Polar form provides more insight multiplication involves rotation in the complex plane because of qb1 qbg ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers Con39iplex Exponential Signals GOO GOG 00G GOODDQ ODODDQGO COu39 OOOOOOOOOOOOOOOO OOQOQ 380G300 n Ci UDQOQQDQOQ QQDO Absolute Value gt The absolute value of a complex number 2 is defined as lzl ZZ thus zl2Zz gt Note zl and lle are realvalued gt In MATLAB abs 2 computes lzl gt Polar Form Let z r ell 2 22re re j r2 gt Hence lzl r gt Rectangular Form Let z X jy lle gawky 2 X2quot quotWW x y ECE 201 Intro to Signal Analysis Compbeumbem ooo cooooooo oooooooooooooooo oooooooooo ooooo Division gt Closely related to multiplication Z1 Z12 Z12 Z4EF gt Polar Form Let Z1 2 r1 em1 and 22 r2 ei 2 then 399XP b1 ltP2 gt Rectangular Form Let Z1 2 X1 jy1 and 22 X2 jy2 then 22 lZ2l2 Z m X22y2 X1 X2Y1Y2 X1Y2X2Y1 EORGE g m Paris ECE 201 Intro to Signal Analysis 56 Complex Numbers Milnentlal Signals 3C 00000000000 Exercises gt For Z1 2 3e7T4 and 22 2e j7i2 compute 1 Z1 22 2 Z1 3922 and 3 21 Give your results in both polar and rectangular forms Paris ECE 201 Intro to Signal Analysis 57 Complex Numbers L 4114quot 0000 OOOOOOOOOOO x U Lecture Complex Algebra Continued Paris ECE 201 Intro to Signal Analysis 58 39dal Signals 0000000 V 39 3 3 i Q Q Q R Good to know gt You should try and remember the following relationships and properties gt 92 1 gt 97T 1 Gin2 j e j7T2 j gt le 1 for all values of qb expltjltqgt2ngtgt err Paris ECE 201 Intro to Signal Analysis 59 Sinlisoiolal Signals Complex Numbers 39 00quot W OOOOOOOOOOOO F 0600000 QQQQQ Powers of Complex Numbers gt A complex number 2 is easily raised to the nth power if z is in polar form gt Specifically z r e rn gt The magnitude r is raised to the n th power gt The phase qb is multiplied by n gt The above holds for arbitrary values of n including gt n an integer eg 22 n a fraction eg 212 n a negative number eg z 1 12 1 n a complex number eg z Mam VVV ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers Complex Exponential Signals coo coo cocooo oooooooo H La OOOOOOOOOOOOOOOO Tiff ODOGDCD JOGU 0000000009 0000 Roots of Unity gt Quite often all complex numbers 2 solving the following equation must be found gt Here N is an integer gt There are N different complex numbers solving this equa on gt The solutions have the form Z92 NfornO12N 1 gt Note that ZN e27m 1 gt The solutions are called the N th roots of unity gt In the complex plane all solutions lie on the unit circle anduwm ECE 201 Intro to Signal Analysis Complex Numbers Corr lex Exponential Signals W 000 OD QQOQOOQG OOOOOOOOOOOOOOOO 0Q QQQDQDQ QOQOQ Roots of a Complex Number gt The more general problem is to find all solutions of the equa on I ZN r e f gt In this case the N solutions are given by qb27m Z r1Nexpj N fornO12N 1 Paris ECE 201 Intro to Signal Analysis 62 Compbeumbem G D a oooeoooo OOOOOOOOOOOOOOOO QQDQ Example Roots of a Complex Number gt Example Find all solutions of Z5 1 gt Solution gt Note 1 em ie r 1 and qb 71 gt There are N 5 solutions gt All have magnitude 1 gt The five angles are 715 3715 5715 7715 9715 ECE 201 Intro to Signal Analysis Compbeumbem Com WxExpmMNMMlSMnMS goo oooeoooo oooooooooooooooo ooooo 1 E g 1 1 1 m E l g ECE 201 Intro to Signal Analysis 300430000ij Two Ways to Express cosgb gt First relationship cosqb Ree gt Second relationship inverse Euler eP e cosqb T gt The first form is best suited as the starting point for problems involving the cosine or sine of a sum gt cosrx 3 gt The second form is best when products of sines and cosines are needed gt cosrx cos3 gt Rule of thumb look to create products of exponentials ly gg U N I V E R S I TV Paris ECE 201 Intro to Signal Analysis 65 Sinusoidal Signals Complex Numbers r 39 ooc 3quot3 gt Show that cosX y equals cosX cosy sinx siny cosXy ReeXY ReeX ey Recosx jsinltxgtgt cosy jsinltygtgt n Recosx cosy sinx siny jcosX si y sinX cosy cosX cosy sinx siny U N l V E I S I TV Paris ECE 201 Intro to Signal Analysis 66 xarglnenilal Sigl lals Complex Numbers ZDQQQ Example gt Show that cosx cosy equals COSX y COSX y cos X cos y e x 26 e y 2 eXy e X y eX y e Xy 4 eXy e IXy eX y e IX y cosxy COSX y ECE 201 Intro to Signal Analysis 67 Com lex Numbers L Exercises gt Simplify 1 08 2 m m4 gt Advanced 1 j 2 cosj mEsORGE Paris ECE 201 Intro to Signal Analysis 68 Shweomalsmnah ope oo ooo Compbeumbem QC Cquot DO ODCOQQQ QC 3000009 Lecture Complex Exponentials ECE 201 Intro to Signal Analysis Complex lxlumtglers Complex Exponential Signals 00 000000 oooeoooo 0000000 oooeoooooooooooo ooooooooooooo ooooc Introduction gt The complex exponential signal is defined as Xt Aexpj27rft 45 gt As with sinusoids A f and qb are realvalued amplitude frequency and phase gt By Euler s relationship it is closely related to sinusoidal signals Xt A COS27 C qb jA Sih27 qb gt We will leverage the benefits the complex representation provides over sinusoids gt Avoid trigonometry gt Replace with simple algebra gt Visualization in the complex plane ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers Complex Exponential Signals ooo oooooo u coo39 ooooooomo quot r ooooooo n a o oooooooooo ooooo Complex Plane Xt1expj27t8t 7T4 t l 1 r 087 til w r r i i O N 4 lmagMaw ta i7 ECE 201 Intro to Signal Analysis Complex Numbers Complex Exponential Signals GOO QQOQQQQG 6060000 CQOQDQQQOOODGQDQ QQDQDQQGOCOQQ 0Q QQQDQDG QOOOQ OOOOOO Expressing Sinusoids through Complex Exponentials gt There are two ways to write a sinusoidal signal in terms of complex exponentials gt Real part A 0032fo qb ReA expj27tft gb gt Inverse Euler Acos27rftqgt expj27tftgb exp j27rftgb gt Both expressions are useful and will be important throughout the course ECE 201 Intro to Signal Analysis Sinusoidal Signals Con39iplex lxlumbers Complex Exponential Signals DOD DOD 000000 000000 00000000 OGDDOOQ GOOU O OQQOGOODODQQQ 0000000000000 5096000000 0000 Phasors gt Phasors are not directedenergy weapons first seen in the original Star Trek movie gt That would be phasers gt Phasors are the complex amplitudes of complex exponential signals Xt Aexpj27tff 45 Ateqj expj27tff gt The phasor of this complex exponential is X Ae gt Thus phasors capture both amplitude A and phase 45 ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers Complex Exponential Signals 000 000 000000 000000 00000000 0000000 0000 GQDQDQQQOOOQOGQQ 0000000000000 0000000000 00000 From Sinusoids to Phasors gt A sinusoid can be written as Acos2nft gb expj27rff gb exp j2nft gb gt This can be rewritten to provide 394 P ACOS27 C 45 expj27tff Ae exp j27tft 2 2 gt Thus a sinusoid is composed of two complex exponentials gt One with frequency f and phasor Af gt rotates counterclockwise in the complex plane gt one with frequency f and phasor A9744 gt rotates clockwise in the complex plane gt Note that the two phasors are conjugate complexes of each other uNlVERSlYV ECE 201 Intro to Signal Analysis Complex Exponential Signals Exercise gt Write Xt 3CDS27T10t 713 as a sum of two complex exponentials gt For each of the two complex exponentials find the frequency and the phasor Paris ECE 201 Intro to Signal Analysis 75 Far What does this MATLAB code do NumPoints 500 tt O NumPoints NumPoints tt goes from 0 to l UnitCircle expj2pitt plotUnitCircle axis square ECE 201 Intro to Signal Analysis Complex Exponential Signals oooooo r 0000000 00 39 70 0000000000000 oooooooooo ooooo MATLAB Scripts gt MATLAB scripts simply contain a sequence of MATLAB commands gt They behave exactly as if the sequence of commands was typed in the command window gt All variables in the workspace can be accessed by the script gt New variables created by the script are visible in the workspace gt Get in the habit of documenting your scripts gt At a minimum the first line should be of the form ScriptName very brief decscription of script gt This is clled the H1 ine and makes your script available to MATLAB s help system gt A more detailed description should follow immediately UNIVERSITY Paris ECE 201 Intro to Signal Analysis 77 Sinusoidal Signals 1 Complex Exponential Signals 000 z t oooooo am i ooooooo t 01 4 39 c A GOOQDC tOC OGDDQ DDOQG The Full MATLAB script PlotUnitCircle Script file to plot a circle of radius one A circle of radius one is plotted in the current figure window The script relies on the fact that expj2pit defines a unit circle i complex plane Furthermore it exploits that the plot command with a single complex valued argument plots the real versus the imaginary p o0 o0 o0 o0 o0 o0 o0 o0 o0 Syntax PlotUnitCircle NumPoints 500 tt O NumPoints NumPoints tt goes from 0 to l UnitCircle expj2pitt plotUnitCircle axis square n1GEORGE UNIVERSI IV ECE 201 Intro to Signal Analysis Complex Exponential Signals oooooo 000000 0000900000000 MATLAB Functions gt MATLAB s functionality can be expanded by writing your own functions gt Follow these rules to write a new function gt The very first line must be of the form function outl out2 MyFunctioninl in2 V The keyword function is required A vector of formal output parameters follows the word function gt No brackets are required for functions with only one output After the equal sign follows the name of the function gt The function must be stored in a file with the name of the function followed by m here MyFunctionm A list of formal input parameters follows in parentheses gt Document your function V V V Paris ECE 201 Intro to Signal Analysis 79 Sinusoidal Signals 1 3 t Complex Exponential Signals 000000 The Header of a MATLAB function function y DoubleMex DoubleMe double the value of the input This function doubles the value of its input The input may be a scalar vector or matrix and the result will be of the same dimension as the input Syntax y DoubleMex o0 o0 o0 o0 o0 o0 o0 o0 o0 ECE 201 Intro to Signal Analysis 39dal Signals f Complex Exponential Signals cocooo 00 0000900000000 V 39 3 3 i 0 i Q Q R The Body of a MATLAB Function Inside a MATLAB function workspace variables are not available gt Any workspace variables needed inside the function must be passed as input parameters All variables inside a function are local they disappear when the function finishes gt Variables needed in the workspace must be passed as output parameters All output variables must be given a value It is good coding practice to check that a function is given the correct input values V V V V Paris ECE 201 Intro to Signal Analysis 81 Sinusoidal Signals quot Complex Exponential Signals 006 00 OO GQGQIDQQQOC ODQ The Body of a MATLAB function Check inputs if nargin l error FunctionHDoubleMeurequiresuexactlyuoneuinput end if nargout gt 1 error FunctionHDoubleMeucathaveHatumostuoneuoutputuargument end Compute result y 2X Paris ECE 201 Intro to Signal Analysis 82 Sinusoidal Signals Complex lxlumbers Complex Exponential Signals ooo oooooo oooooo 7 oooooom COL DOCDIDCDQQQ OOOOOOOOOOOO n d o oooooooooo ooooo Lecture The Phasor Addition Rule ECE 201 Intro to Signal Analysis Complex Numbers Complex Exponential Signals GOO ooooob oooooooo ooooooo oooooooooooooooo ooooooooooooo oo ooooooo ooooo Problem Statment gt It is often required to add two or more sinusoidal signals gt When all sinusoids have the same frequency then the problem simplifies gt This problem comes up very often eg in AC circuit analysis ECE 280 and later in the class chapter 5 gt Starting point sum of sinusoids Xt A1COS27Tft 1 AN cos2m t M gt Note that all frequencies fare the same no subscript gt Amplitudes A phases qb are different in general gt Shorthand notation using summation symbol 2 N Xt Z Acos271ff qbi ECE 201 Intro to Signal Analysis Sinusoidal Signals Con39iplex lxlumbers Complex Exponential Signals ooo coo oooooo 000000 00000060 OODDOOQ CHIij JOEDOQOOGOODODQQQ 0000000000000 0000000000 0000 The Phasor Addition Rule gt The phasor addition rule implies that there exist an amplitude A and a phase qb such that N Xt Z A COS27 C qbi A cos2m f 45 i1 gt Interpretation The sum of sinusoids of the same frequency but different amplitudes and phases is gt a single sinusoid of the same frequency gt The phasor addition rule specifies how the amplitude A and the phase qb depends on the original amplitudes A and qbi gt Example We showed earlier by means of an unpleasant computation involving trig identities that xt 3 COS27 C 4 COS27Tfti 712 2 5cos27tft539G ORGE ECE 201 Intro to Signal Analysis Sinusoidal Signals Complex Numbers Complex Exponential Signals GOO oooooo oooooooo ooooooc ow oooooooooooooooo ooooooooooooo oooooooooo ooooo Prerequisites gt We will need two simple prerequisites before we can derive the phasor addition rule 1 Any sinusoid can be written in terms of complex exponentials as follows Acos27tft p ReAe2 ReAe e2 Recall that As is called a phasor complex amplitude 2 For any complex numbers X1X2 XN the real part of the sum equals the sum of the real parts N N Re Ex Z ReX i1 i1 gt This should be obvious from the way addition is defined for complex numbers P1GEORGE X1 114 T X2 IY2X1X2Y1Y2 U N l V E R S l YV Paris ECE 201 Intro to Signal Analysis Complex Exponential Signals Deriving the Phasor Addition Rule gt Objective We seek to establish that N Z A COS27 C qbi A COS27 C qb i1 and determine how A and qb are computed from the A and bi Paris ECE 201 Intro to Signal Analysis 87 Com lex Exponential Signals a l 11 OOOOOOOOOOOOO Deriving the Phasor Addition Rule gt Step 1 Using the first prerequisite we replace the sinusoids with complex exponentials Z 1Aicos2nftqbi 2 EL ReAe27T i 21ReAe ie27I Paris ECE 201 Intro to Signal Analysis 88 Sil usoidal Signals f Complex Exponential Signals cocci or Wquot r 0 0000 0000000 4 0008000090 Deriving the Phasor Addition Rule gt Step 2 The second prerequisite states that the sum of the real parts equals the the real part of the sum N N I I Z ReAie biel27fft Re 2 Aie e2nrt i1 i1 Paris ECE 201 Intro to Signal Analysis 89 Complex Exponential Signals oooooo ooooooo OOOOOOOOOOOOO Deriving the Phasor Addition Rule gt Step 3 The exponential emf appears in all the terms of the sum and can be factored out N N I 1 Re ZAiePie27Ift Re ZAiegb eI27rft i1 i1 gt The term 2 Aiei i is just the sum of complex numbers in polar form gt The sum of complex numbers is just a complex number X which can be expressed in polar form as X Ae gt Hence amplitude A and phase qb must satisfy Ae P ZAie Pi 39 1 I ECE 201 Intro to Signal Analysis Complex Exponential Signals Deriving the Phasor Addition Rule gt Note gt computing 2 Aiei i requires converting Aiei i to rectangular form gt the result will be in rectangular form and must be converted to polar form AeP Paris ECE 201 Intro to Signal Analysis 91 Com lex Exponential Signals a l 1339 OOOOOOOOOOOOO Deriving the Phasor Addition Rule gt Step 4 Using Aei 2 EL Aiei i in our expression for the sum of sinusoids yields ReZi1Aeiqgtiei2n ReAe4 e2 Re warm A COS27 C qb gt Note the above result shows that the sum of sinusoids of the same frequency is a sinusoid of the same frequency mans UNIVERSITY Paris ECE 201 Intro to Signal Analysis 92 Sinusoidal Signals Con39ipiex Numbers Complex Exponential Signals ooo coo oooooo oooooo oooooooo ooooooo 39 ooooooooooooooeo 0000000000000 000 0030000000 OQOO Applying the Phasor Addition Rule gt Applicable only when sinusoids of same frequency need to be added gt Problem Simplify Xt A1COS2739Cfti qb1 AN cos2m t W gt Solution proceeds in 4 steps 1 Extract phasors X AiePi for i 1N 2 Convert phasors to rectangular form X AcosqbjAsinqb for i 1N 3 Compute the sum X 2 X by adding real parts and imaginary parts respectively 1 4 Convert result X to polar form X Ae gt Conclusion With amplitude A and phase qb determined in the final step X t Acos 27Tft quotquotquotquotquotquotquot quot ECE 201 Intro to Signal Analysis Sinusoidal Si nals Complex Plumbers Complex Exponential Signals 003 000 QQQDDQ QQQQQQ GQQQQOOO GQQQQOD 0300 CQOQDQQQOOODOGDQ OOOOOOOOOOOOO OQOQQQOQDO Q0000 Example gt Problem Simplify Xt 3 COS27 C 4 cos27tft 712 gt Solution 1 Extract Phasors X1 390 3 and X2 497 2 Convert to rectangular form X1 3 X2 4 3 Sum XX1 X2 34 4 Convert to polar form A x 32 4 5 and qb arctan s 530 7 C gt Resu Xt 5 cos2m t 530 ECE 201 Intro to Signal Analysis Complex Exponential Signals C OOOOOOOOOOOO Exercise gt Simplify TC 371 Xt10 cos20m Z 10cos20m T 20 cos20m gt Answer Xt 1of2cos2om n mESORGE Paris ECE 201 Intro to Signal Analysis 95 Part III Spectrum Representation of Signals Paris ECE 201 Intro to Signal Analysis 96 lgnals TitheDormant and Frequency Dornain Periodic Signals o Lecture Sums of Sinusoids of different frequency Paris ECE 201 Intro to Signal Analysis 97 Introduction gt To this point we have focused on sinusoids of identical frequency f N Xt ZAicos27rff 45 i1 gt Note that the frequency fdoes not have a subscript i gt Showed via phasor addition rule that the above sum can always be written as a single sinusoid of frequency f mans UNIVERSITY Paris ECE 201 Intro to Signal Analysis 98 Sum of Sinusoidal Signals TimeDomain and Frequency Domain Periodic Signals Tlme Frequency Spectr rrrri 000 0 Ci coo oooooooo ooooo GDQQQQQ QQQQ QC QC QQ QQQQOQC OOQ Introduction gt We will consider sums of sinusoids of different frequencies N Xt ZAicos27tff gbi i1 gt Note the subscript on the frequencies f gt This apparently minor difference has dramatic consequences ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals Time Dom ain and FrequethDomain Periodic Signals TimeFrequency Spectrum DVD 3 U OOQQQDQG OQQQG GOQQQQ Xt gcos27rft 7T2 cos2713ft 712 15 l 47 cos21 ft 152 7 43 1 cos21 3ft 152 Sum of Sinusoids Amplitude r r r r 001 002 003 004 005 006 BIGEORGE Time s ECE 201 Intro to Signal Analysis n Sum 0f Sinusoidal Signals TirneDm nain and FreqllemyDomall l Periodic Signals iime Heallenmi Specil um 0 accesses QQQ Q Sum of 25 Sinusoids 25 Xt r12 cos2n2n 1ft 712 15 057 Amplitude o l l GEORGE 39 0 0 01 0 02 003 004 0 05 0 06 1 145 Time s ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals quot 39 39 Domain andi FrequennyDumain as 0000 mi as m OQQQ a OOQQQ MATLAB Sum of 25 Sinusoids f 50 fs 200f generate signals 5 cycles with 50 samples per cycle tt O lfs 3f xx zerossizett for kk 125 XX 42kk lpicos2pi2kk lftt pi2 XX end ECE 201 Intro to Signal Analysis SuntomeusoMalenab TimeDon39tain and Frequei ioy Domairi Periodic Signals Time Frequency Spectrum 00 ooo o 0000 ooo do Cl oooooooo ooooo ooooooo QQQQGQ 34000 GQTDQOQUOQQ MATLAB Sum of 25 Sinusoids gt The for loop can be replaced by kk 125 XX 4 2kk lpi cos2pi2kk lftt pi2 ECE 201 Intro to Signal Analysis SuntomeusoMalenab oo oooo TimeDom ain and Freqiiehoy omain Periodic Signals Tin re equenoy Spectrum coo o o ooo Gooboooo DQQQD oo ooooooo oooo Qooooo oooo oooooooooo Nonsinusoidal Signals as Sums of Sinusoids gt If we allow infinitely many Sinusoids in the sum then the result is a square wave signal gt The example demonstrates that general nonsinusoidal signals can be represented as a sum of Sinusoids gt The sinusods in the summation depend on the general signal to be represented gt For the square wave signal we need Sinusoids gt of frequencies 2n 1 f and gt amplitudes W gt This is not obvious gt Fourier Series ECE 201 Intro to Signal Analysis TimeDomain and Frequel icy Domain Periodic Signals 000 000 Time Frequency Spectrum Q Q QOOQOQDQ 000007 ODQQQQQ QQQQ QQQQGQ QQQQOOUOQQ Nonsinusoidal Signals as Sums of Sinusoids gt The ability to express general signals in terms of sinusoids forms the basis for the frequency domain or spectrum representation gt Basic idea list the ingredients of a signal by specifying gt amplitudes and phases as well as gt frequencies of the sinusoids in the sum ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and FrequencyDomain 0Q coo poop coo 0000000 oooooooooo Periodic Signals Tin39leerequency Spectrum o o ooopobop ooooo G000 oooooo The Spectrum of a Sum of Sinusoids gt Begin with the sum of sinusoids introduced earlier N Xt A0 ZAicos27rft 45 i1 where we have broken out a possible constant term gt The term A0 can be thought of as corresponding to a sinusoid of frequency zero gt Using the inverse Euler formula we can replace the sinusoids by complex exponentials xf X g ex 3927Tft ex 3927Tff O 1 2 p I I 2 p j I 39 GEORGE where X0 A0 and X Aiel i ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDormant and Frequency Dorrlairl Periodic Signals Tlme Frequency Spectrum 391 O OGOQOQDCE OOQOQ QC IQQ DCAQQQQ The Spectrum of 3 Sum of Sinusoids cont d gt Starting with X39 X Xt 2 X0 Z exp12m t 7 exp 127Ift 1 where X0 A0 and X Aiei i N gt The spectrum representation simply lists the complex amplitudes and frequencies in the summation X1 Sum of Sinusoidal Signals oo ime Frequency Spectrum oooo wooooo Example gt Consider the signal Xt 3 5cos20m 712 7cos50m 714 gt Using the inverse Euler relationship Xt 3 e j 2 expj27110t I gem2 exp j27110t gem4 expj2n25t ge j i exp j27125t 3 0 gel jn2I1O gain2 1O gem4 25 gear4 25 ECE 201 Intro to Signal Analysis Pei ladle t lilie Fl SQUE llcy i Sum of Sinusoidal Signals Q Ca 0 Exercise gt Find the spectrum of the signal Xt 6 4cos10m 713 5cos20m 717 ECE 201 Intro to Signal Analysis Lecture From TimeDomain to Frequency Domain and back ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and FrequencyDomain Periodic Signals Time Frequency Spectrum G O OOOOOQOQ 00000 QQQO QQQQGO Timedomain and Frequencydomain gt Signals are naturally observed in the timedomain gt A signal can be illustrated in the time domain by plotting it as a function of time gt The frequencydomain provides an alternative perspective of the signal based on sinusoids gt Starting point arbitrary signals can be expressed as sums of sinusoids or equivalently complex exponentials gt The frequencydomain representation of a signal indicates which complex exponentials must be combined to produce the signal gt Since complex exponentials are fully described by amplitude phase and frequency it is sufficient to just specify a list of theses parameters gt Actually we list pairs of complex amplitudes Me and frequencies fand refer to this list as Xf M3 U N l V E R S l TV ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and FrequencyDomain Periodic Signals TimeFrequency Spectrum 00 OQO w G QGQQ 0C0 09000060 00000 00 0000000 0000 QOOGOQ OQOO OOOOOOQQQQ Timedomain and Frequencydomain gt It is possible but not necessarily easy to find X f from Xt this is called Fourier or spectrum analysis gt Similarly one can construct Xt from the spectrum Xf this is called Fourier synthesis gt Notation Xt lt gt Xf gt Example from last time gt Timedomain signal Xt 3 500320712 712 7cos507rt 714 gt Frequency Domain spectrum Xf 30 Ear210 GinZI 1OI EM425 g W 4 25 co NIO I ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and FrequencyDomain Periodic Signals Time Frequency Spectrum 00 o o oooo oooooooo ooooo GO ODQQQOQ QQQO QQQQGQ OOQO QOQQQQQOQD Plotting a Spectrum gt To illustrate the spectrum of a signal one typically plots the magnitude versus frequency gt Sometimes the phase is plotted versus frequency as well ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and FrequencyDomain Periodic Signals TimeFrequency Spectrum so 000 a o L QQQC QQO ODQDQDQG 00000 00 0300000 0000 QQOQOO OQQO OOOOOOQQQQ Why Bother with the FrequencyDomain gt In many applications the frequency contents of a signal is very important gt For example in radio communications signals must be limited to occupy only a set of frequencies allocated by the FCC gt Hence understanding and analyzing the spectrum of a signal is crucial from a regulatory perspective gt Often features of a signal are much easier to understand in the frequency domain Example on next slides gt We will see later in this class that the frequencydomain interpretation of signals is very useful in connection with linear timeinvariant systems gt Example A lowpass filter retains low frequency components of the spectrum and removes highfrequency components ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and FrequencyDomain Periodic Signals Time Frequency Spectrum C 0 OOOOGQOQ OC IQOO ODQQQOQ QQQO QOOQGQ QOQQOOUOOQ 2 1 5 05 o 1 047 05 t t quotg E I I E 0 5 E 8 lt1 0 05 01 1 15 0 2 39 i 01 i i i O 05 1 15 2 490 495 500 505 510 P GEORGE Time 8 Frequency Hz u N I v E H I H ECE 201 Intro to Signal Analysis TimeDomain and FrequencyDomain Periodic Signals TimeFrequency Spectrum 00 O Q 000 09600000 00on 0000000 0000 QQOQOQ eeooeoeeee Example Corrupted signal 5 j j gt Amplitude Spectrum l 01 00 I l U l 05 w 577 r r r r O 05 1 15 2 500 550 600 P GEORGE Time 8 Frequency Hz ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signais TimeDomain and FrequencyDomain Periodic Signais Tii iie Frequency Spectrum GO 000 o o 000 000 oooooooo ooooo GO DQQQQQQ QDQQ DQOQQQ QODQ GODQUQQOQQ Synthesis From Frequency to TimeDomain gt Synthesis is a straightforward process it is a lot like following a recipe gt Ingredients are given by the spectrum Xf Xo0X1zf1X1z f1z XN fN XXz fN Each pair indicates one complex exponential component by listing its frequency and complex amplitude gt Instructions for combining the ingredients and producing the timedomain signal Xt f Xnexpj27rfnt n N GEORGE gt Always srmplify the expressron you obtain Paris ECE 201 Intro to Signal Analysis 117 Sum of Sinusoidal Signals TimeDomain and FrequencyDomain Periodic Signals iine Frequency Spectrum QQQQ o quot quot i i quot COD O 06 J a l u 7 iQQOOQ OQQQ Example gt Problem Find the signal Xt corresponding to Xt 30 gear210 gem2 10 gar4 25 gear4 25 gt Solution Xt 3 e jn2e2mor gem2642mm ei7t4e27t25t ge jn4e j2n25t gt Which simplifies to Xt 3 5008207Tt 712 7COS50739Ct 714 ECE 201 Intro to Signal Analysis m at Sinusciclal E lgnals TimeDomain and FrequencyDomain Pericdic Signals Exercise gt Find the signal with the spectrum Xf 50 2e f7I4 10 2e 7I4 10 gem4 15 ge f i 15 Paris ECE 201 Intro to Signal Analysis 119 Lecture Spectrum Analysis From Time to Frequency Domain ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and FrequencyDomain Periodic Signals Time Frequency Spectrum G O OOOOOQOQ 00000 QQQO QOQQGG QOQQOOQOOQ Analysis From Time to FrequencyDomain gt The objective of spectrum or Fourier analysis is to find the spectrum of a timedomain signal gt We will restrict ourselves to signals Xt that are sums of sinusoids N Xt A0 ZAicos27rft 45 i1 gt We have already shown that such signals have spectrum 1 1 1 1 XOO 5X11 f1 1 I f1 1 I EXN fN EXN where X0 A0 and X AiePi gt We will investigate some interesting signals that can be written as a sum of sinusoids ECE 201 Intro to Signal Analysis TimeDomain and FrequencyDomain Periodic Signals TimeFrequency Spectrum OQO u G 0C0 09000060 00000 0000000 0000 QQOGOQ OOOOOOQQQQ Beat Notes gt Consider the signal Xt 2 cos2715t cos27r400t gt This signal does not have the form of a sum of sinusoids hence we can not determine it s spectrum immediately i 1 Times 005 U N l V E R S l TV ECE 201 Intro to Signal Analysis MATLAB Code for Beat Notes Parameters fs 8192 dur 2 fl 5 f2 400 A 2 NP round2fsfl number of samples to plot time axis and signal ttOlfsdur xx Acos2piflttcos2pif2tt plottt lNP XX1NP tt lNP Acos2pifltt lNP r x1abe1 Times ylabe1 Amplitude GEORGE 9 Ms Paris ECE 201 Intro to Signal Analysis 123 TimeDomain and FrequencyDomain 0 00013 GDQQQQ Beat Notes as a Sum of Sinusoids gt Using the inverse Euler relationships we can write Xt 2 00327151 cos27r400t 2 e2n5t e j27t5l e2n400t e j2n400t gt Multiplying out yields 1 1 X Ee2n405l e j27t405l Ee2n395l e j2n395t gt Applying Euler s relationship lets us write Xt cos27r405t 0032713951 ECE 201 Intro to Signal Analysis TimeDomain and FrequencyDomain Periodic Signals Time Frequency Spectrum ooo o o 000 00000ch 00000 0000000 QQQQ QQQQGQ GQQQQQUOQQ Spectrum of Beat Notes gt We were able to rewrite the beat notes as a sum of sinusoids Xt cos27r405t cos271395f gt Note that the frequencies in the sum 395 Hz and 405 Hz are the sum and difference of the frequencies in the original product 5 Hz and 400 Hz gt It is now straightforward to determine the spectrum of the beat notes signal Xf g 405 g 405 395 g 4395 ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and FrequencyDomain Periodic Signals Time equency Spectrum DD OQQ Q Q 0006 QQO OQGOQOQD DQQQQ 000000 960 QUOGOO OOOOOOOQQQ Spectrum of Beat Notes 05 f l l l s l s l f k k k k k k k k k i i i i i i i i i iiiii kkkkk 03 77777 3 025 77777 8 I 02 7 77777 w 015 77777 01 77 r r r r r r r r r 77777 n k k k k k k k k k hhhhh O l l l l l l 500 400 300 200 100 O 100 200 300 400 500 PLcaonae Frequency Hz H V 539 ECE 201 Intro to Signal Analysis TimeDomain and FrequencyDomain Periodic Signals 000 000 Time Frequency Spectrum Q Q QOOQOQDQ 000007 ODQQQOQ QQQQ QQQQGQ OOOOOOOOO Amplitude Modulation gt Amplitude Modulation is used in communication systems gt The objective of amplitude modulation is to move the spectrum of a signal mt from low frequencies to high frequencies gt The message signal mz may be a piece of music its spectrum occupies frequencies below 20 KHz gt For transmission by an AM radio station this spectrum must be moved to approximately 1 MHz ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and FrequencyDomain 0Q coo poop coo Periodic Signals Tin39leerequency Spectrum i3 0 ooooopoo 00000 0000000 0000 000000 0000000000 Amplitude Modulation gt Conventional amplitude modulation proceeds in two steps 1 A constant A is added to mz such that A mt gt O for all t 2 The sum signal A mt is multiplied by a sinusoid cos27tfct where fC is the radio frequency assigned to the station gt Consequently the transmitted signal has the form Xt A mt COS27TfCt ECE 201 Intro to Signal Analysis Sum of Simisoiolal Signals TimeDomain and FrequencyDomain Periodic Signals Time Frequency Spectrum 0 Q OOOOOQDQ OODOQ DQQQOOQ QQOQ QQOQOQ OOOOOOOOOO Amplitude Modulation gt We are interested in the spectrum of the AM signal gt However we cannot compute X f for arbitrary message signals mt gt For the special case mt COS27Tfmt we can find the spectrum gt To mimic the radio case fm would be a frequency in the audible range gt As before we will first need to express the AM signal Xt as a sum of sinusoids Paris ECE 201 Intro to Signal Analysis 129 Sum of Sinusoidal Signals TimeDomain and FrequencyDomain Periodic Signals Time Frequency Spectrum co coo 4 a com coo 00000000 00000 0000000 Du 000000 OQQQ OOOOOOOOOO Amplitude Modulated Signal gt For mt COS27Tfmt the AM signal equals Xt A cos27rfmt cos27rfct gt This simplifies to Xt A cos27rfct COS27Tfmt COS27TfCt gt Note that the second term of the sum is a beat notes signal with frequencies fm and f0 gt We know that beat notes can be written as a sum of sinusoids with frequencies equal to the sum and difference of fm and f0 ECE 201 Intro to Signal Analysis TimeDomain and FrequencyDomain Periodic Signals Time Frequency Spectrum 000 o o 000 ooooocmo ooooo ODQQQQQ QQQQ QQQQGQ OOOOOOOOOO Plot of Amplitude Modulated Signal For A 2 fm 50 and f0 400 the AM signal is plotted below Amplitude i i i i i i i i 0 002 004 006 008 01 012 014 016 018 02 quot5quot ECE 201 Intro to Signal Analysis TimeDomain and FrequencyDomain Periodic Signals Tin39ielZi equenoy Spectrum coo o 9 QQO 00000006 OQOQO DQGQGQO GOGO 000000 0000000000 Spectrum of Amplitude Modulated Signal gt The AM signal is given by 1 Xt ACos27rfct 00s271f0 fmt E cos27rfc rm gt Thus its spectrum is XU 9 ECE 201 Intro to Signal Analysis TimeDomain and FrequencyDomain Periodic Signals Time Frequency Spectrum ooo o 0 COO oooooooo ooooo CDQQQQQ QQQQ QQQQGQ OOOOOOOOOO Spectrum of Amplitude Modulated Signal For A 2 fm 50 and fc 400 the spectrum of the AM signal is plotted below 1 user rrrrrkrrrrwrwrrwrwrrrwrrrrr re Spectrum 0 o o o h 01 G l l l l l l l l i p w i i 0 i i i i i i i 500 400 300 200 100 0 100 200 300 400 500 ECE 201 Intro to Signal Analysis TimeDomain and FrequencyDomain Periodic Signals Time equency Spectrum poo in a v3 QQO OQGOQDQG DQQQQ DQGQGOO 0060 QUOQOQ OOOOOOOOOO Spectrum of Amplitude Modulated Signal gt It is interesting to compare the spectrum of the signal before modulation and after multiplication with cos27rfct gt The signal st A mt has spectrum W two 550 g sogt gt The modulated signal Xt has spectrum xltrgt e400 lt9 4oogt more 450gtltt350gtd4350 gt Both are plotted on the next page ECE 201 Intro to Signal Analysis TimeDomain and FrequencyDomain Periodic Signals Time Frequency Spectrurri 000 000 ooooooo oooooooooo Cl 00000 QQQQGQ G OOOQOQDQ QQQQ Spectrum before and after AM Before Modulation After Modulation 2 I 2 l 18 r r r r r r r r r r r r r r r r r r r r r r r r r r r r r 18 r r r r r r r r r r r r r r r r r r r r r r r r r r w 16 r r r r r r r r r r r r r r r r r r r r r r r r r r r r r 16 r r r r r r r r r r r r r r r r r r r r r r r r r r w 14 r r r r r r r r r r r r r r r r r r r r r r r r r r r r r 14 r r r r r r r r r r r r r r r r r r r r r r r r r r w 12 r r r r r r r r r r r r r r r r r r r r r r r r r r r r r 12 r r r r r r r r r r r r r r r r r r r r r r r r r r w E E s 1 7777777777777777777777777777 r r s 1 777777777777777777 n gt77 8 8 U U 08 r r r r r r r r r r r r r r r r r r r r r r r r r r r r 087 r r r r r r r r r r r r r r r r r r r r w 06 r r r r r r r r r r r r r r r r r r r r r r r r I r r r r 067 r r r r r r r r r r r r r r r r r r r w 04 r r r r r r r r r r r r r r r r r r r r r r r r r r r r 04 r r r r r r r r r r r r r r r r r r r 397 02 rrrrrrrrrrrrrrrrrrrrrrrrrrr r r 02TT r rrrrrrrrrrrrrrrrr 0 0 i i i i 100 50 0 50 100 500 0 500 Frequency Hz Frequency Hz Mi ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and FrequencyDomain 0Q coo poop coo ooooooo oooooooooo Periodic Signals Tin39ie equency Spectrum C ooooo QQOGOO 9 00600000 000 Spectrum before and after AM gt Comparison of the two spectra shows that amplitude module indeed moves a spectrum from low frequencies to high frequencies gt Note that the shape of the spectrum is precisely preserved gt Amplitude modulation can be described concisely by stating gt Half of the original spectrum is shifted by f0 to the right and the other half is shifted by f0 to the left gt Question How can you get the original signal back so that you can listen to it gt This is called demodulation ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and Frequency Domain Periodic Signals Time Frequency Spectrum oco 0 Ci coo oooooooe ooooo CQQQQQQ QQQQC Q QQQQOQGQQQ Lecture Periodic Signals ECE 201 Intro to Signal Analysis TimenDomain and FrequencyDomain Periodic Signals Time equency Spectrum QQQ o 39 r OQQQ O Doooooo oooooo OQQQ oooooooooo What are Periodic Signals gt A signal Xt is called periodic if there is a constant To such that Xt Xt To for all t gt In other words a periodic signal repeats itself every To seconds gt The interval To is called the fundamental period of the signal gt The inverse of To is the fundamental frequency of the signal gt Example gt A sinusoidal signal of frequency f is periodic with period TO 1f ECE 201 Intro to Signal Analysis TimeDor nain and Frequency Domain Periodic Signals Time Frequency Spectrum 000 o o coo oooooooo ooooo 7 ODQQQQQ QQQQ QQQQGQ QQQQOOUOQQ Harmonic Frequencies gt Consider a sum of sinusoids N Xt A0 ZAicos27rft qbi i1 gt A special case arises when we constrain all frequencies f to be integer multiples of some frequency f0 1 i f0 gt The frequencies f are then called harmonic frequencies of f0 gt We will show that sums of sinusoids with frequencies that are harmonics are periodic ECE 201 Intro to Signal Analysis 8er of Sinusoidal Signals TimeDomain and FrequehcyDomain Periodic Signals Tin39leFrequency Spectrum or coo 3 O DGGQ coo oooooooo oooop ooooooo oooooo oooooooooo Harmonic Signals are Periodic gt To establish periodicity we must show that there is To such Xt Xt To gt Begin with XtTO A02 1Acos2nntTogb A0 Elli A coslt2mrt 2mm gm gt Now let f0 1 To and use the fact that frequencies are harmonics f i f0 ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals co 0000 00 coco TimeDomain and Frequency Dorrlain Periodic Signals coo o 000 00000000 oocoo ooooooq DEGQ oooooo oooooooooo Harmonic Signals are Periodic gt Then f TozifOToziand hence Xt To AO z 11Acos2nnt2nnTo gb A0 E 1Aicos2m it 271i qbi gt We can drop the 271i terms and conclude that Xt To Xt gt Conclusion A signal of the form N Xt A0 ZAicos27ri fot qbi 39 1 I is periodic with period To 1f0 ECE 201 Intro to Signal Analysis SuniofSnmsoMalSmnah 00 come co coop TimeDomain and Frequency Domain Periodic Signals m t 0000000 7 0000 00th 0000 Finding the Fundamental Frequency gt Often one is given a set of frequencies f1 f2 fN and is required to find the fundamental frequency f0 gt Specifically this means one must find a frequency f0 and integers n1 n2 nN such that all of the following equations are met f1 n1 39 f0 f2 2 n2 39 f0 IN nN f0 gt Note that there isn t always a solution to the above problem gt However if all frequencies are integers a solution exists gt Even if all frequencies are rational a solution exists Tittle Frequency Spectrum I tine Frequency Spectrum ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals 30 ooeo TimeDomain and Frequency Domain Periodic Signals coo coo ooooooo oooooooooo Ci COCOS G OOOOOOOO QQQQGQ GO QUQQ 0000 Example gt Find the fundamental frequency for the set of frequencies f112f2 2712 2 51 gt Set up the equations 12 2 n1 39 f0 27 n2 39 f0 51 2 n3 39 f0 gt Try the solution n1 2 1this would imply f0 12 This cannot satisfy the other two equations gt Try the solution n1 2 2 this would imply f0 6 This cannot satisfy the other two equations gt Try the solution n1 2 3 this would imply f0 4 This cannot satisfy the other two equations gt Try the solution n1 2 4 this would imply f0 ECE 201 Intro to Signal Analysis TimeDomain and FrequehcyDomain 006 0630 Periodic Signals N U oooop 000000 f OOOOOOOO GOGO 0009600 DOOOQOGQQQ Example gt Note that the three sinusoids complete a cycle at the same timeat To Z Z O l Amplitude II ECE 201 Intro to Signal Analysis Time Frequency Spectrum U N l V E R S l TV Tirt39ieFrequency Spectrum TinteDonmin and Frequency Don lain Periodic Signals Tlme Frequency Spectrum 0 00000000 GOQOQ no 39 oooo oooooe coco oooooooooo A Few Things to Note gt Note that the fundamental frequency f0 that we determined is the greatest common divisor god of the original frequencies gt f0 3 isthe god of f1 12 f2 27 and f3 51 gt The integers n are the number of full periods cycles the sinusoid of freqency f completes in the fundamental period To 1 f0 gt For example n1 f1 T0 f11f0 4 gt The sinusoid of frequency f1 completes n1 4 cycles during the period To ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and FrequencyDon lain Periodic Signals no u n u OOOOOOO QOQQ Exercise gt Find the fundamental frequency for the set of frequencies nzaazssgzs ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and Frequency Domain Periodic Signals Time Frequency Spectrum G O OOOQOQOQ OOQOQ ODQQQOQ OOO QQQQGQ QQQQOOUOQQ Fourier Series gt We have shown that a sum of sinusoids with harmonic frequencies is a periodic signal gt One can turn this statement around and arrive at a very important result Any periodic signal can be expressed as a sum of sinusoids with harmonic frequencies gt The resulting sum is called the Fourier Series of the signal gt Put differently a periodic signal can always be written in the form X A0 EL Ai 00327Tif01 bi X0 ieZ fifot igtllte j2739lfif0t X0 A0 and mEson ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and FrequehcyDomain Periodic Signals TinteFrequency Spectrum 00 OQQ U Q QGQQ CDC QQQOQDQD OQOQO 00 0009000 000 QQOGOQ OQOO 0000003000 Fourier Series gt For a periodic signal the complex amplitudes X can be computed using a relatively simple formula gt Specifically for a periodic signal xt with fundamental period To the complex amplitudes X are given by 1 x I To xf e 127i iT0dt O gt Note that the integral above can be evaluated over any interval of length T0 ECE 201 Intro to Signal Analysis Sum oi Sinusoidal Signals limeDomain and Frequency Domain Periodic Signals lime Frequency Spectriim Q0 00C Ct Cl DOC OOOOGQDQ OGOGD COQQQQQ 000 QC QC QQ QQQQOQGOOQ Example Square Wave gt A square wave signal is periodic and between t O and 1 To it equals 1 ogrlt xt 1gtltTo gt From the Fourier Series expansion it follows that Xt can be written as Xt ni cos27r2n 1ft 712 ECE 201 Intro to Signal Analysis Sum cl Sii iusoldal Signals Periodic Signals TimeFrequency Spectrum or 3 coco 00quon o cc 0000 oooo L Xt g cos n n 1ft 712 Amplitude i i i i i 001 002 003 004 005 006 uNIVEnsnv Time s ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and Frequency Domain Periodic Signals TimeFrequency Spectrum 00 o o oooo 00000900 00000 GO ODQQQOQ QQQO QOQQGQ OOOO QOQQOOUOOQ Limitations of SumofSinusoid Signals gt So far we have considered only signals that can be written as a sum of sinusoids N Xt A0 ZACOS27Tfit 45 i1 gt For such signals we are able to compute the spectrum gt Note that signals of this form gt are assumed to last forever ie for 00 lt t lt co gt and their spectrum never changes gt While such signals are important and useful conceptually they don t describe realworld signals accurately gt Realworld signals gt are of finite duration gt their spectrum changes over time ECE 201 Intro to Signal Analysis TimeDomain and FrequencyDomain Periodic Signals TimeFrequency Spectrum OQO w G 000 OQQDQDQD 0000 0000000 0000 QQOGOQ OQOO OOOOOOQQQQ Musical Notation gt Musical notation sheet music provides a way to represent realworld signals a piece of music gt As you know sheet music gt places notes on a scale to reflect the frequency of the tone to be played gt uses differently shaped note symbols to indicate the duration of each tone gt provides the order in which notes are to be played gt In summary musical notation captures how the spectrum of the music signal changes over time gt We cannot write signals whose spectrum changes with time as a sum of sinusoids gt A static spectrum is insufficient to describe such signals gt Alternative timefrequency spectrum ECE 201 Intro to Signal Analysis L m oi Sinusoidal Signals S D 0 Ci Cl 000 r C if 1 C TimeDomain and Frequei icy Domain ooo coo oooqooq ecooooqooo Periodic Signals TimeFrequency Spectrum Cl ooooo ooooco Ct OOOQOQDQ Q5300 Example Musical Scale Note Frequency Hz 262 294 330 349 392 440 494 523 Table Musical Notes and their Frequencies ECE 201 Intro to Signal Analysis TimeDomain and FrequencyDomain coo coo ocoeoec oooooooooo Periodic Signais TimeFrequency Spectrum C 00000 000000 9 00000006 coco Example Musical Scale gt If we play each of the notes for 250 ms then the resulting signal can be summarized in the timefrequency spectrum below Frequency 550 7177777771 7777717 777717 7774 77 7777er 7777717 777737 777717 We 77 r N L r 7 Ir 7 r N 7 1 300777 7 06 O 8 1 1 2 Times ECE 201 Intro to Signal Analysis Sum of Sinusoidal Signals TimeDomain and Frequency Domain Periodic Signals TimeFrequency Spectrum ooo o o ooo oooooooo ooooo CQQQQQQ QQQQQQ QQQQOQGQQQ MATLAB Spectrogram Function gt MATLAB has a function spectrogram that can be used to compute the timefrequency spectrum for a given signal gt The resulting plots are similar to the one for the musical scale on the previous slide gt Typically you invoke this function as spectrogram XX 256 128 256 fs yaxis where xx is the signal to be analyzed and fs is the sampling frequency gt The spectrogram for the musical scale is shown on the next slide ECE 201 Intro to Signal Analysis Time Domain and FrequechDomain Periodic Signals TimeFrequency Spectrum coo o ooooo ooooooo oooooo oooo oooooooooo Spectrogram Musical Scale gt The color indicates the magnitude of the spectrum at a given time and frequency Frequency Hz M o o o 01 O O ECE 201 Intro to Signal Analysis Sum of Sinusoidal SingEt S c TimeFrequency Spectrum G 3 OGQOC OOOOO Chirp Signals gt Objective construct a signal such that its frequency increases with time gt Starting Point A sinusoidal signal has the form Xt Acos27rf0f qb gt We can consider the argument of the cos as a timevarying phase function Y 27Tf0t l gt Question What happens when we allow more general functions for 1alz gt For example let em 700m 440m qb ECE 201 Intro to Signal Analysis TimeFrequency Spectrum ooooo 00000 Spectrogram cos Ft gt Question How is he timefrequency spectrum related to 1alt 3000 M 01 O O Frequency Hz l o o o 1500 1000 500 PIGEORGE 0 UNIVERSITY 02 04 06 08 1 12 14 16 18 ECE 201 Intro to Signal Analysis TimeDomain and Frequency Domain Periodic Signals TimeFrequency Spectrum ooo o o 000 00000ch 00000 ODQQQQQ Cu ng oooooo QQQQOOUOQQ Instantaneous Frequency gt For a regular sinusoid 1lz 27rfot qb and the frequency equals f0 gt This suggests as a possible relationship between 1lz and f0 1 of f0 gallt gt If the above derivative is not a constant it is called the instantaneous frequency of the signal ft gt Example For TU 700m2 440m qb we find 1 d r 7 2 440 t 700t 220 f 2 dt 00m 71 gb gt This describes precisely the red line in the spectrogram on the previous slide MAS U N I V E R S l TV ECE 201 Intro to Signal Analysis TimeDomain and FrequencyDomain Periodic Signals TimeFrequency Spectrum Offl3 U U 0530 00600000 00000 DG QDOOO OOOOOO OOOOQOGQQQ Constructing a Linear Chirp gt Objective Construct a signal such that its frequency is initially f1 and increases linear to 1 2 after T seconds gt Solution The above suggests that f f tilt 2T1tf1 gt Consequently the phase function 1lz must be f f TU 2711 2 27rf1t q gt Note that qb has no influence on the spectrum it is usually set to O ECE 201 Intro to Signal Analysis Periodic Signais TimeFrequency Spectrum a OQOQUQDQ OGGQQ QQQQ OOOOOO ODDS Constructing a Linear Chirp gt Example Construct a linear chirp such that the frequency decreases from 1000 Hz to 200 Hz in 2 seconds gt The desired signal must be Xt cos 271200t2 27110000 ECE 201 Intro to Signal Analysis finiteDomain and Frequency Domain quot TimeFrequency Spectrum 39 IQ CD r 3 Sum of Sinusoidal Signais Fifi w OGQOD OOOOO Exercise gt Construct a linear chirp such that the frequency increases from 50 Hz to 200 Hz in 3 seconds gt Sketch the timefrequency spectrum of the following signal Xt cos271500f 100 cos2712t ECE 201 Intro to Signal Analysis Part IV Sampling of Signals ECE 201 Intro to Signal Analysis Lecture Introduction to Sampling ECE 201 Intro to Signal Analysis Introduction to Sampling 0 dooooo oomoooooooooooooooo 0 00000 Sampling and DiscreteTime Signals gt MATLAB and other digital processing systems can not process continuoustime signals gt Instead MATLAB requires the continuoustime signal to be converted into a discrete time signal gt The conversion process is called sampling gt To sample a continuoustime signal we evaluate it at a discrete set of times tn 2 nTS where gt n is a integer gt T8 is called the sampling period time between samples gt fS 1TS is the sampling rate samples per second ECE 201 Intro to Signal Analysis OQOOQQQQDOGCOOQODOG r U QQOQQ Sampling and DiscreteTime Signals gt Sampling results in a sequence of samples XnTS A cos27rfnTS qb V Note that the independent variable is now n not 1 To emphasize that this is a discretetime signal we write V Xn A cos27rfnTS qb V Sampling is a straightforward operation We will see that the sampling rate fS must be chosen with care V ECE 201 Intro to Signal Analysis mmmWMnmSmmMQ oo 0 000000 QODQOOOOQQOOQQDQOQO n a OOOGQ Sampled Signals in MATLAB gt Note that we have worked with sampled signals whenever we have used MATLAB gt For example we use the following MATLAB fragment to generate a sinusoidal signal fs 100 tt Olfs3 XX 5cos2pi2tt pi4 gt The resulting signal xx is a discretetime signal gt The vector xx contains the samples and gt the vector tt specifies the sampling instances 01fs2fs3 gt We will now turn our attention to the impact of the sampling rate f5 ECE 201 Intro to Signal Analysis mmmWMnmSmmMg 00 E 000000 cocoooooooooooooooo c ooooo Example Three Sinuoids gt Objective n MATLAB compute sampled versions of three sinusoids 1 Xt cos2m 714 2 Xt cos2719t 714 3 Xt cos27111t 714 gt The sampling rate for all three signals is fS 10 ECE 201 Intro to Signal Analysis mmmWMnmSmmMg MATLAB code plotSamplingDemo Sample three sinusoidal signals to demonstrate the impact of sampling o0 o0 o0 set parameters 8 10 dur 10 H generate signals tt Olfsdur XXl cos2pittpi4 cos 2pi9tt pi4 cos2pillttpi4 XX2 XX3 plot plotttxxl O ttXX2 X ttxx3 x1abel TimeHs grid legend39fl f9 fll Location EastOutside ECE 201 Intro to Signal Analysis mmmWMnmSmmMg D oooooo oeeaeoeoeceeeeeeeeo GQGQ Resulting Plot 1 rrrr 7777 7777 7777 e 3 5 5 5 5 5 5 5 f fa iiii iiii rrrr ECE 201 Intro to Signal Analysis mmmWMnmSmmMQ co 0 000000 QODQOOOOQQOOQQDQOQO n a OOOGQ What happened gt The samples for all three signals are identical how is that possible gt Is there a bug in the MATLAB code gt No the code is correct gt Suspicion The problem is related to our choice of sampling rate gt To test this suspicion repeat the experiment with a different sampling rate gt We also reduce the duration to keep the number of samples constant that keeps the plots reasonable Paris ECE 201 Intro to Signal Analysis 171 mmmWMnmSmmMQ 00 D 00000 GQQQQQQDQGQOGGGGDOD U MATLAB code plotSamplingDemoHigh Sample three sinusoidal signals to demonstrate the impact of sampling set parameters fs 100 dur l generate signals tt Olfsdur XXl cos2pittpi4 XX2 cos2pi9tt pi4 XX3 cos2pillttpi4 plots p10tttXXl ttXX239 X39ttXX3139 ttllOend XXlllOend ok grid x1abel TimeHs GEORGE 1egend fl f9 fll fslO Location EastOuts1de D As ECE 201 Intro to Signal Analysis Introduction to Sampling oo 0 00000 QOQGQQQOOQGQQQQQOQU Cl Resulting Plot 1 08 w w r 6 067 r 04V 02 39 0 o2 w o4 w 06quot39 r ECE 201 Intro to Signal Analysis OOOOOOOOOOOOOOOOOO h 6060 The Influence of the Sampling Rate gt Now the three sinusoids are clearly distinguishable and lead to different samples gt Since the only parameter we changed is the sampling rate f5 it must be responsible for the ambiguity in the first plot gt Notice also that every 10th sample marked with a black circle is identical for all three sinusoids gt Since the sampling rate was 10 times higher for the second plot this explains the first plot gt It is useful to investigate the effect of sampling mathematically to understand better what impact it has gt To do so we focus on sampling sinusoidal signals ECE 201 Intro to Signal Analysis Introduction to Sampling oo 1 dooooo 000660000000000000 Q 00000 Sampling a Sinusoidal Signal gt A continuoustime sinusoid is given by Xt Acos27rft qb gt When this signal is sampled at rate f5 we obtain the discretetime signal Xn Acos2m nfS qb gt It is useful to define the normalized frequency fd so that Xn Acos27rfdn qb ECE 201 Intro to Signal Analysis OOOOOOOOOOOOOOOOOOO h r QQOGQ Three Cases gt We will distinguish between three cases 1 0 g fd g 12 Oversampling this is what we want 2 12 lt fd 3 1 Undersampling folding 3 1 lt fd g 32 Undersampling aliasing gt This captures the three situations addressed by the first example 1 f1fs10gtfd11O 2 f9fs 1021910 3 f 11fs 10gt fd 1110 gt We will see that all three cases lead to identical samples ECE 201 Intro to Signal Analysis Introduction to Sampling oo 1 dooeoo ooooooooooooooooooo G 00000 Oversampling V When the sampling rate is such that 0 g fd 3 12 then the samples of the sinusoidal signal are given by Xn Acos27rfdn qb V This cannot be simplified further V It provides our baseline V Oversampling is the desired behaviour ECE 201 Intro to Signal Analysis OOOOOOOOOOOOOOOOOOO u QQOGQ Undersampling Aliasing gt When the sampling rate is such that 1 lt fd 3 32 then we define the apparent frequency fa fd 1 Notice that O lt fa g 12 and fd fa 1 gt Forf11fs10gtfd1110gtfa110 The samples of the sinusoidal signal are given by V 39V Xn Acos27rfdn qb Acos27r1 fan qb 39V Expanding the terms inside the cosine Xn Acos27rfan 27m qb Acos27rfan qb V Interpretation The samples are identical to those from a sinusoid with frequency f fa f8 and phase qb GE ECE 201 Intro to Signal Analysis Introduction to Sampling co 0 GQOGOQ OOOOOOOOOOOOOOOOOOO 0 00000 Undersampling Folding gt When the sampling rate is such that 12 lt fd 3 1 then we introduce the apparent frequency fa 1 fd again Oltfag12alsofd1 fa The samples of the sinusoidal signal are given by Xn Acos27rfdn qb Acos27r1 fan qb Expanding the terms inside the cosine Xn Acos 27rfan 27m qb Acos 27rfan qb V V V Because of the symmetry of the cosine this equals Xn Acos27rfan qb V Interpretation The samples are identical to those from a sinusoid with frequency f fa fS and phase qb phase ECE 201 Intro to Signal Analysis Introduction to Sampling 3 OOOOOOOOOOOOOOOOOOO 0 06000 Sampling HigherFrequency Sinusoids gt For sinusoids of even higher frequencies 1 either folding or aliasing occurs gt As before let fd be the normalized frequency ffs gt Decompose fd into an integer part N and fractional part fp gt Example If fd is 57 then N equals 5 and fp is 07 gt Notice that 0 g fp lt 1 always gt Phase Reversal occurs when the phase of the sampled sinusoid is the negative of the phase of the continuoustime sinusoid gt We distinguish between gt Folding occurs when fp gt 12 Then the apparent frequency fa equals 1 fp and phase reversal occurs gt Aliasing occurs when fp g 12 Then the apparent frequency is fa fp no phase reversal occurs U N I V E R S l TV ECE 201 Intro to Signal Analysis mmmWMnmSmmMQ oo 390 000000 ooooooooooooooooooo 1 L 00000 Examples gt For the three sinusoids considered earlier 1 f 1qb 7T4fs 10gt fd 110 2 f 9qb 739L394fs 10 gt fd 910 3 f 11qb 7T4fs 10gt fd 1110 gt The first case represents oversampling The apparent frequency fa fd and no phase reversal occurs gt The second case represents folding The apparent fa equals 1 fd and phase reversal occurs gt In the final example the fractional part of fd 110 Hence this case represents alising no phase reversal occurs ECE 201 Intro to Signal Analysis mmmWMnmSmmMQ oo Q oooooo ooooooooooooooooooo a 000C313 Exercise The discretetime sinusoidal signal xln 5cos27102n g was obtained by sampling a continuoustime sinusoid of the form Xt Acos27rft qb at the sampling rate fS 8000 Hz 1 Provide three different sets of paramters A f and qb for the continuoustime sinusoid that all yield the discretetime sinusoid above when sampled at the indicated rate The parameter f must satisfy 0 lt f lt 12000 Hz in all three cases 2 For each case indicate if the signal is undersampled or 16 oversam led and if aliasin or foldin occurred quotquotquotquotquotquotquot quot ECE 201 Intro to Signal Analysis Introduction to Sampling Q0 0 000000 OOOOOOOOOOOOOOOOOOO n ooooo Experiments gt Two experiments to illustrate the effects that sampling introduces 1 Sampling a chirp signal 2 Sampling a rotating phasor U N I V E R S I 7V Paris ECE 201 Intro to Signal Analysis 183 CGQDQD OOOOOOOOOOOOOOOOOOO g OQOQQ Experiment Sampling a Chirp Signal gt Objective Directly observe folding and aliasing by means of a chirp signal gt Experiment Setup gt Set sampling rate Baseline fS 441 KHz oversampled Comparison fS 8192KHz undersampled gt Generate a sampled chirp signal with instantaneous frequency increasing from O to 2OKHz in 10 seconds gt Evaluate resulting signal by gt playing it through the speaker gt plotting the periodogram gt Expected Outcome gt Expected Outcome gt Directly observe folding and aliasing in second part of experiment U N l V E 5 I TV ECE 201 Intro to Signal Analysis Introduction to Sampling OOOOOOOOOOOOOOOOOO Periodogram of undersampled Chirp 4000 3500 Frequency H M O O O ECE 201 Intro to Signal Analysis Introduction to Sampling Parameters fs 8192 441KHZ for oversampling 8192 for undersampling chitp 0 to ZOKHZ in 10 seconds fstart O fend 20e3 dur 10 generate signal tt Olfsdur psi 2pifend fstart2durttA2 phase function xx cospsi spectrogram spectrogram XX 256 128 256 fs yaxis play sound soundsc XX fs ECE 201 Intro to Signal Analysis Introduction to Sampling co 395 qooeoo OOOOOOOOOOOOOOOOOOO 0 00000 Apparent and Normalized Frequency fa Over sar Ipiir g Oid ng IquotI I I A I39 39 OIG Hg I39lt Sln IquotI gtfd ECE 201 Intro to Signal Analysis 000000000000000000 0 00060 Experiment Sampling a Rotating Phasor gt Objective Investigate sampling effects when we can distinguish between positive and negative frequencies gt Experiment Setup gt Animation rotating phasor in the complex plane gt Sampling rate describes the number of snapshots per second strobes gt Frequency the number of times the phasor rotates per second gt positive frequency counterclockwise rotation gt negative frequency clockwise rotation gt Expected Outcome gt Expected Outcome gt Folding leads to reversal of direction gt Aliasing same direction but apparent frequency is lower than true frequency u N l V E R S l YV ECE 201 Intro to Signal Analysis Introduction to Sampling 13 QOOOQQ OOOOOOOOOOOOOOOOOOO n ooooo True and Apparent Frequency f5 True Frequency O5 O 05 95 10 105 Apparent Frequency O5 O 05 O5 O 05 gt Note that instead of folding we observe negative frequencies gt occurs when true frequency equals 95 in above example Paris ECE 201 Intro to Signal Analysis 189 Introduction to Sampling oo 00 OOOOOOOOOOOOOOO parameters fs 10 sampling rate in frames per second dur 10 signal duration in seconds ff 95 frequency of rotating phasor phi O initial phase ofphasor A l amplitude Prepare for plot TitleString sprintf RotatinguPhasorHfduu52f fffs figurel unit circle plotted for reference cc expi2piO00ll ccx Area1cc cci Aimagcc ECE 201 Intro to Signal Analysis mmmWMnmSmmMg 03008 OOOOOOOOOOOOOOOOOOO 6 3 QOQGO OO 66 Animation for tt Ozlfszdur tic establish time reference plot ccx cci O Acos2piffttphi O Asin2piffttphi Ob axis square axis A A A A tit1eTitleString x1abe1 Real ylabe1 Imag drawnow force plots to be redrawn te toc pause until the next sampling instant if possible if te lt lfs pauselfs te end end ECE 201 Intro to Signal Analysis mmmWMnmSmmMg Lecture The Sampling Theorem ECE 201 Intro to Signal Analysis mmmWMnmSmmMg oo o oooooe oomoooooooooooooooo 0 00000 The Sampling Theorem gt We have analyzed the relationship between the frequency f of a sinusoid and the sampling rate f5 gt We saw that the ratio ffS must be less than 12 ie fS gt 2 f OthenNise aliasing or folding occurs gt This insight provides the first half of the famous sampling theorem A continuoustime signal XU with frequencies no higher than fmax can e reconstructed exactly from its samples xln xn Ts if the the samples are taken at a rate f5 1 Ts that is greater than 2 fmax J gt This very import result is attributed to Claude Shannon andyfis Harry Nyquist uuuu 91 ECE 201 Intro to Signal Analysis mmmWMnmSmmMg 00 Q QOOOQD OQOQQOQQQOOOOGOOOOC O 0000 Reconstructing a Signal from Samples gt The sampling theorem suggests that the original continuoustime signal Xt can be recreated from its samples xln gt Assuming that samples were taken at a high enough rate gt This process is referred to as reconstruction or DtoC conversion discretetime to continuoustime conversion gt In principle the continoustime signal is reconstructed by placing a suitable pulse at each sample location and adding all pulses gt The amplitude of each pulse is given by the sample value ECE 201 Intro to Signal Analysis mmmWMnmSmmMQ 13 o oooooo cocoocoooocoooooooo F 50000 Suitable Pulses gt Suitable pulses include gt Rectangular pulse zeroorder hold 1 for TS2g tlt TS2 pm 0 else gt Triangular pulse linear interpolation 1z TS for ngtgo pa 1 z TS forogz gTS 0 else Paris ECE 201 Intro to Signal Analysis mmmWMnmSmmMQ 4quot quot3 co cocooocooccccob c 00000 Reconstruction gt The reconstructed signal 31 is computed from the samples and the pulse pt OO 31 Z Xn pt nTS n OO gt The reconstruction formula says gt place a pulse at each sampling instant pt nTS gt scale each pulse to amplitude xln gt add all pulses to obtain the reconstructed signal ECE 201 Intro to Signal Analysis U N I V E I S l TV loo Qooocoooooooooo Ideal Reconstruction gt Reconstruction with the above pulses will be pretty good gt Particularly when the sampling rate is much greater than twice the signal frequency significant oversampling gt However reconstruction is not perfect as suggested by the sampling theorem gt To obtain perfect reconstruction the following pulse must be used sinm TS pl Tr gt This pulse is called the sinc pulse gt Note that it is of infinite duration and therefore is not practical gt In practice a truncated version may be used for excellent reconstruction ECE 201 Intro to Signal Analysis OQOQQQDC DGC COOC GDDD C 0000 15 ECE 201 Intro to Signal Analysis 39 anal L irrislrwariarrt 53v r ton oi Fi Part V Introduction to Linear TimeInvariant Syste m s hiGEORGE Paris ECE 201 Intro to Signal Analysis 199 lll39noirlva 339 Lecture Introduction to Systems and FIR filters ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systen39is Convolution and Linear Timeirwariant Systems Implerrientation of HR 0 ac Doe eeeeecooo 0 000030800 0 snoop U 590000000 00000 Systems gt A system is used to process an input signal Xn and produce the ouput signal yn gt We focus on discretetime signals and systems gt a correspoding theory exists for continuoustime signals and systems gt Many different systems gt Filters remove undesired signal components gt Modulators and demodulators gt Detectors Xn gt System gt W1 ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systems 0 0 000000000 6 eoooo u oooeocoo ooooe Cor wolution and Linear Timeinvariant Systems Implementation of HR see 00 QQOQQQQQQ Iquot Representative Examples gt The following are examples of systems gt Squarer yn Xn2 gt Modulator yn Xn cos27rfdn gt Averager yn A17 Eli01 Xn k FIR Filter yn 210 bkxn k gt In MATLAB systems are generally modeled as functions with Xn as the first input argument and yn as the output argument gt Example first two lines of function implementing a squarer function yy squarerxx 9 o squarer output signal is the square of the input signal ECE 201 Intro to Signal Analysis Systems Signals IinearTimeinvariantSystems ConvohnnnlandljnearinneinvanantSysk ns Htjk e ia OiiOiF H o 000 ooooooooo ooooo o oooooooo ooooo Squarer gt System relationship between input and output signals yin Xlni2 gt Example Input signal Xn 1234 3 21 gt Notation Xn 12 3 4 3 2 1 means XO 1X1 2 X6 1 all other Xn O gt Output signal yn 14916941 Paris ECE 201 Intro to Signal Analysis 203 Systems Special Linear Timeinvarian i Systems Ci nvoiution and Tintsinvariant Systems Implementation of Fit i C it o ooooooooo o c 0000 QDQGODCHD Modulator gt System relationship between input and output signals ylnl Xlni 39COS27den where the modulator frequency fd is a parameter of the system gt Example gt Input signal Xn 12 3 4 3 21 gt assume fd 05 ie cos27tfdn 1 11 1 gt Output signal yn 1 2 3 4 3 2 1 ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systen39is Convolution and Linear Timeirwariant Systems Implementation of HR 0 oo poo ooooocooo Q 000000000 0 ooooo U oooooooo 00000 Ave rager V System relationship between input and output signals yin nZIASXln kl A17xnxn 1xn M 1l 2201 17XM k V This system computes the sliding average over the M most recent samples Example Input signal Xn 12 3 4 3 21 For computing the output signal a table is very useful gt synthetic multiplication table V V ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systems Convolution and Linear quotlimeinvariant Systems ImplementationotFiFi O 0130 O 00 000000000 6 QQOQQQQQQ 00000 0 00990000 00000 3Point Averager M 3 n 1 o 1 2 3 4 5 6 7 8 Xn o 1 2 3 4 3 2 1 o o 1 1x1n10331g13300 A17xin 1 o o g g 1 g 1 g g o Al7xn 2 o o o g g 1 g 1 g yn o g 1 2 3 g 3 2 1 ECE 201 Intro to Signal Analysis Systems Special Signals LinearTimeinvariantSysten39ls Convolution and Linear Tlr neIrwarlant Systems Implementation ofFlR o co coo Q 000000000 0 ODQOQLOOQ QODQD G QQQQQUQD OQQQO General FIR Filter gt The Mpoint averager is a special case of the general FIR filter gt FIR stands for Finite Impulse Response we will see what this means later gt The system relationship between the input Xn and the output yn is given by M yn Z bk Xn k k0 ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systems Convolution and Linear Timeinvariant Systems ImplementationofFlR O O 00 000000000 6 QQQQQQQQQ 00000 0 00990000 00000 DQD General FIR Filter gt System relationship M yn Z bk Xn k k0 gt The filter coefficients bk determine the characteristics of the filter gt Much more on the relationship between the filter coefficients bk and the characteristics of the filter later gt Clearly with bk 2 R7 for k O1M 1 we obtain the Mpoint averager gt Again computation of the output signal can be done via a synthetic multiplication table gt Example Xlnl 1234321 and bk 1 21 ECE 201 Intro to Signal Analysis Systems Signals I inear Time Invariant Systems Cerwolutien and TimeIrwariant Systems II Ijlementa ticn cf Flirt 3 3er OOOOOOOOO D GOOSE O UOQQQGQQ 30000 FIR Filter bk 2 1 2 1 3 39L rum L wean IgtIgtw mmm L Lou OOI LOOLLO I D I ls I 07 dowwh I 07 I 4s I D O L D 00 ls 00 D 3 A 3 L 00000 L Looooo gt yn 1000 20001 gt Note that the output signal yln is longer than the input signal xln Paris ECE 201 Intro to Signal Analysis 209 Systems Special Linear Timeinvariant Systems Cr nvclution and ErnieInvariant Systems Implementation cf Flt I 5 D 5 OOO 00000000 Ct 0000 QDQGODQD Exercise 1 Find the output signal yin for an FIR filter M yln Z bkXln k k0 with filter coefficients bk 2 1 12 when the input signal is Xn 1242421 ECE 201 Intro to Signal Analysis Convoll1tion and Linear Tin39ie inval ial39nt Systei ns l1391391plei nentation 01 HR 0 110 OQQ n cocoaoooo QDOQD U QQQDQGQO OQQOO Unit Step Sequence and Unit Step Response gt The signal with samples 1 for n 2 O in u 0 fornlt0 is called the unitstep sequence or unitstep signal gt The output of an FIR filter when the input is the unitstep signal Xn un is called the unitstep response rln Ulr FIR Filter r ECE 201 Intro to Signal Analysis Systems Special Signals Linean Tirneiiwai iat lt Systems Convolution and Linear Tiine invaiiant Systems Implemei itationotFiFl D 0 0130 06 QOQCQQODQ Q QOQQQQQQQ OOOQQ D OQQQQDQQ QDQDQ UnitStep Response of the 3Point Averager gt Input signal xln uln gt Output signal rln E 0 un k n 1 o 1 2 3 uln o 1 1 1 1 111 o 1 1 1 1 1u1n 11 o o 1 1 1 un 2 o o o 1 1 rln 0 g g 1 1 ECE 201 Intro to Signal Analysis Linear Timeinvariant Systems Convolution and Linear Timeirwariant Systems Implementation of FIR 0 GO 000 O ODOGGOGOG GOQQD G QQQQQUQO OQOQO UnitImpulse Sequence and UnitImpulse Response gt The signal with samples 6n 1 forn0 O forny O is called the unitimpulse sequence or unitimpulse signal gt The output of an FIR filter when the input is the unitimpulse signal Xn 6n is called the unitimpulse response denoted hn gt Typically we will simply call the above signals simply impulse signal and impulse response gt We will see that the impulseresponse captures all characteristics of a FIR filter gt This implies that impulse response is a very important concept MAS U N l V E R S l TV ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systems Convolution and Linear Timeinvariant Systems Implementation of FIR c D ODD QGQCOQOQG OD GQOQQQQQO 1 c 00000 J OQQDODOQ QOQQQ UnitImpulse Response of a FIR Filter gt Input signal Xn 6n gt Output signal hn gZQ LO n k n 1 O 1 2 3 M 6n o 1 o o o o b1 39 5U O 0 b1 0 O 0 192 6n 2 o o 0 b2 0 o ECE 201 Intro to Signal Analysis Systems Special Signals LinearTimeInvariantSystems Convolution and Linear Time Invariant Systems Implementation ofFIFI n A O 394 coo I peace a ooooo Important Insights gt For an FIR filter the impulse response equals the sequence of filter coefficients bn forn01M hn 0 else gt Because of this relationship the system relationship for an FIR filter can also be written as ylnl zl o bkxln kl Ef e hIkIXIn kl 2 21 00 hlkixln k gt The operation yn hln Xn 2 22 00 hkXn k is called convolution it is a very very important operation UNIVERSIT ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systems Conml ltion amt Linear Tirne imariant Systems ImplernentationofFIF o D QC 30063000113 0 Ci C C QQQQC39CY 3 CCHDQCIDOD CIDCJDC Lecture Linear TimeInvariant Systems ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systems Convolution and Linear Timeirwariant Systems Implementation of FIR D I DO Cch 003000000 0 000000000 003GB 0 60000000 00000 Introduction gt We have introduced systems as devices that process an input signal Xn to produce an output signal yn gt Example Systems gt Squarer yn xn gt Modulator yn xln cos27tfdn with O lt fd 3 gt FIR Filter 2 M Yin Z hlkl 39Xln kl k0 Recall that hk is the impulse response of the filter and that the above operation is called convolution of hn and Xn gt Objective Define important characteristics of systems and determine which systems possess these characteristics ECE 201 Intro to Signal Analysis 8 S39LmS 833mm Signals Linear I ieinvariant S stes CQHVOIUHOH and LIHEIEII39 imp invariant S stems Im imentation Of FM 0 00 0 00 360000000 0 QOQQOQQQQ 00000 D OOQDQDOO 0000C Causal Systems gt Definition A system is called causal when it uses only the present and past samples of the input signal to compute the present value of the output signal gt Causality is usually easy to determine from the system equa on gt The output yn must depend only on input samples XnXn 1Xn 2 gt Input samples Xn 1Xn 2 must not be used to find yn gt Examples gt All three systems on the previous slide are causal gt The following system is noncausal 1 W7 z Xin kl Xln1IXInIXIn 1I k 1 CADI L ECE 201 Intro to Signal Analysis Linear Timeinvariant Systems Convolution and Linear TlmeIrwarlant Systems Implementation of HR 0 GO DOG O ODQOQLOOQ 0000 G QQQQQUQD OQQQO Linear Systems gt The following test procedure defines linearity and shows how one can determine if a system is linear 1 Reference Signals For i 12 pass input signal Xn through the system to obtain output yn 2 Linear Combination Form a new signal Xn from the linear combination of X1 n and X2n Xlnl X1 7 X2lnl Then Pass signal xln through the system and obtain yn 3 Check The system is linear if Hdmwmw gt The above must hold for all inputs X1 n and X2n gt For a linear system the superposition principle holds UNIVERSIT ECE 201 Intro to Signal Analysis Sy ems Spam Sgnms LmeanTmmemnquy ems o o ooooooooo o 0000 u oooooooo ooooo Convolution and Linear Timeinvariant Systems Implementation of HR ooo 00 QQOQQQQQQ Iquot Illustration X1 In M ID System i V lenl System Y2 In I These two outputs must be identical X1 7 A yln System Paris ECE 201 Intro to Signal Analysis 220 volutlon and Linear Ernie invariant Sysiel ns Implementation 01 HR 000 Systems Special Signals Linear Timeinvariant Systems Corn 3 o co x ooooooeo c ooocooeco 00000 2 ooooo Example Squarer gt Squarer yn xlnl2 1 References yn Xn2 for i 12 2 Linear Combination xln X1 n X2n and Yin Xlnl2 X1lnl X2lnl2 X1 W2 lenl2 2X1 lnllenl 3 Check Yin 75 MW Y2l 7l X1lnl2 X2lnl2 gt Conclusion not linear ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systems Convolulion and Linear TiInc invariant Systems lmplemer rlatior l 01 HR 0 O QCA QQC JCQQODQ CW DQQQQQQC Q 00000 S39 U OCKQDQDOC 00000 0130 Example Modulator gt Modulator yn xln cos2nfdn 1 References yn Xn cos27rfdn for i 12 2 Linear Combination xln X1 n X2n and yln Xn cos27rfdn X1n X2n cos27rfdn 3 Check yln y1ny2n X1n cos27rfdnX2n cos27rfdn gt Conclusion linear u N l V E K S l TV Paris ECE 201 Intro to Signal Analysis 222 Linear Timeinvariant Systems Convolution and Lii39iear Timeirwariant Systems Implementation of FIR o co 000 o cocoooooo 0000 o oooooooo 00000 Example FIR Filter gt FIR Filter yln 21120 hlk Xn k 1 References yn Ell 20 h k Xn k for i 12 2 Linear Combination xln X1 n X2n and M M Yin 2 WM 39Xln kl Z hlkl X1ln klx2ln kl lt20 lt20 3 Check M M Yin Y1IHIY2W Z hlkl X1ln kl 2 WM X2ln kl k0 k0 gt Conclusion linear ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systems Convolution and Linear Timeinvariant Systems Implementation of FIR o poo D 00 QGIZ JGQQOQCJ Cit DOOQQQQQO 00000 3 00000000 CIOQQC Timeinvariance gt The following test procedure defines timeinvariance and shows how one can determine if a system is timeinvariant 1 Reference Pass input signal Xn through the system to obtain output yln 2 Delayed Input Form the delayed signal Xdln Xn no Then Pass signal Xdln through the system and obtain mini 3 Check The system is timeinvariant if yln nol ydlnl gt The above must hold for all inputs Xn and all delays no gt Interpretation A timeinvariant system does not change over time the way it processes the input signal Paris ECE 201 Intro to Signal Analysis 224 Systems Special Signals Linear Timeinvariant Systems n Convolution and Linear Tiii39ie ilwariant Systei l39ls Ii i ipiei nentation oi FlFi c Q 394 CiQC Crocoooaao quotW m quot c oococ scoop Ci 00000000 00000 Illustration XW System ym Delay no yn n0 V These two outputs must be identical V Delay no System ECE 201 Intro to Signal Analysis Systems Special Sigi lals Linear Timeinvariant Systems 0 O oooocoooo Cit GOQQO 3 00000000 QDQDC Example Squarer 1 Reference yin Xn2 2 Delayed Input Xdin Xn no and ydini Xdini2 Xin noi2 3 Check Yin no Xin noi2 Vain gt Conclusion time invariant Paris ECE 201 Intro to Signal Analysis 226 Linear Timeinvariant Systems Convolution and Linear Tir u ie llwarlant Systems lmplerrientation of HR 0 GO 000 n ooooooooo EDOQD 0 00000000 00000 Example Modulator gt Modulator yln xln cos27rfdn 1 Reference yn Xn cos27rfdn 2 Delayed Input Xdln Xn no and ydln Xdln cos27tfdn Xn no cos27tfdn 3 Check yin no Xln no COS27den 70 ydlnl gt Conclusion not timeinvariant ECE 201 Intro to Signal Analysis Systems Special Qignals Linear Timeinvariant Systems Convolution and Linear 39iiime imariant Systems Implementation oi HR 0 0 do ooo 30000001235 Ci ooooooooo ooooo n U 00000000 0000 Example Modulator gt Alternatively to show that the modulator is not timeinvariant we construct a counterexample gt Let xln O123 ie Xn n for n 2 O gt Also let fd so that 1 for n even 00327den 1 for n odd gt Then yln Xn cos27rfdn 0 12 3 gt With no 2 1 Xdn Xn 1 00123 we get ydn 001 23 gt Clearly ydln y yn 1 gt not timeinvariant UNIVEKS TV Paris ECE 201 Intro to Signal Analysis 228 Systems Special Signals Linear Timeinvariant Systems Convolution and Linear Tln ie ilwarlant Systems lrnplei rientation oi HR 3 o go 000 Foooooooo o ooooooooo ooooo J 0000000 OQQOO Example FIR Filter gt Reference yn ZQ LO hlk Xn k gt Delayed Input Xdn Xn no and M M Ydlnl Z hlkl 39Xdln k Z hlk 39Xln no k k0 k0 gt Check M Y 0 Z hlkl 39X 0 k Ydlnl k0 gt time invariant ECE 201 Intro to Signal Analysis Systems SpeeialQignals Linear Timeinvariant Systems Convolution and Linear Tir ne imariant Systems lmplernei utationoiFlFl o o oo poo 30000001130 i3CgtQQQCiCi Q Q ooooo u oooooooo ooooo Exercise gt Let un be the unitstep sequence ie un 1 for n 2 O and un 0 otherwise gt The system is a 3point averager yin XlnlXln 1lXln 2l JOI L Find the output y1 n when the input X1 n un Find the output y2n when the input X2n un 2 Find the output yn when the input Xn uln n 2 How are linearity and timeinvariance evident in your resu s FPONT u N l V E K S l TV Paris ECE 201 Intro to Signal Analysis 230 Systems Special Signals Linear Timeinvariant Systems Corlvoliitiorl and Linear Tli l ie ilwariant Systems Iri39lplei nentation oi FlFi co coo coooooooo pace 3 0000000 00000 O a O Lecture Convolution and Linear TimeInvariant Systems ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systems Convolution and Linear Timeinvariant Systems lmplernentation oi FlF Q It QC QQQOQQODD QGQQQQ G Ci CDQQQ D CQQQGDOD QDQDQ Overview gt Today a really important somewhat challenging class gt Key result for every linear timeinvariant system LTI system the output is obtined from input via convolution gt Convolution is a very important operation gt Prerequisites from previous classes Impulse signal and impulse response convolution linearity and timeinvariance V VVV Paris ECE 201 Intro to Signal Analysis 232 Linear Timeinvariant Systems Convolution and Linear Timeinvariant Systems Implementation of FIR o 00 000 c ooooooooo ooooo o QQQQQOQO 00000 Reminders Convolution and Impulse Response gt We learned so far gt For FIR filters input output relationship M yn Z bkxln k k0 gt If Xn 6n then yn hn is called the impulse response of the system gt For FIRfilters bn for 0 g n g M hm 0 else gt Convolution inputoutput relationship ynXnhn i hlklXln k i xlklhln k 2 00 2 00 mgonaa ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systems Convolution and Linear Timeinvariant Systems Implementation of FIR c D ODD QGQCOQOQG O QQOQQGQQO 1 c 00000 J OQQDODOQ QOQQQ Reminders Linearity and TimeInvariance gt Linearity gt For arbitrary input signals X1 n and X2n let the ouputs be denoted y1 n and y2n gt Further for the input signal Xn X1 n X2n let the output signal be yln gt The system is linear if yn y1 n y2n gt TimeInvariance gt For an arbitrary input signal Xn let the output be yn gt For the delayed input XdIn Xn no let the output be Ydlnl gt The system is timeinvariant if ydln yn no gt Today For any linear timeinvariant system input output relationship is yn Xn hIn U N l V E K S l TV Paris ECE 201 Intro to Signal Analysis 234 I inear Time lrwarlant Systei ns Convolution and Linear Timeinvariant Systems Implementation oi Flirt 300 GO OOOOOOOO ooooc k oooooooo ooooo Preliminaries gt We need a few more facts and relationships for the impulse signal ln gt To start recall gt If input to a system is the impulse signal ln gt then the output is called the impulse response gt and is denoted by hn gt We will derive a method for expressing arbitrary signals xln in terms of impulses Paris ECE 201 Intro to Signal Analysis 235 Systems Special Linear Timeinvariant Systei ns Convolution and Linear Timeinvariant Systems Implementation of Flt i 4quot 1 a a c GU QQQQDDGOQ Q 000000000 000 0000 Q QDQGODQD OQDQD Sitting with lmpulses gt Question What happens if we multiply a signal xln with an impulse signal 6n 1 torn 0 6M 0 else gt Because gt it follows that XO for n O 0 else Paris ECE 201 Intro to Signal Analysis 236 Convolution and Linear Timeinvariant Systems lmplel nentation oi FlFl GQC GO QOOOOOOOO J 00000 Illustration 6 I I I I I I I I I H4 77777 777777 7777777 77777777 7777777 7777777 7777777 7777777 7777777 7777777 no 5 3 3 3 3 3 3 3 3 T T T T T T T T T quot o 5 4 3 2 1 o 1 2 3 4 5 n 1 t t n l l l kkkkkkkkkkkkkkkkkkkkkkkk kkkkkkk oo e A o o 5 4 3 2 1 o 1 2 3 4 5 n 2 E 00 Q1 777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 r P1GEORGE ECE 201 Intro to Signal Analysis Systems Special Eigr lals LineanTimeilwal iat ltSystems Convolution and Linear Timeinvariant Systems mpiementationotFTF D 39 0 0G QQQOQQGDD 6 000000000 GDQDQ D CQQQGDOD QDQDQ Sitting with Impulses gt Related Question What happens if we multiply a signal Xn with a delayed impulse signal 6n k gt Recall that ln k is an impulse located at the k th sampling instance 1 fornk MIT k ZT 0 else gt It follows that Xn 6n k Xk 6n k Paris ECE 201 Intro to Signal Analysis 238 Systems Special Signals Linear Time invariant Systems Convolution and Linear Timeinvariant Systems Implei nentation ot HR 1 M 30 3030306313123 4 QOOOOOOOO GQC J 00000 Illustration xn O quotA T s e e Lam O 5 4 3 2 1 0 1 3 4 5 n 1 I a f f f f IEIO5 V V V V V V V V V V V V V Ml V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V HI V V V V V V V V V V V V V V V HI V V V V V V V NI V V V V V V V V 1 1 1 1 0o e A e r o 5 4 3 2 1 0 1 2 3 4 5 n xn 8n2 A ECE 201 Intro to Signal Analysis Systems Special Sigr lals Convolution and Linear Timeinvariant Systems mplernentation oti FlF D 0 QB ooooooooo ooooooooo t n 3 ooooo Decomposing a Signal with Impulses gt Question What happens if we combine add signals of the form xn 6n k gt Specifically what is xk 6n k kz oo gt Notice that the above sum represents the convolution of xn and Mn 6n xn ECE 201 Intro to Signal Analysis Systems Special Signals Linear Tirne lrwarlant Systems Convolution and Linear Timeinvariant Systems Implementation oi Flirt Q Ar u GO GQDUDQGQQ 0 000000000 00000 QOQDQQQQ 00000 000 Decomposing a Signal with Impulses n 1 O 1 2 Xn x1 xO X1 x2 6n O 1 O O O x1 O o x0 o o X16n 1 O O X1 O o o o x2 ZZ OOXk 6n k X1 XO X1 x2 U N I V E I S l TV Paris ECE 201 Intro to Signal Analysis 241 Systems Special Linear Timeinvariant Systems Convolution and Linear Timeinvariant Systems Implementation of Fi r3 39 O QQQQDDOOQ GO 000 G 000000000 0000 O QDQGGODQ OQDQD Decomposing a Signal with Impulses gt From these considerations we conclude that 00 Z Xk 6n k Xn kz oo gt Notice that this implies Xn 6n Xn gt We now have a way to write a signal Xn as a sum of scaled and delayed impulses gt Next we exploit this relationship to derive our main result ECE 201 Intro to Signal Analysis W Signals LinearTimeinvariantSystems Convolution and Linear Timeinvariant Systems Im lementa tionoiFlH quotA Q COO GO OOOOOOOOO ooooc k commence ooooo Applying Linearity and TimeInvariance gt We know already that input 6n produces output hln impulse repsonse We write 6M I gt hln gt For a timeinvariant system 6n k H hln k gt And for a linear system Xk 6n k H xlk hn k U N I V E I S l TV Paris ECE 201 Intro to Signal Analysis 243 Systems Special Linear Timeinvariant Systei ns Convolution and Linear Timeinvariant Systems Implementation of Flt i n 000 U GU QQQQDDGOQ QODQOQDQG O OQDQD Derivation of the Convolution Sum gt Linearity linear combination of input signals produces output equal to linear combination of individual outputs Input H Output X 16n1 lt 1hn1 XO 6n H XO hn X16n 1 H X1hn 1 X2 6n 1 H X2 hn 2 l ZZZ ooxlkl Sln kl Xlnl H Yin ZZZ ooxlkl hln I ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systen39ls Convolution and Linear Timeinvariant Systems Implementation of FIR o 00 Dee oeooooooo 0 000000000 0 00000 0 00000000 0000 Summary and Conclusions gt We just derived the convolution sum formula ylnl Xlnlhlnl 1 f Xlklhln kl k oo gt We only assumed that the system is linear and timeinvariant gt Therefore we can conclude that for any linear timeinvariant system the output is the convolution of input and impulse response gt Needless to say convolution and impulse response are enormously important concepts ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systems Convolution and Linear Timeinvariant Systems Implementatioan FlFt o 000 0 00 000000000 0 000000000 00000 0 00000000 00000 Identity System gt From our discussion we can draw another conclusion gt Question How can we characterize a LTI system for which the output yn is the same as the input Xn gt Such a system is called the identity system gt Specifically we want the impulse response hn of such a system gt As always one finds the impulse response hn as the output of the LTI system when the impulse 6n is the input gt Since the ouput is the same as the input for an identity system we find the impulse response of the identity system ECE 201 Intro to Signal Analysis Convolution and Linear Timeinvariant Systems Implementation of HR 0 oo ooo ooooocooo O QODQD U QQQQQUQD OOOOO Ideal Delay Systems gt Closely Related Question How can one characterize a LTI system for which the output yn is a delayed version of the input Xn yinl Xin no where no is the delay introduced by the system gt Such a system is called an ideal delay system gt Again we want the impulse response hn of such a system gt As before one finds the impulse response hln as the output of the LTI system when the impulse 6n is the input gt Since the ouput is merely a delayed version of the input we find hn 6n no ECE 201 Intro to Signal Analysis Systems Special Signals Linear Timeinvariant Systems Convolution and Linear Timeinvariant Systems Implementation of HR 0 ooo O 00 QGQQQQOQQ Q QQOQQQQQQ 00000 0 00990000 00000 Exercise gt Show that convolution is a commutative operation ie that xln hn equals hn Xn ECE 201 Intro to Signal Analysis olution and Linear Timeinvariant Systems Implementation oi Fi U Lecture Convolution and Linear TimeInvariant Systems Paris ECE 201 Intro to Signal Analysis 249 Special LineatTime invariantSystems 00 Building Blocks gt Recall that the inputoutput relationship for an FIR filter is given by M Ylnl Z kaln kl k 0 gt Digital systems implementing this relationships are easily constructed from simple building blocks yn X11 X11 z11 b yn Xn Unit Vln Delay 5 Adder Multiplier Unit delay 4mm ECE 201 Intro to Signal Analysis lime luwariant 391 39 and quotlimeinvariant Systems Implementation of FIR 00 Operation of Building Blocks yn X11 Xln Z11 b y11 Xn Unit YIl Delay 5 Adder Multiplier Unit delay gt Adder sum of two signals Zinl Xlnl yinl gt Multiplier product of signal with a scalar ylnl b Xlnl gt Unitdelay delays input by one sample nmxm u ME Paris ECE 201 Intro to Signal Analysis 251 rant Implementation of FIR ooo Block Diagrams Paris ECE 201 Intro to Signal Analysis 252 ecwency Part VI Frequency Response Paris ECE 201 Intro to Signal Analysis 253 Lecture Introduction to Frequency Response ECE 201 Intro to Signal Analysis Introduction to Frequency Response OOOOOOOOOO Introduction gt We have discussed gt Sinusoidal and complex exponential signals gt Spectrum representation of signals gt arbitrary signals can be expressed as the sum of sinusoidal or complex exponential signals gt Linear timeinvariant systems gt Next complex exponential signals as input to linear timeinvariant systems A expj27tfdn p gt System yn niGEORGE Paris ECE 201 Intro to Signal Analysis 255 Introduction to Frequency Response Frequency ct LTl Systems ooooooooooo lJ OOQDQQQQ Example 3Point Averaging Filter gt Consider the 3point averager 1 2 Yin glgxln k Xn Xn 1 Xn 2 JOI L gt Question What is the output yln if the input is xln expj27tfdn gt Recall that fd is the normalized frequency ffs we are assuming the signal is oversampled lfdl lt gt Initially assume A 1 and qb O generalization is easy Paris ECE 201 Intro to Signal Analysis 256 Introduction to Frequency Response Frequency Response of Hi Systems 00000000000 0 00000000 Delayed Complex Exponentials gt The 3point averager involves delayed versions of the input signal gt We begin by assessing the impact the delay has on the complex exponential input signal gt For xln expj27rfdn a delay by k samples leads to Xn k expj27rfdn k e2739Efdn 2739Efdk ej27rfdn e j27rfdk I e27Ifdngbk ej27rfdn egbk Where 45k 271de is the phase shift induced by the k sample delay U N l V E R S l TV ECE 201 Intro to Signal Analysis Introduction to Frequency Response Frequency Response of Hi Systems ooooooooooo Q QOOQQGQQ Average of Delayed Complex Exponentials gt Now the output signal yln is the average of three delayed complex exponentials Ylnl Z o Xln kl 20 e2739L fdn 2739Efdk gt This expression involves the sum of complex exponentials of the same frequency the phasor addition rule applies 1 2 Z e j27 lffdk 3 k0 yn ej27rfdn gt Important Observation The output signal is a complex exponential of the same frequency as the input signal gt The amplitude and phase are different u N l V E R S l YV Paris ECE 201 Intro to Signal Analysis 258 Introduction to Frequency Response Frequency Response oi lTl Systems 00000000000 0 oooooooo Frequency Response of the 3Point Averager gt The output signal yln can be rewritten as 6271 de e j27 lffdk e27de Hfd where Hfd 20642 de e j27 ffd e j27 E2fd e j27 ffde27de 1 e j27 ffd 0 2cos27rfd COI LCOI LCOI L ECE 201 Intro to Signal Analysis Introduction to Frequency Response Prague 00000000000 0 Interpretation gt From the above we can conclude gt If the input signal is of the form Xn expj27rfdn gt then the output signal is of the form Ylnl Hfd 39eXp27den gt The function Hfd is called the frequency response of the system gt Note If we know Hfd we can easily compute the output signal in response to a complex expontial input signal ECE 201 Intro to Signal Analysis Introduction to Frequency Response Frequency Response LTl Systems ooooooooooo 39 Ct GOOOGQDQ Examples gt Recall e j271 fd 3 Let Xn be a complex exponential with fd O gt Then all samples of Xn equal to one Hfd 1 2cos27rfd V V The output signal yln also has all samples equal to one For fd O the frequency response HO 1 And the output yln is given by V V ylnl H0 39GXPUZNOH ie all samples are equal to one MSITV Paris ECE 201 Intro to Signal Analysis 261 Introduction to Frequency Response Frequency of LTl Systems ooooooooooo L OOODQQQQ Examples gt Let xln be a complex exponential with fd gt Then the samples of Xn are the periodic repetition of 1 1 1 gt The 3point average over three consecutive samples equals zero therefore yn O gt For fd the frequency response Hfd O gt Consequently the output yln is given by ylnl Hg explt2nngt 0 Thus all output samples are equal to zero U N l V E 5 I TV Paris ECE 201 Intro to Signal Analysis 262 Introduction to Frequency Response Frequency Response oi lTl Systems 00000000000 0 OOODDODD Plot of Frequency Response 4 A 3 I H O D U 6 C Q n1GEOR UNIVERSITY ECE 201 Intro to Signal Analysis Introduction to Frequency Response Frequency Response oi iTi Systems OOOOOOOOOOO QOOQQQQC General Complex Exponential gt Let Xn be a complex exponential of the from AeZ fdnw gt This signal can be written as Xn x e27de where X A9 is the phasor of the signal gt Then the output yn is given by ylnl Had X expuznfdn gt Interpretation The output is a complex exponential of the same frequency fd gt The phasor for the output signal is the product Hfd X UNIVERSlTV ECE 201 Intro to Signal Analysis Introduction to Frequency Response Frequency Response oi Lil Systems ooooooooooo Ct oooooooo Lecture The Frequency Response of LTI Systems ECE 201 Intro to Signal Analysis introduction to Frequency Response Frequency Response of LTI Systems ooooooooooo ooooooeo Introduction gt We have demonstrated that for linear time invariant systems gt the output signal yn gt is the convolution of the input signal Xn and the impulse response hn ylnl Xlnl hlnl zl o hlkl Xln kl gt Question Find the output signal yn when the input signal is Xn Aexpj27rfn qb Paris ECE 201 Intro to Signal Analysis 266 introduction to Freqliericy Response Frequency Response of LTI Systems 00000000000 0 00000000 Response to a Complex Exponential gt Problem Find the output signal yn when the input signal is Xn Aexpj27rfn qb gt Output yn is convolution of input and impulse response ylnl Xlnl hlnl HALO hlkl Xln kl Ell0 hlkl Aexp2nfn k qb A expj27rfn qb 2120 hlk exp j27rfk A expj27rfn gb Hf gt The term M Hf Z hk exp j27rfk k0 is called the Frequency Response of the system ECE 201 Intro to Signal Analysis introduction to Frequency Response Frequency Response of LTI Systems ooooooooooo 0 0000000 Interpreting the Frequency Response The Frequency Response of an LT system with impulse response hn is M Hltrgt hlkl 39eXP f27Tfk k0 gt Observations gt The response of a LTI system to a complex exponential signal is a complex exponential signal of the same frequency gt Complex exponentials are eigenfunctions of LTI systems gt When Xn Aexpj27rfn qb then yn Xn Hf gt This is true only for complex exponential input signals m s BGN U N l V E R S 1 TV Paris ECE 201 Intro to Signal Analysis 268 introduction to Frequency Response Frequency Response of LTI Systems QOOGODQQOQO 0 00000000 Interpreting the Frequency Response gt Observations gt Hf is best interpreted in polar coordinates Hf lHfl 94 gt Then for Xn AGXP27Tfn P ylnl Xlnl Hf AGXpj27Tf7 4 Hf ell4U A Hf expj27rfnlt 4Hf gt The amplitude of the resulting complex exponential is the product A lHfl gt Therefore Hf is called the gain of the system gt The phase of the resulting complex exponential is the sum qgtzHltfgt gt 4Hf is called the phase of the system ms U N I V E R S I TY ECE 201 Intro to Signal Analysis introduction to Frequency Response Frequency Response of LTI Systems ooooooooooo C OOOOOOOO Example gt Let hn 1 21 gt Then W 20 hlkl explt 2n ltgt 1 2 exp j27rf 1 exp j27rf2 exp j27rf expj27rf 2 exp j27rf exp j27rf 20032711 2 gt Gain lHfl lZCos27rf 2l ECE 201 Intro to Signal Analysis Frequency Response of LTI Systems lnhoduc ontolaequency5esponse oooooogoooo 0 00000000 Example Phase of Hfd O N I pF ECE 201 Intro to Signal Analysis introduction to Frequency Response Frequency Response of LTI Systems OQOODDQOOQQ Q OOOOOOOO Example gt The filter with impulse response hln 1 2 1 is a high pass filter gt It rejects sinusoids with frequencies near f O gt and passes sinusoids with frequencies near f g gt Note how the function of this system is much easier to describe in terms of the frequency response Hf than in terms of the impulse response hln gt Question Find the output signal when input equals Xn 2 expj27rf 4n 712 gt Solution H exp j27r 2cos2n 2 2ej 2 2dr Thus yn 2e 7T2 Xn 4expj27rn4 ECE 201 Intro to Signal Analysis mijmx lum m mg Sigma 133 L EQE 1 Prof Paris Last updated October 31 2007 Lecture Introduction to Sampling o MATLAB and other digital processing systems can not process continuoustime signals 0 Instead MATLAB requires the continuoustime signal to be converted into a discretetime signal 0 The conversion process is called sampling 0 To sample a continuoustime signal we evaluate it at a discrete set of times In nTS where o n isa integer 0 TS is called the sampling period time between samples a fS 1TS is the sampling rate samples per second 2m FeteTime Signals 0 Sampling results in a sequence of samples XnT5 A cos27rfnT5 gt 0 Note that the independent variable is now n not I 0 To emphasize that this is a discretetime signal we write Xn A cos27rfnT5 gt 0 Sampling is a straightforward operation 0 We will see that the sampling rate f5 must be chosen with care 0 Note that we have worked with sampled signals whenever we have used MATLAB O For example we use the following MATLAB fragment to generate a sinusoidal signal is l H O lls 3 xx 5cos2pi2tt piA o The resulting signal xx is a discretetime signal 0 The vector xx contains the samples and o the vector tt specifies the sampling instances 01fs2fsm3 0 We will now turn our attention to the impact of the sampling rate 1 0 Objective In MATLAB compute sampled versions of three sinusoids Q Xt COS27rf 7r4 Q Xt COS27r9f 7 7r4 Q Xt COS27r1 l t 7r4 o The sampling rate for all three signals is f5 10 SampfngD 7 fsampl39 1s 10 dur10 113 duh cos2piupi4 cos piwu ipiM XXZ 2 XXS cos2pi11upi4 plolHxx1 0 XXZ X Hxx3 gri Xlabe Tmeus emui Sampe three snusude sgnas r0 demunsrrare me rmpacr Hg o The samples for all three signals are identical how is that possible o Is there a bug in the MATLAB code 0 No the code is correct 0 Suspicion The problem is related to our choice of sampling rate 0 To test this suspicion repeat the experiment with a different sampling rate 0 We also reduce the duration to keep the number of samples constant that keeps the plots reasonable Sam A 0f 5 s 100 dur 1 H 0113 duh xx1 cos2piupi4 XXZ cos2pi9nipi4 XXS 7 cos2pi11upi4 plolH xx1 H XXZ gtgtlt H XXS hold on plolH11U endxx1110 end ok grid xlabe T meus hold 011 pfngDemUHghi Sampe three snusude sgnas r0 demunsrrare me rmpacr ampmg The fine Sampling Rate 0 Now the three sinusoids are clearly distinguishable and lead to different samples 0 Since the only parameter we changed is the sampling rate f5 it must be responsible for the ambiguity in the first plot 0 Notice also that every 10th sample marked with a black circle is identical for all three sinusoids 0 Since the sampling rate was 10 times higher for the second plot this explains the first plot o It is useful to investigate the effect of sampling mathematically to understand better what impact it has 2m o A continuoustime sinusoid is given by Xt Acos27rft gt 0 When this signal is sampled at rate f5 we obtain the discretetime signal Xn Acos27rfnf5 gt o It is useful to define the normalized frequency fd so that Xn Acos27rfdn gt 0 We will distinguish between three cases 0 0 g fd g 12 Oversampling 9 12 lt fd g1 Undersampling folding Q 1 lt fd g 32 Undersampling aliasing o This captures the three situations addressed by the first example 0 f1fs10 fd110 Q f9fs10 fd910 Q f11fs10 fd1110 0 We will see that all three cases lead to identical samples 0 When the sampling rate is such that 0 g fd g 12 then the samples of the sinusoidal signal are given by Xn Acos27rfdn gt o This cannot be simplified further o It provides our baseline o Oversampling is the desired behaviour 0 When the sampling rate is such that 1 lt fd g 32 then we define the apparent frequency fa fd 7 1 0 Notice that O lt fa g 12 0 Forf11fs10 fd 1110efa11ot o The samples of the sinusoidal signal are given by Xn Acos27rfdn gt ACOS27r1 fan gt 0 Expanding the terms inside the cosine Xn Acos27rfan 27m gt Acos27rfan gt 0 Interpretation The samples are identical to those from a sinusoid with frequency fa fS and phase 425 0 When the sampling rate is such that 12 lt fd g 1 then we introduce the apparent frequency fa 1 7 fd again 0 lt fa 1 2 o Forf9fs10 fd 910 f311Ot o The samples of the sinusoidal signal are given by Xn Acos27rfdn gt ACOS27r1 7 fan gt 0 Expanding the terms inside the cosine Xn Acos727rfan 27m gt Acos727rfan gt 0 Because of the symmetry of the cosine cosX cos7X this equals Xn Acos27rfan 7 gt o For sinusoids of even higher frequencies 1 either folding or aliasing occurs 0 As before let fd be the normalized frequency ffs 0 Decompose fd into an integer part N and fractional part 69 0 Example If fd is 57 then N equals 5 and fp is 07 0 Notice that 0 g fp lt 1 always 0 Phase Reversal occurs when the phase of the sampled sinusoid is the negative of the phase of the continuoustime sinusoid 0 We distinguish between 0 Folding occurs when fp gt 12 Then the apparent frequency fa equals 1 7 fp and phase reversal occurs 0 Aliasing occurs when fp g 12 Then the apparent frequency is 1 3 fp no phase reversal occurs Pr 15 Wt o For the three sinusoids considered earlier 0 f1q57r4fs10 fd110 Q f9 44 10 e fd 910 9 f11q57r4fs10 fd1110 o The first case represents oversampling The apparent frequency fa fd and no phase reversal occurs 0 The second case represents folding The apparent fa equals 1 7 fd and phase reversal occurs 0 In the final example the fractional part of fd 110 Hence this case represents alising no phase reversal occurs The discretetime sinusoidal signal Xn Scos27r02n 7 g was obtained by sampling a continuoustime sinusoid of the form Xt Acos27rft gt at the sampling rate I 8000 Hz 0 Provide three different sets of paramters A f and gt for the continuoustime sinusoid that all yield the discretetime sinusoid above when sampled at the indicated rate The parameter f must satisfy 0 lt flt 12000 Hz in all three cases 9 For each case indicate if the signal is undersampled or Pr 5 Mi Lecture The Sampling Theorem 0 We have analyzed the relationship between the frequency fol a sinusoid and the sampling rate f5 0 We saw that the ratio ffS must be less than 12 ie fS gt 2 f 0 Otherwise aliasing or folding occurs 0 This insight provides the first half of the famous sampling theorem edtrLCla I1deSha n non Nd am imammmr Sr immme quotSignal from Sampls o The sampling theorem suggests that the original continuoustime signal Xt can be recreated from its samples Xn 0 Assuming that samples were taken at a high enough rate 0 This process is referred to as reconstruction or DtoC conversion 0 In principle the continoustime signal is reconstructed by placing a suitable pulse at each sample location and adding all pulses o The amplitude of each pulse is given by the sample value 2m ll 0 Suitable pulses include o Rectangular pulse zeroorder hold 7 1 foriTSZ g tlt TS2 pm 7 0 else 0 Triangular pulse linear interpolation 1tTS foring th pt 17 tTS forOg tg TS 0 else o The reconstructed signal 31 is computed from the samples and the pulse pt 0 21 Z Xn pt 7 nTS n7oo o The reconstruction formula says a place a pulse at each sampling instant p07 nTs 0 scale each pulse to amplitude Xn 0 add all pulses to obtain the reconstructed signal 0 Reconstruction with the above pulses will be pretty good 0 Particularly when the sampling rate is much greater than twice the signal frequency significant oversampling 0 However reconstruction is not perfect as suggested by the sampling theorem 0 To obtain perfect reconstruction the following pulse must I 7 sin7rtT5 7 7rf T5 39 o This pulse is called the sinc pulse 0 Note that it is of infinite duration and therefore is not practical o In practice a truncated version may be used for excellent reconstruction be used Wm Wmmmwi 391 O J k t 02 r n J Pan Lecture Introduction to Systems and FIR filters 0 A system is used to process an input signal Xn and produce the ouput signal yn 0 We focus on discretetime signals and systems 0 a correspoding theory exists for continuoustime signals 0 Many different systems 0 Filters remove undesired signal components 0 Modulators and demodulators a Detectors Xn 4 System 4 Ylnl J W 4 ame mmm 0 The following are examples of systems a Squarer yn Xn2 o Modulator yn n cos27rfdn o Averager yn ML Ekoxn7 k 0 FIR Filter yn 220 kan 7 k l W 4 Etame mmm wam 0 System relationship between input and output signals yn Xnl2 0 Example Input signal Xn 123432 1 0 Notation Xn 123432 1 means XO1 X1 2 t t X6 1 all other Xn 0 0 Output signal yn 14916941 Mth 0 System relationship between input and output signals yn Xn cos27rfdn assume fd 05 ie cos27rfdn 1 71 1 71 0 Example Input signal xn 123432 1 0 Output signal yn 1 72 3 743721 l at z 4 31me 43mm A 0 System relationship between input and output signals ytn Ma 220 xi 7 k Mli xnxni1xni M Zk0 xl kl 0 This system computes the sliding average over the M 1 most recent samples 0 Example Input signal xn 123432 1 o For computing the output signal a table is very useful 0 synthetic multiplication table n 1012 3 4 5 6 7 8 Xn012 3 4 3 21 o o 1 12 4 21 W 1 1 Mi1xn72 o o o g g 1 g 1 g g yn012 3 33 3 21 g yn0 7233 21 l at z 4 Etame mmm gen 0 The Mpoint averager is a special case of the general FIR filter 0 FIR stands for Finite Impulse Response we will see what this means later 0 The system relationship between the input Xn and the output yn is given by M yn Zbk xn7 k k0 i at z 4 31me 43mm gen 0 The filter coefficients bk determine the characteristics of the filter 0 Clearly with bk If for k O1Mwe obtain the Mpoint averager o Computation of the output signal can be done via a synthetic multiplication table 0 Example Xn 12341521 and bk 1721 7 8 O O O O 2 O 2 1 O 1 6 1 1 4 3 o 5 2 2 6 4 O 7071 mmm 4 3 3 8 3 2 7 O 0 7 3 4 4 6 2 O 2 man mmquot mm 7 23341007 0 12220007 1 011001f0ltL 4OOOOOF W H y n mnnm nX X XXV1 1 21 7 0 Find the output signal yn for an FIR filter M yn Zbk xn7 k k0 with filter coefficients bk 1 71 2 when the input signal is Xn 1242421 O The signal with samples M 7 1 for n O 7 O for n lt O is called the unitstep sequence or unitstep signal 0 The output of an FIR filter when the input is the unitstep signal Xn un is called the unitstep response rn W114 FIRFiIter 4m 2m 1111117 39 0 Input signal Xn un 0 Output signal rn g 10 un 7 k n 71 o 1 2 3 un O 1 1 1 1 Mn 0 g g 7 7 gun71 o o g 7 7 gun72 o o o 7 7 rn 0 g g 1 1 o The signal with samples 1 torn0 6lnl O torny O is called the unitimpulse sequence or unitimpulse signal 0 The output of an FIR filter when the input is the unitimpulse signal Xn 6n is called the unitimpulse response denoted hn 0 Frequently we will simply call the above signals simply impulse signal and impulse response 0 We will see that the impulseresponse captures all characteristics of a FIR filter 0 Input signal Xn 6n 0 Output signal hn gZQI 6n7 k n 1 0 1 2 3 M 6n o 1 o o o 0 191 6I7 7 1 0 0 b1 0 0 0 192 6n7 2 o o 0 b2 0 o bM 6n7 M o o o o o bM hn 0 b0 b1 b2 b3 bM Wt ll tgllglll l o For an FIR filter the impulse response equals the sequence of filter coefficients 7 bn forn01M hn 7 0 else 0 Because of this relationship the system relationship for an FIR filter can also be written as yn 250 kal k 2H hklxln e k 23 00 hkxn 7 k 0 The operation yn hn gtk Xn 23 00 hkxn7 k is called convolution it is a very very important operation Lecture Linear TimeInvariant Systems lmmdt 0 We have introduced systems as devices that process an input signal Xn to produce an output signal yn 0 Example Systems a Squarer yn Xn o Modulator yn n cos27rfdn with 0 lt fd g o FIR Filter M Jlnl Zhlkl Xln kl k0 Recall that hk is the impulse response of the filter and that the above operation is called convolution of hn and Xn 0 Objective Define important characteristics of systems and determine which systems possess these characteristics 0 Definition A system is called causal when it uses only the present and past samples of the input signal to compute the present value of the output signal 0 Causality is usually easy to determine from the system equation 0 The outputyn must depend only on input samples Xnxn 71Xn 7 2 t t t 0 Input samples Xn 1Xn2 t H must not be used to find NH 0 Examples 0 All three systems on the previous slide are causal o The following system is noncausal 1 yin11 Z Xlnikl Xln1lxlnlxlni 1 7M 0 The following test procedure defines linearity and establishes how one can determine if a system is linear 0 References For i 12 pass input signal Xn through the system to obtain output yn 9 Linear Combination Form a new signal Xn from the linear combination of X1 7 and X2n Xn X1 n X2nt Then Pass signal Xn through the system and obtain yn 9 Check The system is linear if yin Y1 in J2lnl o The above must hold for all inputs X1n and X2n o For a linear system the superposition principle holds Pi Mi X2 n 8 Y2 n I t These two outputs must be identical o Squarer yn n2 0 References yn n2 for i 12 9 Linear Combination Xn X1n X2n and Jquot Xn2 X1nX2quot2 X1n2X2quot22X1nixzinie 9 Check Jn a y1inlJ2n X1II7D2 lenl 0 Conclusion not linear o Modulator yn xn 00327rfdn 0 References yn Xn cos27rfdn for i 12 9 Linear Combination Xn X1n X2n and yn Xin 00827rfdn X1n X2n cos2 rfdni 9 Check Jn J1n y2n X1I7 cos27rfdn X2n cos27rfdni 0 Conclusion linear o FIR Filter yn 220 hk Xn7 k 0 References yn EffLo hk X39I77 k for i 12 Linear Combination Xn X1n X2n and M M Jn Zhikl Xn k Z W X1n k X2n kl k0 k0 9 Check M M Jn J1inJ2n Z W X1nkiZ hik X2n kii k0 k0 0 Conclusion linear him1mm 99mm 0 The following test procedure defines timeinvariance and establishes how one can determine if a system is timeinvariant 0 Reference Pass input signal Xn through the system to obtain output yn Q Delayed Input Form a new signal Xdn Xn 7 no Then Pass signal Xdn through the system and obtain ydn Q Check The system is timeinvariant if Jlni nol Win 0 The above must hold for all inputs Xn and all delays no 0 Interpretation A timeinvariant system does not change the way it processes the input signal with time T mg mmm Malina WM These two outputs must be identical

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

#### "I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

#### "Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.