Question

How can I create anti-noise with code or an application? It doesn't have to be realtime, just sound that is the opposite of the entire soundtrack! So, when you play both together, they will cancel out each other.

Was it helpful?

Solution

If you have pure noise availible try (I have not tried it my self) to fft you can use fftw-3

1 Take some buffer containeing noise only 2 Zero-pad the noise so that its length matches up with the entire signal 3 Calculate the noise spectrum N 4 Calculate the signal spectrum X filter out frquencies in X that are present in N and store the result in Y 6 Recompose y from Y

in Matlab or octave:

n=length(x);
n(1:noise_end-noise_start+1)=x(noise_start:noise_end);
N=fft(n);
X=fft(N);
%   Filter noise frquencies
y=ifft(Y);

The idea is to use the spectrum of the noise signal to reduce the noise in the desired signal. When the spectrum of the noise is known, filter these frequencies out.

OTHER TIPS

From your description, it sounds like you just need to invert the source signal. If you do that and sum to the original, you'll be sitting at -inf, no problem.

But, what I think you actually want to do is reduce noise on a signal based on a measurement of the background noise. This is basically accomplished by doing the following:

  1. Spectral analysis of a selection of noise samples. You get this by running an FFT.
  2. Conversion of the area you wish to fix from time domain to frequency domain. (Again, FFT.)
  3. Subtraction of that noise from the original you want to fix up.

You'll end up with something close, but will undoubtedly want to do more work on the signal from there. There's a lot of math involved here, but if you search around Stack Overflow for DSP, you'll find several things to read up on. Hopefully this will get you started.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top