1 / 17

MATLAB Session 4

MATLAB Session 4. ES 156 Signals and Systems 2007 Harvard SEAS. Prepared by Jiajun Gu. OUTLINE. Fourier series of exponential signals Fourier series of a continuous-time rectangular signal Sinc function. Fourier series of exponential signals. Fourier series of Fourier series of .

nizana
Télécharger la présentation

MATLAB Session 4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MATLAB Session 4 ES 156 Signals and Systems 2007 Harvard SEAS Prepared by Jiajun Gu

  2. OUTLINE • Fourier series of exponential signals • Fourier series of a continuous-time rectangular signal • Sinc function

  3. Fourier series of exponential signals • Fourier series of • Fourier series of

  4. Fourier series of exponential signals II • Fourier series of • What is Fourier series of • Discrete cases?

  5. OUTLINE • Fourier series of exponential signals • Fourier series of a continuous-time rectangular signal • sinc function

  6. Fourier series of a continuous-time rectangular signal

  7. Fourier series of a continuous-time rectangular signal II (Example 3.5)

  8. Plot the series: FS generation function function ak=series_term(k,T1,T) % to compute Fourier series a_k % T is the period, 2*T1 is the width of the rectangular pulses % k is the input (integer). ak is the output % which is the k-th term of the Fourier series omega0=2*pi/T; if k==0 ak=2*T1/T; else ak=sin(k*2*pi/T*T1)/(k*pi); end

  9. Plot the series: scale k-scripts Case1: T1=1, T=20; Case2: T1=1, T=10; for k=-30:30 a(k+30+1)=series_term(k,1,20); b(k+30+1)=series_term(k,1,10); end figure;subplot(2,1,1) set(gca,'fontsize',14); stem(-30:30,a,'.'); xlabel('k');ylabel('a_k') subplot(2,1,2) set(gca,'fontsize',14); stem(-30:30,b,'.'); xlabel('k');ylabel('b_k')

  10. Plot the series: scale k

  11. Plot the series: scale -Scripts figure;subplot(2,1,1) set(gca,'fontsize',14); stem((-30:30)*2*pi/20,a,'.'); xlim([-6*pi,6*pi]) % x-axis from –6pi to 6pi xlabel('k');ylabel('a_k') subplot(2,1,2) set(gca,'fontsize',14); stem((-30:30)*2*pi/10,b,'.'); xlim([-6*pi,6*pi]) % x-axis from -6pi to 6pi xlabel('k');ylabel('b_k')

  12. Plot the series: scale

  13. OUTLINE • Fourier series of exponential signals • Fourier series of a continuous-time rectangular signal • sinc function

  14. Definition of sinc() function • MATLAB has a built-in function sinc() • Why do we want to use sinc()? • Don’t need to write your own code. • It can take vectors as input.

  15. Using sinc() to calculate FS T=10; k=-30:30; c=2/20*sinc(2*1/T.*k); figure;set(gca,'fontsize',14); stem(k*2*pi/T,c,'.'); xlim([-6*pi,6*pi]) xlabel('k\omega_0'); title('T_1=1,T=10')

  16. Using sinc() to plot FS

  17. Practice problems • Find the expression of the Fourier Series of the following signals. Plot the series. • MATLAB question in Homework 4

More Related