Dsssssssss
Dsssssssss
6.1. Objective:
Sampling of continuous time signals and its reconstruction.
6.2. Apparatus/equipment/software:
MATLAB
6.3. Theory:
fs≥2fm.
Proof:
Consider a continuous time signal x(t). The spectrum of x(t) is a band limited to fm Hz
i.e the spectrum of x(t) is zero for |ω|>ωm.
Sampling of input signal x(t) can be obtained by multiplying x(t) with an impulse
train δ(t) of period Ts. The output of multiplier is a discrete signal called sampled
signal which is represented with y(t) in the following diagrams:
Figure 6.1
Here, you can observe that the sampled signal takes the period of impulse. The process of
sampling can be explained by the following mathematical expression:
Sampled signal y(t)=x(t).δ(t). (1)
The trigonometric Fourier series representation of δ(t) is given by
δ(t)=a0+Σ∞n=1(an cosn ωst + bn sinn ωst). (2)
Where
a0=1Ts∫T2−T2δ(t)dt=1Tsδ(0)=1Ts
an=2Ts∫T2−T2δ(t)cosnωsdt=2T2δ(0)cosnωs0=2T
bn=2Ts∫T2−T2δ(t)sinnωstdt=2Tsδ(0)sinnωs0=0
Y(ω)=1Ts[X(ω)+X(ω−ωs)+X(ω+ωs)+X(ω−2ωs)+X(ω+2ωs)+…..]
Y(ω)=1TsΣ∞n=−∞X(ω−nωs)
Were
n=0,±1,±2,...
To reconstruct x(t), you must recover input signal spectrum X(ω) from sampled signal
spectrum Y(ω), which is possible when there is no overlapping between the cycles of
Y(ω).
Possibility of sampled frequency spectrum with different conditions is given by the
following diagrams:
Figure 6.2
Since we can have different signals with the same, then there can be an infinite number of
continuous-time signal which yield the same discrete-time sinusoid!
6.4. Aliasing Effect:
The overlapped region in case of under sampling represents aliasing effect, which
can be removed by Considering fs >2fm
This lesson “simplifies” the sampling theorem because it only uses the non-uniqueness of
discrete-time sinusoids and the mapping between continuous- and discrete-time frequencies.
The next two lessons take a more conventional Fourier transform based approach to
developing the sampling theorem.
The purpose of this section is to study the relation in the time domain between a continuous time
signalxa(t) and the discrete-time signal x[n] generated by a periodic sampling of xa(t).
Task 6.1 Code:
Output:
Task 6.2 Code:
Output:
Task 6.3 Code:
Task 6.4 Code:
Output:
Task 6.4 Code:
Output:
Task 6.5
Sampling of a Sinusoidal Signal
In this project you will investigate the sampling of a continuous-time sinusoidal signal xa(t) at various
sampling rates. Since MATLAB cannot strictly generate a continuous-time signal, you will generate a
sequence {xa(nTH)} from xa(t) by sampling it at a very high rate, 1/TH, such that the samples are very
close to each other. A plot of xa(nTH) using the plot command will then look like a continuous-time
signal. Code:
Output:
Continuous-time signal
1. What is the frequency in Hz of the sinusoidal signal? What is the sampling period in second?
Ans. The frequency of the sinusoidal signal is 13KHz and the sampling period is 0.1sec.
Task 6.6
Run Program 6.5 for four other values of the sampling period with two lower and two higher than that
listed in Program P6.5. Comment on your results.
Code:
For T = 0.01
Output:
Task 6.7 Code:
For T = 0.05
Task 6.8
Output:
Code:
For T = 0.2
Output:
Task 6.10
Code:
For T = 0.5
Output:
Repeat Pervious Program by changing the frequency of the sinusoidal signal to 3 KHz and 7 KHz,
respectively. Is there any difference between the corresponding equivalent discrete-time signals and
the one generated in Question Q6.5? If not, why not? Code:
For f = 3
Task 6.12
Output:
Task 6.11 Code:
For f = 7
Output:
Task 6.12
Aliasing Effect in the Time Domain
In this exercise I will generate a continuous-time equivalent ya(t) of the discrete-time signal x[n]
generated in Program P6.5 to investigate the relation between the frequency of the sinusoidal signal
xa(t) and the sampling period. To generate the reconstructed signal ya(t) from x[n] , we pass x[n]
through an ideal low-pass filter that in turn can be implemented. Code:
Output:
2. Explain working of line 10 of program which reads:
ya = sinc((1/T)*t(:,ones(size(n))) - (1/T)*n(:,ones(size(t)))')*xs;
Ans. ya(t) is calculated from thje sampling period of the program.
Task 6.13
Repeat Pervious Program by changing the frequency of the sinusoidal signal to 3 KHz and 7 KHz,
respectively. Is there any difference between the corresponding equivalent discrete-time signals and the
one generated in Q 6.5? If not, why not?
Code:
For f = 3
Output:
Task 6.14
Repeat Pervious Program by changing the frequency of the sinusoidal signal to 3 KHz and 7 KHz,
respectively. Is there any difference between the corresponding equivalent discrete-time signals and the
one generated in Q 6.5? If not, why not? Code:
For f = 7
Output:
The relation between the continuous-time Fourier transform (CTFT) of an arbitrary bandlimited
continuous-time signal and the discrete-time Fourier transform (DTFT) of the discrete-time signal is
investigated next in this project. In order to convert a continuous-time signal xa(t) into an equivalent
discrete-time signal x[n], the former must be band-limited in the frequency domain (see R6.2). To
illustrate the effect of sampling in the frequency domain we choose an exponentially decaying
continuous-time signal with a CTFT that is approximately bandlimited. Task 6.15
Code:
Output:
There is an effect of aliasing in signal.
3. What is the continuous-time function xa(t) in Program P6.15? How is the CTFT of xa(t) being
computed?
Ans. The continuous-time function xa(t) in this program is 2*t*e-t and the CTFT is compute by using
MATLAB command freqs ().
Task 6.16
Repeat Program P6.15 by increasing the sampling period to 1.5. Is there any visible effect of aliasing?
Code:
There is a difference in the signal due to effect of aliasing.
Output:
Task 6.17
−πt2
Modify Program P6.3 for the case of xa(t) = e
Code:
The signal shape is completely changed.
Output:
Exercise 1
Consider the given CT signal: x(t) = sin (2 pi F0 t). Suppose that F0 = 2 kHz and Fs = 50 kHz.
Plot the signal x(n). What will be the discrete frequency fd of the signal x(n)? ii) Plot the signal
y(n) created by taking the even numbered samples of x(n). Is this a sinusoidal signal? Why? If
so, what is the frequency?
Code:
Exercise 2 Code:
For f=5000
Output:
Output:
Exercise 3
Consider the following CT signal: x(t) = sin (2 pi F0 t). The sampled version will be: x(n) =sin
(2 pi F0/Fs n), where n is a set of integers and sampling interval Ts=1/Fs. Plot the signal x(n) for
n = 0 to 99 for Fs = 5 kHz and F1 = 0.5, 2, 3 and 4.5 kHz. Explain the similarities and differences
among various plots. Also mention that whether aliasing occurs or not.
Code:
Output:
When the f1=2 Code:
Output:
When the f=3 Code:
Output:
When the f=4 Code:
Output: