Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

NumPy & SciPy Learning Notes

This repository contains my personal notes and exercises from learning NumPy, SciPy, and basic signal processing in Python — written while working through array operations, image processing, Fourier transforms, and peak detection.

📌 This is a learning log, not a standalone project. For an applied, real-world signal processing project built on these fundamentals, see my biomedical_signal_analysis repository, which performs ECG filtering, FFT analysis, and heartbeat (R-peak) detection on real clinical data.

📖 What's Covered

  • NumPy Array Basics — creating, reshaping, and slicing arrays
  • Image Processing with NumPy — treating images as numeric matrices: flipping, cropping, downsampling, and thresholding
  • Statistical & Mathematical Functions — sum, mean, standard deviation, variance, min/max, and their index equivalents (argmin/argmax)
  • Masking & Filtering — Boolean indexing and np.where
  • Matrix Operations & Broadcasting — element-wise math, dot products, and transposition
  • Signal Generation — building clean sine waves and combining signals of different frequencies
  • Fourier Transform (FFT) — converting a signal from the time domain to the frequency domain, and correctly interpreting the output (fftfreq, fftshift, positive-frequency filtering)
  • Peak Detection (scipy.signal.find_peaks) — locating local maxima in a noisy signal using height and distance thresholds, demonstrated on a synthetic (non-clinical) signal

Requirements

Install the required libraries with: pip install numpy matplotlib scipy pillow ipython

▶️ How to Run

Each cell in numpy_learning_notes.py is separated by # %% markers, which makes it runnable interactively:

  • VS Code: open the file and use the built-in "Run Cell" feature (requires the Python and Jupyter extensions).
  • Jupyter Notebook: convert the file to a .ipynb, or paste sections into notebook cells directly.

Some cells in the image-processing section expect a local image file at image/616151.jpg. To run those cells, place any image of your own at that path (or update the path in the code) — the image itself is not included in this repository.

📝 Note

These notes were written progressively while learning, so earlier sections are simpler and later sections (Fourier Transform, peak detection) build on the concepts introduced earlier. Comments throughout the code explain not just what each line does, but why.

About

Personal notes and exercises on NumPy, SciPy, and signal processing fundamentals — arrays, image processing, Fourier Transform, and peak detection in Python

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages