Home > other >  Why change the fs, spectrum amplitude change
Why change the fs, spectrum amplitude change

Time:09-17

As title,
 CLC.
Ar=audiorecorder,16,2 (11025); % the recording object is established, and set the sampling frequency is 44100 hz, 16, double track
Ar. Record; % began recording
Pause (5); Recording % 5 seconds
Ar. Stop; Stop the recording %
P=ar. Play; % t
Y=ar. Getaudiodata (' int16 '); % data read
Audiowrite (' nansheng. Wav, y, 11025); % to store the recording
[y, fs]=audioread (' nansheng. Wav); Recording % read
N=length (y);
Y1=FFT (y, n);
F=fs * (0: n/2-1)/n.
Figure (1)
Subplot (2,1,1);
The plot (y);
Xlabel (' time ');
Ylabel (' margin ');
The title (' boys voice waveform);
grid on;
% time domain signal waveformSubplot (2,1,2);
The plot (f, abs (y1 (1: n/2)));
The title (' boys voice spectrum);
Xlabel (' frequency ');
Ylabel (' amplitude);
grid on; % frequency domain signal waveform
  • Related