# Filtering voice signal from randomly added frequencies

I have this assignment that I can't figure how to solve.

I have a sound.wav human-voice file, and use matlab add-random-noise (monotonic)

Goal: to remove the noise from the sound (and the sound from the noise)

What I've done so far is to read the file and then add the noise. I then do an fft. Now I need to analyze the frequency spectrum, but I'm not sure how to do it. And finally do an ifft to recover the sound back.

I've used many kinds of filters: low pass, high pass, band pass, moving average.

The problems were:

1. I've managed to filter the sound without the noise BUT the sound always got worse as well.

2. It worked only for specific cases of random noise but not for any random noise that function might produce.

### Any help would be appriciated. Thanks!

add_random_noise.m
n=[0:length(y)-1]';
r=rand();
%%rr=1+rand();
%%rrr=2+2*rand();
c=cos(2*pi*440*r*n/Fs);%%+cos(2*pi*440*rr*n/Fs)+cos(2*pi*440*rrr*n/Fs);
yn=y+c/17;
yn=yn/max(yn);
end


now im having truble to make the filter: matlab How to design lpf\bpf\hpf without builtin functions
• To begin with, go back to your teacher and insist that the sin waves can neither be considered random, nor can be termed noise. A better name for this function would be add_random_frequencies. – Izhaki May 21 '13 at 21:32
• "whose average does not vary over time" what do you mean? I did compared between the original sound(X) to the noisy sound(XN) on the frequency domain (dif=XN-X). then I took the mean from dif, and then notch NX. the result is a white noise and lower volume of the original sound. avg = mean(abs(dif).^2) for i = 1:length(dif) if abs(dif(i)).^2 > avg XN(i) = 0; end end` – jico May 22 '13 at 14:37