How to plot WAV file

조회 수: 20 (최근 30일)
John
John 2011년 11월 23일
댓글: Anzzza 2022년 2월 9일
Hello,
I'd like to plot .wav file in time and frequency domain.

채택된 답변

Wayne King
Wayne King 2011년 11월 23일
If this is the output of wavread, then see if you have two channels in y
[y,fs] = wavread(filename);
If y is two-channels, Nx2, then just plot one:
y = y(:,1);
dt = 1/fs;
t = 0:dt:(length(y)*dt)-dt;
plot(t,y); xlabel('Seconds'); ylabel('Amplitude');
figure
plot(psd(spectrum.periodogram,y,'Fs',fs,'NFFT',length(y)));
  댓글 수: 10
irtaza mazhar
irtaza mazhar 2022년 1월 26일
wht if channel is 1??
Anzzza
Anzzza 2022년 2월 9일
when you have stereo audio, you got two channels. if you can, it's easier to work with one

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Pulsed Waveforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by