Skip to content

Instantly share code, notes, and snippets.

View HENDRIX-ZT2's full-sized avatar
💭
🐑

HENDRIX-ZT2

💭
🐑
View GitHub Profile
@ksvbka
ksvbka / worker-threadpool.py
Created December 19, 2018 15:29
Demo worker threadpool and report progress in PyQT.
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QVBoxLayout, QPushButton, QWidget
from PyQt5.QtCore import QObject, QRunnable, QThreadPool,pyqtSlot, pyqtSignal
import time
import traceback, sys
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
@fschwar4
fschwar4 / sinc_interpolation.py
Last active April 15, 2024 11:22
Fast Python implementation of Whittaker–Shannon / sinc / bandlimited interpolation.
import numpy as np
from numpy.typing import NDArray
def sinc_interpolation(x: NDArray, s: NDArray, u: NDArray) -> NDArray:
"""Whittaker–Shannon or sinc or bandlimited interpolation.
Args:
x (NDArray): signal to be interpolated, can be 1D or 2D
s (NDArray): time points of x (*s* for *samples*)
u (NDArray): time points of y (*u* for *upsampled*)