Open Ended Lab DSP
Open Ended Lab DSP
recObj1 = audiorecorder(5000,16,1);
recDuration = 3; % record for 3 seconds
recordblocking(recObj1,recDuration);
recObj2 = audiorecorder(5000,16,1);
recDuration2 = 3; % record for 3 seconds
recordblocking(recObj2,recDuration2);
y = getaudiodata(recObj1);
z = getaudiodata(recObj2);
subplot(3,3,1)
plot(y);
title('S1 in t')
subplot(3,3,2)
plot(z);
title('S2 in t')
y1= fft(y);
z1=fft(z);
subplot(3,3,3);
plot(abs(y1));
title('S1 in f');
subplot(3,3,4)
plot(abs(z1));
title('S2 in f');
upS1= upsample(y,3);
upS2= upsample(z,3);
subplot(3,3,1)
plot(upS1);
title('upsampled S1 in t')
subplot(3,3,2)
plot(upS2);
title('upsampled S2 in t')
y1= fft(upS1);
z1=fft(upS2);
subplot(3,3,3);
plot(abs(y1));
title('upsampled S1 in f');
subplot(3,3,4)
plot(abs(z1));
title(' upsampled S2 in f');
clc
num=fir1(10,0.1,'low');
lp1=filter(num,1,upS1);
subplot(2,1,1)
plot(lp1);
title('upsampled S1 passed thru LP')
num2=fir1(10,0.1,'low');
lp2=filter(num2,1,upS2);
subplot(2,1,2)
plot(lp2);
title('upscaled S2 passed thru LP');