Skip to content

Instantly share code, notes, and snippets.

View shabaz123's full-sized avatar

shabaz123

View GitHub Profile
@shabaz123
shabaz123 / plot_touchstone_with_cursor.py
Created July 15, 2024 00:27
Plot S11 File with cursor attempt
# Create a Smith Chart and plot the contents of a .s1p file
import numpy as np
import skrf as rf
from matplotlib import rcParams, pyplot as plt
import sys
from mpl_smithchart import SmithAxes
# output settings
out_title = "Smith Chart Output"
@shabaz123
shabaz123 / plot_touchstone_file.py
Last active July 15, 2024 00:05
Plot S11 data
# Create a Smith Chart and plot the contents of a .s1p file
import numpy as np
import skrf as rf
from matplotlib import rcParams, pyplot as plt
import sys
from mpl_smithchart import SmithAxes
# output settings
out_title = "Smith Chart Output"
@shabaz123
shabaz123 / StarmapProjectESP32.ino
Created July 11, 2024 05:44
Starmap on ESP32 (work in progress)
// StarmapProjectESP32.ino
// rev 0.1 - June 2024 - shabaz
// This code implements a star chart in an ESP32
// ******** includes ********
#include <Starmap.h>
#include <Flash_SST25VF.h>
//#include <Teseo.h>
#include <Arduino_GFX_Library.h>
@shabaz123
shabaz123 / main.py
Created May 28, 2024 00:13
remote control example for up/down volume control
# sny_ir_receiver.py - A Pi Pico MicroPython based SNY IR receiver
# rev 1 - shabaz - October 2023
# modified for controlling up/down outputs - shabaz - May 2024
import time
from machine import Pin
from rp2 import asm_pio, PIO, StateMachine
# IR sensor pin
ir_pin = Pin(15, Pin.IN, Pin.PULL_UP)
@shabaz123
shabaz123 / plot_ind.py
Created January 31, 2024 19:05
Charts inductance from .s1p Touchstone file (from S11 Reflection Coefficients)
# plot_ind.py - Reads a .s1p file and plots the inductance vs frequency on a graph
# uses DraggableMarker class from https://stackoverflow.com/questions/43982250/draggable-markers-in-matplotlib
# rev 1 - shabaz - January 2024
import skrf as rf
import numpy as np
import matplotlib.pyplot as plt
import sys
# set the filename
@shabaz123
shabaz123 / elec_comp.py
Created January 29, 2024 04:14
Electrical Length Compensation for VNA Measurements
# elec_comp.py - Electrical length compensation
# rev 1 - shabaz - January 2024
# based on code by Keisuke Kawahara
# This code reads two .s1p files, (for S11 Open and DUT).
# Then, the electrical length is calculated from the Open file,
# and applied to the DUT file. The corrected DUT file is saved to a new file,
# and is also displayed on a Smith chart.
import skrf as rf
import matplotlib.pyplot as plt
# de_embed.py - VNA Measurement De-Embedding
# rev 1 - shabaz - January 2024
# This code reads three .s1p files, (for S11 Open, Short, and for the DUT).
# Then, the DUT is de-embedded using the Open and Short files.
# The corrected DUT is saved to a new file, and is also displayed on a Smith chart.
import numpy as np
import matplotlib.pyplot as plt
import skrf as rf
from scipy.optimize import minimize
@shabaz123
shabaz123 / FindLibUSB.cmake
Created January 15, 2024 23:42
cmake file used for building libmirisdr-4
# FindLibUSB.cmake - Try to find the Hiredis library
# Once done this will define
#
# LIBUSB_FOUND - System has libusb
# LIBUSB_INCLUDE_DIR - The libusb include directory
# LIBUSB_LIBRARIES - The libraries needed to use libusb
# LIBUSB_DEFINITIONS - Compiler switches required for using libusb
find_path(LIBUSB_INCLUDE_DIR
NAMES libusb.h
PATHS
FROM alpine:3.17.0
# Install toolchain
RUN apk update && \
apk upgrade && \
apk add git \
python3 \
py3-pip \
cmake \
build-base \
Details: An error occurred while executing command: 'host-status --ide-path=/root/.cache/JetBrains/RemoteDev/dist/5e0b8d8cdf7c1_CLion-2023.3.1 --project-path=/IdeaProjects/project1' Exit code: 1
2024-01-12 01:35:33,005 INFO sh -c "uname -sm"
stdout:
Linux x86_64
2024-01-12 01:35:33,276 INFO sh -c "echo $SHELL"