DSP Lab 2
DSP Lab 2
Code:
fs = 8000; % Sampling frequency
nBits = 16; % Bit depth
nChannels = 1; % Number of audio channels
ID = -1; % Default audio input device
% Start recording
disp("Begin speaking.")
recordblocking(recObj, 2); % Record for 2 seconds
disp("End of recording.")
figure(2)
plot(f, abs(F)) % Plot magnitude spectrum
title('Frequency Domain of "jambo.wav"')
xlabel('Frequency (Hz)')
ylabel('Magnitude')
xlim([0 fs/2]) % Limit to half the sampling rate