ROSE HULMAN INSTITUTE OF TECHNOLOGY Department of Electrical and Computer Engineering ECE 300 Signals and Systems Fall 2008 Fourier Series and Filtering Periodic Signals Lab 06 by Robert Throne 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 periodic 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 in MATLAB and 2 Understand how Fourier series coefficients are changed when a periodic signal goes through a system 3 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 1 Plotting a Periodic Signal using the Complex Fourier Series Copy your file Complex Fourier Series m to a new file lab6 m Be sure to delete anything that is not necessary in this code since part of your grade will be based on your code Plot the Complex Fourier series representation of the following periodic function defined over one period using 20 terms of the series 0 2 t 1 1 1 t 2 x t 3 2 t 3 0 3 t 4 Note that the function does not start at zero be sure your quadl function does not assume this Page 1 of 1 ECE 300 Signals and Systems Fall 2008 Procedure 2 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 If x t is a periodic signal with period T then it has the Fourier series k 2 1 representation x t ck e jk ot where 0 and ck x t e jk ot dt Using the fact that TT T k the magnitude of the ck is even and the phase of the ck is odd we can rewrite the complex Fourier series as a Fourier cosine series x t k ce k k jk o t k co 2 ck cos k o t ck k 1 Assume next we have a periodic signal x t A cos 0t We can represent this as a phasor X A Assume this signal is the input to an LTI system with transfer function H j We know we are only interested in the response of the transfer function at the same frequency as the input so we want H j 0 Again we can represent the transfer function as the phasor H H j 0 H j 0 The output of the system in steady state is then Y HX A H j 0 H j 0 Going back from phasor notation to the time domain we have the steady state output is y t A H j 0 cos 0t H j 0 Now assume we have two inputs to the system x1 t A1 cos 1t 1 x 2 t A2 cos 2t 2 We can represent these two inputs as phasors X1 A1 1 X 2 A2 2 For each input the corresponding output will be Y1 H1X1 where H1 H j 1 H j 1 Y2 H 2 X 2 where H 2 H j 2 H j 2 The steady state output due to each input is then Page 2 of 2 ECE 300 Signals and Systems Fall 2008 y1 t A1 H1 j 1 cos 1t 1 H j 1 y2 t A2 H 2 j 2 cos 2t 2 H j 2 If the input is x t x1 t x2 t then by linearity our output will be y t y1 t y2 t A1 H1 j 1 cos 1t 1 H j 1 A2 H 2 j 2 cos 2t 2 H j 2 Now assume we have a periodic signal x t as the input to an LTI system with transfer function H j Since this signal is periodic it has a Fourier series representation x t k k k ck e jk ot co 2 ck cos k o t ck k 1 Extending our analysis above the steady state output of the system will be k y t c0 H 0 2 ck H jk 0 cos k ot ck H jk 0 k 1 a Modify your code in lab6 m to produce the output signal for a filtered signal We will actually only be looking at the first N terms in the Fourier series as we have been We will start with a simple filter H j j This filter computes the derivative of the input In order to do this so we can reuse the code we will break this up into two pieces Let s define the variable H0 to be the value of the transfer function at 0 and the variable array H to be the value of the transfer function at the discrete frequencies 0 2 0 3 0 N 0 It is probably easiest to assign these frequencies to a variable array W 1 N o b For the periodic signal you determined the complex Fourier series of in part a plot the Fourier series representation of both the input signal and the output signal using different line types and a legend Start with N 5 and gradually increase N until you see what is happening and you get a good graph If N becomes too large you will not be able to see much Print out a good plot and attach it to the worksheet at the end of this lab Describe what you see think about the derivative of the step function Have this part checked off before you go on Instructor Verification see last page Page 3 of 3 ECE 300 Signals and Systems Fall 2008 Procedure 3 Slope of Phase and Delay in the Time Response a Now we want look at using Matlab to generate filter coefficients For the majority of the filters it uses Matlab assumes filter has the form b s N bN 1s N 1 b2 s 2 b1s b0 H s N N aN s aN 1s N 1 a2 s 2 a1s a0 Hence in order to represent any filter Matlab just uses an array for the b coefficients and an array for the a coefficients For example we might have two variables arrays B and A to store the coefficients These variables would be B bN b1 b0 A aN a1 a0 th Let s assume we want to use a 10 order Butterworth lowpass filter with a frequency cutoff of 20 0 Use the help command to look up the Matlab function butter You should return the coefficients in two arrays i e your command should be B A butter Note that we are constructing an analog filter here so read all of the description for the butter command b We now again …
View Full Document