Title: | A Self-Adaptive Approach for Demodulating Multi-Component Signal |
---|---|
Description: | Local Mean Decomposition is an iterative and self-adaptive approach for demodulating, processing, and analyzing multi-component amplitude modulated and frequency modulated signals. This R package is based on the approach suggested by Smith (2005) <doi:10.1098/rsif.2005.0058> and the 'Python' library 'PyLMD'. |
Authors: | Shubhra Prakash [trl, aut, cre] |
Maintainer: | Shubhra Prakash <[email protected]> |
License: | Apache License (>= 2) |
Version: | 1.1.0 |
Built: | 2025-03-10 05:06:07 UTC |
Source: | https://github.com/shubhra-opensource/lmd |
Method for extracting product functions
extract_product_function( signal, max_envelope_iteration = 200, envelope_epsilon = 0.01, convergence_epsilon = 0.01 )
extract_product_function( signal, max_envelope_iteration = 200, envelope_epsilon = 0.01, convergence_epsilon = 0.01 )
signal |
Signal values (Numeric | vector) |
max_envelope_iteration |
Maximum number of iterations when separating local envelope signals (Integer) |
envelope_epsilon |
Terminate processing when obtaining pure FM signal (Double) |
convergence_epsilon |
Terminate processing when modulation signal converges (Double) |
Product Function
Shubhra Prakash, [email protected]
https://pypi.org/project/PyLMD/
x=1:100 y = (2 / 3 )* sin(x * 30) + (2 / 3) * sin(x * 17.5) + (4 / 5) *cos(x * 2) plot(y,type="l") pf=extract_product_function(y)
x=1:100 y = (2 / 3 )* sin(x * 30) + (2 / 3) * sin(x * 17.5) + (4 / 5) *cos(x * 2) plot(y,type="l") pf=extract_product_function(y)
Method for finding Extreme Points
find_extrema(signal, include_endpoints = TRUE)
find_extrema(signal, include_endpoints = TRUE)
signal |
Signal values (Numeric | vector) |
include_endpoints |
whether to include end points or not (Boolean) |
A local extrema is the point at which a maximum or minimum value of the function in some open interval containing the point is obtained.
Indexes of all extrema values (including starting and ending points)
Shubhra Prakash, [email protected]
signal=c( 0.841471 ,0.9092974,0.14112,-0.7568025,-0.9589243) find_extrema(signal)
signal=c( 0.841471 ,0.9092974,0.14112,-0.7568025,-0.9589243) find_extrema(signal)
Method for checking if signal is increasing or decreasing monotonously
is_monotonous(signal)
is_monotonous(signal)
signal |
Signal values (Numeric | vector) |
A monotonic signal is a function that keeps increasing or decreasing as its domain variable proceeds.#'
Boolean
Shubhra Prakash, [email protected]
https://pypi.org/project/PyLMD/
x=1:100 is_monotonous(x)
x=1:100 is_monotonous(x)
Method for finding Product Functions (PFs)
lmd( signal, include_endpoints = TRUE, max_smooth_iteration = 12, max_envelope_iteration = 200, envelope_epsilon = 0.01, convergence_epsilon = 0.01, max_num_pf = 8 )
lmd( signal, include_endpoints = TRUE, max_smooth_iteration = 12, max_envelope_iteration = 200, envelope_epsilon = 0.01, convergence_epsilon = 0.01, max_num_pf = 8 )
signal |
Signal values (Numeric | vector) |
include_endpoints |
Whether to treat the endpoint of the signal as a pseudo-extreme point (Boolean) |
max_smooth_iteration |
Maximum number of iterations of moving average algorithm (Integer) |
max_envelope_iteration |
Maximum number of iterations when separating local envelope signals (Integer) |
envelope_epsilon |
Terminate processing when obtaining pure FM signal (Double) |
convergence_epsilon |
Terminate processing when modulation signal converges (Double) |
max_num_pf |
The maximum number of PFs generated(Integer) |
LMD is a method of decomposing signal into Product Functions (PFs) based on algorithm presented in Jonathan S. Smith. The local mean decomposition and its application to EEG perception data. Journal of the Royal Society Interface, 2005, 2(5):443-454
list(pf,residue) | PFs:The decompose functions arranged from high frequency to low frequency | residue:residual component
Shubhra Prakash, [email protected]
https://pypi.org/project/PyLMD/
x=1:100 y = (2 / 3 )* sin(x * 30) + (2 / 3) * sin(x * 17.5) + (4 / 5) *cos(x * 2) plot(y,type="l") lmd(y)
x=1:100 y = (2 / 3 )* sin(x * 30) + (2 / 3) * sin(x * 17.5) + (4 / 5) *cos(x * 2) plot(y,type="l") lmd(y)
Shiny Dashboard for plotting Product Functions (PFs) and Residue
lmd_shiny()
lmd_shiny()
Shubhra Prakash, [email protected]
Method for finding Local Mean and Envelope
local_mean_and_envelope(signal, extrema)
local_mean_and_envelope(signal, extrema)
signal |
Signal values (Numeric | vector) |
extrema |
indexes for extreme values |
mean, envelope and smoothed mean and envelope values
Shubhra Prakash, [email protected]
https://pypi.org/project/PyLMD/
signal = sin(1:10) extrema = c(1 , 2, 5, 8, 10) local_mean_and_envelope(signal, extrema)
signal = sin(1:10) extrema = c(1 , 2, 5, 8, 10) local_mean_and_envelope(signal, extrema)
Weighted Moving Average Smoothing
moving_average_smooth(signal, window, max_smooth_iteration = 12)
moving_average_smooth(signal, window, max_smooth_iteration = 12)
signal |
Signal values (Numeric | vector) |
window |
filter weights for smoothing (Numeric | vector) |
max_smooth_iteration |
Maximum number of iterations of moving average algorithm (Integer) |
Weighted Moving Average Smoothing is used to smooth en the mean and envelope signal
smooth signal
Shubhra Prakash, [email protected]
https://pypi.org/project/PyLMD/
x=0:100 y = (2 / 3 )* sin(x * 30) + (2 / 3) * sin(x * 17.5) + (4 / 5) *cos(x * 2) plot(y,type="l") wma=moving_average_smooth(y,5) plot(wma,type="l")
x=0:100 y = (2 / 3 )* sin(x * 30) + (2 / 3) * sin(x * 17.5) + (4 / 5) *cos(x * 2) plot(y,type="l") wma=moving_average_smooth(y,5) plot(wma,type="l")
Method for plotting Product Functions (PFs) and Residue
plot_lmd( lmd_obj, max_pf = length(lmd_obj[["pf"]]), show_residue = TRUE, pricolor_plot = "midnightblue", line_size_plot = 1 )
plot_lmd( lmd_obj, max_pf = length(lmd_obj[["pf"]]), show_residue = TRUE, pricolor_plot = "midnightblue", line_size_plot = 1 )
lmd_obj |
LMD object created from LMD function |
max_pf |
Number of PFs to Plot |
show_residue |
Whether to plot residue or not |
pricolor_plot |
color of plots |
line_size_plot |
Size of line in ggplot |
ggplot plot for Product Functions (PFs) and Residue
Shubhra Prakash, [email protected]
x=1:100 y = (2 / 3 )* sin(x * 30) + (2 / 3) * sin(x * 17.5) + (4 / 5) *cos(x * 2) plot_lmd(lmd(y))
x=1:100 y = (2 / 3 )* sin(x * 30) + (2 / 3) * sin(x * 17.5) + (4 / 5) *cos(x * 2) plot_lmd(lmd(y))