Can Anyone help me to remove noise from this audio file in matlab

조회 수: 3 (최근 30일)
puneet lalwani
puneet lalwani 2018년 11월 20일
댓글: puneet lalwani 2018년 11월 20일
I am new to matlab. Can anyone please help me remove noise from this audio signal. This is for a college assignment. the audio file is attached here. Thank you.
  댓글 수: 2
Jan
Jan 2018년 11월 20일
Because this is a homework question, you will get an answer if you show your own effort and ask a specific question.
puneet lalwani
puneet lalwani 2018년 11월 20일
I tried using cheby2 filter but the thing is I cannot make out at what range is the noise. I cannot remove the noise from this. The code i used is given below
%%1) Load the 'audio_sample.wav' file in MATLAB
[sample_data, sample_rate] = audioread('aat_audio.mp3');
% a. Plot the signal in time and the amplitude of its frequency
% components using the FFT.
sample_period = 1/sample_rate;
t = (0:sample_period:(length(sample_data)-1)/sample_rate);
subplot(2,2,1)
plot(t,sample_data)
title('Time Domain Representation - Unfiltered Sound')
xlabel('Time (seconds)')
ylabel('Amplitude')
xlim([0 t(end)])
fs = sample_rate/2;
m = length(sample_data); % Original sample length.
n = pow2(nextpow2(m)); % Transforming the length so that the number of
% samples is a power of 2. This can make the transform computation
% significantly faster,particularly for sample sizes with large prime
% factors.
y = fft(sample_data, n);
f = (0:n-1)*(sample_rate/n);
amplitude = abs(y)/n;
subplot(2,2,2)
plot(f(1:floor(n/2)),amplitude(1:floor(n/2)))
title('Frequency Domain Representation - Unfiltered Sound')
xlabel('Frequency')
ylabel('Amplitude')
% b. Listen to the audio file.
% sound(sample_data, sample_rate)
%%2) Filter the audio sample data to remove noise from the signal.
order = 7;
%%[n,Ws] = cheb2ord(2000/fs,2020/fs,1,100); % Filter Order
[z,p,k] = cheby2(order,150,0.4,'low'); % Filter Design
[soslp,glp] = zp2sos(z,p,k);
%%[b,a] = butter(order,1000/(sample_rate/2),'low');
filtered_sound = filtfilt(soslp, glp, sample_data);
%%filtered_sound = filter(b,a,sample_data);
sound(filtered_sound, sample_rate)
t1 = (0:sample_period:(length(filtered_sound)-1)/sample_rate);
subplot(2,2,3)
plot(t1,filtered_sound)
title('Time Domain Representation - Filtered Sound')
xlabel('Time (seconds)')
ylabel('Amplitude')
xlim([0 t1(end)])
m1 = length(sample_data); % Original sample length.
n1 = pow2(nextpow2(m1)); % Transforming the length so that the number of
% samples is a power of 2. This can make the transform computation
% significantly faster,particularly for sample sizes with large prime
% factors.
y1 = fft(filtered_sound, n1);
f = (0:n1-1)*(sample_rate/n1);
amplitude = abs(y1)/n1;
subplot(2,2,4)
plot(f(1:floor(n1/2)),amplitude(1:floor(n1/2)))
title('Frequency Domain Representation - Filtered Sound')
xlabel('Frequency')
ylabel('Amplitude')

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Measurements and Spatial Audio에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by