PCM DECODING : effect of different sample frequency

3 views (last 30 days)
I Used “resample” command to see the effect of changing the frequency of
9-bit quantized signal for the following casses ( fs=44100, fs=2000 and fs=300)
on both the size of the data and the sound quality while decreasing the sample frequency
I can't hear the sound for fs = 300 because it gives me Error using sound (line 76) Device Error: Invalid sample rate please if you know how solve this problem help me , Thank you
another thing , I don't notice a very big difference between fs=44100 and fs=2000 why ?!
fs=44100;
ts=1/fs;
t=0:ts:4-ts;
x1 = audiorecorder(fs, 16, 1);
disp('Start speaking.')
recordblocking(x1, 4);
disp('End of Recording.');
m=getaudiodata(x1);
m1=resample(m,2000 , 44100);
m2=resample(m,300 , 44100);
n9=9;
L9=2.^n9;
delta2=2.00001.*max(abs(m))/L9;
delta4=2.00001.*max(abs(m1))/L9;
delta8=2.00001.*max(abs(m2))/L9;
mqfO= delta2.*floor(m/delta2) + delta2/2;
mqf1= delta4.*floor(m1/delta4) + delta4/2;
mqf2= delta8.*floor(m2/delta8) + delta8/2;
sound(mqfO,fs);
pause(5)
sound(mqf1,2000);
pause(5)
sound(mqf2,300);

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!