Skip to content

Instantly share code, notes, and snippets.

@encse
encse / iq_demod.py
Last active July 30, 2025 21:18
iq demodulation
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal
# Source: https://github.com/guillaume-chevalier/filtering-stft-and-laplace-transform
def butter_lowpass_filter(data, cutoff_freq, sampling_freq, order=4):
nyq_freq = 0.5 * sampling_freq
normal_cutoff = float(cutoff_freq) / nyq_freq
b, a = signal.butter(order, normal_cutoff, btype='lowpass')