Interactive Demo of Nyquist's Sampling Theorem

版本 1.50.0.0 (4.3 KB) 作者: Costas Vlachos
Interactively demonstrates Nyquist's Sampling Theorem.
1.0K 次下载
更新时间 2017/1/14

查看许可证

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.

引用格式

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. 检索来源 .

MATLAB 版本兼容性
创建方式 R2016b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Discrete Fourier and Cosine Transforms 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.50.0.0

Improved description layout.
Improved description layout.

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