Skip to main content

Pattern Extraction and Periodicity analysis,and commnunication multiple method library based on BEDCMM

Project description

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     2.6160
1    random   5000    61.1024
2    random  10000   245.1453
3  periodic   1000     1.2297
4  periodic   5000    28.6166
5  periodic  10000   110.1707
6     spike   1000     1.3126
7     spike   5000    27.9070
8     spike  10000   113.7231

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bedcmm-2.40.tar.gz (222.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bedcmm-2.40-cp311-cp311-win_amd64.whl (323.8 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

Details for the file bedcmm-2.40.tar.gz.

File metadata

  • Download URL: bedcmm-2.40.tar.gz
  • Upload date:
  • Size: 222.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for bedcmm-2.40.tar.gz
Algorithm Hash digest
SHA256 781abe2df214e26f2d18f935cad1529287ff7e4858f1b223d72674676d1f43ce
MD5 c80d80a2cbd47ca1a172a088f9313488
BLAKE2b-256 0b37a74ac841e7ff1fe65b586854e8181d5b3942b5eee29ff549d5801d87fa6f

See more details on using hashes here.

File details

Details for the file bedcmm-2.40-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: bedcmm-2.40-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 323.8 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for bedcmm-2.40-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 231cf89b782ca0c89d9dfaae71a8b66d7d0bc795ba4704dbf5be5a2be205a850
MD5 5eee10b94f6987fd965d66a1eb0acca8
BLAKE2b-256 b7fe3a85edfc749b0813cd7f7c462b63d9ee053ce8d24da4dcc9f544b0ffd868

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page