Hearing Aid Program on MATLAB
Using MATLAB, take in a sound file using a level detector, and applying bandpass channels with compression to the sound.
Can someone help me with this problem, no special format is required when writing to code.
Answer:
clc
clear
close all
%%
[A,fs]=audioread('1 (1).wav');
%% Sender
C=[];
A=A';
for i=512:512:numel(A)
B=dct(A(i-511:i));
C=[C, B(1:128)];
end
%% Reciever
A2=[];
for i=128:128:numel(C)
S=[C(i-127:i),zeros(1,384)];
S=idct(S);
A2=[A2,S];
end
%% Evaluation
dis=numel(A)-numel(A2);
A2=[A2,zeros(1,dis)];
PSNR=psnr(A2,A)
MSError=mse(A2,A)
SNR=snr(A2,A)
%% plot
figure,
plot(A);
hold on
plot(A2,'r')
plot((A2-A),'y')
legend('Original' , 'Recieved','Difference')
title('Audio Compression By DCT');
xlabel('Samples');
ylabel('Amp.');
grid();
Please give me thumbs up,if you like the answer .
Please let me know if you don't understand any step before giving
Down rating directly :). Happy to help
Get Answers For Free
Most questions answered within 1 hours.