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!

    function yn=add_random_noise(y,Fs)

include: add_random_noise.m sound.wav


I have changed the add "noise" to return only one sinusoid noise. I run the same noise with my original wav and with zeros and watched the noise in the peak in the range of the lower frequency

now i`m having truble to make the filter: matlab How to design lpf\bpf\hpf without builtin functions

  • $\begingroup$ Your noise is the sum of 3 sinusoids with random frequencies, right? This is a very specific situation. Haven't you treated some relevant methods in the course where the assignment is taken from? Do you need to remove the noise for one specific outcome of the random generator, or for all possible outcomes? This basically boils down to the question if the frequencies of the sinusoids can be viewed as fixed and known or not. $\endgroup$
    – Matt L.
    Commented May 20, 2013 at 11:38
  • $\begingroup$ Matt. up till now I just thought to use the original voice and compare it with the noisy one. I'm not sure how can I benefit from this specific sinusoids noise equation. the noise is unknown and I need to handle with all possible outcomes. but before I can do that, help me to figure a simple one and I'll try my best for all the other random noises. $\endgroup$
    – jico
    Commented May 20, 2013 at 20:31
  • $\begingroup$ 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. $\endgroup$
    – Izhaki
    Commented May 21, 2013 at 21:32
  • $\begingroup$ Then I assume that all you need to do is FFT the signal to identify frequencies whose average does not vary over time. Once found, just notch (filter) them out. $\endgroup$
    – Izhaki
    Commented May 21, 2013 at 21:34
  • $\begingroup$ "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 $\endgroup$
    – jico
    Commented May 22, 2013 at 14:37


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.