Wolfram 音频 | 应用示例
Wolfram 音频 | 应用示例
在代码中点击并按下 ,即可编辑并运行任何代码。
+
音频处理与分析。Wolfram 音频为语音、音乐及其他音频信号提供高度优化的处理和深度分析功能。通过与机器学习和神经网络的紧密集成,为自动化系统、安全、医疗等众多领域提供解决方案。
导入、处理和导出音频
导入、处理和导出音频
导入带有高频背景噪音的音频文件: |
In[]:=
music=Import["ExampleData/sample.flac"]
显示音频频谱图: |
In[]:=
Spectrogram[music]
消除高频背景噪音: |
In[]:=
filteredmusic=LowpassFilter[music,]
查看滤波后音频的频谱图: |
In[]:=
Spectrogram[filteredmusic]
以您选择的格式导出结果: |
In[]:=
Export["filteredexample.mp3",filteredmusic]
可视化音频信号
可视化音频信号
不同类型来源的音频: |
In[]:=
sources=ExampleData[{"Audio",#}]&/@{"Cat","Cello","FemaleVoice"}
音频波形显示音频振幅随时间的变化: |
In[]:=
AudioPlot[#,PlotLayout->"Averaged"]&/@sources
频谱图显示频率随时间的变化: |
In[]:=
Spectrogram/@sources
周期图显示主导频率: |
In[]:=
Periodogram[#,256]&/@sources
消除噪音或添加效果
消除噪音或添加效果
从嘈杂的音频片段开始: |
In[]:=
apollo=ExampleData[{"Audio","Apollo11SmallStep"}]
对音频进行去噪: |
In[]:=
filteredapollo=WienerFilter[apollo,30]
对音频的前半部分进行变调: |
In[]:=
{beginning,end}=AudioSplit[filteredapollo,4];AudioJoinAudioPitchShiftbeginning,,end
从音频中提取特征
从音频中提取特征
从口述数字数据集开始: |
In[]:=
digitspeech=
;
使用预训练模型定义特征提取器: |
In[]:=
extractor=NetAppend[NetTake[NetModel["Wav2Vec2 Trained on LibriSpeech Data"],"FeatureExtractor"],"Mean"->AggregationLayer[Mean,1]]
在三维图中显示提取的特征: |
In[]:=
Module{colors,styling},colors="Speaker A"->,"Speaker B"->,"Speaker C"->;styling=;Legended[FeatureSpacePlot3D[Normal[digitspeech[All,styling]],FeatureExtractor->extractor,LabelingFunction->None],PointLegend[Values[colors],Keys[colors]]]
识别音频源
识别音频源
识别音频信号中的内容: |
In[]:=
AudioIdentify
从混合音源的音频开始: |
mixedsources=;
根据半秒片段识别主要音源: |
In[]:=
segmentIds=AudioBlockMapAudioIdentify&,mixedsources,{1,.5}//Normal
将音频片段组合成一段: |
In[]:=
intervals=GroupBysegmentIds,Last,
绘制结果: |
In[]:=
LegendedAudioPlotmixedsources,,SwatchLegend