def DST4(samples):
"""
Method to create DST4 transformation using DST3
Arguments :
samples : (1D Array) Input samples to be transformed
Returns :
y : (1D Array) Transformed output samples
"""
# Initialize
samplesup=np.zeros(2*N, dtype = np.float32)
# Upsample signal
# Reverse order to obtain DST4 out of DCT4:
#samplesup[1::2]=np.flipud(samples)
samplesup[0::2] = samples
y = spfft.dst(samplesup,type=3,norm='ortho')*np.sqrt(2)#/2
# Flip sign of every 2nd subband to obtain DST4 out of DCT4
#y=(y[0:N])*(((-1)*np.ones(N, dtype = np.float32))**range(N))
return y[0: N]
评论列表
文章目录