java - How can I get the ratio of two audio signals in the frequencies domain? -
i need compare 2 audio signals, signal1 , signal2. signal1 white noise. signal2 same signal of signal1, particular equalization cutting or attenuating frequencies. how can ratio of 2 audio signals in frequencies domain? (e.g.: @ frequency of 100hz, signal2 attenuated 50% compared signal1). need information process third signal applying same equalization applied transform signal1 in signal2.
i used this library process data , pass time domain frequencies domain. code same signal1 , signal2.
doublefft_1d fft1 = new doublefft_1d (fft_size); double[] input1 = new double[fft_size]; double[] fftbuff1 = new double[fft_size * 2]; this.wavfiledoubleinputstreammic.read(input1, 0, fft_size); (int = 0; < fft_size; i++){ fftbuff1[2*i] = input1[i]; fftbuff1[2*i+1] = 0; } fft1.complexforward(fftbuff1);
how can use fft results (from signal1 , signal2) reach goal?
you need calculate magnitude of each signal in frequency domain power spectrum estimate each, , divsion, i.e.
- get signal 1 , signal 2
- apply suitable window function both signals (e.g. von hann)
- apply fft windowed signals
- calculate magnitude of fft output,
mag = sqrt(re*re+im*im)
- gives real-valued power spectrum - divide power spectrum of signal 1 power spectrum of signal 2 real-valued ratio versus frequency
to apply correction signal 3 can use overlap-add or overlap-save method - take fft of signal3, multiply each complex value real value obtained above, use inverse fft time domain. slight complication need overlap successive sample windows , process overlap correctly (see links overlap-add/overlap-save methods above.)
Comments
Post a Comment