I have two signals
>> t = linspace(0, 10, 10000); % 0 to 10 seconds
>> u1 = 30*sin(2*pi*5*t); % Sine signal 1
>> u2 = 10*sin(2*pi*90*t); % Sine signal 2
>> u = u1 + u2; % Combine
>> spa(u, t); % Spectral analysis
>> grid on
And the spectral analysis shows these two signals u1
and u2
Now I want to filter the signal u
by using a RC-filter
$$G(s) = \frac{1}{RCs + 1}$$
I say that at 90 Hz
, I'm going to reduce the amplitude of the u2
sine signal with 50%, also half. 90 Hz is $s = 2\pi90$ radians.
So I put in the $s$ inside $G(s)$
$$G(2\pi90) = 0.5 = \frac{1}{RC2\pi90 + 1}$$
And now trying to solve $RC$
$$RC = \frac{1-0.5}{0.5*2\pi90} = 1.7684*10^{-3}$$
Assume that we are using $R = 1 kOhm$ and $C = 1.7684 uF$.
So I created my transfer function i MALTAB / Octave and plotted the bode diagram
>> R = 1000;
>> C = 1.7684e-06;
>> G = tf(1, [R*C 1]) % Transfer function
G =
scalar structure containing the fields:
num = 1
den =
1.7684e-03 1.0000e+00
delay = 0
tfnum = 1
tfdash = ---------------
tfden = 0.0017684s + 1
type = TF
sampleTime = 0
>> bode(G, 0, 600); % From 0 rad/s to a little bit over 2*pi*90 rad/s. As you can see, at ` 2*pi*90 = 565.49 rad/s`, I have `-3 dB`, that's `0.7079` in magnitude.
I do linear simulation of my transfer function and the spectral analysis. As you can see, why has not the amplitude of the peak of 90 Hz become half?
>> y = lsim(G, u, t);
>> spa(y, t); % Spectral analysis