# MATLAB How do I pass a signal into a low-pass filter in matlab?

I'm having trouble figuring out how to pass a signal into a low pass filter using MATLAB.

I am given a .wav file and am following instructions on how to remove high frequency noise compenents from taking the Discrete Fourier Transform(DFT) of the audio signal. The idea is that there is a secret message in the .wav file that is currently being hidden by a lot of unwanted frequency noise. I am supposed to get rid of said noise.

My script is currently as follows:
y = y(:.1);
plot(y) NFFT = length(y);                             % number of discrete points
Y = fftshift(fft(y,NFFT));                               % DFT of the audio signal
F = ((-1:2/NFFT:1-2/NFFT)*Fs);                 % Range of the frequency of the audio file
magnitude_Y = abs(Y);                                % Magnitude of DFT
phase_Y = unwrap(angle(Y));                      % Phase of DFT

I'm supposed to plot the magnitude and phase and explain any trends in the plots.

plot(magnitude_Y,F)
plot(phase_Y,F)

At this point, I am supposed to remove the high-frequency components that are unwanted by setting them to zero. Which is apparently done via low-pass filtering. This is where I am having trouble. I have seeked help on this and came across commands such as using butter, fft, etc. I have no idea how to use those functions and don't even know if that is the right way of approaching my problem.

So again, I would like help on passing this signal(DFT) into a low-pass filter to get rid of unwanted noise. Thanks.

Audio signal in question - Warning, the sound isn't pleasant to listen to. Would recommend lowering your volume.

• Multiple your DFT by a vector with the filter response you desire and then ifft. Commented May 15, 2017 at 15:44