function [clean] = method2(corrupt, noise, cleanphrase) % use these functions first % noise=wavread('noise'); % corrupt=wavread('corrupt'); % cleanphrase=wavread('cleanphrase'); [N, trash]=size(corrupt); noise=noise(1:N); corruptFFT=fft(corrupt); noiseFFT=fft(noise); DELTAF=1/(N*1/11025); FREQ=0:DELTAF:11025/2; FREQ=FREQ'; figure(1) plot(FREQ(1:N/2), abs(noiseFFT(1:N/2))); figure(2) plot(FREQ(1:N/2), abs(corruptFFT(1:N/2))); superClean=zeros(N,1); for n = 1:N/2 if (FREQ(n)>387 & FREQ(n)<399) | (FREQ(n)>780 & FREQ(n)<790) | (FREQ(n)>1173 & FREQ(n)<1183) | (FREQ(n)>1567 & FREQ(n)<1574) superClean(n)=0.001*corruptFFT(n); else superClean(n)=corruptFFT(n); end end clean = real(ifft(superClean)); figure(3) plot(FREQ(1:N/2), abs(superClean(1:N/2))); SOUNDSC(real(clean), 11025); pause SOUNDSC(corrupt, 11025); pause SOUNDSC(cleanphrase, 11025);