Professional Documents
Culture Documents
signalHW4 2023193004
signalHW4 2023193004
recDuration = 5;
disp("Begin speaking.")
recordblocking(recObj,recDuration);
disp("End of recording.")
recordedVoice = getaudiodata(recObj);
k2 = 2.0;
alpha2 = 0.6;
distortedVoice2 = distortVoice(recordedVoice, k2, alpha2);
filteredVoice2 = removeDistortion(distortedVoice2, k2, alpha2);
k3 = 2.5;
alpha3 = 0.4;
distortedVoice3 = distortVoice(recordedVoice, k3, alpha3);
filteredVoice3 = removeDistortion(distortedVoice3, k3, alpha3);
subplot(3,1,2);
plot(distortedVoice1);
title('Distorted Voice 1 (k=1.5, α=0.8)');
subplot(3,1,3);
plot(filteredVoice1);
title('Filtered Voice 1');
figure;
subplot(3,1,1);
plot(recordedVoice);
title('Original Voice');
subplot(3,1,2);
plot(distortedVoice2);
title('Distorted Voice 2 (k=2.0, α=0.6)');
subplot(3,1,3);
plot(filteredVoice2);
title('Filtered Voice 2');
figure;
subplot(3,1,1);
plot(recordedVoice);
title('Original Voice');
subplot(3,1,2);
plot(distortedVoice3);
title('Distorted Voice 3 (k=2.5, α=0.4)');
subplot(3,1,3);
plot(filteredVoice3);
title('Filtered Voice 3');