Method for finding Product Functions (PFs)
Usage
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
)
Arguments
- 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)
Value
list(pf,residue) | PFs:The decompose functions arranged from high frequency to low frequency | residue:residual component
Details
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
Author
Shubhra Prakash, shubhraprakash279@gmail.com
Examples
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)
#> $pf
#> $pf[[1]]
#> [1] -1.76564295 -1.14741909 1.71676319 0.65380322 -1.36306170 -0.19503684
#> [7] 0.82203177 0.89904663 1.05210311 -0.56874240 -1.25002462 1.27300660
#> [13] 1.41097333 -1.26221439 -0.78475830 1.02719097 0.61513174 0.32112846
#> [19] -0.10456166 -1.18269150 0.22491213 1.50323528 -0.72262683 -1.36688328
#> [25] 0.77474499 0.65088344 -0.30480424 0.17134563 -0.39287448 -0.50062777
#> [31] 1.04113666 0.18619356 -1.30403436 0.34728771 0.95773187 -0.60940802
#> [37] -0.17839391 0.41580468 -0.50355018 0.16922911 0.69173974 -0.79468078
#> [43] -0.41208422 0.80048565 -0.47687538 -0.68900800 0.69270340 -0.16953484
#> [49] -0.71763963 0.70960621 0.28158331 -0.58804478 0.47111217 0.20499907
#> [55] -0.55126107 0.78267374 0.53192077 -1.12099717 0.11278100 1.06702570
#> [61] -0.55945812 -0.57178242 0.30091135 -0.27421108 0.27557155 0.67832924
#> [67] -1.12345090 -0.70708319 1.50962997 0.34243961 -1.16547039 0.04669490
#> [73] 0.31894176 -0.08517476 0.31437416 -0.72739535 -1.09254203 1.34156606
#> [79] 1.26481815 -1.37044913 -0.69048601 1.15993465 0.63094325 0.13120706
#> [85] -0.43456742 -1.25347509 0.51543719 1.59670085 -1.08333316 -1.58807017
#> [91] 1.17722289 1.17780269 -0.53152671 -0.79240936 -1.05023779 -0.17062331
#> [97] 1.52128156 -0.04269183 -1.50075828 1.25247132
#>
#> $pf[[2]]
#> [1] -0.023598746 0.011540430 0.104002403 0.139829499 -0.012266744
#> [6] -0.198770790 -0.244593717 -0.217420851 -0.192531584 -0.125315046
#> [11] 0.030706642 0.176842483 0.167971121 0.014624520 -0.126480018
#> [16] -0.153574702 -0.133793217 -0.134463660 -0.094706696 0.040684061
#> [21] 0.142850881 0.093993065 -0.025782183 -0.084495442 0.004643535
#> [26] 0.092090481 -0.030115827 -0.142805218 -0.020382131 0.158582374
#> [31] 0.090378354 -0.066644115 -0.114851095 -0.054102787 0.067481724
#> [36] 0.076217486 -0.024423551 -0.056678072 0.000809861 0.034208894
#> [41] -0.006661900 -0.044204363 -0.017585166 0.053620918 0.113273694
#> [46] 0.102503058 0.039568385 -0.011994149 -0.033528849 -0.037628209
#> [51] -0.051214498 -0.085204941 -0.088208506 -0.021579901 0.048818370
#> [56] 0.007868271 -0.085332199 -0.078389027 0.004081704 0.103592413
#> [61] 0.113134083 -0.029541220 -0.088077098 0.029830060 0.084442096
#> [66] -0.031994340 -0.077663554 0.028109760 0.089980546 0.035944158
#> [71] -0.138888344 -0.186659959 0.064814999 0.222351282 0.093344060
#> [76] -0.136707986 -0.094412081 0.064554079 0.074413772 -0.037221986
#> [81] -0.134726305 -0.130638480 -0.087107105 -0.077132377 -0.034486892
#> [86] 0.108043782 0.214085911 0.148846714 -0.005285647 -0.169203533
#> [91] -0.239616712 -0.104736402 0.078703574 0.188751584 0.337560047
#> [96] 0.432796859 0.283012841 -0.028444604 -0.368281113 -0.589854669
#>
#> $pf[[3]]
#> [1] 0.1636448382 0.1407318063 0.0849717254 0.0096142501 -0.0539709648
#> [6] -0.0934449226 -0.1195657947 -0.1367795391 -0.1420832966 -0.1368547174
#> [11] -0.1234619662 -0.1001291257 -0.0680498619 -0.0354435355 -0.0078518650
#> [16] 0.0157320727 0.0345377652 0.0454906706 0.0515115211 0.0602505420
#> [21] 0.0727060273 0.0791082066 0.0693982851 0.0440026943 0.0117867487
#> [26] -0.0166523789 -0.0310191156 -0.0260152705 -0.0074680251 0.0120984021
#> [31] 0.0223701807 0.0184122336 0.0026321216 -0.0153733675 -0.0268993975
#> [36] -0.0316708705 -0.0346125221 -0.0369268159 -0.0334587047 -0.0192527094
#> [41] 0.0050911501 0.0342698285 0.0581703864 0.0658709907 0.0568311841
#> [46] 0.0424352467 0.0333627104 0.0305702356 0.0297370439 0.0271902134
#> [51] 0.0178508534 -0.0045022184 -0.0370071795 -0.0655093235 -0.0775134817
#> [56] -0.0692724369 -0.0449144280 -0.0158154453 0.0073847645 0.0249213782
#> [61] 0.0410171726 0.0529470386 0.0559404527 0.0507598563 0.0408356975
#> [66] 0.0272715431 0.0092192771 -0.0137102680 -0.0381731651 -0.0527559615
#> [71] -0.0421654309 -0.0025483896 0.0495585103 0.0877727354 0.0931514822
#> [76] 0.0606747292 0.0013983995 -0.0603225724 -0.0991248851 -0.1024894181
#> [81] -0.0765192026 -0.0405703986 -0.0136662900 -0.0006005832 0.0055432040
#> [86] 0.0113671929 0.0186026947 0.0262220836 0.0355964432 0.0521829269
#> [91] 0.0779350672 0.1057411489 0.1245770695 0.1207650470 0.0777758196
#> [96] -0.0024027934 -0.0848834589 -0.1347479666 -0.1513031094 -0.1535547653
#>
#> $pf[[4]]
#> [1] 3.512567e-02 3.511196e-02 3.506123e-02 3.486016e-02 3.422426e-02
#> [6] 3.263504e-02 2.943046e-02 2.409024e-02 1.662801e-02 7.800724e-03
#> [11] -1.088686e-03 -8.739442e-03 -1.440790e-02 -1.811400e-02 -2.043011e-02
#> [16] -2.205072e-02 -2.340039e-02 -2.439870e-02 -2.442176e-02 -2.253740e-02
#> [21] -1.805033e-02 -1.114241e-02 -3.119653e-03 4.043408e-03 8.618381e-03
#> [26] 9.872133e-03 8.220267e-03 4.823179e-03 9.613689e-04 -2.430330e-03
#> [31] -4.882766e-03 -6.232781e-03 -6.411139e-03 -5.361813e-03 -3.135042e-03
#> [36] -2.546508e-05 3.415309e-03 6.544925e-03 8.834389e-03 9.942167e-03
#> [41] 9.669209e-03 7.958374e-03 5.021922e-03 1.459757e-03 -1.836589e-03
#> [46] -4.023014e-03 -4.667100e-03 -3.883008e-03 -2.184625e-03 -2.182343e-04
#> [51] 1.435594e-03 2.345092e-03 2.269472e-03 1.212215e-03 -5.599558e-04
#> [56] -2.600661e-03 -4.456202e-03 -5.805903e-03 -6.460150e-03 -6.242597e-03
#> [61] -4.914677e-03 -2.276006e-03 1.611686e-03 6.315370e-03 1.121783e-02
#> [66] 1.591027e-02 2.044977e-02 2.520708e-02 3.037130e-02 3.549086e-02
#> [71] 3.947426e-02 4.112673e-02 3.987738e-02 3.615733e-02 3.116084e-02
#> [76] 2.617248e-02 2.196055e-02 1.861669e-02 1.584761e-02 1.338796e-02
#> [81] 1.120812e-02 9.446458e-03 8.223184e-03 7.523781e-03 7.208907e-03
#> [86] 7.078620e-03 6.884049e-03 6.250269e-03 4.594101e-03 1.193442e-03
#> [91] -4.507889e-03 -1.248026e-02 -2.188288e-02 -3.128370e-02 -3.925193e-02
#> [96] -4.495255e-02 -4.835946e-02 -5.003143e-02 -5.065572e-02 -5.085826e-02
#>
#> $pf[[5]]
#> [1] -3.707549e-02 -3.706642e-02 -3.705204e-02 -3.703042e-02 -3.699792e-02
#> [6] -3.694988e-02 -3.688552e-02 -3.680141e-02 -3.669202e-02 -3.654852e-02
#> [11] -3.635577e-02 -3.609014e-02 -3.571585e-02 -3.518388e-02 -3.443150e-02
#> [16] -3.338568e-02 -3.196984e-02 -3.011376e-02 -2.776442e-02 -2.489705e-02
#> [21] -2.152336e-02 -1.769326e-02 -1.349269e-02 -9.034408e-03 -4.446590e-03
#> [26] 1.398397e-04 4.602625e-03 8.836061e-03 1.275535e-02 1.629894e-02
#> [31] 1.942688e-02 2.211800e-02 2.436622e-02 2.617298e-02 2.753981e-02
#> [36] 2.845883e-02 2.890508e-02 2.883502e-02 2.819153e-02 2.692093e-02
#> [41] 2.499745e-02 2.244430e-02 1.934788e-02 1.585299e-02 1.214212e-02
#> [46] 8.405890e-03 4.814912e-03 1.500334e-03 -1.452094e-03 -3.998885e-03
#> [51] -6.129299e-03 -7.854350e-03 -9.196665e-03 -1.018243e-02 -1.083563e-02
#> [56] -1.117411e-02 -1.120816e-02 -1.094166e-02 -1.037677e-02 -9.520913e-03
#> [61] -8.394227e-03 -7.036619e-03 -5.509931e-03 -3.895741e-03 -2.286855e-03
#> [66] -7.765257e-04 5.530770e-04 1.640561e-03 2.449783e-03 2.971359e-03
#> [71] 3.219860e-03 3.227894e-03 3.039997e-03 2.706388e-03 2.276257e-03
#> [76] 1.795293e-03 1.300984e-03 8.226668e-04 3.810767e-04 -1.149459e-05
#> [81] -3.489604e-04 -6.308318e-04 -8.601743e-04 -1.042242e-03 -1.183949e-03
#> [86] -1.291907e-03 -1.372776e-03 -1.432545e-03 -1.475938e-03 -1.507279e-03
#> [91] -1.529745e-03 -1.545686e-03 -1.557020e-03 -1.564807e-03 -1.570228e-03
#> [96] -1.573859e-03 -1.576272e-03 -1.577913e-03 -1.579128e-03 -1.579942e-03
#>
#> $pf[[6]]
#> [1] -4.183347e-03 -4.259470e-03 -4.351226e-03 -4.456273e-03 -4.573669e-03
#> [6] -4.703013e-03 -4.844480e-03 -4.998543e-03 -5.165984e-03 -5.324561e-03
#> [11] -5.470204e-03 -5.599517e-03 -5.709561e-03 -5.798802e-03 -5.865830e-03
#> [16] -5.910103e-03 -5.931463e-03 -5.929847e-03 -5.905347e-03 -5.857247e-03
#> [21] -5.784111e-03 -5.684212e-03 -5.555212e-03 -5.394062e-03 -5.197739e-03
#> [26] -4.963085e-03 -4.687070e-03 -4.367157e-03 -4.001631e-03 -3.589849e-03
#> [31] -3.132058e-03 -2.630234e-03 -2.087871e-03 -1.509889e-03 -9.030670e-04
#> [36] -2.755882e-04 3.630271e-04 1.001652e-03 1.628781e-03 2.232226e-03
#> [41] 2.799470e-03 3.318576e-03 3.777926e-03 4.167345e-03 4.478022e-03
#> [46] 4.703052e-03 4.837542e-03 4.879124e-03 4.827550e-03 4.685509e-03
#> [51] 4.457689e-03 4.151441e-03 3.775935e-03 3.342100e-03 2.862447e-03
#> [56] 2.350088e-03 1.818949e-03 1.282823e-03 7.548515e-04 2.476213e-04
#> [61] -2.277179e-04 -6.616145e-04 -1.046545e-03 -1.376779e-03 -1.648747e-03
#> [66] -1.860822e-03 -2.013634e-03 -2.109203e-03 -2.151420e-03 -2.145104e-03
#> [71] -2.096486e-03 -2.011778e-03 -1.897823e-03 -1.761553e-03 -1.608992e-03
#> [76] -1.446507e-03 -1.279362e-03 -1.111802e-03 -9.478790e-04 -7.903047e-04
#> [81] -6.415165e-04 -5.028506e-04 -3.754403e-04 -2.595361e-04 -1.552209e-04
#> [86] -6.231186e-05 1.963637e-05 9.150507e-05 1.538251e-04 2.074038e-04
#> [91] 2.531553e-04 2.920646e-04 3.231878e-04 3.482529e-04 3.682116e-04
#> [96] 3.839918e-04 3.967056e-04 4.067277e-04 4.147241e-04 4.208017e-04
#>
#> $pf[[7]]
#> [1] -0.010292534 -0.010216312 -0.010124461 -0.010019223 -0.009901537
#> [6] -0.009771708 -0.009629466 -0.009474240 -0.009304955 -0.009143455
#> [11] -0.008993622 -0.008858162 -0.008739228 -0.008637469 -0.008553024
#> [16] -0.008484958 -0.008431561 -0.008390538 -0.008359242 -0.008335441
#> [21] -0.008316937 -0.008302024 -0.008288918 -0.008276659 -0.008264169
#> [26] -0.008250719 -0.008235761 -0.008218974 -0.008199934 -0.008178455
#> [31] -0.008154389 -0.008127488 -0.008097507 -0.008064392 -0.008027972
#> [36] -0.007988275 -0.007945214 -0.007898701 -0.007848855 -0.007795804
#> [41] -0.007739903 -0.007681328 -0.007620499 -0.007557970 -0.007494340
#> [46] -0.007430346 -0.007366763 -0.007304488 -0.007244325 -0.007187297
#> [51] -0.007134211 -0.007086070 -0.007043757 -0.007008043 -0.006979792
#> [56] -0.006959575 -0.006948255 -0.006946420 -0.006954465 -0.006972895
#> [61] -0.007002097 -0.007042236 -0.007093315 -0.007155144 -0.007227413
#> [66] -0.007309473 -0.007400313 -0.007498978 -0.007604077 -0.007714123
#> [71] -0.007827487 -0.007942545 -0.008057851 -0.008171771 -0.008283238
#> [76] -0.008390991 -0.008494143 -0.008592303 -0.008684847 -0.008771699
#> [81] -0.008852718 -0.008927953 -0.008997520 -0.009061745 -0.009120680
#> [86] -0.009174482 -0.009223400 -0.009267664 -0.009307450 -0.009342881
#> [91] -0.009374222 -0.009401809 -0.009424302 -0.009442934 -0.009458280
#> [96] -0.009470789 -0.009481213 -0.009489647 -0.009496457 -0.009501790
#>
#>
#> $residue
#> [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#>