You are on page 1of 20

Indian Institute of Technology, Kharagpur

DSP Lab
Experiment-1

Vaibhav Jalani
20EE10078

1
1 Displaying Continuous-Time Vs. Discrete-Time
1. Plot continuous sine wave, i.e. very high sampling frequency such that the
discrete wave appears to be continuous.

2. Plot discrete sine wave, i.e. with lower sampling frequency this time, plotted
using stem function.

Figure 1: A: Continuous sine wave, B: Discrete sine wave

2
Code:

3
2 Vector Index vs. Time
Sine wave (continuous) between t=3.5 and 4.5

Figure 2: Sine wave for t=3.5 to 4.5

The difference between the three plots-

1. The first and graphs i.e. subplots in fig-1 contains plots between t=0 to t=1
whereas the wave in fig-2 in plotted for t=3.5 to t=4.5.

2. The first subplot fig-1-A and fig-2 contains continuous time waves (i.e. wave
with high sampling frequency) and are plotted using plot function whereas the
wave in fig-2-B contains a discrete time wave and is plotted using stem function.

4
Code:

5
3 Analytical Calculation
Computing the value of the following two integrals and comparing them with values
achieved via MATLAB.

Figure 3: Calculations

6
Code:

7
4 Numerical Computation of Continuous-Time Sig-
nals
Riemann Integral is used to calculate the value of definite integrals (basically area
under a curve). In this, we divide a curve into a fixed number of rectangles and then
calculate area of each rectangle and then sum them to get an approximate value of
area under a curve.

Following graph shows the area under the curve (sin(7t))sq. when we split the curve
into different number of rectangles-

Figure 4: Number of rectangles vs Area approximated

8
We can see that the area approximates to zero for N=7 and N=14. This is
because-

1. The sampling rate is these cases is an integral multiple of the frequency and
samples discretely becomes periodic.

2. Hence the integral is symmetric about the x axis in these cases due to which
while summation, they cancel each other and hence the value becomes 0.

9
Code:

10
Following graph shows the area under the curve exp(t) when we split the curve
into different number of rectangles-

Figure 5: Number of rectangles vs Area approximated

11
Code:

12
5 Special Functions
Plot the following two given continuous-time functions over the specified intervals.

Figure 6: A-Special Function, B-Rectangle Unit Impulse

13
Code:

14
Plotting the given other two functions -

Figure 7: Plot

15
Code:

16
Figure 8: Plot

17
Code:

18
6 Sampling
The word sampling refers to the conversion of a continuous-time signal into a discrete
time signal.

Plotting graphs for different sampling frequencies for the function: x[n]=sin(2*pi*Ts*n)
A: Ts = 1/10 ; 0 ≤ n ≤ 100
B : T s = 1/3; 0 ≤ n ≤ 30
C : T s = 1/2; 0 ≤ n ≤ 20
D : T s = 10/9; 0 ≤ n ≤ 9

Figure 9: Plot for different given parameters

19
Code:

20

You might also like