BodePlotter


Frequency Response (Bode Plot)


For installer downloads and source code, please visit our GitHub Pages site:
BodePlotter
You can also browse the latest releases on GitHub:
Releases


Table of Contents

  1. Features
  2. Example RC Band Pass Filter Circuit
  3. Screen shots of bodeplots
  4. Software Usage
  5. Command Line Options
  6. Recommended Display
  7. Oscilloscope Setup
  8. Install on Windows 11
  9. Install USB Driver for Windows 11
  10. Install the .deb Package on Mint Linux (22.1)
  11. Remove the .deb Package on Mint Linux (22.1)
  12. Build the .deb Package
  13. Windows Build Process
  14. Issues

Features

1. Python Application with Briefcase

2. OWON HDS320S Oscilloscope + Multi-Meter + Waveform Generator

3. Additional Information


Example RC Band Pass Filter Circuit


Lower Cutoff Frequency (f1)

f1 = 1 / (2 * π * R1 * C1)

Given:
R1 = 1.46 [kΩ] = 1460 [Ω]
C1 = 105.89 [nF] = 105.89 × 10^-9 [F]

f1 = 1 / (2 * π * 1460 * 105.89 × 10^-9) ≈ 1029.5 [Hz]

Upper Cutoff Frequency (f2)

f2 = 1 / (2 * π * R2 * C2)

Given:
R2 = 2.93 [kΩ] = 2930 [Ω]
C2 = 1.02 [nF] = 1.02 × 10^-9 [F]

f2 = 1 / (2 * π * 2930 * 1.02 × 10^-9) ≈ 53.254 [kHz]

TINA-TIV9 Simulation of the Circuit

The circuit was simulated using TINA-TIV9 software. Below is the visual representation of the circuit setup:

TINA-TIV9 Circuit Simulation


TINA-TIV9 Simulation Results

The simulation provided the following results, showcasing the circuit’s behavior:

TINA-TIV9 Simulation Results


Bode Plots Using OWON HDS320S

The Bode plots were generated using the OWON HDS320S oscilloscope in conjunction with the Bode-Plots Python application:

Bode Plots with OWON HDS320S


Screen shots of bodeplots

HDS320S Magnitude/Phase Bode Plotter window before Measurements or playback

HDS320S Magnitude/Phase Bode Plotter window before Measurements or playback


HDS320S Magnitude/Phase Bode Plotter window Playback Dark Theme

HDS320S Magnitude/Phase Bode Plotter window Playback Dark Theme


HDS320S Magnitude/Phase Bode Plotter window Playback Light Theme

HDS320S Magnitude/Phase Bode Plotter window Playback Light Theme


HDS320S Magnitude/Phase Bode Plotter window 1MHz to 10MHz getting into the noise floor

HDS320S Magnitude/Phase Bode Plotter window 1MHz to 10MHz getting into the noise floor


Watch the HDS320S Magnitude/Phase Bode Plotter window and MatPlotLib windows Playback Video

Watch the HDS320S Magnitude/Phase Bode Plotter window and MatPlotLib windows Video


Software Usage

  1. Launch the software via the command line (bodeplots) or from the menu.
  2. Verify oscilloscope settings and input desired parameters.
  3. Click Search and Setup Oscilloscope to initialize.
  4. Click Start Measurements (takes about 15 to 30 minutes).
  5. After completion, load the JSON log file for playback and analysis.

Command Line Options

usage: bodeplots.exe [-h] [--plot-type {XY,MP,FFT,SC,BODEPLOTTER}]
                     [--start-decade START_DECADE] [--stop-decade STOP_DECADE]
                     [--points-per-decade POINTS_PER_DECADE]
                     [--base-port BASE_PORT] [--leave-logs]

BodePlots Application

options:
  -h, --help            show this help message and exit
  --plot-type {XY,MP,FFT,SC,BODEPLOTTER}
                        Select the type of plot to display. Options: XY, MP,
                        FFT, SC, or BODEPLOTTER.
  --start-decade START_DECADE
                        Specify the starting decade for data processing.
  --stop-decade STOP_DECADE
                        Specify the ending decade for data processing.
  --points-per-decade POINTS_PER_DECADE
                        Specify the number of points per decade for the plot.
  --base-port BASE_PORT
                        Specify first IP port for + 0, + 1, + 2, + 3 ports.
  --leave-logs          Leave log files and temp directories intact on exit
                        and, on Linux, output logs to console.

  1. 4K Display (4096x2160) preferred; minimum 1600x1200 resolution.
  2. VirtualBox with Mint Linux 22.1 works well.

Oscilloscope Setup

  1. Connect the oscilloscope to your PC using a USB cable (preferably with Ferrite Rings to reduce noise).
  2. Set HDS320S to default:
    • Press SystemF3 (Default Setting) → Confirm.
  3. Connect probes:
    • CH1 (yellow lead) to circuit input.
    • CH2 (blue lead) to circuit output.
    • Gen Out to input ground.

Install on Windows 11

  1. Download Bode-Plots-0.0.6.msi and double-click it in File Explorer.
  2. Follow the installation prompts: NextNextFinish.
  3. Open “Bode” from the Windows Start menu.
  4. Adjust vertical height as needed.
  5. Install USB Driver for Windows 11 using Zadig.

