PySDKit 0.4.54__tar.gz → 0.4.55__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. {pysdkit-0.4.54 → pysdkit-0.4.55}/PKG-INFO +2 -1
  2. {pysdkit-0.4.54 → pysdkit-0.4.55}/PySDKit.egg-info/PKG-INFO +2 -1
  3. {pysdkit-0.4.54 → pysdkit-0.4.55}/PySDKit.egg-info/SOURCES.txt +15 -1
  4. {pysdkit-0.4.54 → pysdkit-0.4.55}/README.md +1 -0
  5. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/__init__.py +7 -1
  6. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_tfa/__init__.py +24 -0
  7. pysdkit-0.4.55/pysdkit/_tfa/set.py +482 -0
  8. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/__init__.py +10 -0
  9. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/_loaders.py +81 -0
  10. pysdkit-0.4.55/pysdkit/data/deconv_sig1.npy +0 -0
  11. pysdkit-0.4.55/pysdkit/data/deconv_sig2.npy +0 -0
  12. pysdkit-0.4.55/pysdkit/data/deconv_sig3.npy +0 -0
  13. pysdkit-0.4.55/pysdkit/data/set_batdata2.npy +0 -0
  14. pysdkit-0.4.55/pysdkit/data/set_vibdata.npy +0 -0
  15. pysdkit-0.4.55/pysdkit/tests/test_deconvolution.py +408 -0
  16. pysdkit-0.4.55/pysdkit/tests/test_set.py +211 -0
  17. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/__init__.py +43 -0
  18. pysdkit-0.4.55/pysdkit/utils/deconvolution/__init__.py +61 -0
  19. pysdkit-0.4.55/pysdkit/utils/deconvolution/_acycbd.py +184 -0
  20. pysdkit-0.4.55/pysdkit/utils/deconvolution/_common.py +232 -0
  21. pysdkit-0.4.55/pysdkit/utils/deconvolution/_imckd.py +224 -0
  22. pysdkit-0.4.55/pysdkit/utils/deconvolution/_plot.py +254 -0
  23. pysdkit-0.4.55/pysdkit/utils/deconvolution/_smhd.py +226 -0
  24. {pysdkit-0.4.54 → pysdkit-0.4.55}/LICENSE +0 -0
  25. {pysdkit-0.4.54 → pysdkit-0.4.55}/PySDKit.egg-info/dependency_links.txt +0 -0
  26. {pysdkit-0.4.54 → pysdkit-0.4.55}/PySDKit.egg-info/requires.txt +0 -0
  27. {pysdkit-0.4.54 → pysdkit-0.4.55}/PySDKit.egg-info/top_level.txt +0 -0
  28. {pysdkit-0.4.54 → pysdkit-0.4.55}/pyproject.toml +0 -0
  29. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_acmd/__init__.py +0 -0
  30. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_acmd/acmd.py +0 -0
  31. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_acmd/ba_acmd.py +0 -0
  32. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_acmd/dd_acmd.py +0 -0
  33. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/__init__.py +0 -0
  34. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/_find_extrema.py +0 -0
  35. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/_prepare_points.py +0 -0
  36. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/_splines.py +0 -0
  37. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/apitmemd.py +0 -0
  38. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/ceemdan.py +0 -0
  39. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/eemd.py +0 -0
  40. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/emd.py +0 -0
  41. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/esmd.py +0 -0
  42. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/hht/__init__.py +0 -0
  43. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/hht/frequency.py +0 -0
  44. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/hht/hht.py +0 -0
  45. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/memd.py +0 -0
  46. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/nstemd.py +0 -0
  47. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/online_emd.py +0 -0
  48. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/remd.py +0 -0
  49. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/semd.py +0 -0
  50. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd/tvf_emd.py +0 -0
  51. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd2d/__init__.py +0 -0
  52. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd2d/bmemd.py +0 -0
  53. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_emd2d/emd2d.py +0 -0
  54. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_ewt/__init__.py +0 -0
  55. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_ewt/efd.py +0 -0
  56. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_ewt/ewt.py +0 -0
  57. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_ewt/ewt2d.py +0 -0
  58. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_faemd/__init__.py +0 -0
  59. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_faemd/extrema.py +0 -0
  60. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_faemd/faemd.py +0 -0
  61. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_faemd/faemd2d.py +0 -0
  62. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_faemd/faemd3d.py +0 -0
  63. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_faemd/filter.py +0 -0
  64. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_gdmd/__init__.py +0 -0
  65. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_gdmd/agncmd.py +0 -0
  66. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_gdmd/gdmd.py +0 -0
  67. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_gdmd/ivgnmd.py +0 -0
  68. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_gdmd/vgnmd.py +0 -0
  69. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_imd/__init__.py +0 -0
  70. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_imd/apmd.py +0 -0
  71. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_imd/imd.py +0 -0
  72. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_jmd/__init__.py +0 -0
  73. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_jmd/jmd.py +0 -0
  74. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_jmd/mjmd.py +0 -0
  75. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_jmd/sjmd.py +0 -0
  76. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_lmd/__init__.py +0 -0
  77. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_lmd/lmd.py +0 -0
  78. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_lmd/rlmd.py +0 -0
  79. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_osd/__init__.py +0 -0
  80. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_osd/components.py +0 -0
  81. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_osd/osd.py +0 -0
  82. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_osd/swd.py +0 -0
  83. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_tfa/sst.py +0 -0
  84. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_tfa/vtfmtd.py +0 -0
  85. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_tid/__init__.py +0 -0
  86. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_tid/alif.py +0 -0
  87. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_tid/fmd.py +0 -0
  88. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_tid/hvd.py +0 -0
  89. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_tid/itd.py +0 -0
  90. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_tid/iterative_filtering.py +0 -0
  91. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_tid/ssa.py +0 -0
  92. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd/__init__.py +0 -0
  93. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd/base.py +0 -0
  94. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd/mvmd.py +0 -0
  95. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd/na_mvmd.py +0 -0
  96. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd/namvmd.py +0 -0
  97. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd/ovmd.py +0 -0
  98. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd/stvmd.py +0 -0
  99. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd/svmd.py +0 -0
  100. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd/vmd_c.py +0 -0
  101. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd/vmd_f.py +0 -0
  102. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd/vme.py +0 -0
  103. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd2d/__init__.py +0 -0
  104. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd2d/cvmd2d.py +0 -0
  105. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vmd2d/vmd2d.py +0 -0
  106. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vncmd/__init__.py +0 -0
  107. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vncmd/avncmd.py +0 -0
  108. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vncmd/incmd.py +0 -0
  109. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vncmd/stnbmd.py +0 -0
  110. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/_vncmd/vncmd.py +0 -0
  111. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/_add_noise.py +0 -0
  112. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/_assets.py +0 -0
  113. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/_cube.py +0 -0
  114. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/_generator.py +0 -0
  115. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/_image.py +0 -0
  116. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/_models.py +0 -0
  117. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/_test_univariate.py +0 -0
  118. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/_time_series.py +0 -0
  119. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/apitmemd_section_2b.npy +0 -0
  120. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/apitmemd_section_3a.npy +0 -0
  121. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/apitmemd_section_3b.npy +0 -0
  122. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/dual_signal_noise.npy +0 -0
  123. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/ecg_055m.npy +0 -0
  124. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/fast_kurtogram_x.npy +0 -0
  125. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/fmd_demo.npy +0 -0
  126. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/gearbox_fault_snippet.npy +0 -0
  127. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/input_sig.npy +0 -0
  128. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/map2.npy +0 -0
  129. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/memd_syn_12channel.npy +0 -0
  130. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/memd_syn_16channel.npy +0 -0
  131. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/memd_syn_hex.npy +0 -0
  132. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/memd_taichi_hex.npy +0 -0
  133. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/oemd_ecg.npy +0 -0
  134. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/prefixed_double_filter.npy +0 -0
  135. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/single_nsignal.npy +0 -0
  136. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/sst_doppler.npy +0 -0
  137. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/sst_float.npy +0 -0
  138. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/texture.txt +0 -0
  139. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/data/vmd_example.npy +0 -0
  140. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/entropy/__init__.py +0 -0
  141. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/entropy/_approxiamte_entropy.py +0 -0
  142. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/entropy/_permutation_entropy.py +0 -0
  143. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/entropy/_sample_entropy.py +0 -0
  144. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/models/__init__.py +0 -0
  145. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/models/_base.py +0 -0
  146. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/models/_kmeans.py +0 -0
  147. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/models/_knn.py +0 -0
  148. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/models/_pca.py +0 -0
  149. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/plot/__init__.py +0 -0
  150. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/plot/_fourier_spectra.py +0 -0
  151. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/plot/_functions.py +0 -0
  152. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/plot/_plot_images.py +0 -0
  153. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/plot/_plot_imfs.py +0 -0
  154. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/plot/_plot_signal.py +0 -0
  155. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/__init__.py +0 -0
  156. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/data/__init__.py +0 -0
  157. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/data/test_generator_cube.py +0 -0
  158. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/data/test_generator_image.py +0 -0
  159. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/data/test_generator_signal.py +0 -0
  160. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/data/test_generator_univariate_signal.py +0 -0
  161. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/models/__init__.py +0 -0
  162. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/models/test_knn.py +0 -0
  163. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/models/test_pca.py +0 -0
  164. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/run_all.py +0 -0
  165. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_acmd.py +0 -0
  166. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_agncmd.py +0 -0
  167. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_alif.py +0 -0
  168. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_apitmemd.py +0 -0
  169. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_apmd.py +0 -0
  170. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_avncmd.py +0 -0
  171. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_baacmd.py +0 -0
  172. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_bmemd.py +0 -0
  173. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_ceemdan.py +0 -0
  174. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_cvmd2d.py +0 -0
  175. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_ddacmd.py +0 -0
  176. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_eemd.py +0 -0
  177. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_efd.py +0 -0
  178. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_emd.py +0 -0
  179. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_emd2d.py +0 -0
  180. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_esmd.py +0 -0
  181. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_ewt.py +0 -0
  182. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_ewt2d.py +0 -0
  183. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_faemd.py +0 -0
  184. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_faemd2d.py +0 -0
  185. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_faemd3d.py +0 -0
  186. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_fmd.py +0 -0
  187. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_gdmd.py +0 -0
  188. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_hht.py +0 -0
  189. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_hvd.py +0 -0
  190. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_imd.py +0 -0
  191. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_itd.py +0 -0
  192. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_ivgnmd.py +0 -0
  193. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_jmd.py +0 -0
  194. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_kurtogram.py +0 -0
  195. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_lmd.py +0 -0
  196. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_memd.py +0 -0
  197. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_moving_decomp.py +0 -0
  198. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_mstl.py +0 -0
  199. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_mvmd.py +0 -0
  200. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_nstemd.py +0 -0
  201. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_onlineemd.py +0 -0
  202. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_osd.py +0 -0
  203. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_ovmd.py +0 -0
  204. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_remd.py +0 -0
  205. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_rlmd.py +0 -0
  206. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_semd.py +0 -0
  207. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_sjmd.py +0 -0
  208. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_ssa.py +0 -0
  209. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_sst.py +0 -0
  210. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_stl.py +0 -0
  211. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_stnbmd.py +0 -0
  212. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_stvmd.py +0 -0
  213. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_svmd.py +0 -0
  214. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_swd.py +0 -0
  215. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_tvfemd.py +0 -0
  216. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_vgnmd.py +0 -0
  217. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_vmd.py +0 -0
  218. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_vmd2d.py +0 -0
  219. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_vme.py +0 -0
  220. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_vncmd.py +0 -0
  221. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tests/test_vtfmtd.py +0 -0
  222. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tsa/__init__.py +0 -0
  223. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tsa/_dtw.py +0 -0
  224. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tsa/_moving_decomp.py +0 -0
  225. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tsa/_mstl.py +0 -0
  226. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/tsa/_stl.py +0 -0
  227. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/_correlation.py +0 -0
  228. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/_diagnalization.py +0 -0
  229. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/_differ.py +0 -0
  230. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/_fft.py +0 -0
  231. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/_function.py +0 -0
  232. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/_hilbert.py +0 -0
  233. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/_instantaneous.py +0 -0
  234. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/_kernel_matrix.py +0 -0
  235. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/_kurtogram.py +0 -0
  236. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/_mirror.py +0 -0
  237. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/_pca.py +0 -0
  238. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/_process.py +0 -0
  239. {pysdkit-0.4.54 → pysdkit-0.4.55}/pysdkit/utils/_smooth1d.py +0 -0
  240. {pysdkit-0.4.54 → pysdkit-0.4.55}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySDKit
