ColorGrayscale Jeffrey Schiano 2014. All rights reserved. Rec 2. EE 350Continuous-Time Linear SystemsRecitation 21 Jeffrey Schiano 2014. All rights reserved. Rec 2. Recitation 2 Topics• Solved Problems– Classification of Signals– Basic Signal Operations• MATLAB Programming– Desktop Environment– Basic Operations, Built-In Functions, and Variables– m-files– Graphics: 2D plots2 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 1• Consider the signal1. Sketch f(t)2. Classify f(t) as a causal or noncausal signal3. Is f(t) either an even or odd function?4. Is f(t) periodic or aperiodic?5. Is f(t) an energy signal? If so, determine the energy metric f6. What is Pf, the power of the signal f(t)?3() ( )tft eu t Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 1 Solution4 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 1 Solution5 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 1 Solution6 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 2• Consider the signal1. Sketch f(t)2. Classify f(t) as a causal or noncausal signal3. Is f(t) either an even or odd function?4. Is f(t) periodic or aperiodic? If periodic, what is the fundamental period?5. Is f(t) an energy signal? If so, determine the energy metric f6. Is f(t) a power signal? If so, determine the power metric Pf7( ) 5 ( 10 2) u(t 10 2)nnft ut n n Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 2 Solution8 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 2 Solution9 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 2 Solution10 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 3• Express the signal f(t) the signal as sum of even and odd functions1. Verify, for an arbitrary f(t), that the functions fe(t) and fo(t) are even and odd functions, respectively2. Determine expressions for fe(t) and fo(t) for the given f(t)3. Sketch f(t), fe(t) and fo(t)11-() () () ()where() ( ) () ( )( ) and ( )22teoeoft eut f t f tft f t ft f tft ft Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 3 Solution12 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 3 Solution13 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 3 Solution14 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 4• Consider the signal shown below1. Find an expression for f(t)2. Sketch the following signals: f(t-1), 2f(t+1), f(t/3), f(-t), f(1-t)15()ftt1011 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 4 Solution16 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 4 Solution17 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 4 Solution18 Jeffrey Schiano 2014. All rights reserved. Rec 2. MATLAB• MATLAB (matrix laboratory) is a numerical computing environment and programming language• MATLAB allows– Matrix manipulations– Plotting– Implementation of algorithms– Symbolic computing– Creation of user interfaces19 Jeffrey Schiano 2014. All rights reserved. Rec 2. SIMULINK• A dataflow graphical programming language for modeling and simulating dynamic systems• Widely used in control systems engineering and signal processing• Tightly integrated with the MATLAB environment20 Jeffrey Schiano 2014. All rights reserved. Rec 2. Launch MATLAB21 Jeffrey Schiano 2014. All rights reserved. Rec 2. Basic Operations• MATLAB supports basic operations and can be used as a calculator22Operation MATLAB Example Resultaddition 200 + 350 550subtraction 300 - 200 100multiplication 4*16 64division 24/6 4power 4^2 16 Jeffrey Schiano 2014. All rights reserved. Rec 2. Built-In Functions• There are a host of useful functions• To learn about a function xyz, type: >> help xyz23Operation MATLAB Example Resultnatural logarithm log(10) 2.3026logarithm Base 10 log10(10) 1exponent (ex) exp(1) 2.7183square root sqrt(100) 10cos (radians) cos(pi) -1cosd (degrees) cosd(45) 0.7071 Jeffrey Schiano 2014. All rights reserved. Rec 2. Variables• MATLAB does not require any variable type declarations or dimension statements to define variables• When defining a variable, it must appear on the left side of the equality sign• Multiplication must be explicit, that is, include the multiplication symbol *24acceptable: >> x = 3unacceptable: >> 3 = xacceptable: >> y = 3*x + 2unacceptable: >> y = 3x + 2 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 5• Use Euler's identity to determine the rectangular form of• Verify your result using the MATLAB command window– MATLAB recognizes i and j as the square root of -1– Use 1i to improve calculation speed254jxe Jeffrey Schiano 2014. All rights reserved. Rec 2. Vectors• Row vector: >> w = [1, 2, 3, 4]• Column vector: >> x = [1; 2; 3; 4]• Row Vector of 5 ones: >> y = ones(1,5)• Column vector of 5 ones: >> x = ones(5,1)• Row vector of 3 zeros: >> a = zeros(1,3)• A vector [1, 1.5, 2]: >> b = [1 : 0.5 : 2]• A row vector of 100 points evenly spaced between 0 and 10: >> c = linspace(0,10);– The semicolon suppresses the echo!26 Jeffrey Schiano 2014. All rights reserved. Rec 2. Scripts• MATLAB statements may be executed in a script as control flow program• Generate a script by choosing New Script (Ctrl + N)27 Jeffrey Schiano 2014. All rights reserved. Rec 2. Problem 6• Write a script that plots cos(t) and sin(t) versus t using 100 points uniformly distributed over the interval 0 to 4• Plot the cosine signal using a solid black curve, and the sine signal using a dotted blue curve• Use the legend command to distinguish the curves in the plot• Use the xlabel, ylabel, and title commands to label the plot28 Jeffrey Schiano 2014. All rights reserved. Rec 2. EE 350Continuous-Time Linear SystemsRecitation 21 Jeffrey Schiano 2014. All rights reserved. Rec 2. Recitation 2 Topics• Solved Problems– Classification of Signals– Basic Signal Operations• MATLAB
View Full Document