# How to filter a signal knowing the frequency response of a system in MATLAB?

I have a signal of period $T_0=8$, let's say $x(t)$, and it has the following Fourier coefficients:

$$a_k=\frac{1}{4} \mathrm{sinc}^2\left(\frac{3k}{8}\right) e^{ik\frac{\pi}{2}}$$ for $1\le|k|\le6$ and $a_k=0$ for the rest.

I also have a system which has a frequency response : $$H(j\omega)=\frac{j\omega}{j\omega+\frac{3\pi}{2}}$$

Using MATLAB, what's the best way apply this filter to this signal? I got the signal $x(t)$ from the coefficients and now I don't know how to proceed from here. I'll leave my code here:

T=8;
w0=2*pi/T;

t=0:0.001:2*T;
exp_jwt=exp(1j*w0*t);

k=-6:6;
ak=0.25*(sinc(3*k/8)).^2.*exp(1j*k*pi/2);
ak(k==0)=0;

x=zeros(size(t));
for (i=1:length(k))
x=x+ak(i).*(exp_jwt).^(k(i));
end

• You will have a transient response (because of the pole in the system), which will die out exponentially, and a "steady state" response, which will contain the same frequencies as $x(t)$ but with scaled amplitudes. – fibonatic Jun 4 '16 at 12:32
• Why do you want to solve this with Matlab? You'd have to approximate the given continuous-time system in some way. It's quite straightforward to solve this using pencil and paper. – Matt L. Jun 4 '16 at 16:10

$$x(t)=\sum_{1\le|k|\le 6}a_ke^{jk\omega_0t}\tag{1}$$
with $\omega_0=2\pi/T$.
An LTI system's response to $a_ke^{jk\omega_0t}$ simply is $H(jk\omega_0)a_ke^{jk\omega_0t}$, where $H(j\omega)$ is the system's frequency response. Consequently, the response to $x(t)$ is
$$y(t)=\sum_{1\le|k|\le 6}H(jk\omega_0)a_ke^{jk\omega_0t}\tag{2}$$
If you want to use Matlab, you could better use it to evaluate Eq. $(2)$, rather than to simulate the continuous-time system.