Extract frequency samples from .wav file
이전 댓글 표시
Hi,
I'd like to get a list of frequencies from a .wav file, but I don't have any idea how. I've tried to use the function wavread, from which I can get the amplitude values and plot them against the time, but what I want is to get and plot the discrete frequency values of the sound file (as I show in the image I've attached). The code I've used is the following one, and it would be perfect if I could do exactly the same operations but with the frequency values instead of the amplitude ones.
[wave,fs]=wavread('filename.wav');
t=0:1/fs:(length(wave)-1)/fs;
plot(t,wave);
Could anyone here give me a hand? Thanks in advance!
답변 (2개)
Star Strider
2015년 6월 21일
0 개 추천
If you have the Signal Processing Toolbox, use the spectrogram function. That may provide what you want.
댓글 수: 2
FirstName LastName
2015년 6월 24일
Star Strider
2015년 6월 24일
My pleasure.
You can get data from spectrogram by asking it for outputs. All the data it calculates are available. See the documentation on Spectrogram and Instantaneous Frequency for details.
카테고리
도움말 센터 및 File Exchange에서 Pulsed Waveforms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!