tripathy12345 / FBSE-EWT

Fourier Bessel Series Expansion- Empirical Wavelet Transform
3 stars 0 forks source link

How to determine the order of FBSE from your code? #2

Open rsarka34 opened 3 days ago

rsarka34 commented 3 days ago

How to determine the 'Order of FBSE' from you code? I mean which part of the FBSE code refer to the order of FBSE

import numpy as np from scipy.special import jn from scipy.linalg import toeplitz import matplotlib.pyplot as plt from scipy.io import loadmat from scipy import signal from scipy.fft import fft, fftfreq def FBSE(x, fs): f = x N = len(f) nb = np.arange(1, N+1)

MM = N
if 'alfa' not in locals():
    x = 2
    alfa = np.zeros(MM)
    for i in range(1, MM+1):
        ex = 1
        while abs(ex) > 0.00001:
            ex = -jn(0, x) / jn(1, x)
            x = x - ex
        alfa[i-1] = x
        # print(f'Root # {i} = {x:.5f} ex = {ex:.6f}')
        x = x + np.pi

a = N
D = np.zeros((MM, N))
fre = (alfa * fs) / (2 * np.pi * N)
for m1 in range(1, MM+1):
    D[m1-1, :] = jn(0, alfa[m1-1] / a * nb)

a3 = np.zeros(MM)
for m1 in range(1, MM+1):
    a3[m1-1] = (2 / (a**2 * (jn(1, alfa[m1-1]))**2)) * np.sum(nb * f * D[m1-1, :])

return a3, fre, alfa