Wolfram Audio | Things to Try
Wolfram Audio | Things to Try
Make edits and run any piece of code by clicking inside the code and pressing .
+
Audio Processing & Analysis. Wolfram Audio offers highly optimized processing and high-level analysis of speech, music and other audio signals. Tight integration with machine learning and neural networks enables solutions in automated systems, security, medicine and more.
Import, Process and Export Audio
Import, Process and Export Audio
Import an audio file with high-frequency background noise: |
In[]:=
music=Import["ExampleData/sample.flac"]
Show the audio spectrogram: |
In[]:=
Spectrogram[music]
Remove the high-frequency background noise: |
In[]:=
filteredmusic=LowpassFilter[music,]
See the spectrogram of the filtered audio: |
In[]:=
Spectrogram[filteredmusic]
Export the result in the format of your choice: |
In[]:=
Export["filteredexample.mp3",filteredmusic]
Visualize Audio Signals
Visualize Audio Signals
Audio from different types of sources: |
In[]:=
sources=ExampleData[{"Audio",#}]&/@{"Cat","Cello","FemaleVoice"}
Audio waveforms show audio amplitude over time: |
In[]:=
AudioPlot[#,PlotLayout->"Averaged"]&/@sources
Spectrograms show frequency over time: |
In[]:=
Spectrogram/@sources
Periodograms show dominant frequencies: |
In[]:=
Periodogram[#,256]&/@sources
Remove Noise or Add Effects
Remove Noise or Add Effects
Start with a noisy audio clip: |
In[]:=
apollo=ExampleData[{"Audio","Apollo11SmallStep"}]
Denoise the audio: |
In[]:=
filteredapollo=WienerFilter[apollo,30]
Perform a pitch shifting on the first half of the audio: |
In[]:=
{beginning,end}=AudioSplit[filteredapollo,4];AudioJoinAudioPitchShiftbeginning,,end
Extract Features from Audio
Extract Features from Audio
Begin with a dataset of spoken digits: |
In[]:=
digitspeech=
;
Define a feature extractor using a pre-trained model: |
In[]:=
extractor=NetAppend[NetTake[NetModel["Wav2Vec2 Trained on LibriSpeech Data"],"FeatureExtractor"],"Mean"->AggregationLayer[Mean,1]]
Show extracted features in a 3D plot: |
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]]]
Identify Audio Sources
Identify Audio Sources
Identify what’s in an audio signal: |
In[]:=
AudioIdentify
Begin with audio from mixed sources: |
In[]:=
mixedsources=;
Identify the dominant source by half-second segments: |
In[]:=
segmentIds=AudioBlockMapAudioIdentify&,mixedsources,{1,.5}//Normal
Assemble the segments into intervals: |
In[]:=
intervals=GroupBysegmentIds,Last,
Plot the results: |
In[]:=
LegendedAudioPlotmixedsources,,SwatchLegend