[docs]defround_away(x):""" Function that rounds away from 0 to mimic the Matlab round function. Examples: 2.3 -> 2 ; 2.7 -> 3 ; 2.5 -> 3 Parameters ---------- x : number to round Returns ------- rounded value Function found at https://stackoverflow.com/questions/59142749/how-to-round-away-from-zero """a=np.abs(x)b=np.floor(a)+np.floor(2*(a%1))returnnp.sign(x)*b
[docs]defbeta(x):""" Beta function used in Meyer and Littlewood-Paley mother wavelets definitions """ifx<0:return0elifx>1:return1else:returnnp.power(x,4)*(35-84*x+70*np.power(x,2)-20*np.power(x,3))