Você está na página 1de 1

ICSE 6245 Lab Session : MATLAB Review

Consider the following signals cases of a rectangular pulse, and triangular pulse. Using MATLAB, plot the signals and their corresponding Fourier Transforms.

(a) Ans.
% rectangular pulse in the range -0.5 and 0.5 clc; clear all; close all; t=-2:0.005:2; x=rectpuls(t); subplot(1,2,1), plot(t,x); xlabel('t'),ylabel('x'); grid on; axis([-2 2 -1.5 1.5]);

%fourier transform N= length(t); R =fft(x); % discrete fourier transform of rectangular pulse x f= linspace(0,1,N); %generate frequency vector subplot(1,2,2), plot (f,abs(R)) %Plot amplitude vs frequency xlabel('f');ylabel('R(f)'); axis([-0.5 0.5 0 200]);

(b)  (c )

Você também pode gostar