A Python project that demonstrates how Gaussian noise affects analog and digital signals using NumPy and Matplotlib.
This project was built as part of my learning journey to better understand the mathematics behind signal processing, including sine waves, Gaussian distributions, and data visualization.
Communication signals are often affected by noise during transmission. This simulation compares:
- Original Analog Signal
- Analog Signal with Gaussian Noise
- Original Digital Signal
- Digital Signal with Gaussian Noise
The goal is to visualize how noise impacts different types of signals and understand why digital communication is generally more resistant to interference.
- Python 3
- NumPy
- Matplotlib
- Analog Signals
- Digital Signals
- Sine Wave Generation
- Gaussian (Normal) Distribution
- Mean (μ)
- Standard Deviation (σ)
- Signal Noise Simulation
- Data Visualization
The analog signal is generated using the sine wave equation:
a(t)=sin(2πft)
where:
- f = Frequency (5 Hz)
- t = Time
Noise is generated using:
noise = np.random.normal(0, 0.3, len(t))Where:
-
Mean (μ) = 0
- The average noise is centered around zero, so the signal is not shifted upward or downward.
-
Standard Deviation (σ) = 0.3
- Controls how much the signal is distorted.
- Larger values produce stronger noise.
The program generates four graphs:
- Original Analog Signal
- Analog Signal with Noise
- Original Digital Signal
- Digital Signal with Noise
(You can add a screenshot here after uploading it to the repository.)
Example:
Clone the repository:
git clone https://github.com/alexandrebayanza-maker/signal-noise-simulation.gitMove into the project folder:
cd signal-noise-simulationInstall the required libraries:
pip install numpy matplotlibRun the program:
python analog_digital_simulation.pysignal-noise-simulation/
│
├── analog_digital_simulation.py
├── README.md
└── images/
└── signal_noise.png
Through this project, I learned:
- How analog and digital signals are represented mathematically.
- How Gaussian noise is generated using NumPy.
- The role of mean and standard deviation in probability distributions.
- Why digital signals are generally more resistant to noise.
- How data visualization makes complex concepts easier to understand.
This project reinforced an important lesson:
Programming becomes far more meaningful when you understand the mathematics behind the code.
Some enhancements I plan to add include:
- Adjustable signal frequency
- Interactive noise controls
- Signal filtering techniques
- Fast Fourier Transform (FFT) visualization
- Improved graphical interface
Alexandre Bayanza
I'm passionate about software engineering, problem solving, and continuously learning through hands-on projects.
- LinkedIn: https://www.linkedin.com/in/alexandre-bayanza
- GitHub: https://github.com/alexandrebayanza-maker
⭐ If you found this project interesting, feel free to star the repository or share your feedback!