MATLAB reads pcm and displays sound waveform

 The sound file I experimented with is a single channel with a fixed sampling frame rate of 160,000 from Baidu. The following code displays the waveform

Fs=16000;
%fileId = fopen('outfile.pcm','r');
%fileId = fopen('3.pcm','r');
fileId = fopen('test0.pcm','r');
x = fread(fileId,inf,'int16');
figure(1)
plot(x)

The results are as follows:

 

Guess you like

Origin blog.csdn.net/gbz3300255/article/details/109115061