% clean.m removes selected frequency components to clean up the sound % This is nowhere near a good way to do this; it is only a first step. [se]=wavread('e.spoken.out'); % read spoken e data se=se-132; se_spectrum=fft(se); se_spectrum(1)=1; clean_spectrum=se_spectrum; % begin cleaning up the spectrum for j=600:1000 % remove high frequencies clean_spectrum(j)=0; end for j=1:50 % remove low frequencies clean_spectrum(j)=0; end se_clean = ifft(clean_spectrum); % inverse fast Fourier transform subplot(2,1,1) k=[1:1:1200]; plot(k,abs(se_spectrum(k))/5000) title('Original spectrum') ylabel('Strength'); xlabel('Frequency'); subplot(2,1,2) plot(k,abs(clean_spectrum(k))/5000) title('Cleaned spectrum') ylabel('Strength'); xlabel('Frequency'); sound(se,41600); sound(se_clean,41600);