Sampling an analog signal is a crucial step in any digital signal processing system. The Nyquist–Shannon sampling theorem guarantees the full recovery of a signal when sampled at a frequency greater than or equal to its bandwidth (or twice the maximum frequency for real signals). This project demonstrates the importance and validation of the Nyquist rate through an interactive desktop application.
- Load a signal .
- Visualize the signal and sample it at various frequencies.
- Recover the original signal using the Whittaker–Shannon interpolation formula.
- Display four graphs:
- Original signal with sampled points.
- Reconstructed signal.
- Difference between the original and reconstructed signals.
- Frequency domain visualization to check for aliasing.
- Sampling frequency is displayed as actual in HZ.
- User can:
- Load signals from a file or create a mixed signal using the signal mixer.
- Add sinusoidal components with adjustable frequencies and magnitudes .
- Remove components dynamically while preparing the mixed signal.

- User also can:
- Add noise to the loaded signal with a custom signal-to-noise ratio (SNR).
- Sampling and recovery occur in real time without requiring “Update” or “Refresh” buttons.
-
Explore multiple signal reconstruction methods, including Whittaker–Shannon interpolation.
-
Allow users to select a reconstruction method via a combobox.
- The application resizes gracefully without disrupting the UI layout.
video.mp4
- README.md: Project overview and setup instructions.
- requirements.txt: List of dependencies.
- task2.py: Entry point for the application.
- icons/: Icons of program.
-
Clone the Repository:
git clone [https://github.com/Ziadmohammed200/Signal-Studio.git](https://github.com/Ziadmohammed200/Sampling-Theory-Studio.git) cd sampling-theory-studio -
Install Dependencies:
pip install -r requirements.txt
-
Run the Application:
python task2.py
-
Load or Compose Signals:
- Use the "Load Signal" button to import a signal file.
- Alternatively, create a mixed signal using the signal composer.
-
Add Noise:
- Adjust the SNR slider to add noise to the signal.
-
Sample and Recover:
- Adjust the sampling frequency and observe the reconstruction in real time.
-
Test Different Reconstruction Methods:
- Select a reconstruction method from the combobox and compare results.
This project is licensed under the MIT License. See LICENSE for details.
- Inspired by digital signal processing principles and the Nyquist–Shannon sampling theorem.


