semvec/pypi-packages huggingface dataset:
vmdrs-py 0.3.0
Better, drop in replacement of vmdpy
Requires Python: >=3.7
Keywords: signal-processing,vmd,signal-analysis,python

vmdrs-py
---
Drop in replacement for [vmdpy](https://github.com/vrcarva/vmdpy) with fixes and improvements using the [vmd-rs](https://github.com/jiafuei/vmd-rs) Rust crate.

VMD, aka Variational Mode Decomposition, is a signal processing tool that decompse the input signal into different band-limited IMFs.

Installation
---
Available on [PyPI](https://pypi.org/project/vmdrs-py)

```
pip install --upgrade vmdrs-py
```

Requirements
---
```
numpy>=1.20
```

Examples
---
```
#%% Simple example: generate signal with 3 components + noise  
import numpy as np  
import matplotlib.pyplot as plt  
from vmdrs_py import VMD  

#. Time Domain 0 to T  
T = 1000  
fs = 1/T  
t = np.arange(1,T+1)/T  
freqs = 2*np.pi*(t-0.5-fs)/(fs)  

#. center frequencies of components  
f_1 = 2  
f_2 = 24  
f_3 = 288  

#. modes  
v_1 = (np.cos(2*np.pi*f_1*t))  
v_2 = 1/4*(np.cos(2*np.pi*f_2*t))  
v_3 = 1/16*(np.cos(2*np.pi*f_3*t))  

f = v_1 + v_2 + v_3 + 0.1*np.random.randn(v_1.size)  

#. some sample parameters for VMD  
alpha = 2000       # moderate bandwidth constraint  
tau = 0.            # noise-tolerance (no strict fidelity enforcement)  
K = 3              # 3 modes  
DC = 0             # no DC part imposed  
init = 1           # initialize omegas uniformly  
tol = 1e-7  


#. Run VMD 
u, u_hat, omega = VMD(f, alpha, tau, K, DC, init, tol)  

#. Visualize decomposed modes
plt.figure()
plt.subplot(2,1,1)
plt.plot(f)
plt.title('Original signal')
plt.xlabel('time (s)')
plt.subplot(2,1,2)
plt.plot(u.T)
plt.title('Decomposed modes')
plt.xlabel('time (s)')
plt.legend(['Mode %d'%m_i for m_i in range(u.shape[0])])
plt.tight_layout()

```


Compiling from source
---

### Requirements

1. Python >= 3.7
2. Rustc

### Instructions
Rust compiler is needed since this project is compiled using [Maturin](https://github.com/PyO3/maturin). 
```
pip install maturin
git clone https://github.com/jiafuei/vmdrs-py.git && cd vmdrs-py
maturin build --release
```

### Customizing BLAS providers
BLAS is used by [ndarray](https://github.com/rust-ndarray/ndarray), follow the instructions there
and edit [Cargo.toml](./Cargo.toml).
ShrinkX 1.3
A Python tool for effortlessly compressing media files for sharing online.

# Shrinkx
Shrinkr is a Python tool for effortlessly compressing media files using ffmpeg. The tool is inspired by the website https://8mb.video and the annoyance of memorizing ffmpeg command arguments 😩.

## Demo
https://github.com/stormedx/shrinkx/assets/88412569/fdc7f111-ddf8-4053-a89e-5bf68a058152

## Requirements

- Python 3.8 or higher 
- ffmpeg 5.x or higher is required and needs to be a $PATH variable on your system. Please read [ffmpeg](#ffmpeg) for additional information.

## Commands
- '-f', '--format': Choose the file format you want to encode the output to (i.e .mp4, .webm, .mov, .mkv).
- '-s', '--size': Allows you to compress a file to a specific size (kilobytes, megabytes, gigabytes).
- '-o', '--output': Output directory for the compressed file. If no location is given, the output file will output to the parent working directory of the source file.
- '--no-audio' : Removes all audio in the output file.
- '--chan' : Shortcut for compressing files into a .webm suitable for 4chan (<3.5mb in size, no audio).
- '--discord' : Shortcut for compressing files into an .mp4 >8mb in size

## Usage Examples

In it's simplest form, `shrinkx file.mov` will automatically compress & encode to .mp4 for sharing easily on platforms such as Discord.

`shrinkx --size 5mb -f webm video.mp4`

### ffmpeg installation
WIP