首页 \ 问答 \ 如何将mfcc矢量与注释中的标签结合起来传递给神经网络(How to combine mfcc vector with labels from annotation to pass to a neural network)

如何将mfcc矢量与注释中的标签结合起来传递给神经网络(How to combine mfcc vector with labels from annotation to pass to a neural network)

使用librosa,我为我的音频文件创建了mfcc,如下所示:

import librosa
y, sr = librosa.load('myfile.wav')
print y
print sr
mfcc=librosa.feature.mfcc(y=y, sr=sr)

我还有一个文本文件,其中包含与音频对应的手动注释[start,stop,tag],如下所示:

0.0 2.0声音1
2.0 4.0 sound2
4.0 6.0沉默
6.0 8.0 sound1

问题:如何将生成的librosa生成的mfcc与文本文件中的注释结合起来。

最终目标是,我想结合对应于标签的mfcc,并传递
它到神经网络。
因此,神经网络将mfcc和相应的标签作为训练数据。

如果它是一维的,我可以有N列N值,最后一列Y带有Class标签。 但我很困惑如何继续,因为mfcc的形状类似于(16,X)或(20,Y)。 所以我不知道如何将两者结合起来。

我的样本mfcc在这里: https//gist.github.com/manbharae/0a53f8dfef6055feef1d8912044e1418

请帮忙谢谢。

更新:目标是训练神经网络,以便在将来遇到它时识别出新的声音。

我用Google搜索,发现mfcc非常适合演讲。 但是我的音频有语音,但我想识别非语音。 是否有其他推荐的音频功能用于通用音频分类/识别任务?


Using librosa, I created mfcc for my audio file as follows:

import librosa
y, sr = librosa.load('myfile.wav')
print y
print sr
mfcc=librosa.feature.mfcc(y=y, sr=sr)

I also have a text file that contains manual annotations[start, stop, tag] corresponding to the audio as follows:

0.0 2.0 sound1
2.0 4.0 sound2
4.0 6.0 silence
6.0 8.0 sound1

QUESTION: How to do I combine the generated mfcc's that was generated by librosa, with the annotations from text file.

Final goal is, I want to combine mfcc corresponding to the label, and pass
it to a neural network.
So a neural network will have the mfcc and corresponding label as training data.

If it was one dimensional , I could have N columns with N values and the final Column Y with a Class label. But i'm confused how to proceed, as the mfcc has the shape of something like (16, X) or (20, Y). So I don't know how to combine the two.

My sample mfcc's are here : https://gist.github.com/manbharae/0a53f8dfef6055feef1d8912044e1418

Please help thank you.

Update : Objective is to train a neural network so that it can identify a new sound when it encounters it in the future.

I googled and found that mfcc are very good for speech. However my audio has speech but I want to indentify non speech. Are there any other recommended audio features for a general purpose audio classification/recognition task?


原文:https://stackoverflow.com/questions/48388641
更新时间:2023-08-19 12:08

最满意答案

您更新数组值而不是TableModel值。 使用jTable.getModel().setValueAt()传递inputRow,inputColoumn和它们的适当值。 您的模型必须是可编辑的。 如果您使用DefaultTableModel则默认情况下它是可编辑的。


You update array value not TableModel value. Use jTable.getModel().setValueAt() passing inputRow, inputColoumn and appropriate value for them. Your model must be editable. If you use DefaultTableModel it's editable by default.

相关问答

更多
  • 尝试规范化字符串以符合BigDecimal要求: private static BigDecimal parse(String str) { String normalized = str.replaceAll("\\s", "").replace(',', '.'); return new BigDecimal(normalized); } 上面的代码从输入字符串中删除所有空白字符(在BigDecimal构造函数中不允许)。 更重要的是 - 如果需要,它会将逗号替换为小数点。 Try t ...
  • @trashgod @mKorbel 感谢帮助人员,我通过在done()函数中将信息添加到表中来解决了这个问题。 代码如下 SwingWorker worker = new SwingWorker< Void, Void>() { String[] billItems = null; @Override public Void doInBackground() { String SQL = "SELECT ...
  • 我建议你使用表格模型,只要数据改变你改变模型。 只需构建JTable实例一次,而不是每当需要更改数据时。 I suggest you use a table model, whenever the data changes you change the model. Build the JTable instance only once, not whenever you need to change the data.
  • 第一个答案 为此,您应该访问表的列,如下所示: TableColumn column = null; column = table.getColumnModel().getColumn(/*here the index of your column*/); column.sizeWidthToFit(); 如果标题为空或者什么都不做,请小心 一些来源以防万一https://docs.oracle.com/javase/tutorial/uiswing/components/table.html#width ...
  • GustlyWind的评论是了解如何使用JTable的最佳地点。 数据的关键是获取模型中的项目。 您可以使用DefaultTableModel ,这需要将表结果放入2D数组或Vector中。 或者,您可以实现自己的模型,该模型使用应用程序中的其他自定义对象或不同的基础数据结构。 无论哪种方式,当您遍历查询的ResultSet ,您将不得不提取相关数据并将其粘贴到某种Collection 。 GustlyWind's comment is the best place to look on how to us ...
  • data = new DefaultTableModel(vectorData, columNames); table = new JTable(data); 您正在创建一个新的TableModel和一个新的JTable。 问题是你永远不会将新表添加到GUI。 您不能只更改对“table”变量的引用,并希望将表添加到GUI中。 因此解决方案是不创建新的JTable。 相反,您只需重置现有JTable的TableModel: data = new DefaultTableModel(vectorData, ...
  • 是的,但这经过编辑 模型不会跟踪值之前/之后。 如果您需要此信息,则需要自己完成。 或者,您可以使用Table Cell Listener为您执行此操作。 Yes, but this getting after edited The model does not track before/after values. If you want this information you need to do it yourself. Or, you can use the Table Cell Listener ...
  • 您更新数组值而不是TableModel值。 使用jTable.getModel().setValueAt()传递inputRow,inputColoumn和它们的适当值。 您的模型必须是可编辑的。 如果您使用DefaultTableModel则默认情况下它是可编辑的。 You update array value not TableModel value. Use jTable.getModel().setValueAt() passing inputRow, inputColoumn and approp ...
  • 看到JTable教程,一切都在那里描述 我看不出有理由使用AbstractTableModel ,不知道为什么烦扰JTable包含实际数量的行和列(最多DefaultTableModel和DefaultTableModel ),而是从DefaultTableModel开始 或使用此AbstractTableModel更改DefaultTableModel 可以从一开始 import java.awt.*; import java.awt.event.ActionEvent; import java.awt. ...
  • 您可以替换自己的Scrollable实现来获得各种效果。 特别是,覆盖getPreferredScrollableViewportSize()并返回行高的合适倍数。 设N是您希望滚动条出现的行数。 JTable table = new JTable(tableModel) { @Override public Dimension getPreferredScrollableViewportSize() { return new Dimension(SOME_WIDTH, N ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)