- 博客(51)
- 收藏
- 关注
原创 简单的头传递函数Demo——DAFX第二版
clear ;% 利用简单的头传递函数,生成虚拟声源% 对生成的音频使用耳机监听;% 角度控制参数: theta[x, Fs] = audioread('song.wav');theta = 0 ;HRIRl=simpleHRIR(theta,Fs);HRIRr=simpleHRIR(-theta,Fs);outsigL= conv(HRIRl,x);outsigR= conv(HRIRr,x);y = [outsigL outsigR];audiowrite('ou...
2021-06-03 11:23:31 302
原创 使用卷积进行混响音响制作-python
signal.fftconvolve函数:采用fft进行卷积操作,输出信号长度大于信号,或者冲击响应长度,所以要进行裁剪。from scipy import signaldef reverb(win , Vwave): sig = Vwave filtered = signal.fftconvolve(sig , win ,mode ='full') filtered = filtered[0: len(sig)] return filtered...
2021-01-07 10:07:01 1283 1
原创 在Python中使用os模块对音频文件名字进行批量更改
在Python中使用os模块对音频文件名字进行批量更改:在一个类似 1_16_1168630199_275382270_1148_R9sk_4_s1.wav 命名的音频文件中,需要将“1_”换成“0_” .import osdef rename_func(path): filelist = os.listdir(path) for file in filelist: file_name_list = file.split('_') ...
2020-08-28 10:17:38 513
原创 python把一个音频文件转移到另外一个路径下
import shutilimport ospath = '../example_samples/test_wav/data1/'files = os.listdir(path)files.remove('.DS_Store')def filegender(file_name): new_name = '' file_name_list = file_name.split('.') file_name_list.pop() file_name_list_len..
2020-08-05 20:51:48 732
原创 wget下载
import osimport fnmatchimport wget#dir_target = os.path.join(root_dir, 'example_samples/age_recognition_by_embedding/test_caf')dir_target ='/Users/zyc/Documents/data/age_特征/data_caf'dir_input = '/Users/zyc/Documents/data/age_特征/data'tmp = os.listdir.
2020-07-31 12:01:54 366
原创 dataset的设置
制作数据集import osimport globimport torchimport numpy as npimport scipy.io.wavfile as wavfrom scipy.io.wavfile import readfrom utils_mfcc import computer_featurefrom torch.utils.data import Datasetimport pdbclass MyDataset_train(Dataset): de.
2020-05-21 20:56:36 673
原创 读取多个音频及其label python
def get_audio_and_transcriptch(txt_files, wav_files, n_input, n_context, word_num_map, txt_labels=None): audio = [] audio_len = [] transcript = [] transcript_len = [] if txt_file...
2020-05-21 19:18:13 365
原创 读取wav文件对应的label python
import numpy as npfrom python_speech_features import mfcc # 需要pip installimport scipy.io.wavfile as wavimport osdef get_wavs_lables(wav_path, label_file): # 获得训练用的wav文件路径列表 wav_files =...
2020-05-21 19:15:17 497
原创 lstm - pytorch
1 lstm做分类2 lstm做回归3 lstm的参数输入1 图像分类任务:train_loader中取出来的变量维度: torch.Size([64, 1, 28, 28])需要将其改成:torch.Size([64, 28, 28]) 代表batchsize , height, weightlstm的参数设置:input:形状的输入(seq_len,ba...
2020-05-01 16:33:17 454
原创 hmm python
hmm已知模型(A,B,pai)和观测序列,计算在该模型下观测序列出现的概率。import numpy as npimport csvclass HMM(object): def __init__(self,N,M): self.A = np.zeros((N,N)) # 状态转移概率矩阵 self.B = np.zer...
2020-04-28 12:22:16 320
原创 设计低通滤波器-Matlab
clear ;close all;filename ='./23.wav';[x ,fs] = audioread(filename);parametricEQ = fdesign.parameq('N,Flow,Fhigh,Gref,G0,GBW,Gst', 2, 4700, 8000 ,0,-15,-5,-1,fs);Hd = design( parametricEQ,'cheb...
2020-04-27 02:49:11 1019
原创 EM算法-python
em算法的细节可以看书#模拟两个正态分布的均值估计 from numpy import *import numpy as npimport randomimport copySIGMA = 6EPS = 0.0001#生成方差相同,均值不同的样本def generate_data(): Miu1 = 20 Miu2 = 40 N = 1000 X =...
2020-04-27 02:48:39 479
原创 基于hmm-gmm的1到10唤醒-python
可供参考的项目有:https://github.com/jayaram1125/Single-Word-Speech-Recognition-using-GMM-HMM-数据集得自己造:# -----------------------------------------------------------------------------------------...
2020-04-27 02:21:22 699
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人