Theory

Sampling is the process of converting a continuous-time signal into a discrete-time signal. It is a fundamental operation in digital signal processing and communication systems.

According to the Nyquist-Shannon sampling theorem, a continuous-time signal can be completely represented in its samples and recovered back if the sampling frequency is greater than twice the maximum frequency component of the signal.

Ideal Sampling

Multiplication of the continuous-time signal by a train of ideal impulses (Dirac delta functions).

Natural Sampling

Multiplication of the continuous-time signal by a periodic pulse train with finite width.

Flat-Top Sampling

The sampled signal amplitude is held constant during the sampling period using a sample-and-hold circuit.

Nyquist-Shannon Sampling Theorem

If a continuous-time signal contains no frequency components higher than W hertz, then it can be completely determined by uniform samples taken at a rate fs ≥ 2W samples per second.

Mathematically, if x(t) is a band-limited signal with X(f) = 0 for |f| ≥ fm, then x(t) can be uniquely determined from its samples x(nT) when:

fs ≥ 2fm

Where fs = 1/T is the sampling frequency and fm is the maximum frequency component in the signal.

Power Spectrum Analysis (0-50 Hz)

The power spectrum shows how the power of a signal is distributed over different frequencies (0-50 Hz range). It is obtained by taking the Fourier Transform of the signal.

Key Observations in Power Spectrum:

  • Original Signal: Shows a single peak at the signal frequency f (Hz)
  • Ideal Sampling: Creates spectral replicas at multiples of fs (folding)
  • Natural Sampling: Similar to ideal but with sinc envelope shaping due to finite pulse width
  • Flat-Top Sampling: Additional sinc distortion due to holding operation

When fs < 2f (below Nyquist rate), aliasing occurs where higher frequency components fold back into the baseband (0-50 Hz), causing distortion.

Interpretation Guide: Red dashed lines in the spectrum indicate the signal frequency (f) and its aliases. The x-axis shows frequency from 0 to 50 Hz.

Types of Sampling Techniques

1. Ideal Sampling (Impulse Sampling)

In ideal sampling, the continuous-time signal is multiplied by a train of ideal impulses spaced at the sampling interval T. The sampled signal is given by:

xs(t) = x(t) · δT(t) = Σ x(nT) δ(t - nT)

2. Natural Sampling (Gating)

In natural sampling, the continuous-time signal is multiplied by a periodic pulse train p(t) with finite pulse width τ. The sampled signal is:

xs(t) = x(t) · p(t)

3. Flat-Top Sampling

In flat-top sampling, the sample value is held constant during the sampling period. This is implemented using a sample-and-hold circuit and is represented as:

xs(t) = Σ x(nT) · h(t - nT)

where h(t) is a rectangular pulse of width τ ≤ T.

Simulation

Adjust the parameters below to visualize different sampling techniques and their power spectra (0-50 Hz).

2.0
3.0 Hz
15 Hz
Warning: Sampling frequency is below the Nyquist rate (2× signal frequency). Aliasing will occur!

Original Signal: x(t) = A sin(2πft)

Time Domain (0-2 seconds)
Power Spectrum (0-50 Hz)

Ideal Sampling (Impulse Sampling)

Time Domain (0-2 seconds)
Power Spectrum (0-50 Hz)
Spectrum shows spectral replicas at f ± k·fs. Red lines show the signal frequency and its aliases.

Natural Sampling (Gating)

Time Domain (0-2 seconds)
Power Spectrum (0-50 Hz)
Spectrum has sinc envelope due to finite pulse width (τ = 20ms). Red lines show the signal frequency and its aliases.

Flat-Top Sampling (Sample & Hold)

Time Domain (0-2 seconds)
Power Spectrum (0-50 Hz)
Spectrum has additional sinc distortion from holding. Red lines show the signal frequency and its aliases.

Procedure

  1. Understand the theoretical concepts of sampling techniques from the theory section.
  2. Adjust the signal parameters (amplitude and frequency) using the sliders.
  3. Set the sampling frequency. Observe the effect of changing sampling frequency relative to the Nyquist rate (2× signal frequency).
  4. Click "Run Experiment" to visualize the three sampling techniques and their power spectra (0-50 Hz).
  5. Observe and compare the time domain waveforms for ideal, natural, and flat-top sampling.
  6. Analyze the power spectra: note spectral replicas, aliasing (when fs < 2f), sinc envelopes, and distortions.
  7. Look for red dashed lines in the spectrum indicating the signal frequency and its aliases.
  8. For natural sampling, observe how pulse width affects both time waveform and spectral envelope.
  9. For flat-top sampling, note how holding affects both time waveform and frequency response.
  10. Record your observations for different parameter combinations.
  11. Write a comprehensive lab report following the guidelines provided.

Report Writing Guidelines

A well-structured lab report should include the following sections:

  • Title Page: Experiment title, your name, course information, date, and lab section.
  • Abstract: Brief summary of objectives, methods, and key findings.
  • Introduction: Theory of sampling, Nyquist theorem, power spectrum analysis, and types of sampling techniques.
  • Objectives: Clear statement of experiment goals.
  • Methodology: Description of the virtual experiment procedure.
  • Results: Screenshots of waveforms and power spectra for different parameter settings with proper labels.
  • Analysis: Comparison of the three sampling techniques in both time and frequency domains, effect of changing parameters, observation of aliasing when fs < 2f.
  • Discussion: Interpretation of results, practical applications of each sampling technique, advantages and disadvantages, observations from power spectra.
  • Conclusion: Summary of key findings and learning outcomes.
  • References: Cite relevant textbooks and resources.

Note: Include mathematical equations, waveform diagrams, power spectrum plots, and tables where appropriate. Discuss the practical implications of sampling in communication systems.