Monday, October 5, 2020

COMPRESSING THE RECORDED AUDIO USING A-Law

 


% 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

CHECKING WHETHER THE SYSTEM IS STABLE OR NOT

  % SURAJ BASTOLA % % ==========CHECKING WHETHER SYSTEM IS STABLE OR NOT ================== % H(z) = (2z+0.5)/(z^2+0.5z-1) b = [2 0.5]; a=[1...