Matlab查看信号时域波形

plot_time.m

clear;clc;
maindir = 'D:/EDUCATION/datasets/';
subdir='XXX/';
subdirpath = fullfile( maindir, subdir, '*.wav' );
dat = dir( subdirpath );               % 子文件夹下找后缀为wav的文件
for i = 1 : 1 : 12
    datapath=dat( i+25 ).name;
    name=datapath(22:end);
    filename = fullfile( maindir, subdir, datapath);
	info = audioinfo(filename);
    [y,Fs] = audioread(filename);
    t = 0:1/Fs:info.Duration;
	t = t(1:end-1);
    subplot(3,4,i);
    plot(t,y);
    ylim([-1.2 1.2])
    title(name)

end

你可能感兴趣的:(Matlab,matlab,算法,开发语言)