我需要从.wav文件(音频样本)到.csv文件中提取持续时间,meanfreq,sd,中位数等功能。
我已经完成了代码,但无法获得所需的所有功能。 我想拥有的功能是:
"meanfreq", "sd", "median", "Q25", "Q75", "IQR", "skew", "kurt", "sp.ent", "sfm", "mode", "centroid", "meanfun", "minfun", "maxfun", "meandom", "mindom", "maxdom", "dfrange", "modindx", "label"
我设法提取的功能是:
'nobs', 'mean', 'skew', 'kurtosis', 'median', 'mode', 'std', 'low', 'peak', 'q25', 'q75', 'iqr', 'label'
这是我已经完成的功能(请注意:这只是我功能代码的一小部分,我还有更多功能):
def get_features(frequencies): # acoustic attributes
print("\nExtracting features ")
nobs, minmax, mean, variance, skew, kurtosis =
stats.describe(frequencies)
median = np.median(frequencies)
mode = stats.mode(frequencies).mode[0]
std = np.std(frequencies)
low, peak = minmax
q75, q25 = np.percentile(frequencies, [75, 25])
iqr = q75 - q25
return (nobs, mean, skew, kurtosis, median, mode, std, low, peak, q25, q75, iqr)
我也知道互联网上存在现有的voice.csv数据集,但是我想要将它们从.wav转换为.csv的代码,并且能够自己提取特征,而不是使用预处理的.csv文件。
非常感谢您:)