Install USB Driver for Windows 11

  1. Download and Install Zadig
    Download zadig-2.9.exe to install the drivers for the OWON HDS320S.

  2. Allow Device Changes
    When prompted, allow Zadig to change Windows 11 device settings by clicking the Yes button.
    Allow Zadig to change Windows 11 device settings

  3. Allow Updates
    When prompted, allow Zadig to check for updates by clicking the Yes button.
    Allow Zadig to check for updates

  4. Detect USB Device
    Ensure your HDS320S is plugged in and powered on. Zadig should detect the USB device otherwise select from list.
    Zadig detects USB device

  5. Detect USB Device
    Correctly selected USB device will have USB ID 5345 1234.
    Zadig detects USB device

  6. Select the Correct Driver
    In the driver details, rename the device to OWON HDS320S. Then, use the drop-down arrow to select libusb-win32 (v1.4.0.0).
    Select libusb-win32 driver

  7. Install the Driver
    Click the Install Driver button and wait for the installation to complete.
    Install Driver

  8. Successful Installation
    Zadig should report that the driver was installed successfully.
    Driver installed successfully


Install the .deb Package on Mint Linux (22.1)

  1. Download: bodeplots_0.0.6-1~linuxmint-xia_amd64.deb.
  2. Open a terminal and run:
    sudo apt install ./bodeplots_0.0.6-1~linuxmint-xia_amd64.deb
    

Remove the .deb Package on Mint Linux (22.1)

  1. Open a terminal and run:
    sudo apt purge bodeplots
    

Build the .deb Package

  1. Use Live Mint (22.1) via VirtualBox or a local installation.
  2. Download: bodeplots-source-code.tgz.
  3. Follow these steps:
    mkdir BodePlotter-ScopeFFT
    mv ~/Downloads/bodeplots-source-code.tgz BodePlotter-ScopeFFT
    cd BodePlotter-ScopeFFT
    apt update
    sudo apt install python3-virtualenv git
    virtualenv bodeplotter -p python
    source bodeplotter/bin/activate
    pip install --upgrade pip
    pip install briefcase numpy dearpygui matplotlib pyusb scipy screeninfo PyQt5
    tar zpxvf bodeplots-source-code.tgz
    cd bodeplots
    rm -rf build/bodeplots
    briefcase create
    briefcase update -r
    briefcase build
    briefcase package
    

    Package file location: dist/bodeplots_0.0.6-1~linuxmint-xia_amd64.deb.


Windows Build Process

Environment Setup for Windows 11

  1. Install Latest Microsoft Visual C++ Redistributable:
  2. Install Git:
  3. Install Python and dependencies via PowerShell:
    mkdir C:\BodePlotter-ScopeFFT
    cd C:\BodePlotter-ScopeFFT
    python # or https://www.python.org/downloads/release/python-3132/
    # https://www.python.org/ftp/python/3.13.2/python-3.13.2-amd64.exe
    python -m venv bodeplotter
    .\bodeplotter\Scripts\activate
    python.exe -m pip install --upgrade pip
    pip install briefcase numpy dearpygui matplotlib pyusb scipy screeninfo PyQt5
    
  4. Extract source code and build: bodeplots-source-code.tgz
    cd C:\BodePlotter-ScopeFFT
    .\bodeplotter\Scripts\activate
    cd .\bodeplots
    briefcase create windows app
    briefcase update -r
    briefcase update
    briefcase build -v
    briefcase run -u
    briefcase package windows
    
  5. Packaged MSI: dist\Bode-Plots-0.0.6.msi.

Issues

  1. Smith Chart Normalization:
    • The Smith chart is currently not normalized. When the magnitude for an active filter exceeds 0 dB, the plot area scales dynamically to accommodate the data, causing the rendered chart to extend outside the standard Smith chart boundaries.
  2. Matplotlib Performance on Windows 11:
    • On Windows 11, Matplotlib may struggle to keep pace at higher playback speeds where the slider value is less than 0.6:
      • If Matplotlib is selected, starting measurements or playback may exceed 90 seconds before additional windows load.
      • Matplotlib windows are not automatically closed when DearPyGui exits, which can leave log files and temporary files in the user’s TEMP directory.
        • bodeplots will clear BodePlotter_* directories in %TEMP% that are over an hour old.
      • Using Matplotlib within threads makes DearPyGui unstable; therefore, a new process per Matplotlib window is used instead.
        • Current Implementation:
          • Using the console_app flag in pyproject.toml to open a blank console. The advantage of the console is that you can press CTRL+C to close all Bode-Plots windows.
          • It is recommended to stop active measurements or playback before proceeding, allowing port connections to close gracefully without generating crash dumps.
          • If you would like to hide the console, consider creating a bode-plots.vbs script. If you encounter issues with invalid characters, open the file in Notepad++, select Encoding → Convert to ANSI, and then save the file. For example:
            Set WshShell = CreateObject("WScript.Shell")
            WshShell.Run "cmd /c bodeplots.exe", 0, True
            Set WshShell = Nothing