Can someone please find and plot the Fourier Transform of y,x(i) and b signals from the below code... y is Gate function , x(i) is train of impulse and b is sampled signal

5 views (last 30 days)
T = -5:0.01:5;
y = rectpuls(T,2);
subplot(2,2,1);
plot(T,y);
xlabel('Time');
ylabel('Amplitude');
title('Gate Function');
grid on;
n= -5:1:5;
L =length(n);
for i= 1:L
x(i)=1;
end;
subplot(2,2,2);
stem(n,x);
xlabel('Time');
ylabel('Amplitude');
title('Train of Impulses');
grid on;
t=-5:0.01:5;
b=y.*x(i);
subplot(2,2,3);
stem(t,b);
xlabel('Time');
ylabel('Amplitude');
title('Sampled Signal');
grid on;
  1 Comment
Geoff Hayes
Geoff Hayes on 7 Apr 2015
Harshit - you have provided a number of lines of code but have not indicated where or what the problem is. Does the above code fail (is there an error?) or not produce the result that you are looking for?

Sign in to comment.

Answers (0)

Categories

Find more on Signal Generation and Preprocessing in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!