目录
神经网络的输入是混合(男性+女性)音频的振幅谱。神经网络的输出目标是男性说话者理想的软掩模。损失函数是使输出和输入目标之间的均方误差最小化。在输出端,利用混合信号的输出幅度谱和相位将音频STFT转换回时域,并采用自监督学习方法。训练集是混合音频的前40秒中理想软掩模和二进制掩模的分离结果,网络输出是验证集为混合音频后的后20秒中男性说话者预测的理想软掩膜。






主函数部分代码:
firstTrainingAudioFile = "f.mp3";
secondTrainingAudioFile = "m.mp3";
C=1;%用于强化背景音乐
firstsongTrain = C*audioread(firstTrainingAudioFile);
secondsongTrain = audioread(secondTrainingAudioFile);
L=500000;%采样值
firstsongTrain = firstsongTrain(L:2*L);
secondsongTrain = secondsongTrain(L:2*L);%训练集
firstValidationAudioFile ="f.mp3";
secondValidationAudioFile = "m.mp3";
firstsongValidate = C*audioread(firstValidationAudioFile);
secondsongValidate = audioread(secondValidationAudioFile);
L1=1000000;
firstsongValidate = firstsongValidate(3*L1:4*L1);
secondsongValidate = secondsongValidate(2.5*L1:3.5*L1);%验证级
% 将训练信号缩放到相同的功率。将验证信号缩放到相同的功率。
firstsongTrain =firstsongTrain/norm(firstsongTrain);%训练集,
secondsongTrain = secondsongTrain/norm(secondsongTrain);
firstsongValidate = firstsongValidate/norm(firstsongValidate);%验证集
secondsongValidate = secondsongValidate/norm(secondsongValidate);
mixTrain = firstsongTrain + secondsongTrain;
mixTrain = mixTrain / max(mixTrain);
mixValidate = firstsongValidate + secondsongValidate;
mixValidate = mixValidate / max(mixValidate);
WindowLength = 128;
FFTLength = 128;
OverlapLength = 128-1;
Fs = 44000;
win = hann(WindowLength,"periodic");
audiowrite('est_mix.wav',mixValidate,Fs);
P_mix0 = stft(mixTrain,'Window',win,'OverlapLength',OverlapLength,'FFTLength',FFTLength);
P_f = abs(stft(firstsongTrain,'Window',win,'OverlapLength',OverlapLength,'FFTLength',FFTLength));
P_s = abs(stft(secondsongTrain,'Window',win,'OverlapLength',OverlapLength,'FFTLength',FFTLength));
N = 1 + FFTLength/2;
[1]鲁玉军,周世豪,胡小勇.基于BP神经网络和小波神经网络的太阳辐射强度预测[J].软件工程,2023,26(01):5-8+4.DOI:10.19644/j.cnki.issn2096-1472.2023.001.002.
我正在学习如何使用Nokogiri,根据这段代码我遇到了一些问题:require'rubygems'require'mechanize'post_agent=WWW::Mechanize.newpost_page=post_agent.get('http://www.vbulletin.org/forum/showthread.php?t=230708')puts"\nabsolutepathwithtbodygivesnil"putspost_page.parser.xpath('/html/body/div/div/div/div/div/table/tbody/tr/td/div
总的来说,我对ruby还比较陌生,我正在为我正在创建的对象编写一些rspec测试用例。许多测试用例都非常基础,我只是想确保正确填充和返回值。我想知道是否有办法使用循环结构来执行此操作。不必为我要测试的每个方法都设置一个assertEquals。例如:describeitem,"TestingtheItem"doit"willhaveanullvaluetostart"doitem=Item.new#HereIcoulddotheitem.name.shouldbe_nil#thenIcoulddoitem.category.shouldbe_nilendend但我想要一些方法来使用
类classAprivatedeffooputs:fooendpublicdefbarputs:barendprivatedefzimputs:zimendprotecteddefdibputs:dibendendA的实例a=A.new测试a.foorescueputs:faila.barrescueputs:faila.zimrescueputs:faila.dibrescueputs:faila.gazrescueputs:fail测试输出failbarfailfailfail.发送测试[:foo,:bar,:zim,:dib,:gaz].each{|m|a.send(m)resc
我正在尝试设置一个puppet节点,但rubygems似乎不正常。如果我通过它自己的二进制文件(/usr/lib/ruby/gems/1.8/gems/facter-1.5.8/bin/facter)在cli上运行facter,它工作正常,但如果我通过由rubygems(/usr/bin/facter)安装的二进制文件,它抛出:/usr/lib/ruby/1.8/facter/uptime.rb:11:undefinedmethod`get_uptime'forFacter::Util::Uptime:Module(NoMethodError)from/usr/lib/ruby
我想了解Ruby方法methods()是如何工作的。我尝试使用“ruby方法”在Google上搜索,但这不是我需要的。我也看过ruby-doc.org,但我没有找到这种方法。你能详细解释一下它是如何工作的或者给我一个链接吗?更新我用methods()方法做了实验,得到了这样的结果:'labrat'代码classFirstdeffirst_instance_mymethodenddefself.first_class_mymethodendendclassSecond使用类#returnsavailablemethodslistforclassandancestorsputsSeco
如何在buildr项目中使用Ruby?我在很多不同的项目中使用过Ruby、JRuby、Java和Clojure。我目前正在使用我的标准Ruby开发一个模拟应用程序,我想尝试使用Clojure后端(我确实喜欢功能代码)以及JRubygui和测试套件。我还可以看到在未来的不同项目中使用Scala作为后端。我想我要为我的项目尝试一下buildr(http://buildr.apache.org/),但我注意到buildr似乎没有设置为在项目中使用JRuby代码本身!这看起来有点傻,因为该工具旨在统一通用的JVM语言并且是在ruby中构建的。除了将输出的jar包含在一个独特的、仅限ruby
在rails源中:https://github.com/rails/rails/blob/master/activesupport/lib/active_support/lazy_load_hooks.rb可以看到以下内容@load_hooks=Hash.new{|h,k|h[k]=[]}在IRB中,它只是初始化一个空哈希。和做有什么区别@load_hooks=Hash.new 最佳答案 查看rubydocumentationforHashnew→new_hashclicktotogglesourcenew(obj)→new_has
我在我的项目中添加了一个系统来重置用户密码并通过电子邮件将密码发送给他,以防他忘记密码。昨天它运行良好(当我实现它时)。当我今天尝试启动服务器时,出现以下错误。=>BootingWEBrick=>Rails3.2.1applicationstartingindevelopmentonhttp://0.0.0.0:3000=>Callwith-dtodetach=>Ctrl-CtoshutdownserverExiting/Users/vinayshenoy/.rvm/gems/ruby-1.9.3-p0/gems/actionmailer-3.2.1/lib/action_mailer
设置:狂欢ruby1.9.2高线(1.6.13)描述:我已经相当习惯在其他一些项目中使用highline,但已经有几个月没有使用它了。现在,在Ruby1.9.2上全新安装时,它似乎不允许在同一行回答提示。所以以前我会看到类似的东西:require"highline/import"ask"Whatisyourfavoritecolor?"并得到:Whatisyourfavoritecolor?|现在我看到类似的东西:Whatisyourfavoritecolor?|竖线(|)符号是我的终端光标。知道为什么会发生这种变化吗? 最佳答案
我已经从我的命令行中获得了一切,所以我可以运行rubymyfile并且它可以正常工作。但是当我尝试从sublime中运行它时,我得到了undefinedmethod`require_relative'formain:Object有人知道我的sublime设置中缺少什么吗?我正在使用OSX并安装了rvm。 最佳答案 或者,您可以只使用“require”,它应该可以正常工作。我认为“require_relative”仅适用于ruby1.9+ 关于ruby-主要:Objectwhenrun