How to find cutoff frequency (wc) using second order low pass filter and 3rd order low pass filter.
Afficher commentaires plus anciens
function [ filtered_result_data ] = PT2_Filter( data_need_to_be_filtered, wc, k, samplingtime )
filtered_result_data(1) = data_need_to_be_filtered (1);
filtered_result_data(2) = data_need_to_be_filtered (2);
b0 = wc^2 *samplingtime^2; %* 0.0001^2;
a0 = b0 + 4 * k * wc *samplingtime + 4; %* 0.0001 + 4;
a1 = 2 * b0 - 8;
a2 = b0 - 4 * k * wc *samplingtime + 4; %* 0.0001 + 4;
for i = 3:length(data_need_to_be_filtered)
filtered_result_data(i) = 1/a0 * ( b0 *( data_need_to_be_filtered(i)...
+ 2*data_need_to_be_filtered(i-1)+data_need_to_be_filtered(i-2) ) ...
- a1 * filtered_result_data(i-1) -a2 * filtered_result_data(i-2));
end
I am using this 2nd order low pass filter to filter the data in Matlab app. for that I need to write angular cutoff frequency(wc rad/s) and damping factor(k) and sampling time (from txt file) and it uses cutoff frequency(Hz) to filter the data. For example, right now i am using wc=608rad/s k = 0.707 and calculated frequncy I got cutoff frequency(fc) around 96 Hz (using formula wc=2*pi*fc). but I want to do reverse procedure like If I use dropdown menu and put some cutoff frequency like 50 Hz, 70 Hz etc. By selecting specific cutoff frequency what will I get angular cutoff frequency(wc) in matlab workspace or textbox of matlab app? Also, Code for, if we use 3rd order low pass filter to filter the data and find wc using 3rd order low pas filter. if anyone know how to write code for both filter, it would be very helpful.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!