Hey, Huijia Ma,
I understand that you want to achieve the filter response, using three RC low pass filters with a cut-off frequency of 450 Hz in a cascaded manner, along with a twin-tee notch filter centered at 800 Hz, as evident from the figure provided in the question.
Here is a possible solution:
- You will need to create transfer functions for each and cascade them together to achieve the overall response.
- To cascade three LPFs, you can raise the transfer function of one R-C LPF to the third power.
An example code for your reference is:
C = 1 / (2 * pi * fc * R);
H_lpf = tf([1], [R * C, 1]);
H_lpf_cascaded = H_lpf^3;
omega_notch = 2 * pi * fc_notch;
H_notch = tf([1, 0, omega_notch^2], [1, 2 * zeta * omega_notch, omega_notch^2]);
H_overall = H_lpf_cascaded * H_notch;
f = logspace(0, 5, 10000);
[mag, ~, w] = bode(H_overall, 2 * pi * f);
semilogx(f, 10*log10(psd));
xlabel('Frequency [Hz]');
title('PSD of the filter response');
line([fc_notch fc_notch], ylim, 'Color', 'red', 'LineStyle', '--');
text(fc_notch, 10*log10(psd(round(end/2))), ' Notch Frequency', 'Color', 'red', 'HorizontalAlignment', 'left');
You can refer to the following documentation for more information on the functions “tf” , “bode” and “squeeze” respectively:
- https://www.mathworks.com/help/releases/R2022b/control/ref/tf.html
- https://www.mathworks.com/help/releases/R2022b/control/ref/lti.bode.html
- https://www.mathworks.com/help/releases/R2022b/matlab/ref/squeeze.html
I hope this helps!