viewing spectrum of an audio signal in matlab

조회 수: 248 (최근 30일)
Bahareh
Bahareh 2011년 10월 15일
댓글: Priyanka Phadte 2017년 12월 22일
Hello all,
I have an audio signal (.wav) and would like to view its spectrum in matlab. Can anybody help me in this manner?
Thanks in advance.

채택된 답변

Wayne King
Wayne King 2011년 10월 15일
Read it in with wavread()
[signal,fs] = wavread('file.wav');
If signal is Nx2 (two columns), extract one of them
signal = signal(:,1);
If you have the Signal Processing Toolbox, enter
plot(psd(spectrum.periodogram,signal,'Fs',fs,'NFFT',length(signal)));
  댓글 수: 4
Regin Rex Pacaldo
Regin Rex Pacaldo 2017년 10월 30일
How can i import my mp3 sound in matlab and analyze it?.
Priyanka Phadte
Priyanka Phadte 2017년 12월 22일
use audioread('filename.mp3') in matlab version 2017

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Ali Isik
Ali Isik 2011년 10월 15일
you should first read the audio signal using wavread() function. as a result of reading, the signal will be vectorized. after that, you should use fft() function to get the fourier transform of vectorized signal. at the end plot() the fourier transform of signal. sample code
[xn fs]=wavread('signal_name.wav');
nf=1024; %number of point in DTFT
Y = fft(xn,nf);
f = fs/2*linspace(0,1,nf/2+1);
plot(f,abs(Y(1:nf/2+1)));

카테고리

Help CenterFile Exchange에서 Measurements and Spatial Audio에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by