Sei sulla pagina 1di 7

“Impulse noise removal from audio using

median filter”
1. Introduction: NOISE
In audio , noise is generally any unpleasant sound and, more
technically, any unwanted sound that is unintentionally added
to a desired sound. In recording sound, noise is often present on
analog tape or low-fidelity digital recordings. The
standard audio cassette includes a layer of hiss on every
recording.

Noise is unwanted signal which may cause an error through


recording, or transmitting the audio signal.
Therefore, the process of noise removal is an initial procedure
that should be implemented before many advance
sound processing tasks such as audio coding, recognition, and
analysis.

Audio signal is often corrupted with different types of noise,


among them are Gaussian noise, impulse noise, and others.
Gaussian noise is the worst noise corrupts every sample in the
audio signal. Consequently, many researchers spent great effort
to remove such noise. The other important noise that may
corrupt the audio signal is the impulse noise.

IMPULSE NOISE:
Impulse noise is a category of (acoustic) noise which includes
unwanted, almost instantaneous (thus impulse-like) sharp sounds (like
clicks and pops). Noises of the kind are usually caused
by electromagnetic interference, scratches on the recording
disks, gunfire, explosions and ill synchronization in digital recording
and communication. High levels of such a noise (200+ decibels) may
damage internal organs, while 180 decibels are enough to destroy or
damage human ears.

1|Page
It occurs due to clicks, scratches, burst and crackles or due to an error
in the transmission device . There are two types of impulse noise; the
first one is fixed value impulse noise which takes only two values 0 or
1. The other type is random value impulse noise which may take any
value in the range between two values; one of them is maximum and
the other is minimum. Thus, random valued impulse noise is more
difficult to detect compared to the fixed valued type because random
valued impulse noise takes a range of values similar to that of the audio
signal.

MEDIAN FILTER:

The Median Filter is a non-linear digital filtering technique, often used


to remove noise from an image or signal. Such noise reduction is a
typical pre-processing step to improve the results of later processing
(for example, edge detection on an image).
Median filtering is very widely used in digital image
processing because, under certain conditions, it preserves edges while
removing noise (but see discussion below), also having applications
in signal processing.

The nonlinear function of the median filter can be expressed as:


y(n) = med[x(n-k),x(n-k+1),….,x(n),…..,x(n+k-1),x(n+k)] Where, y(n)
is the output and x(n) the input signal.

The filter “collects” a window containing N=2k+1 samples of the input


signal and then performs the median operation on this set of samples.
The median filter itself is simple and in the standard form there is only
one design parameter, namely the filter length N=2k+1.

Standard global filtering techniques like low pass filtering do not


differentiate between impulses corrupted samples and uncorrupted
samples. Median filters and other order static filters that operate on a
localized area typically modify uncorrupted samples as the filtering is
applied uniformly over the whole signal. The median filter is a highly
robust estimator of the signal value in the presence of impulse noise.

2|Page
However, a median filter will eliminate changes in the input signal with
a duration less than half the size of the filter window. When the signal
is heavily corrupted with impulse noise, a large median window is
needed and this leads to more uncorrupted samples being replaced by
the median value within the window and more high frequency
components being removed by the filter. As a result, conventional
techniques for impulse noise removal perform poorly for an acceptable
level of feature and tonal quality. The ideal objective would be to
replace only the noisy samples, leaving uncorrupted samples
unchanged.
2. Approach of Algorithm(steps):

3. Algorithm implementation(program):
[y1,fs]=audioread('C:\Users\001su\Downloads\10khzwav.wav');
time=1/fs*length(y1);
t=linspace(0,time,length(y1));
figure
subplot(2,1,1)
plot(t,y1);
sound(y1,fs)
title('time plot of original audio');
subplot(2,1,2)
3|Page
N=length(y1);
Fc=((-N/2):(N/2)-1)/N;
F=fs*Fc;
plot(F,y1);
title('frequency plot of original audio');
%noise
figure
subplot(1,1,1)
Y= medfilt1(y1,10);
filename= ('C:\Users\001su\Downloads\result.wav');
audiowrite(filename,Y,fs);
plot(t,y1,t,Y)
sound(Y,fs)
title('comparing both signals');
legend('original','filtered')
legend('boxoff')
%basic median filter
Fs=100;
T=0:1/fs:1;
x=sin(2*pi*t*3)+0.25*sin(2*pi*t*40);
figure
subplot(1,1,1)
Y= medfilt1(x,10);
plot(t,x,t,Y)
title('basic working of median filter on sinosoidal signal');
legend('original','filtered')
legend('boxoff')

4. Results :

Since we used a signal frequency tone of 10khz as an input audio


which comprised some noise.
Later after median filtering we were able to hear sharp tone of 10khz
only .
It works best on higher frequency rather than lower frequency.

4|Page
5|Page
5. Conclusion :
Median filters find their application in various fields like
1.ECG Signals
2.Video signals
3.Digital images
4.Radiographic images

6|Page

Potrebbero piacerti anche