Lab12
Lab12
Lab12
SECTION : A
Marks Obtained :
Remarks:
Nyquist Criteria
Nyquist criteria decides the minimum sampling rate. The Nyquist rate is defined as the
minimum sampling rate required to represent complete information about continuous signal
f(t) in its sampled form, f*(t). therefore, according to sampling theorem, the Nyquist rate is
When Ts=1/2fm, this amounts to 2fm samples per second. This is called Nyquist rate of
sampling and 1/Ts=fs=2fm is called Nyquist frequency. In simple words, it means that the
signal must be sampled at least twice during each period of cycle of its highest frequency
component.
The minimum sampling frequency fs equal to 2fm cannot be achieved in practice because of the
difficulty in realizing ideal filters. Practically we must use the sampling frequency which is more
than twice the maximum frequency in the baseband waveform. How much ore is a matter that
depends upon the low-pass filter characteristics and how faithfully the baseband waveform
must be reproduced. If there are multiple frequency components in a signal, then the Nyquist
criteria is applied for the highest frequency component in the signal.
Types of Sampling
Basically, there are three types of sampling techniques such as:
(i) Instantaneous or Impulse sampling
(ii) Natural sampling
(iii) Flat top sampling
Out of these three, instantaneous sampling is called ideal sampling whereas natural sampling
and flat-top sampling are called practical sampling methods.
Fig.1 : (a) Baseband signal, (b) impulse train, (c) functional diagram of a switching sampler, (d)
sampled signal
Since the width of the pulse approaches zero, the instantaneous sampling gives a train of
impulses of height equal to the instantaneous value of the input signal x(t) at the sampling
instant.
Fig.3 : (a) Continuous time signal x(t), (b) Sampling function waveform i.e., periodic pulse train,
(c) Naturally sampled signal waveform g(t)
Fig.8 : (a) Baseband signal x(t), (b) Instantaneously sample signal s(t), (c) Constant pulse width
function h(t), (d) Flat top sampled signal g(t) obtained through convolution of h(t) and s(t)
Number of Samples
Total numbers of samples in a Sampled Signal the total number of samples can be calculated
using the following formula.
Number of Samples = Sampling Frequency/Maximum Frequency
Ns = fs/fm
where,
Number of Samples - The Number of Samples of a continuous-time signal is the total samples in
the output sample signal.
Sampling Frequency - (Measured in Hertz) - Sampling frequency is the number of samples per
second in a signal.
Maximum Frequency - (Measured in Hertz) - Maximum Frequency is the highest frequency of a
band-limited continuous-time signal.
Practice Exercises
Practice Exercise 1.
Creating an impulse train.
Code:
Output:
Practice Exercise 2.
Consider a signal y(t) = sin(wt) where “w=2πf” Take the case when f = 23 (Hertz).
a) What should be the sampling frequency (fs) according to Nyquist Criteria?
b) Plot original signal and sampled signal in MATLAB.
a) Sampling frequency should be greater than 23*2 =46Hz
b) Code:
Output:
Practice Exercise 3. Natural Sampling
Sample a sine wave using natural sampling technique.
Code:
t=0:0.001:3;
sq=square(100*t)+1;
si=sin(10*t);
a=sq.*si;
subplot(311);plot(t,si);
subplot(312); plot(t,sq);
subplot(313);plot(t,a)
Output:
Lab Tasks
Exercise 1.
The impulse train in the practice exercise 1 picks up each sample every 20 steps or every 20
samples. Vary the code so that a sample is taken every
i) 2 steps
ii) 100 steps
iii) 40 steps
what number of steps causes for better reconstruction of the signal and what number of steps
causes for the signal to be highly distorted? Explain your answer. Make the plots for -roll
number to + roll number (use last digs if roll number is a high number). Provide explanation and
analysis for each plot.
Code:
i) 2 steps
iii) 40 steps
Exercise 3.
Consider a signal (t) = 50 cos (20πt) + 10 cos (100πt) what is the maximum frequency
component in the above signal (Remember the relation )
ANS:
1st Term:
20π = 2πf
f = 10 Hz
2nd Term:
100π = 2πf
f = 50 Hz
Max Frequency Component:
50 Hz
fs = 2 * fmax
fs = 2 * 50 Hz
fs = 100 Hz
b) Plot original signal and sampled signal in MATLAB. Make the plots for -roll number to +
roll number (use last digs if roll number is a high number)
Exercise 4.
Implement Flat top sampling for signals in practice exercise 3. Plot original signal and sampled
signal in MATLAB. Make the plots for -roll number to + roll number (use last digs if roll number
is a high number). Provide explanations and analysis.
CODE:
Result:
Exercise 5.
Name 3 applications of sampling and explain how they utilize the sampling technique.
Ans:
1. Digital Audio Processing:
Application: Converts analog sound waves into digital signals.
Utilization: Audio signals are sampled (e.g., at 44.1 kHz for CDs) by an
ADC. The digital samples are processed and stored, then played back
<---------------------------------- END ------------------------------->