二维MFCC的滑动平均滤波实现代码
时间: 2023-03-14 22:19:06 浏览: 77
二维MFCC的滑动平均滤波实现代码的实现原理是,使用移动平均算法来计算特征向量的滑动平均值,以获取较平滑的特征值。具体的实现代码可以参考以下示例: import numpy as np def sliding_mean(feature_vector, window_size):
# Calculate the sliding mean
sliding_mean = np.convolve(feature_vector, np.ones(window_size)/window_size, 'same')
return sliding_mean
相关问题
MFCC的滑动平均滤波实现代码
MFCC的滑动平均滤波实现代码可以参考以下代码:import numpy as npdef sliding_avg_filter(x, window_size):n = len(x)padded = np.concatenate([np.repeat(x[0], window_size//2), x, np.repeat(x[-1], window_size//2)])filtered = np.zeros(n)for i in range(n):filtered[i] = np.mean(padded[i:i+window_size])return filtered
阅读全文