From 332459ee9e8bd7cfb2520d78887b485f7baba14c Mon Sep 17 00:00:00 2001 From: nvlinhvn Date: Sun, 19 May 2024 22:58:56 +0200 Subject: [PATCH 1/2] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index dd0aa2a..8e69e3b 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ package_path = os.path.abspath('/usr/local/Caskroom/miniconda/base/envs/YOUR_ENV if package_path not in sys.path: sys.path.insert(0, package_path) +import numpy as np from hstransform import HSTransform # Create input signal (for example: Voltage signal) @@ -82,6 +83,7 @@ S_transformed = hs.fit_transform(t, signal) ### 5.1 Power Quality Disturbance +Compare HS-transform vs. Morlet Wavelet Transform: ![Voltage Disturbance](https://raw.githubusercontent.com/nvlinhvn/HSTransform/main/img/power_quality_disturbance.png) The figure showed HS-transform is able to detect the transient disturbances like notch, spike. Meanwhile, those signals from Morlet Wavelet transform are not obviously recognized. From 4d168dbd727978df3664b015f626ae4e94fdd676 Mon Sep 17 00:00:00 2001 From: nvlinhvn Date: Sun, 19 May 2024 23:11:39 +0200 Subject: [PATCH 2/2] Package with Pypi --- .gitignore | 1 + .ipynb_checkpoints/setup-checkpoint.py | 38 ----- HSTransform.egg-info/PKG-INFO | 22 ++- dist/HSTransform-0.1.1-py3-none-any.whl | Bin 0 -> 5535 bytes dist/HSTransform-0.1.1.tar.gz | Bin 0 -> 5086 bytes dist/HSTransform-0.1.6-py3-none-any.whl | Bin 5295 -> 0 bytes dist/HSTransform-0.1.6.tar.gz | Bin 4861 -> 0 bytes .../.ipynb_checkpoints/__init__-checkpoint.py | 1 - .../hstransform-checkpoint.py | 133 ------------------ setup.py | 2 +- 10 files changed, 22 insertions(+), 175 deletions(-) delete mode 100644 .ipynb_checkpoints/setup-checkpoint.py create mode 100644 dist/HSTransform-0.1.1-py3-none-any.whl create mode 100644 dist/HSTransform-0.1.1.tar.gz delete mode 100644 dist/HSTransform-0.1.6-py3-none-any.whl delete mode 100644 dist/HSTransform-0.1.6.tar.gz delete mode 100644 hstransform/.ipynb_checkpoints/__init__-checkpoint.py delete mode 100644 hstransform/.ipynb_checkpoints/hstransform-checkpoint.py diff --git a/.gitignore b/.gitignore index 8215b1a..65c73f7 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ __pycache__/__init__.cpython-39.pyc .ipynb_checkpoints/__init__-checkpoint.py tests/.ipynb_checkpoints/test_hstransform-checkpoint.py .DS_Store +.ipynb_checkpoints/setup-checkpoint.py diff --git a/.ipynb_checkpoints/setup-checkpoint.py b/.ipynb_checkpoints/setup-checkpoint.py deleted file mode 100644 index 1d9833d..0000000 --- a/.ipynb_checkpoints/setup-checkpoint.py +++ /dev/null @@ -1,38 +0,0 @@ -""" -This is the setup module for the HSTransform package. (Beta test) - -S-transform with Hyperbolic Window -Combines the best properties of the Short-time Fourier Transform -and the Wavelet Transform. -""" - -from setuptools import setup, find_packages - -with open("README.md", "r", encoding="utf-8") as fh: - long_description = fh.read() - -setup( - name='HSTransform', - version='0.1.5', - url='https://github.com/nvlinhvn/HSTransform', - packages=find_packages(), - license='MIT', - author='Linh V Nguyen', - author_email='linhvietnguyen.ee@gmail.com', - description='A Package to Compute S-transform with Hyperbolic Window', - python_requires='>=3.10', - long_description=long_description, - long_description_content_type="text/markdown", - install_requires=[ - 'numpy>=1.21.2', - 'scipy>=1.7.1', - 'pandas>=1.3.3', - 'pytest>=6.2.5' - ], - classifiers=[ - 'Development Status :: 4 - Beta', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3.10', - ], - test_suite='tests' -) diff --git a/HSTransform.egg-info/PKG-INFO b/HSTransform.egg-info/PKG-INFO index 5b03c9c..2f7e7df 100644 --- a/HSTransform.egg-info/PKG-INFO +++ b/HSTransform.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: HSTransform -Version: 0.1.6 +Version: 0.1.1 Summary: A Package to Compute S-transform with Hyperbolic Window Home-page: https://github.com/nvlinhvn/HSTransform Author: Linh V Nguyen @@ -41,12 +41,18 @@ HS Transform requires the following Python packages: ## 3. How to Install -You can install HS Transform using pip: +After that, you can install HS Transform using pip: ``` pip install HSTransform ``` +You can also install all dependencies and package in 1 statement + +``` +pip install numpy scipy pandas matplotlib pytest HSTransform +``` + ## 4. Run tests After installation, you can test the package using the included test scripts: @@ -56,7 +62,18 @@ After installation, you can test the package using the included test scripts: Here’s an example of how to use HS Transform to analyze a signal with voltage disturbance and power system fault: +It's noted sometimes you need to include the installed HSTransform package location into sys + ```python +import sys +import os + +# Add the package directory to sys.path +package_path = os.path.abspath('/usr/local/Caskroom/miniconda/base/envs/YOUR_ENVIRONMENT/lib/python3.10/site-packages/') +if package_path not in sys.path: + sys.path.insert(0, package_path) + +import numpy as np from hstransform import HSTransform # Create input signal (for example: Voltage signal) @@ -80,6 +97,7 @@ S_transformed = hs.fit_transform(t, signal) ### 5.1 Power Quality Disturbance +Compare HS-transform vs. Morlet Wavelet Transform: ![Voltage Disturbance](https://raw.githubusercontent.com/nvlinhvn/HSTransform/main/img/power_quality_disturbance.png) The figure showed HS-transform is able to detect the transient disturbances like notch, spike. Meanwhile, those signals from Morlet Wavelet transform are not obviously recognized. diff --git a/dist/HSTransform-0.1.1-py3-none-any.whl b/dist/HSTransform-0.1.1-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..622f165c074ed21279651e11e9e1eb5b8f4200d2 GIT binary patch literal 5535 zcmai&cT`hpx5k5XLnkN#j?_>C5u`{*K!H%CN$4QbOMpZK=|w{CAkviHdv8)Ay+%5y zfOMn^(xhDczBQxQJ9p-swUc%J*uRst^6qCn&wdEQ#RCBV03twVXeE4>xSo~i@`>%T zu3wfF66I{_fV4n3+w&P4TRT{zjE#96-C*3kL)ycA9K4)L{oJa3e7)M;{g7@xF7+KE zGGAgR9KgfBsDu%f@ac(Fd}e$AV1@z!p!<#b%Ns7i*>HWtj1b7{uvA3BS6k@`+d-MB zK$NLG)XtLw%A;%S*ZRi17t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%g@K4#6$XIL6oQRcx1IldaQ*Cw!%+Q{av zG8aLX@4QOlRGqXNcyB8rJud6LH1s~6uyyg)Lm18#5bpoKFT4CR|8r&e{`mSOQT>|9 zeuezqdhEXl03gfv(QlAnfS1d%Upapl27hwOF4NxsiH5(n|6Mfv**^bQ``-k`Uon3d z4t`?5myzM02K>*c@H_E$k@!h;yj&>$6Y)Qi@jLGK!TyN@Ugnv9!u_u?{~i1LQ2&Xo d!m;=l?0-l6Aq=13M-S2Et$!&DywpFQ{s;9hra%Ay literal 0 HcmV?d00001 diff --git a/dist/HSTransform-0.1.1.tar.gz b/dist/HSTransform-0.1.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..993652b8ff928ecc0d1b0c2ae65020172e4c6e4c GIT binary patch literal 5086 zcma)-5vAcJ48ZKSddtxQ&MVy1s0GH zSwNcI@BN+U`2+4fbIzQ3F|X#uXE+i`Ny*%wyAS}{CZ+)nK7lU20p23wq7wfp$RPml zNEsP`lxq&zwb+n@YMF8yackxW_cdTTNlC_`R(iSN)0yd z-3kgRw(Jv5r~cB5-~Subu>_phS2^SMFF84}F6-CLX5nk>hftF|r5mAYk-7S*;7)Yb zRE{s49T}og&vC@%taJ|E!_D;T{p2DuW|%HrgTD=4+LX5km;mI_XQD05ArPMYoj&O;nx8U3#BQ~DEueVK{?QCxY2rM5eI_EXiG8>m1U zYU4hpSLF?HG|;o7EM+j~7T~Y>4xzqot@`5LDX|u{sfqR~z|FB1zs_?Lgfvt_gItlwW?-QL^7 zpn$8Yd%vCm_CoAF?fL#^ZM^(hgO}*!}vn~T5g*K#jG6jf><|iV^6}e z2voVmWJe^&Mg}M%R5iG&H$M4m@VH0>VUfNFW=w^tFdx%+5@I_|srXr~)fKFU(#Fq% zt4NqvHX^jwyBC!IGQMdneHU%2m7D5MOU=~cnSRNv&HC}ov0WbWgJ7qTh_oU!B9l#W zx6yCQ)kNVFv?3!){z~N70?&68_nkq$=OV4p-Z26SU{hh6+GL+{NBk+|NtpL`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4sTV+vRHPK~Yp{ZRL zb$Lrel1R0F2M4={Zx&76i=;Me+yys^2_+Wb)n27P@eDng7eT$Z)C2!mZ6rP$*m-Ym zP!?4X15|zQ;{NmNDlpPyHLdq`L-TmB#z^Ef@sub~gPrs2eZX*eWeBAf!A6QS(xQSV z!q$0Jldig%W8<1Q2}5U|VpOq))(6B4Yc@Cjqttv-1seT1+K1vKt4@|Y)rHwE_9c|U z94vx{oOcQ%Jgv+V47_7@MVmu?BgP`Z`iCq)D`7LyL#zhsoPnWMM4GY#*R(|DK#)I0L_(p%%JM}e15Ue<73&BBm1O=^)dXPhq6xZ`BK}Dqjo=%-NCE_=% zR5M=l`*tj5Jq*q5+zMB)-sYV1yN4t?Wq=t0tJ-I?xEYoGlPyC!WNdJjx0%6yqKvx=DH8KqdKz)Ek{t>1UaNBd89~+?KqL#m2^ZD}- z+03LidT(vx_9FUNWoH+fxB{wb^oOQXN!+~!glvQ5!hkCH??LK=><%=;AcI5C*AV!UOmh{Fx+t diff --git a/dist/HSTransform-0.1.6.tar.gz b/dist/HSTransform-0.1.6.tar.gz deleted file mode 100644 index 46dc2b3b4efade84dcf3c22e55d251c119958d80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4861 zcmah~X*kpmqn%{W64}ELvc_b|k|ld~QJ6$z-!ns&Ft#iiObSKW$1ZzBn!(>5vSi<4 zEM=H1Gs4XL?*D!7=lk3*=bSI+d^pc}o&!!}WaKq9^`rsr+TMq`2EsjqU;#HE@;Bvg z$%nYYKzmwyutl}3)6oj7dZ?SsE2&o{;*Kh&7V<;pk8;1^*3HX5K9Xh?*X0}|3&gk7 z%`a3(CsSJM+pJ*AAnEufoLXvWS6ZB@95XoGD6I6Vzp_ZhUJD{zzus9eU^sI z-WfimBZi1P4IF@XG2ni83){#m=INcV?|U6)+cE5 zgS4o=lKoGS)&bf8=`Vp?_#If@JzG^dLnxdfo;m@Y0|Q+d_kff8fS)>>qufKyyn#K1 z0-&%A(E1KC0#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WbC-cm-JZ~aU}7tUZD`XeA0Ve~beyf6zn(n%+3~krE$`x-PGApQJqT*knqiPI6&(PpN%Q)b`5XQVrr%xzd;`wl+ud z2-*S?avsbsv97aeDRt%6$o(gOQxRqbrnb&BC0!#Lt!7_$Es`$vyI2$VaA|2IP$007 z2=fYewxnNrHn1iZz{92TsM1DLI}%rCc2U66lWVcmTCJmMu2M;QcbcW&NTP+tqpNk( zVfM3L-+j{G_QXZ(AMvt){6Q?bsi(BMXQLWw7G&3N?F#4nA#lB9Vve;w=`waO9E+D_ z(e~%8pLn_wz&V}}S*IcjekF^q1%bQabR7C6FLz`$IG#m)!1*LytPMp);kNuE#x06+-b4)380{IBuB%|i4<#$a$C~rpt2_}+$~>O}%rqT+g|&^e=)7k;$Ps5+C^`7z!n{*U0bUPPh-?`jcOp=Ji$ADx+wFL~BcYWj) z$-oAndhi&~0Dzgl3afkIuuq^KvYiNmtnAN5=f2H%p4_*i{yUWCl)NXvEyocym-Y_-)E1 zBzz-1# zjyQK5_Aj*6LkuJ1XWNekWS4- z41~eSgi(rtfI9 zyYkYT%>sSy;zxRQ@(_u51=m|{42|1d~@$bxcF`w{{}bm)tlL#64juoz0f}`!`q71oLQ7fDd(7 zNqU|;(XZHl*629m|E4EJGtQ?ZG{VW-x9dmGB$1xj3lC+f*?=21v~X!> np.ndarray: - """ - Computes the hyperbolic Gaussian window. - - Parameters - ---------- - l : int - length of the signal - n : int - frequency point - time : np.ndarray - time values of the signal - - Returns - ------- - g : np.ndarray - hyperbolic Gaussian window - """ - vectorf = np.arange(0, l) - vectorf1 = vectorf**2 - lambdaf = self.forwardtaper - lambdab = self.backwardtaper - lambda_val = self.curvature - x = (lambdaf + lambdab) * time / (2 * lambdaf * lambdab) + (lambdaf - lambdab) * np.sqrt(time**2 + lambda_val) / (2 * lambdaf * lambdab) - x = np.tile(x, (1, 2)).T - vectorf2 = -vectorf1 * x**2 / (2 * n**2) - g = 2 * np.abs(vectorf) * np.exp(vectorf2) / ((lambdaf + lambdab) * np.sqrt(2 * np.pi)) - return np.sum(g) - - def fit_transform(self, - time_values: Union[pd.Series, np.ndarray, list], - input_signal: Union[pd.Series, np.ndarray, list], - minf: int = 0, - fsamplingrate: int = 1) -> np.ndarray: - """ - Computes the S-transform of the input signal. - - Parameters - ---------- - time_values : np.ndarray - time values of the signal - input_signal : np.ndarray - input signal - minf : int - minimum frequency point - fsamplingrate : int - frequency sampling rate - - Returns - ------- - S : np.ndarray - S-transform of the input signal - """ - # Validate the input - self._input_validation(input_signal) - - # Convert to numpy arrays if they are not array types - if not isinstance(time_values, np.ndarray): - time_values = np.array(time_values) - if not isinstance(input_signal, np.ndarray): - input_signal = np.array(input_signal) - - n = len(input_signal) - # Make sure the max frequency to be optimized (Cover the 6th, 12th, or 18th harmonic respectively) - maxf = min(900, n // 2) - - # Compute the fft of input - h = fft(input_signal) - h = np.concatenate((h, h)) - - # S output - s = np.zeros(((maxf - minf + 1) // fsamplingrate, n), dtype='complex') - s[0, :] = np.mean(input_signal) * (1 & np.arange(1, n + 1)) - - # Increment the frequency point - for k in range(fsamplingrate, maxf - minf + 1, fsamplingrate): - w_hy = self._compute_hyperbolic_gaussian(n, minf + k, time_values) - s[k // fsamplingrate, :] = ifft(h[minf + k + 1:minf + k + n+1] * w_hy) - - return s diff --git a/setup.py b/setup.py index 60edd5e..c35430e 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name='HSTransform', - version='0.1.6', + version='0.1.1', url='https://github.com/nvlinhvn/HSTransform', packages=find_packages(), license='MIT',