Commit 1c0dd7b9 authored by Hafiz Emin Kosar's avatar Hafiz Emin Kosar
Browse files

- more commenting on transform functions

parent c9ef60c7
Pipeline #264764 passed with stage
in 1 minute and 37 seconds
......@@ -8,11 +8,28 @@ else:
def ient_dft(s, fs, NFFT=0):
"""
Calculate discrete Fourier transform of vector s
Sampling frequency fs is used to calculate frequency vector f
Number of frequency coefficients can be specified as well
"""
"""Calculate discrete fourier transform of vector s
Parameters
----------
s : array_like
vector to be transformed
fs : float
sampling frequency, is used to calculate frequency vector f
NFFT : float, optional
number of frequency coefficients
Returns
-------
S : ndarray
resulting discrete fourier transform
f : ndarray
frequency vector
Examples
--------
For examples see primer at ient_nb/Transforms.ipynb
"""
if NFFT==0:
NFFT = len(s) # int(2**np.ceil(np.log2(len(bla))))
......@@ -23,10 +40,25 @@ def ient_dft(s, fs, NFFT=0):
def ient_idft(S, Ntime=0, NFFT=0):
"""
Calculate discrete inverse Fourier transform of vector S
Number of time bins is used to crop the output of NumPy's ifft function
Number of frequency coefficients can be specified as well
"""Calculate inverse discrete fourier transform of vector S
Parameters
----------
S : array_like
vector to be transformed
Ntime : float, optional
number of time bins, is used to crop the output of NumPy's ifft function
NFFT : float, optional
number of frequency coefficients
Returns
-------
s : ndarray
resulting inverse discrete fourier transform
Examples
--------
For examples see primer at ient_nb/Transforms.ipynb
"""
if NFFT == 0: NFFT = len(S)
......@@ -40,7 +72,7 @@ def ient_idft(S, Ntime=0, NFFT=0):
def ient_ilaplace_ht(t=np.linspace(-6, 6, num=1024), H0=1, pp=np.array([]), pz=np.array([]), ord_p=np.array([]),
ord_z=np.array([]), roc=[-12, 12]):
"""Calculate inverse Laplace-Transform h(t) of H(p) defined by its gain factor, poles and zeroes
"""Calculate inverse laplace transform h(t) of H(p) defined by its gain factor, poles and zeroes
Parameters
----------
......@@ -226,6 +258,7 @@ def ient_ilaplace_Hf(f=np.linspace(-6, 6, num=1024), H0=1, pp=np.array([]), pz=n
For more examples see primer at ient_nb/Transforms.ipynb
"""
numerator = H0 * np.ones(f.shape)
for ind, ppz in enumerate(pz):
......@@ -249,7 +282,7 @@ def ient_ilaplace_Hf(f=np.linspace(-6, 6, num=1024), H0=1, pp=np.array([]), pz=n
def ient_iz_hn(n=np.linspace(-6, 6, num=13), H0=1, pp=np.array([]), pz=np.array([]), ord_p=np.array([]),
ord_z=np.array([]), roc=[0, 12]):
"""Calculate inverse z-Transform h(n) of H(z) defined by its gain factor, poles and zeroes
"""Calculate inverse z-transform h(n) of H(z) defined by its gain factor, poles and zeroes
Parameters
----------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment