This guide will walk you through the steps required to set up a virtual environment using venv
and run the real-time FFT visualization application.
Ensure you have the following installed on your system:
- Python 3.x
pip3
(Python package installer)virtualenv
package (optional, but recommended for managing virtual environments)
cd sketch
Create a virtual environment using venv
:
python3 -m venv venv
-
On Windows:
.\venv\Scripts\activate
-
On macOS and Linux:
source venv/bin/activate
With the virtual environment activated, install the necessary packages using pip3
:
pip3 install -r requirements.txt
Ensure your Arduino is connected to the correct serial port. You may need to modify the serial port setting in the script (e.g., /dev/ttyACM0
for Linux, COM3
for Windows).
Execute the Python script to start the real-time FFT visualization:
python3 fft_visualizer.py
Once you are done, deactivate the virtual environment:
deactivate
- Make sure your Arduino is properly programmed to send FFT data to the serial port.
- Adjust the serial port name in the script to match your system's configuration.
- The application will prompt you to choose a filter type and, if applicable, a cutoff frequency.
- FIXED PARAMENTERS BETWEEN THE SKETCH and PYTHON SCRIPT:
- sampling rate
- number of samples
- bauds