Professional Documents
Culture Documents
Function: y=e−x
PROGRAM:
clc;
clear;
clf();
x=linspace(-5,5,20);
y=exp(-x^2);
subplot(321)
plot(x,y)
xlabel("Value of x")
ylabel("Value of y")
title("Graph of y=e^-x^2")
xgrid;
g=fft(y);
disp(g,"fft of y = e(-x^2)");
subplot(322)
plot(x,fftshift(g))
xlabel("Value of x")
ylabel("Value of fftshift of y")
title("Graph of fftshift of y=e^-x^2");
xgrid;
subplot(323)
plot(x,g);
xlabel("Value of x")
ylabel("Value of fft of y")
title("Graph of fft of y=e^-x^2");
xgrid;
subplot(324)
h=ifft(y)
plot(x,h);
xlabel("Value of x")
ylabel("Value of ifft of y")
title("Graph of ifft of y=e^-x^2");
xgrid;
subplot(325)
h=ifft(y);
disp(h,"ifft of y = e(-x^2)");
plot(x,ifftshift(h));
xlabel("Value of x")
ylabel("Value of ifft shift of y")
title("Graph of ifft shift of y=e^-x^2");
xgrid;
RESULT:
DISCUSSION:
values for the function y=e−x . In this graph we can see that the value of y
first increases exponentially and then remains constant and then decreases
exponentially. The values are same because the function contains square
of x.
In the graph of fft, we can see that the value of y remains in between y =
-4 to 4 for the given function. The value shows some variation in the
beginning and in the end. From x = -2 to 2.5, the values remain almost
constant.
In the graph of fftshift, we can see that the value of y remains in between
y = -4 to 4 for the given function. The value shows some variation from x
= -2.5 to 3, the values remain almost constant in the beginning and in the
end.
Similarly, in ifft, we can see that the value of y remains in between y =
-0.2 to 0.2 for the given function. The value shows some variation in the
beginning and in the end. From x = -2 to 2.5, the values remain almost
constant.
In the graph of ifftshift, we can see that the value of y remains in between
y = -4 to 4 for the given function. The value shows some variation from x
= -2.5 to 3, the values remain almost constant in the beginning and in the
end.