# Matlab Spectra Plot : Convolution with Low-Pass Filter

Lpf = ones(1,10);

y=abs(fft([lpf zeros(1,246)]));

Create a signal consisting of a 500 and 1000Hz cosine sampled t 10kHz.

fs= 10e3;

t =(0:1:0.02*fs);

f1=500;

f2=1000;

s=cos(2*pi*t*f1/fs)+cos(2*pi*t*f2/fs);

Plot the convolution of the signal with lpf, from the command filtered=conv(s,lpf)

**Plot the magnitude of the spectra of the pre and post filtered signals. Explain your results in terms of the spectrum of the signals and of the filter**

**This is the part I need help with.

Â© BrainMass Inc. brainmass.com March 4, 2021, 7:04 pm ad1c9bdddfhttps://brainmass.com/math/trigonometry/matlab-spectra-plot-convolution-with-low-pass-filter-80188

#### Solution Preview

lpf = ones(1,10);

y=abs(fft([lpf zeros(1,246)]));

Create a signal consisting of a 500 and 1000Hz cosine sampled t 10kHz.

fs= 10e3;

t =(0:1:0.02*fs);

f1=500;

f2=1000;

s=cos(2*pi*t*f1/fs)+cos(2*pi*t*f2/fs);

Plot the convolution of the signal with lpf, from the command filtered=conv(s,lpf)

**Plot the magnitude of the spectra of the pre and post filtered ...

#### Solution Summary

A Matlab Spectra Plot and Convolution with Low-Pass Filter are investigated. The solution is detailed and well presented. The response received a rating of "5/5" from the student who originally posted the question.