matlab session 4 l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
MATLAB Session 4 PowerPoint Presentation
Download Presentation
MATLAB Session 4

Loading in 2 Seconds...

play fullscreen
1 / 17

MATLAB Session 4 - PowerPoint PPT Presentation


  • 162 Views
  • Uploaded on

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 .

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'MATLAB Session 4' - nizana


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
matlab session 4

MATLAB Session 4

ES 156 Signals and Systems 2007

Harvard SEAS

Prepared by Jiajun Gu

outline
OUTLINE
  • Fourier series of exponential signals
  • Fourier series of a continuous-time rectangular signal
  • Sinc function
fourier series of exponential signals
Fourier series of exponential signals
  • Fourier series of
  • Fourier series of
fourier series of exponential signals ii
Fourier series of exponential signals II
  • Fourier series of
  • What is Fourier series of
  • Discrete cases?
outline5
OUTLINE
  • Fourier series of exponential signals
  • Fourier series of a continuous-time rectangular signal
  • sinc function
plot the series fs generation function
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

plot the series scale k scripts
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')

plot the series scale scripts
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')

outline13
OUTLINE
  • Fourier series of exponential signals
  • Fourier series of a continuous-time rectangular signal
  • sinc function
definition of sinc function
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.
using sinc to calculate fs
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')

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