ROSE HULMAN INSTITUTE OF TECHNOLOGY Department of Electrical and Computer Engineering ECE 300 Signals and Systems Fall 2006 Fourier Series and Filtering Periodic Signals Lab 04 by Robert Throne base on a lab by M Yoder Objectives A variety of interesting waveforms can be expressed as sums of complex exponentials of different frequencies The pulse trains used in communication systems speech waveforms and the waveforms produced by musical instruments can be modeled in this way It is also important to determine how these periodid signals are modified when they are the input to a linear time invariant system The four main objectives of this lab are 1 Improve your knowledge of programs and functions in MATLAB and 2 Write a function that will sum several complex exponential terms 3 Understand how Fourier series coefficients are changed when a periodic signal goes through a system 4 Review filtering of signals and develop an understanding of the relationship between the phase of a system and the time delay in the output signal Procedure A Efficient Synthesis of x t The way your program Complex Fourier Series m computes x t is very inefficient and we are going to try and speed this up and take advantage of Matlab s strengths In what follows remember we want to compute x t k N ce k N jk o t k To do this we need to do the following a Copy Complex Fourier Series m to a new file Lab4 m or something similar You do not want to write over code that is already working b Define an array W N 0 N 1 0 0 which we can write as W N 0 0 N 1 0 N 0 N 1 1 0 1 N 1 N o c In order to use this sum we need the array C c N c N 1 c 1 c0 c1 cN 1 cN Page 1 of 6 ECE 300 Signals and Systems Fall 2006 What we have is c0 and the array c c1 cN 1 cN Use these arrays and the properties of the coefficients to construct the array C Your method of construction should work for any sized array The Matlab commands fliplr and conj will be very helpful here Constructing C should require one statement in Matlab and of course must occur after c and c0 are available d Remove comment out the for loop that determines the Fourier estimate of x t i e the synthesis part of the code e Now write a function sum exp which takes as arguments W C and t where t is an array of the times we want to find x at The command est sum exp C W t should return the vector est evaluated at all times t To understand how we are going to do this let s consider the following situation Assume we want to know est t at three times and we are going to use up to the second harmonic in the Fourier series representation N 2 so we have est ti for i 1 2 3 Assume we have a row vector of the three times t t1 t2 W 2 0 C c 2 0 c 1 c0 0 0 k 2 c e k 2 jk o ti k t3 the row vector 2 0 of the required frequencies and the row vector c1 c2 First let s form 2 0 1 0 jW T t j 0 t1 t2 0 2 0 j 2 0t1 j1 t 0 1 t3 0 j1 0t1 j 2 0t1 j 2 0t2 j1 0t2 0 j1 0t2 j 2 0t2 j 2 0t3 j1 0t3 0 j1 0t3 j 2 0t3 Then e j 2 0t1 j1 0t1 e jW T t 1 e j1 0t1 e e j 2 0t1 e j 2 0t2 e j1 0t2 1 j1 0t2 e e j 2 0t2 e j 2 0t3 e j1 0t3 1 e j1 0t3 e j 2 0t3 Finally by premultiplying by C we will get the desired result The function sum exp should actually consist of one line of code The Matlab command transpose may also be of some help here f Plot the following function and the Fourier series representation of the function using 50 terms Include this figure in your lab notebook and have it checked off before you go on You have already determined a Fourier series representation for this function on your homework Page 2 of 6 ECE 300 Signals and Systems Fall 2006 0 2 t 1 1 1 t 2 f t 3 2 t 3 0 3 t 4 Instructor Verification see last page Procedure B Filtering Periodic Signals One of the reasons for using a Fourier Series representation of a periodic signal instead of a different type of representation is that we get a frequency domain representation of the original signal x t Recall from phasor analysis that if the input to a LTI system is x t A cos 0t the steady state output will be y t A H j 0 cos 0t H j 0 Let s rewrite the periodic input signal x t using Euler s identity x t A j 0t A j 0t e e 2 2 We can rewrite the output as A H j 0 j 0t H j 0 A H j 0 j 0t H j 0 e e 2 2 Using the properties that for a real system H j 0 H j 0 the magnitude is an even y t function and H j 0 H j 0 the phase is an odd function we get A H j 0 e j H j 0 j 0t A H j 0 e j H j 0 j 0t e e 2 2 Now if we recognize the above expression for x t as its Fourier series representation with coefficients Ae j Ae j c 1 c0 0 c1 2 2 we can write y t y t c 1 H j 0 e j 0t c1 H j 0 e j 0t b 1e j 0t b1e j 0t In general then if x t has the finite Fourier series representation x t k N ce k N jk o t k Page 3 of 6 ECE 300 Signals and Systems Fall 2006 then the steady state output will be given by y t k N be k N k jk o t where bk ck H jk 0 We are now ready to modify Lab4 m so we can filter signals a We will start with a simple filter H j j This filter computes the derivative of the input For this filter determine a new vector H H jN 0 H j N 1 0 H 0 H j N 1 0 H jN 0 b Construct the new vector this should be easy to do B c N H jN 0 c N 1 H j N 1 0 c0 H 0 cN 1 H j N 1 0 cN H jN 0 c Plot the output …
View Full Document