% SURAJ BASTOLA %%%%%%%%%%%%
%%% COMPRESSING THE RECORDED AUDIO USING A LAW%%%%%%
% =============== Syntax: out = compand(in,A,v,'A/compressor') ==========================================
% IN MATLAB, Fs takes default value of 8000
clc;
close all;
[y,Fs] = audioread('C:\Users\suraj\OneDrive\Documents\MIT COLLEGE\Software Defined Radio Communication\MATLAB COding\audioRecorded.wav');
z = abs(fft(y));
disp(z);
figure(1)
subplot(2,2,1)
plot(y)
title('Recorded Audio')
subplot(2,2,2)
plot(z)
title('FFT of Recorded Audio')
A = 87.6
compressed = compand(y,A,max(y),'A/compressor');
x = abs(fft(compressed));
disp(x);
subplot(2,2,3)
plot(compressed)
title('Compressed Audio')
subplot(2,2,4)
plot(x)
title('FFT of Compressed Audio')
sgtitle('Compressing audio using A-law');
No comments:
Post a Comment