DOC PREVIEW
Rose-Hulman ECE 300 - Fourier Series and Filtering Periodic Signals

This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ROSE-HULMAN INSTITUTE OF TECHNOLOGY Department of Electrical and Computer Engineering ECE 300 Signals and Systems Fall 2005 RDT Fourier Series and Filtering Periodic Signals Lab 04 by Robert Throne (based on a Lab by Mark 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. In this lab we will explore some analytical techniques for generating waveforms by summing complex exponentials. The two 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. Pre-Lab Do the following before coming to lab. Record the results in your lab notebook and hand in a photocopy of your pre-lab. a) Work the following matrix algebra problems by hand: 1. 126423453156⎡⎤⎡⎤⎢⎥=⎢⎥⎢⎥⎣⎦⎢⎥⎣⎦2. 126423453156⎡⎤⎡⎤⎢⎥=⎢⎥⎢⎥⎣⎦⎢⎥⎣⎦b) In MATLAB, a process called implicit type assignment can automatically create a matrix when it is called for in a computation. For example, in the computation below, MATLAB would understand that the result of the command cos(x) results in a matrix as shown. Find the result of the commands listed by hand. ()()()() ()cos a cos babx;cosxcos c cos dcd⎡⎤⎡⎤==⎢⎥⎢⎥⎣⎦⎣⎦ 1. jxe2. jxxe Page 1 of 7ECE 300 Signals and Systems Fall 2005 c) Write a function that performs the same task as the following without using a for loop, and paste the code and verification that it works in your notebook. function Z=replacez(A) %REPLACEZ Function that replaces the positive elements of a matrix with 1 % usage: % Z=replacez(A) % A=input matrix whose positive elements are to be replaced with 1 % [M,N]=size(A); for i=1:M for j=1:N if A(i,j)>0 Z(i,j)=1; else Z(i,j)=A(i,j); end end end MATLAB hint: The MATLAB logical operators may be helpful in completing this exercise. Use help to understand what these commands do. Procedure A: Efficient Synthesis of x(t) The way the program Fourier_Series.m computes ()xt 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 ()okNjk tkkNxt ceω==−≈∑ To do this we need to do the following: a) Just after the period, T, is defined, write an expression for 0ω, the natural frequency. b) Define an array []0000 0( 1) ... 0 ... ( 1)WN N N N0ωωωω ω=− − − −ω which we can write as []( 1) ... 1 0 1 ... ( 1)oWNN N Nω=− − − − c) In order to use this sum, we need the array (1) 1 0 1 1[ ... ... ]NNNCc c c cc c c−−− − −=N What we have is and the array 0c11[ ... ]NNcc c c−=. Use these arrays and the properties of the coefficients to construct the array . 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 and are available. Cc0c Page 2 of 7ECE 300 Signals and Systems Fall 2005 d) Remove (delete) the following inefficient lines of code m = 1; est = T*c(1)*conj(feval(@periodic,t))+T*conj(c(1))*feval(@periodic,t); % for i = 2:N m = i; est = est + T*c(i)*conj(feval(@periodic,t)); est = est + T*conj(c(i))*feval(@periodic,t); end; est = est+c0; e) Now write a routine 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 x = sum_exp(C,W,t) should return the vector x 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 ()xt at three times and we are going to use up to the second harmonic in the Fourier series representation (2N=), so we have for Assume we have a row vector of the three times 22()oikjk tikkxt ceω==−=∑1, 2, 3i =[]123tttt= , the row vector []00 020W02ωωω=− −ω of the required frequencies, and the row vector []21012Cc c ccc−−=. First let’s form []00102001021230010200102222111000111222Tjt jt jtjt jt jtjW t j t t tjt jt jtjt jt jtωωωωωωωωωωωω−−−⎡⎤ ⎡⎢⎥ ⎢−−−⎢⎥ ⎢⎢⎥ ⎢==⎢⎥ ⎢⎢⎥ ⎢⎢⎥ ⎢⎣⎦ ⎣030303032102ωωωω−⎤⎥−⎥⎥⎥⎥⎥⎦ Then 01 02 0301 02 0301 02 0301 02 03222111111222111Tjt jt jtjt jt jtjW tjt jt jtjt jt jteeeeeeeeeeeeeωω ωωωωωωωωω ω−− −−−−=⎡⎤⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎣⎦ Finally, by premultiplying by C we will get the desired result. The function sum_exp should actually consist of one line of code. f) Plot the original function and the Fourier Series representation of the function using 50 terms. The function is defined over the period -2 to 4. Include this figure in your lab notebook and have it checked off before you go on. The function you should be plotting is Page 3 of 7ECE 300 Signals and Systems Fall 2005 30211()32 303 4ttfttt12−≤<−⎧⎪−≤<⎪=⎨≤<⎪⎪≤<⎩ 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()xt. Recall from phasor analysis that if the input to a LTI system is 0() cos( )xt A tωφ=+ the steady state output will be 00 0() | ( )|cos( ( ) )yt A H j t H jωωω=+∠φ+ Let’s rewrite the periodic input signal()xt using Euler’s identity, 00() ()()22jt jtAAxt e eωφωφ+−+=+ We can rewrite the output as 00 00(()) ((00|( )| |( )|()22jt Hj jt HjAHj AHjyt e eωφ ω ωφ ω))ωω++∠ − ++∠=+ Using the properties that for a real system 0|( )||( )Hj H j0|ωω=− (the magnitude is an even function) and 0() (Hj H j0)ωω∠=−∠− (the phase is an odd function) , we get 0000() ( )() (00| ( )| | ( )|()22jHj jH jjt jtAHj e AH j eyt e eωω)ωφωωω∠∠φ−+−+−=+ Now if we recognize the above expression for ()xt as its Fourier series representation, with coefficients 101022jjAe Aecccφφ−−=== we can write 00010 10 1 1() ( ) ( )0jtjtjtytcHje cHje be


View Full Document

Rose-Hulman ECE 300 - Fourier Series and Filtering Periodic Signals

Documents in this Course
Exam 2

Exam 2

8 pages

Load more
Download Fourier Series and Filtering Periodic Signals
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Fourier Series and Filtering Periodic Signals and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Fourier Series and Filtering Periodic Signals 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?