Interactive Demo of Nyquist's Sampling Theorem

Interactively demonstrates Nyquist's Sampling Theorem.
1K download
Aggiornato 14 gen 2017

Visualizza la licenza

This script demonstrates Nyquist's Sampling Theorem, by sampling a continuous-time sinusoidal signal of a frequency f = 50 Hz to 3 kHz, with a fixed sampling frequency fs = 2 kHz. Therefore, only signals with frequencies f <= fs/2 = 1 kHz can be faithfully reconstructed by their samples, while those with frequencies f > 1 kHz will exhibit aliasing effects (i.e., reconstructing the original signal will generate new components that were not part of the original signal).

The generated graph shows both the original signal (in red) and the reconstructed signal (in blue). The reconstructed signal is linearly interpolated and shown together with the samples (circle markers). The user can interactively change the original signal's frequency and phase, and observe how this affects the reconstructed signal, as the frequency approaches and crosses the fs/2 boundary.

In order to have a better appreciation of the aliasing effects on the signal being sampled, the user can listen to both the original and the reconstructed signals and compare the corresponding sounds. This is only possible on sound-capable computers.

The simulation can be interactively controlled in real-time using the following keys:

[Q] / [A] increases/decreases the original signal's frequency (coarse).
[W] / [S] increases/decreases the original signal's frequency (fine).
[E] / [D] increases/decreases the original signal's phase.
[I] plays a one-second sound of the original signal.
[O] plays a one-second sound of the reconstructed signal.
[R] resets all parameters to their initial values.
[ESC] exits the script.

Cita come

Costas Vlachos (2024). Interactive Demo of Nyquist's Sampling Theorem (https://www.mathworks.com/matlabcentral/fileexchange/61143-interactive-demo-of-nyquist-s-sampling-theorem), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2016b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versione Pubblicato Note della release
1.50.0.0

Improved description layout.
Improved description layout.

Improved description layout.
Improved description layout.
Improved description layout.
Improved description layout.