3
- Version: 0.4.54
3
+ Version: 0.4.55
4
4
  Summary: A Python library for signal decomposition algorithms with a unified interface.
5
5
  Author: Whenxuan Wang, RuiZhe Wang, Rongkun Zhu, Kai Wu, Lei Wang, josefinez, Deeksha Manjunath, Yuan Feng, WenTong Zhao, JacktheFowler
6
6
  Maintainer-email: Whenxuan Wang <wwhenxuan@gmail.com>, RuiZhe Wang <3133986068@qq.com>
@@ -200,6 +200,7 @@ plot_IMFs(signal, IMFs) # per-channel panels
200
200
  | [`STNBMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/stnbmd.py) (Short-Time Narrow-Band Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0022460X16002443?via%3Dihub) | [[code]](https://ww2.mathworks.cn/matlabcentral/fileexchange/56226-short-time-narrow-band-mode-decomposition-stnbmd-toolbox) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/vncmd/stnbmd.ipynb) |
201
201
  | [`VTFMTD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_tfa/vtfmtd.py) (Variational TF Mode Tracking Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0165168426001179) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/183389-variational-time-frequency-mode-tracking-decomposition) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/tfa/vtfmtd.ipynb) |
202
202
  | [`SST`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_tfa/sst.py) (Synchrosqueezing Transform) | [[paper]](https://doi.org/10.1016/j.sigpro.2014.08.010) | [[code]](https://www.commsp.ee.ic.ac.uk/~mandic/research/sst.htm) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/tfa/sst.ipynb) |
203
+ | [`SET`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_tfa/set.py) (Synchroextracting Transform) | [[paper]](https://doi.org/10.1109/TIE.2017.2696503) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/62483-synchroextracting-transform?s_tid=srchtitle) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/tfa/set.ipynb) |
203
204
  | [`SWD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_osd/swd.py) (Swarm Decomposition) | [[paper]](https://doi.org/10.1016/j.sigpro.2016.09.004) | [[code]](https://github.com/gkaposto/Swarm-Decomposition) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/osd/swd.ipynb) |
204
205
  | [`OSD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_osd/osd.py) (Optimization-based Signal Decomposition) | [[paper]](https://web.stanford.edu/~boyd/papers/sig_decomp_mprox.html) | [[code]](https://github.com/cvxgrp/signal-decomposition) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/osd/osd_intro.ipynb) |
205
206
  | [`STL`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/tsa/_stl.py) (Seasonal-Trend decomposition using LOESS) | [[paper]](https://www.nniiem.ru/file/news/2016/stl-statistical-model.pdf) | [[code]](https://www.statsmodels.org/stable/examples/notebooks/generated/stl_decomposition.html) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/tsa/stl.ipynb) |
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySDKit
3
- Version: 0.4.54
3
+ Version: 0.4.55
4
4
  Summary: A Python library for signal decomposition algorithms with a unified interface.
5
5
  Author: Whenxuan Wang, RuiZhe Wang, Rongkun Zhu, Kai Wu, Lei Wang, josefinez, Deeksha Manjunath, Yuan Feng, WenTong Zhao, JacktheFowler
6
6
  Maintainer-email: Whenxuan Wang <wwhenxuan@gmail.com>, RuiZhe Wang <3133986068@qq.com>
@@ -200,6 +200,7 @@ plot_IMFs(signal, IMFs) # per-channel panels
200
200
  | [`STNBMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/stnbmd.py) (Short-Time Narrow-Band Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0022460X16002443?via%3Dihub) | [[code]](https://ww2.mathworks.cn/matlabcentral/fileexchange/56226-short-time-narrow-band-mode-decomposition-stnbmd-toolbox) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/vncmd/stnbmd.ipynb) |
201
201
  | [`VTFMTD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_tfa/vtfmtd.py) (Variational TF Mode Tracking Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0165168426001179) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/183389-variational-time-frequency-mode-tracking-decomposition) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/tfa/vtfmtd.ipynb) |
202
202
  | [`SST`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_tfa/sst.py) (Synchrosqueezing Transform) | [[paper]](https://doi.org/10.1016/j.sigpro.2014.08.010) | [[code]](https://www.commsp.ee.ic.ac.uk/~mandic/research/sst.htm) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/tfa/sst.ipynb) |
203
+ | [`SET`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_tfa/set.py) (Synchroextracting Transform) | [[paper]](https://doi.org/10.1109/TIE.2017.2696503) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/62483-synchroextracting-transform?s_tid=srchtitle) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/tfa/set.ipynb) |
203
204
  | [`SWD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_osd/swd.py) (Swarm Decomposition) | [[paper]](https://doi.org/10.1016/j.sigpro.2016.09.004) | [[code]](https://github.com/gkaposto/Swarm-Decomposition) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/osd/swd.ipynb) |
204
205
  | [`OSD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_osd/osd.py) (Optimization-based Signal Decomposition) | [[paper]](https://web.stanford.edu/~boyd/papers/sig_decomp_mprox.html) | [[code]](https://github.com/cvxgrp/signal-decomposition) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/osd/osd_intro.ipynb) |
205
206
  | [`STL`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/tsa/_stl.py) (Seasonal-Trend decomposition using LOESS) | [[paper]](https://www.nniiem.ru/file/news/2016/stl-statistical-model.pdf) | [[code]](https://www.statsmodels.org/stable/examples/notebooks/generated/stl_decomposition.html) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/tsa/stl.ipynb) |
@@ -62,6 +62,7 @@ pysdkit/_osd/components.py
62
62
  pysdkit/_osd/osd.py
63
63
  pysdkit/_osd/swd.py
64
64
  pysdkit/_tfa/__init__.py
65
+ pysdkit/_tfa/set.py
65
66
  pysdkit/_tfa/sst.py
66
67
  pysdkit/_tfa/vtfmtd.py
67
68
  pysdkit/_tid/__init__.py
@@ -103,6 +104,9 @@ pysdkit/data/_time_series.py
103
104
  pysdkit/data/apitmemd_section_2b.npy
104
105
  pysdkit/data/apitmemd_section_3a.npy
105
106
  pysdkit/data/apitmemd_section_3b.npy
107
+ pysdkit/data/deconv_sig1.npy
108
+ pysdkit/data/deconv_sig2.npy
109
+ pysdkit/data/deconv_sig3.npy
106
110
  pysdkit/data/dual_signal_noise.npy
107
111
  pysdkit/data/ecg_055m.npy
108
112
  pysdkit/data/fast_kurtogram_x.npy
@@ -116,6 +120,8 @@ pysdkit/data/memd_syn_hex.npy
116
120
  pysdkit/data/memd_taichi_hex.npy
117
121
  pysdkit/data/oemd_ecg.npy
118
122
  pysdkit/data/prefixed_double_filter.npy
123
+ pysdkit/data/set_batdata2.npy
124
+ pysdkit/data/set_vibdata.npy
119
125
  pysdkit/data/single_nsignal.npy
120
126
  pysdkit/data/sst_doppler.npy
121
127
  pysdkit/data/sst_float.npy
@@ -149,6 +155,7 @@ pysdkit/tests/test_bmemd.py
149
155
  pysdkit/tests/test_ceemdan.py
150
156
  pysdkit/tests/test_cvmd2d.py
151
157
  pysdkit/tests/test_ddacmd.py
158
+ pysdkit/tests/test_deconvolution.py
152
159
  pysdkit/tests/test_eemd.py
153
160
  pysdkit/tests/test_efd.py
154
161
  pysdkit/tests/test_emd.py
@@ -180,6 +187,7 @@ pysdkit/tests/test_ovmd.py
180
187
  pysdkit/tests/test_remd.py
181
188
  pysdkit/tests/test_rlmd.py
182
189
  pysdkit/tests/test_semd.py
190
+ pysdkit/tests/test_set.py
183
191
  pysdkit/tests/test_sjmd.py
184
192
  pysdkit/tests/test_ssa.py
185
193
  pysdkit/tests/test_sst.py
@@ -221,4 +229,10 @@ pysdkit/utils/_kurtogram.py
221
229
  pysdkit/utils/_mirror.py
222
230
  pysdkit/utils/_pca.py
223
231
  pysdkit/utils/_process.py
224
- pysdkit/utils/_smooth1d.py
232
+ pysdkit/utils/_smooth1d.py
233
+ pysdkit/utils/deconvolution/__init__.py
234
+ pysdkit/utils/deconvolution/_acycbd.py
235
+ pysdkit/utils/deconvolution/_common.py
236
+ pysdkit/utils/deconvolution/_imckd.py
237
+ pysdkit/utils/deconvolution/_plot.py
238
+ pysdkit/utils/deconvolution/_smhd.py
@@ -147,6 +147,7 @@ plot_IMFs(signal, IMFs) # per-channel panels
147
147
  | [`STNBMD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_vncmd/stnbmd.py) (Short-Time Narrow-Band Mode Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0022460X16002443?via%3Dihub) | [[code]](https://ww2.mathworks.cn/matlabcentral/fileexchange/56226-short-time-narrow-band-mode-decomposition-stnbmd-toolbox) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/vncmd/stnbmd.ipynb) |
148
148
  | [`VTFMTD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_tfa/vtfmtd.py) (Variational TF Mode Tracking Decomposition) | [[paper]](https://www.sciencedirect.com/science/article/pii/S0165168426001179) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/183389-variational-time-frequency-mode-tracking-decomposition) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/tfa/vtfmtd.ipynb) |
149
149
  | [`SST`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_tfa/sst.py) (Synchrosqueezing Transform) | [[paper]](https://doi.org/10.1016/j.sigpro.2014.08.010) | [[code]](https://www.commsp.ee.ic.ac.uk/~mandic/research/sst.htm) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/tfa/sst.ipynb) |
150
+ | [`SET`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_tfa/set.py) (Synchroextracting Transform) | [[paper]](https://doi.org/10.1109/TIE.2017.2696503) | [[code]](https://www.mathworks.com/matlabcentral/fileexchange/62483-synchroextracting-transform?s_tid=srchtitle) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/tfa/set.ipynb) |
150
151
  | [`SWD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_osd/swd.py) (Swarm Decomposition) | [[paper]](https://doi.org/10.1016/j.sigpro.2016.09.004) | [[code]](https://github.com/gkaposto/Swarm-Decomposition) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/osd/swd.ipynb) |
151
152
  | [`OSD`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/_osd/osd.py) (Optimization-based Signal Decomposition) | [[paper]](https://web.stanford.edu/~boyd/papers/sig_decomp_mprox.html) | [[code]](https://github.com/cvxgrp/signal-decomposition) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/osd/osd_intro.ipynb) |
152
153
  | [`STL`](https://github.com/wwhenxuan/PySDKit/blob/main/pysdkit/tsa/_stl.py) (Seasonal-Trend decomposition using LOESS) | [[paper]](https://www.nniiem.ru/file/news/2016/stl-statistical-model.pdf) | [[code]](https://www.statsmodels.org/stable/examples/notebooks/generated/stl_decomposition.html) | [[notebook]](https://github.com/wwhenxuan/PySDKit/blob/main/examples/tsa/stl.ipynb) |
@@ -2,7 +2,7 @@
2
2
  A Python library for signal decomposition algorithms.
3
3
  """
4
4
 
5
- __version__ = "0.4.54"
5
+ __version__ = "0.4.55"
6
6
 
7
7
  # Empirical Mode Decomposition
8
8
  from ._emd import EMD
@@ -133,6 +133,9 @@ from ._tfa import VTFMTD, vtfmtd
133
133
  # Synchrosqueezing Transform
134
134
  from ._tfa import SST, sst
135
135
 
136
+ # Synchroextracting Transform
137
+ from ._tfa import SET, set
138
+
136
139
  # Adaptive Polymorphic Mode Decomposition / Impulsive Mode Decomposition
137
140
  from ._imd import APMD, IMD, imd
138
141
 
@@ -235,6 +238,7 @@ Short-Time Narrow-Banded Mode Decomposition | STNBMD
235
238
  Adaptive Local Iterative Filtering | ALIF
236
239
  Variational TF Mode Tracking Decomposition | VTFMTD
237
240
  Synchrosqueezing Transform | SST
241
+ Synchroextracting Transform | SET
238
242
  Adaptive Polymorphic Mode Decomposition | APMD
239
243
  Impulsive Mode Decomposition | IMD
240
244
  Empirical Wavelet Transform | EWT
@@ -314,6 +318,8 @@ __all__ = [
314
318
  "vtfmtd",
315
319
  "SST",
316
320
  "sst",
321
+ "SET",
322
+ "set",
317
323
  "APMD",
318
324
  "IMD",
319
325
  "imd",
@@ -35,6 +35,19 @@ from .sst import (
35
35
  sst_wavelet_linear,
36
36
  universal_threshold,
37
37
  )
38
+ from .set import (
39
+ SET,
40
+ set,
41
+ brevridge,
42
+ brevridge_mult,
43
+ frequency_axis_set,
44
+ gaussian_window,
45
+ odd_window_length,
46
+ reconstruct_from_ridges,
47
+ set_transform,
48
+ stft_gaussian_pair,
49
+ synchroextracting_operator,
50
+ )
38
51
  from pysdkit.data._loaders import (
39
52
  load_dual_signal_noise,
40
53
  load_map2,
@@ -67,6 +80,17 @@ __all__ = [
67
80
  "selective_cwt_mask",
68
81
  "sst_wavelet_linear",
69
82
  "universal_threshold",
83
+ "SET",
84
+ "set",
85
+ "brevridge",
86
+ "brevridge_mult",
87
+ "frequency_axis_set",
88
+ "gaussian_window",
89
+ "odd_window_length",
90
+ "reconstruct_from_ridges",
91
+ "set_transform",
92
+ "stft_gaussian_pair",
93
+ "synchroextracting_operator",
70
94
  "load_dual_signal_noise",
71
95
  "load_single_nsignal",
72
96
  "load_map2",
@@ -0,0 +1,482 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Synchroextracting Transform (SET).
4
+
5
+ Faithful Python port of Yu, Yu and Xu's MATLAB ``SET_Y.m`` (IEEE TIE
6
+ 2017) and the companion ridge extractors ``brevridge.m`` /
7
+ ``brevridge_mult.m``.
8
+
9
+ SET is a post-processing of the short-time Fourier transform (STFT).
10
+ SST *squeezes* every STFT coefficient onto the instantaneous-frequency
11
+ (IF) trajectory; SET instead *extracts* only the coefficient that
12
+ already sits on that trajectory and discards the smeared energy. The
13
+ result is closer to the ideal TFA
14
+
15
+ ITFA(t, ω) = A(t) · δ(ω − φ'(t))
16
+
17
+ and, because the retained coefficients are the original STFT values,
18
+ a real-valued mode can be read off the ridge (MATLAB ``real(Te(I,t))``).
19
+
20
+ G. Yu, M. Yu, C. Xu, *Synchroextracting Transform*, IEEE Transactions
21
+ on Industrial Electronics 64(10):8042–8054, 2017.
22
+ """
23
+
24
+ from __future__ import annotations
25
+
26
+ from typing import Dict, Optional, Tuple, Union
27
+
28
+ import numpy as np
29
+
30
+ _WINDOW_SIGMA = 0.32
31
+
32
+
33
+ def matlab_round(value: float) -> int:
34
+ """MATLAB ``round`` (ties away from zero), used for ``round(N/2)``."""
35
+ value = float(value)
36
+ if value >= 0.0:
37
+ return int(np.floor(value + 0.5))
38
+ return int(np.ceil(value - 0.5))
39
+
40
+
41
+ def odd_window_length(hlength: int) -> int:
42
+ """Force an odd Gaussian support (MATLAB ``hlength+1-rem(hlength,2)``)."""
43
+ length = int(hlength)
44
+ if length < 3:
45
+ raise ValueError("hlength must be >= 3")
46
+ return length + 1 - (length % 2)
47
+
48
+
49
+ def gaussian_window(
50
+ hlength: int, sigma: float = _WINDOW_SIGMA
51
+ ) -> Tuple[np.ndarray, np.ndarray]:
52
+ """
53
+ Unit-support Gaussian and its derivative (MATLAB ``SET_Y`` lines 32–38).
54
+
55
+ ``ht = linspace(-0.5, 0.5, hlength)``,
56
+ ``h = exp(-π/σ² ht²)``, ``h' = -2π/σ² ht · h``.
57
+
58
+ :return: ``(h, dh)`` of odd length ``hlength``.
59
+ """
60
+ n_taps = odd_window_length(hlength)
61
+ ht = np.linspace(-0.5, 0.5, n_taps)
62
+ window = np.exp(-np.pi / (sigma**2) * ht**2)
63
+ deriv = -2.0 * np.pi / (sigma**2) * ht * window
64
+ return window, deriv
65
+
66
+
67
+ def frequency_axis_set(n_samples: int, fs: float = 1.0) -> np.ndarray:
68
+ """
69
+ Frequency axis of the SET / STFT map (cycles in ``fs`` units).
70
+
71
+ MATLAB keeps FFT bins ``1:round(N/2)`` (DC through just below or at
72
+ Nyquist). Bin ``k`` (0-based) is ``k * fs / N`` Hz.
73
+ """
74
+ n_freq = matlab_round(n_samples / 2.0)
75
+ return np.arange(n_freq, dtype=float) * (float(fs) / float(n_samples))
76
+
77
+
78
+ def _as_real_1d(signal: np.ndarray) -> np.ndarray:
79
+ samples = np.asarray(signal, dtype=float)
80
+ if samples.ndim == 2 and 1 in samples.shape:
81
+ samples = samples.ravel()
82
+ if samples.ndim != 1:
83
+ raise ValueError(
84
+ "SET expects a real 1-D record; got shape {}".format(
85
+ np.asarray(signal).shape
86
+ )
87
+ )
88
+ if samples.size < 8:
89
+ raise ValueError("SET requires at least 8 samples")
90
+ return np.ascontiguousarray(samples, dtype=float)
91
+
92
+
93
+ def stft_gaussian_pair(
94
+ x: np.ndarray,
95
+ hlength: int,
96
+ sigma: float = _WINDOW_SIGMA,
97
+ ) -> Tuple[np.ndarray, np.ndarray, np.ndarray, float]:
98
+ """
99
+ STFT of ``x`` with the SET Gaussian and with its derivative.
100
+
101
+ Direct port of the ``tfr1`` / ``tfr2`` construction in ``SET_Y.m``:
102
+ for each time ``ti`` the windowed samples ``x(ti+τ) h(τ)`` are
103
+ placed at circular FFT indices and transformed.
104
+
105
+ :return: ``(tfr, tfr_d, window, va)`` where both maps have shape
106
+ ``(round(N/2), N)`` (positive frequencies only) and
107
+ ``va = N / hlength`` is the SET time-scale factor.
108
+ """
109
+ samples = _as_real_1d(x)
110
+ n_samples = int(samples.size)
111
+ n_taps = odd_window_length(hlength)
112
+ window, deriv = gaussian_window(n_taps, sigma=sigma)
113
+ half_len = (n_taps - 1) // 2
114
+ tau_cap = matlab_round(n_samples / 2.0) - 1
115
+
116
+ buf = np.zeros((n_samples, n_samples), dtype=np.complex128)
117
+ buf_d = np.zeros((n_samples, n_samples), dtype=np.complex128)
118
+ for time_idx in range(n_samples):
119
+ tau_lo = -min(tau_cap, half_len, time_idx)
120
+ tau_hi = min(tau_cap, half_len, n_samples - 1 - time_idx)
121
+ tau = np.arange(tau_lo, tau_hi + 1)
122
+ fft_idx = np.mod(n_samples + tau, n_samples)
123
+ buf[fft_idx, time_idx] = samples[time_idx + tau] * window[half_len + tau]
124
+ buf_d[fft_idx, time_idx] = samples[time_idx + tau] * deriv[half_len + tau]
125
+
126
+ spec = np.fft.fft(buf, axis=0)
127
+ spec_d = np.fft.fft(buf_d, axis=0)
128
+ n_freq = matlab_round(n_samples / 2.0)
129
+ tfr = spec[:n_freq, :]
130
+ tfr_d = spec_d[:n_freq, :]
131
+ scale = float(n_samples) / float(n_taps)
132
+ return tfr, tfr_d, window, scale
133
+
134
+
135
+ def synchroextracting_operator(
136
+ tfr: np.ndarray,
137
+ tfr_d: np.ndarray,
138
+ va: float,
139
+ energy: float,
140
+ amp_thresh: float = 0.8,
141
+ if_tol: float = 0.5,
142
+ ) -> np.ndarray:
143
+ """
144
+ Binary SET mask (MATLAB ``IF``).
145
+
146
+ Keep a TF bin when ``|STFT| > amp_thresh * mean(|x|)`` and the IF
147
+ correction ``|-Re(va i G'/ (2π G))|`` is strictly less than
148
+ ``if_tol`` frequency bins (default half a bin).
149
+ """
150
+ with np.errstate(divide="ignore", invalid="ignore"):
151
+ ratio = (float(va) * 1j * tfr_d) / (2.0 * np.pi * tfr)
152
+ delta = -np.real(ratio)
153
+ finite = np.isfinite(delta)
154
+ strong = np.abs(tfr) > float(amp_thresh) * float(energy)
155
+ return strong & finite & (np.abs(delta) < float(if_tol))
156
+
157
+
158
+ def set_transform(
159
+ x: np.ndarray,
160
+ hlength: Optional[int] = None,
161
+ fs: float = 1.0,
162
+ amp_thresh: float = 0.8,
163
+ if_tol: float = 0.5,
164
+ sigma: float = _WINDOW_SIGMA,
165
+ ) -> Dict[str, Union[np.ndarray, float, int]]:
166
+ """
167
+ Synchroextracting transform (MATLAB ``SET_Y``).
168
+
169
+ :param x: real 1-D record.
170
+ :param hlength: int,
171
+ Gaussian support in samples (made odd). Default ``round(N/8)``.
172
+ :param fs: float,
173
+ Sampling frequency.
174
+ :param amp_thresh: float,
175
+ Amplitude gate as a multiple of ``mean(|x|)``. MATLAB uses
176
+ ``0.8``; set ``0`` to keep weak coefficients.
177
+ :param if_tol: float,
178
+ Half-width of the extracting operator in bins (MATLAB ``0.5``).
179
+ :return: dict with ``te`` (SET), ``seo`` (binary operator), ``tfr``
180
+ (amplitude-rectified STFT), ``freq``, ``fs``, ``hlength``.
181
+ """
182
+ samples = _as_real_1d(x)
183
+ n_samples = int(samples.size)
184
+ if hlength is None:
185
+ hlength = matlab_round(n_samples / 8.0)
186
+ n_taps = odd_window_length(hlength)
187
+ tfr_raw, tfr_d, window, va = stft_gaussian_pair(samples, n_taps, sigma=sigma)
188
+ energy = float(np.mean(np.abs(samples)))
189
+ seo = synchroextracting_operator(
190
+ tfr_raw, tfr_d, va, energy, amp_thresh=amp_thresh, if_tol=if_tol
191
+ )
192
+ tfr = tfr_raw / (np.sum(window) / 2.0)
193
+ te = tfr * seo.astype(tfr.dtype)
194
+ freq = frequency_axis_set(n_samples, fs=fs)
195
+ return {
196
+ "te": te,
197
+ "seo": seo.astype(float),
198
+ "tfr": tfr,
199
+ "tfr_raw": tfr_raw,
200
+ "freq": freq,
201
+ "fs": float(fs),
202
+ "hlength": n_taps,
203
+ "va": float(va),
204
+ "x": samples,
205
+ }
206
+
207
+
208
+ def brevridge(
209
+ tx: np.ndarray,
210
+ freq: np.ndarray,
211
+ ridge_lambda: float = 1.0,
212
+ max_jump: int = 10,
213
+ n_starts: int = 40,
214
+ ) -> Tuple[np.ndarray, float]:
215
+ """
216
+ Greedy ridge of a TF map (MATLAB ``brevridge.m``).
217
+
218
+ Several random (uniform) initial times, then a forward/backward
219
+ search that penalises second differences of the frequency index.
220
+
221
+ :return: ``(ridge, energy)`` with ``ridge`` a length-``T`` array of
222
+ **0-based** frequency indices.
223
+ """
224
+ energy_map = np.log(
225
+ np.abs(np.asarray(tx, dtype=float)) + np.finfo(float).eps ** 0.25
226
+ )
227
+ n_freq, n_time = energy_map.shape
228
+ if n_time < 3 or n_freq < 1:
229
+ raise ValueError("brevridge needs a TF map with at least 3 time samples")
230
+ freq = np.asarray(freq, dtype=float).ravel()
231
+ if freq.size < 2:
232
+ domega = 1.0
233
+ else:
234
+ domega = float(freq[1] - freq[0])
235
+ aux = float(ridge_lambda) * (domega**2) * 0.5
236
+ max_jump = int(max_jump)
237
+ n_starts = int(n_starts)
238
+
239
+ starts = np.floor(
240
+ np.linspace(
241
+ n_time / (n_starts + 1.0), n_time - n_time / (n_starts + 1.0), n_starts
242
+ )
243
+ ).astype(int)
244
+ starts = np.clip(starts, 1, n_time - 2)
245
+
246
+ best_ridge = np.zeros(n_time, dtype=int)
247
+ best_energy = -np.inf
248
+
249
+ for start in starts:
250
+ curve = np.zeros(n_time, dtype=int)
251
+ idx = int(np.argmax(energy_map[:, start]))
252
+ curve[start] = idx
253
+ energy = float(energy_map[idx, start])
254
+ idx = int(np.argmax(energy_map[:, start - 1]))
255
+ curve[start - 1] = idx
256
+ energy += float(energy_map[idx, start - 1])
257
+
258
+ for time_idx in range(start + 1, n_time):
259
+ lo = max(0, idx - max_jump)
260
+ hi = min(n_freq, idx + max_jump + 1)
261
+ penalty = (
262
+ aux
263
+ * (np.arange(lo, hi) - 2 * curve[time_idx - 1] + curve[time_idx - 2])
264
+ ** 2
265
+ )
266
+ score = energy_map[lo:hi, time_idx] - penalty
267
+ offset = int(np.argmax(score))
268
+ idx = lo + offset
269
+ curve[time_idx] = idx
270
+ energy += float(score[offset])
271
+
272
+ idx = int(curve[start])
273
+ for time_idx in range(start - 1, -1, -1):
274
+ lo = max(0, idx - max_jump)
275
+ hi = min(n_freq, idx + max_jump + 1)
276
+ if time_idx + 2 < n_time:
277
+ curv = np.arange(lo, hi) - 2 * curve[time_idx + 1] + curve[time_idx + 2]
278
+ else:
279
+ curv = np.arange(lo, hi) - curve[time_idx + 1]
280
+ penalty = aux * curv**2
281
+ score = energy_map[lo:hi, time_idx] - penalty
282
+ offset = int(np.argmax(score))
283
+ idx = lo + offset
284
+ curve[time_idx] = idx
285
+ energy += float(score[offset])
286
+
287
+ if energy > best_energy:
288
+ best_energy = energy
289
+ best_ridge = curve.copy()
290
+ return best_ridge, float(best_energy)
291
+
292
+
293
+ def brevridge_mult(
294
+ tx: np.ndarray,
295
+ freq: np.ndarray,
296
+ n_ridges: int,
297
+ ridge_lambda: float = 1.0,
298
+ clear_win: int = 5,
299
+ ) -> Tuple[np.ndarray, np.ndarray]:
300
+ """
301
+ Extract ``n_ridges`` ridges (MATLAB ``brevridge_mult.m``).
302
+
303
+ After each ridge, a frequency window of width ``clear_win`` is
304
+ zeroed so the next search cannot lock onto the same component.
305
+
306
+ :return: ``(ridges, energies)`` with ``ridges`` of shape
307
+ ``(n_ridges, T)`` (0-based frequency indices).
308
+ """
309
+ n_ridges = int(n_ridges)
310
+ if n_ridges < 1:
311
+ raise ValueError("n_ridges must be >= 1")
312
+ work = np.array(tx, dtype=float, copy=True)
313
+ n_freq, n_time = work.shape
314
+ ridges = np.zeros((n_ridges, n_time), dtype=int)
315
+ energies = np.zeros(n_ridges, dtype=float)
316
+ half = int(clear_win)
317
+ for ridge_idx in range(n_ridges):
318
+ curve, energy = brevridge(work, freq, ridge_lambda=ridge_lambda)
319
+ ridges[ridge_idx] = curve
320
+ energies[ridge_idx] = energy
321
+ for time_idx in range(n_time):
322
+ lo = max(0, int(curve[time_idx]) - half)
323
+ hi = min(n_freq, int(curve[time_idx]) + half + 1)
324
+ work[lo:hi, time_idx] = 0.0
325
+ return ridges, energies
326
+
327
+
328
+ def reconstruct_from_ridges(te: np.ndarray, ridges: np.ndarray) -> np.ndarray:
329
+ """
330
+ Real SET coefficients along ridges (MATLAB ``real(Te(Cs(k,t), t))``).
331
+
332
+ :param te: complex SET map ``(F, T)``.
333
+ :param ridges: int array ``(K, T)`` of 0-based frequency indices.
334
+ :return: real modes ``(K, T)``.
335
+ """
336
+ te = np.asarray(te)
337
+ ridges = np.asarray(ridges, dtype=int)
338
+ if ridges.ndim == 1:
339
+ ridges = ridges.reshape(1, -1)
340
+ n_modes, n_time = ridges.shape
341
+ if te.shape[1] != n_time:
342
+ raise ValueError("ridge length must match the time axis of Te")
343
+ clipped = np.clip(ridges, 0, te.shape[0] - 1)
344
+ time_idx = np.arange(n_time)
345
+ modes = np.empty((n_modes, n_time), dtype=float)
346
+ for mode_idx in range(n_modes):
347
+ modes[mode_idx] = np.real(te[clipped[mode_idx], time_idx])
348
+ return modes
349
+
350
+
351
+ class SET(object):
352
+ """
353
+ Synchroextracting Transform for time-frequency analysis and modes.
354
+
355
+ * :meth:`transform` — SET map ``Te(t, ω)`` (and the STFT / SEO).
356
+ * :meth:`fit_transform` — extract ``n_imfs`` ridges of ``|Te|`` and
357
+ reconstruct each mode as the real SET coefficient on that ridge.
358
+ The last row is the residual ``x - sum(modes)``.
359
+
360
+ :param hlength: int or None,
361
+ Gaussian window length (odd). ``None`` uses ``round(N/8)``.
362
+ :param fs: float,
363
+ Sampling frequency (default 1).
364
+ :param amp_thresh: float,
365
+ STFT amplitude gate (MATLAB ``0.8``).
366
+ :param if_tol: float,
367
+ Extracting half-width in bins (MATLAB ``0.5``).
368
+ :param n_imfs: int,
369
+ Number of oscillatory modes for :meth:`fit_transform`.
370
+ :param ridge_lambda: float,
371
+ Smoothness of ``brevridge`` (examples use ``1``).
372
+ :param clear_win: int,
373
+ Frequency clearing window between successive ridges (examples
374
+ use ``5``).
375
+ """
376
+
377
+ def __init__(
378
+ self,
379
+ hlength: Optional[int] = None,
380
+ fs: float = 1.0,
381
+ amp_thresh: float = 0.8,
382
+ if_tol: float = 0.5,
383
+ n_imfs: int = 1,
384
+ ridge_lambda: float = 1.0,
385
+ clear_win: int = 5,
386
+ ) -> None:
387
+ if hlength is not None and int(hlength) < 3:
388
+ raise ValueError("hlength must be >= 3")
389
+ if float(fs) <= 0.0:
390
+ raise ValueError("fs must be positive")
391
+ if int(n_imfs) < 1:
392
+ raise ValueError("n_imfs must be >= 1")
393
+ self.hlength = None if hlength is None else int(hlength)
394
+ self.fs = float(fs)
395
+ self.amp_thresh = float(amp_thresh)
396
+ self.if_tol = float(if_tol)
397
+ self.n_imfs = int(n_imfs)
398
+ self.ridge_lambda = float(ridge_lambda)
399
+ self.clear_win = int(clear_win)
400
+
401
+ self.signal: Optional[np.ndarray] = None
402
+ self.te_: Optional[np.ndarray] = None
403
+ self.tfr_: Optional[np.ndarray] = None
404
+ self.seo_: Optional[np.ndarray] = None
405
+ self.freq_: Optional[np.ndarray] = None
406
+ self.ridges_: Optional[np.ndarray] = None
407
+ self.imfs: Optional[np.ndarray] = None
408
+ self.residue: Optional[np.ndarray] = None
409
+
410
+ def __str__(self) -> str:
411
+ return "Synchroextracting Transform (SET)"
412
+
413
+ def __call__(self, signal: np.ndarray, n_imfs: Optional[int] = None) -> np.ndarray:
414
+ return self.fit_transform(signal, n_imfs=n_imfs)
415
+
416
+ def _run(self, signal: np.ndarray) -> Dict[str, Union[np.ndarray, float, int]]:
417
+ result = set_transform(
418
+ signal,
419
+ hlength=self.hlength,
420
+ fs=self.fs,
421
+ amp_thresh=self.amp_thresh,
422
+ if_tol=self.if_tol,
423
+ )
424
+ self.signal = np.asarray(result["x"])
425
+ self.te_ = np.asarray(result["te"])
426
+ self.tfr_ = np.asarray(result["tfr"])
427
+ self.seo_ = np.asarray(result["seo"])
428
+ self.freq_ = np.asarray(result["freq"])
429
+ return result
430
+
431
+ def transform(self, signal: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
432
+ """
433
+ SET time-frequency map.
434
+
435
+ :param signal: real 1-D record.
436
+ :return: ``(te, freq)`` with ``te`` of shape ``(n_freq, T)``.
437
+ """
438
+ result = self._run(signal)
439
+ return np.asarray(result["te"]), np.asarray(result["freq"])
440
+
441
+ def fit_transform(
442
+ self,
443
+ signal: np.ndarray,
444
+ n_imfs: Optional[int] = None,
445
+ ) -> np.ndarray:
446
+ """
447
+ Ridge-based modal decomposition of the SET map.
448
+
449
+ Each mode is ``real(Te[ridge_k, t])``. The last row is the
450
+ residual ``x - sum(modes)``.
451
+
452
+ :param signal: real 1-D record.
453
+ :param n_imfs: int,
454
+ Number of ridges (defaults to the value given at init).
455
+ :return: IMF array of shape ``(n_imfs + 1, T)``.
456
+ """
457
+ result = self._run(signal)
458
+ n_modes = self.n_imfs if n_imfs is None else int(n_imfs)
459
+ if n_modes < 1:
460
+ raise ValueError("n_imfs must be >= 1")
461
+ te = np.asarray(result["te"])
462
+ freq = np.asarray(result["freq"])
463
+ ridges, _energies = brevridge_mult(
464
+ np.abs(te),
465
+ freq,
466
+ n_modes,
467
+ ridge_lambda=self.ridge_lambda,
468
+ clear_win=self.clear_win,
469
+ )
470
+ modes = reconstruct_from_ridges(te, ridges)
471
+ residual = np.asarray(result["x"]) - np.sum(modes, axis=0)
472
+ imfs = np.vstack([modes, residual[None, :]])
473
+ self.ridges_ = ridges
474
+ self.imfs = imfs
475
+ self.residue = residual
476
+ return imfs
477
+
478
+
479
+ def set(signal: np.ndarray, **kwargs) -> np.ndarray:
480
+ """Functional modal-decomposition interface (``SET(...)(signal)``)."""
481
+ n_imfs = kwargs.pop("n_imfs", 1)
482
+ return SET(n_imfs=n_imfs, **kwargs).fit_transform(signal, n_imfs=n_imfs)
@@ -50,6 +50,11 @@ __all__ = [
50
50
  "load_sst_float",
51
51
  "load_sst_doppler",
52
52
  "load_fast_kurtogram_x",
53
+ "load_set_batdata2",
54
+ "load_set_vibdata",
55
+ "load_imckd_sig1",
56
+ "load_acycbd_sig2",
57
+ "load_smhd_sig3",
53
58
  ]
54
59
 
55
60
  # A series of functions for generating 1D NumPy signals
@@ -139,4 +144,9 @@ from ._loaders import (
139
144
  load_sst_float,
140
145
  load_sst_doppler,
141
146
  load_fast_kurtogram_x,
147
+ load_set_batdata2,
148
+ load_set_vibdata,
149
+ load_imckd_sig1,
150
+ load_acycbd_sig2,
151
+ load_smhd_sig3,
142
152
  )