Last update time: 07-20-2022
Hi, I'm Shimin Zhang (张是民)
- 📕 Research interests: Speech Enhacement (including acoustic echo cancellation, noise suppression, target speaker extration)
- 📫 How to reach me: [email protected]
A STFT/iSTFT written up in PyTorch using 1D Convolutions
License: MIT License
Last update time: 07-20-2022
Hi, I'm Shimin Zhang (张是民)
Hi,if i want to use tensorflow,how to change?
def init_kernels(win_len, win_inc, fft_len, win_type=None, invers=False):
if win_type == 'None' or win_type is None:
window = np.ones(win_len)
else:
window = get_window(win_type, win_len, fftbins=True)**0.5
N = fft_len
fourier_basis = np.fft.rfft(np.eye(N))[:win_len]
real_kernel = np.real(fourier_basis)
imag_kernel = np.imag(fourier_basis)
kernel = np.concatenate([real_kernel, imag_kernel], 1).T
if invers :
kernel = np.linalg.pinv(kernel).T
kernel = kernel*window
kernel = kernel[:, None, :]
return tf.convert_to_tensor(kernel,tf.float32)
class ConvSTFT(tf.keras.layers.Layer):
def __init__(self, win_len, win_inc, fft_len, win_type='hamming', feature_type='real', fix=True):
super(ConvSTFT, self).__init__()
self.fft_len = fft_len
kernel= init_kernels(win_len, win_inc, self.fft_len, win_type)
self.weight = tf.Variable(kernel)
self.feature_type = feature_type
self.stride = win_inc
self.win_len = win_len
self.dim = self.fft_len
def call(self, inputs):
outputs = tf.nn.conv1d(inputs, self.weight, stride=self.stride,padding='VALID')
output_list = []
dim = self.dim//2+1
real = outputs[:, :dim, :]
imag = outputs[:, dim:, :]
output_list = [real,imag]
return output_list
It is right?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.