先去下载一个声音文件;使用这个代码即可
clear; clc; [y, Fs] = audioread('xxx.wav'); plot(y); y = y(:, 1); spectrogram(y); sound(y, Fs); % player = audioplayer(y, Fs); y1 = diff(y(:, 1)); subplot(2, 1, 1); plot(y(:, 1)); subplot(2, 1, 2); plot(y1);