How to plot WAV file
显示 更早的评论
Hello,
I'd like to plot .wav file in time and frequency domain.
采纳的回答
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 个评论
so are these saved in a .wav file as two channels? one for the right ear and one for the left?
If so, then just do
yright = y(:,1);
yleft = y(:,2);
or however it is.
@John, Pardon the yelling: THE MIT KEMAR HRTFS ARE NOT GIVEN FOR THE RIGHT AND LEFT EARS. Please read the documentation about how they recorded the HRTFS.
Hi !! thanks for your helpful post. I wonder if the unit is volt or mV ? Please can you confirm me that the unit of the amplitude axe is in Volt (or mV) ? thank !!
hi sorry, but why it display "Undefined function or variable 'wavread'." after i run this coding "[y,fs] = wavread(filename);" ??
try: [y,fs] = audioread ('Filename')
thank you :)
Hello Wayne King,
Could you explain the variables and why you put them in the format you did? If you can explain your code with comments that would be helpful.
Thank you,
Natalie
what should be its xlabel and ylabel (for the graph which is plotted)
wht if channel is 1??
when you have stereo audio, you got two channels. if you can, it's easier to work with one
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Pulsed Waveforms 的更多信息
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
