summaryrefslogtreecommitdiff
path: root/830/CH4/EX4.2.7/CTFT_2.sce
blob: d4370d17a9919f9d5ad1e7a1d64d0c8fd503c175 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//Graphical//
//Example 4.2.7 Sampling a Nonbandlimited Signal
//Plotting Continuous Time Fourier Transform of
//Continuous Time Signal x(t)= exp(-A*abs(t))
clear;
clc;
close;
// Analog Signal
A =1;    //Amplitude
Dt = 0.005;
t = -2:Dt:2;
xa = exp(-A*abs(t));
//
// Continuous-time Fourier Transform
Wmax = 2*%pi*2;        //Analog Frequency = 2Hz
K = 4;
k = 0:(K/500):K;
W = k*Wmax/K;
Xa = xa * exp(-sqrt(-1)*t'*W) * Dt;
Xa = real(Xa);
W = [-mtlb_fliplr(W), W(2:501)]; // Omega from -Wmax to Wmax
Xa = [mtlb_fliplr(Xa), Xa(2:501)];
subplot(2,1,1);
a =gca();
a.x_location = "origin";
a.y_location = "origin";
plot(t,xa);
xlabel('t in msec.');
ylabel('xa(t)')
title('Analog Signal')
subplot(2,1,2);
a =gca();
a.x_location = "origin";
a.y_location = "origin";
plot(W/(2*%pi),Xa);
xlabel('Frequency in Hz');
ylabel('Xa(jW)*1000')
title('Continuous-time Fourier Transform')