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

The power spectrum shows how the power of a signal is distributed over different frequencies. It is obtained by taking the Fourier Transform of the signal's autocorrelation function or by squaring the magnitude of the Fourier Transform.

Key Observations in Power Spectrum:

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

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

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.

2.0
2.0 Hz
12 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

Power Spectrum

Ideal Sampling (Impulse Sampling)

Time Domain

Power Spectrum

Spectrum shows replicas at f ± k·fs. Observe aliasing when fs < 2f.

Natural Sampling (Gating)

Time Domain

Power Spectrum

Spectrum has sinc envelope due to finite pulse width. Replicas attenuated at higher frequencies.

Flat-Top Sampling (Sample & Hold)

Time Domain

Power Spectrum

Spectrum has additional sinc distortion from holding. High-frequency attenuation occurs.

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.
  5. Observe and compare the time domain waveforms for ideal, natural, and flat-top sampling.
  6. Analyze the power spectra: note spectral replicas, aliasing, sinc envelopes, and distortions.
  7. Try sampling below the Nyquist rate (fs < 2f) to observe aliasing effects in both time and frequency domains.
  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.