Skip to main content

bedcmm

CI PyPI version Python Versions

Open Implementation of Patented Algorithm (Japan Patent)

This repository provides an open implementation of the "Base Extraction Division Minimum Method," which is registered as a patent in Japan.

  • This implementation is intended for research, verification, and evaluation purposes.
  • Commercial use or redistribution requires obtaining a license (see below).

bedcmm is a library for robust periodicity, pattern extraction, and communication multiplexing based on a patented method.

Features

A robust algorithm for pattern extraction and periodicity analysis, designed to remain stable under outliers and impulsive noise.

  • Quantitative pattern extraction

  • Quantitative periodicity calculation

    • Applied to pitch detection robust to impulsive (spike) noise
      https://github.com/YASUHARA-Wataru/bedcmmPitch
    • Periodicity analysis robust to outliers
      (example_temperature_period_ana.py)
    • Support for missing values (NaN)
      • Periodicity can be computed directly without interpolation or preprocessing
      • Outputs the valid data ratio (valid_ratio) as a measure of reliability
      • Shows behavior similar to autocorrelation on complete data, while remaining applicable to datasets with missing values
  • Quantitative continuity calculation

  • Multiplexing communication using shorter sequences than M-sequences and only 1-bit quantization.However, synchronization is required(only send), randomness is not guaranteed, and signal-to-noise ratio (SNR) is not improved.

  • Cross-periodicity analysis (not part of the core patented claims)

    • A method for comparing periodic structures between signals, analogous to the relationship between autocorrelation and cross-correlation

    Note: When the same signal is provided as both inputs, the result corresponds to auto-periodicity.

Install

pip install bedcmm

Example

  • pattern
import numpy as np
import bedcmm

np.random.seed(0)

# 周期 + ノイズ
base = np.tile([1, 0, 0, 0], 25)
noise = np.random.randint(0, 2, len(base)) * 0.1

x = base + noise

score = bedcmm.pattern.periodicity(x)

print("periodicity score:", score)
  • communication
import numpy as np
import bedcmm

base1 = [False, False, False, False, False, True, True, True]
base2 = [False, False, False, True, False, False, True, True]
base3 = [False, True, False, False, False, False, True, True]
tx1 = np.tile(base1, 5)
tx2 = np.tile(base2, 5)
tx3 = np.tile(base3, 5)

tx = np.array([tx1,tx2,tx3])

send_signal = bedcmm.communication.multiplexing(tx)
print(send_signal)

demod_signal1 = bedcmm.communication.demodulate(send_signal,base1)
demod_signal2 = bedcmm.communication.demodulate(send_signal,base2)
demod_signal3 = bedcmm.communication.demodulate(send_signal,base3)

print("demod_signal1:", demod_signal1)
print("demod_signal2:", demod_signal2)
print("demod_signal3", demod_signal3)

Demo

By running pattern_demo.ipynb and communication_demo.ipynb, you can obtain simple sample results:

A brief explanation is available in the doc directory.

How to run faster

python setup.py build_ext --inplace Run with Cython (pattern modules)

Calculation speed

The benchmark script is speed_test.py.

Cython

         mode      N  time_msec
0      random   1000     0.4663
1      random   5000     9.2802
2      random  10000    36.8042
3    periodic   1000     0.3934
4    periodic   5000     9.3168
5    periodic  10000    35.1771
6   periodic2   1000     0.4475
7   periodic2   5000     9.7517
8   periodic2  10000    35.1592
9       spike   1000     0.5319
10      spike   5000     9.9697
11      spike  10000    35.5499

Python only

       mode      N   time_msec
0    random   1000    188.5421
1    random   5000   4593.9274
2    random  10000  19079.0753
3  periodic   1000    196.6179
4  periodic   5000   4723.4922
5  periodic  10000  18833.8787
6     spike   1000    206.1020
7     spike   5000   4802.0938
8     spike  10000  19601.9191

Patent Information

This algorithm is based on the following Japanese patent:

  • Patent Number: JP Patent No. 7537807
  • Title: Pattern Extraction and Communication Multiplexing Method
  • Registration Date: August 13, 2024
  • Summary: Methods for pattern extraction, periodicity calculation, continuity calculation, and communication multiplexing.

Scope of Patent and Non-Patented Implementations

This repository contains both implementations covered by the patent and independent auxiliary or extended implementations.

  • Patent-covered components:

    • Core algorithm for pattern extraction and periodicity analysis based on the Base Extraction Division Minimum Method
  • Extended implementations:

    • Handling of missing values (NaN)
  • Non-patented implementations:

    • Cross-periodicity analysis (e.g., cross_periodicity and related functions)

The applicability of the patent may depend on the specific use case and implementation details.

Contact

fapow.contact[at]gmail.com

Metadata

Release files for bedcmm 2.44

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bedcmm 2.44
File Size Uploaded Provenance Actions
bedcmm-2.44.tar.gz 242.3 kB Without provenance Details for bedcmm-2.44.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bedcmm 2.44
File Interpreter ABI Platform Actions
bedcmm-2.44-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for bedcmm-2.44-cp311-cp311-win_amd64.whl

Total release size: 361.4 kB

Release files / bedcmm-2.44.tar.gz

Download URL bedcmm-2.44.tar.gz
Size 242.3 kB
Tags Source
SHA-256 checksum
How to use checksums
274943ab1c2e265341a9fab7329a6e8395a7df055b79d539def29a910340d744
BLAKE2b-256 checksum
How to use checksums
80e2c01832cc79fa0403f9fca15362a4b6bff7f0c55e937447ceb6df46f02390
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / bedcmm-2.44-cp311-cp311-win_amd64.whl

Download URL bedcmm-2.44-cp311-cp311-win_amd64.whl
Size 119.1 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
8d237b34a79513d42c92db3010935c05b4d81da42c2cf8aa47a7d31bbecd3dbd
BLAKE2b-256 checksum
How to use checksums
ef53e3d04a370e65d3fa7512c64dc74ac1ead3f32e752371dc42ed37d095f217
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Security for bedcmm 2.44

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page