|
|
@ -366,4 +366,144 @@ clear clearVars |
|
|
|
clear -regexp ^high_pass_prototype_ |
|
|
|
clear -regexp ^geffe_ |
|
|
|
clear -regexp ^transformation_ |
|
|
|
% ========== POLES TRANSFORMATION END ========== |
|
|
|
% ========== POLES TRANSFORMATION END ========== |
|
|
|
|
|
|
|
%% ========== ZEROS-POLES GROUPING START ========== |
|
|
|
|
|
|
|
% Grouping is done "by hand". |
|
|
|
|
|
|
|
% ------------------------------------------------------------------------- |
|
|
|
% Unit 1 has a pole pair with ±73.41 degrees of angle, Q equal to 1.751, |
|
|
|
% the pole pair lies on a circle with a radius equal to 21505.94 and is |
|
|
|
% grouped with a zero at 0.0 + 15707.96 i, resulting in a high pass notch. |
|
|
|
% ------------------------------------------------------------------------- |
|
|
|
% Unit 2 has a pole pair with ±73.41 degrees of angle, Q equal to 1.751, |
|
|
|
% the pole pair lies on a circle with a radius equal to 11473.11 and is |
|
|
|
% grouped with a zero at 0.0 + 15707.96 i, resulting in a low pass notch. |
|
|
|
% ------------------------------------------------------------------------- |
|
|
|
% Unit 3 has a pole pair with ±87.73 degrees of angle, Q equal to 12.67, |
|
|
|
% the pole pair lies on a circle with a radius equal to 19957.29 and is |
|
|
|
% grouped with a zero at 0.0 + 15707.96 i, resulting in a high pass notch. |
|
|
|
% ------------------------------------------------------------------------- |
|
|
|
% Unit 4 has a pole pair with ±87.73 degrees of angle, Q equal to 12.67, |
|
|
|
% the pole pair lies on a circle with a radius equal to 12363.40 and is |
|
|
|
% grouped with a zero at 0.0 + 15707.96 i, resulting in a low pass notch. |
|
|
|
% ------------------------------------------------------------------------- |
|
|
|
|
|
|
|
% Two low pass notch units are required to implement the desired band |
|
|
|
% elimination filter. |
|
|
|
|
|
|
|
% ========== ZEROS-POLES GROUPING END ========== |
|
|
|
|
|
|
|
%% ========== UNITS IMPLEMENTATION START ========== |
|
|
|
% AEM(3) = 6, so the circuits shown in 7.21 and 7.23 are going to be used |
|
|
|
% for the low pass notch units. |
|
|
|
|
|
|
|
% High pass notch units 1 and 3 |
|
|
|
% Initializes necessary arrays, each array is 1X2, the first element (1,1) |
|
|
|
% corresponds to the first unit (unit 1) and the second element (1,2) to |
|
|
|
% second unit (unit 3). |
|
|
|
high_pass_notch_units_k1 = zeros([1 2]); |
|
|
|
high_pass_notch_units_k2 = zeros([1 2]); |
|
|
|
high_pass_notch_units_gain_high = zeros([1 2]); |
|
|
|
high_pass_notch_units_C = zeros([1 2]); |
|
|
|
high_pass_notch_units_C1 = zeros([1 2]); |
|
|
|
high_pass_notch_units_R1 = zeros([1 2]); |
|
|
|
high_pass_notch_units_R2 = zeros([1 2]); |
|
|
|
high_pass_notch_units_R3 = zeros([1 2]); |
|
|
|
high_pass_notch_units_R4 = zeros([1 2]); |
|
|
|
high_pass_notch_units_frequency_scale_factors = zeros([1 2]); |
|
|
|
high_pass_notch_units_amplitude_scale_factors = zeros([1 2]); |
|
|
|
high_pass_notch_units_transfer_functions = [tf(1) tf(1)]; |
|
|
|
|
|
|
|
for i=1:2 |
|
|
|
unit_index = i*2-1; |
|
|
|
% Calculates k1 design parameter using the eq. 7-135 |
|
|
|
high_pass_notch_units_k1(1,i) = ... |
|
|
|
band_elimination_poles_radial_frequencies(1,unit_index)^2/ ... |
|
|
|
abs(band_elimination_transfer_function_zeros(1,i))^2-1; |
|
|
|
% Calculates k2 design parameter using the eq. 7-136 |
|
|
|
temp = (2+high_pass_notch_units_k1(1,i))* ... |
|
|
|
band_elimination_poles_Q(1,unit_index)^2; |
|
|
|
high_pass_notch_units_k2(1,i) = temp/(temp+1); |
|
|
|
% Calculates k (unit's gain at high frequencies) using the eq. 7-137 |
|
|
|
high_pass_notch_units_gain_high(1,i) = high_pass_notch_units_k2(1,i)* ... |
|
|
|
(band_elimination_poles_radial_frequencies(1,unit_index)^2/ ... |
|
|
|
abs(band_elimination_transfer_function_zeros(1,i))^2); |
|
|
|
% Calculates R2 using the eq. 7-138 |
|
|
|
high_pass_notch_units_R2(1,i) = band_elimination_poles_Q(1,unit_index)^2* ... |
|
|
|
(high_pass_notch_units_k1(1,i)+2)^2; |
|
|
|
% Assumes that R3 is 1 Ohm and the radial frequency is 1 rad/s |
|
|
|
high_pass_notch_units_R3(1,i) = 1; |
|
|
|
% Calculates R4 using the eq. 7-139 |
|
|
|
high_pass_notch_units_R4(1,i) = (high_pass_notch_units_k1(1,i)+2)* ... |
|
|
|
band_elimination_poles_Q(1,unit_index)^2; |
|
|
|
% Calculates C using the eq. 7-140 |
|
|
|
high_pass_notch_units_C(1,i) = 1/ ... |
|
|
|
(band_elimination_poles_Q(1,unit_index)* ... |
|
|
|
(high_pass_notch_units_k1(1,i)+2)); |
|
|
|
% Initial axioms of the design were: |
|
|
|
% C1 = k1 * C |
|
|
|
high_pass_notch_units_C1(1,i) = high_pass_notch_units_k1(1,i)* ... |
|
|
|
high_pass_notch_units_C(1,i); |
|
|
|
% R1 = 1 Ohm |
|
|
|
high_pass_notch_units_R1(1,i) = 1; |
|
|
|
|
|
|
|
% Selects the appropriate frequency scale factor to transfer the |
|
|
|
% normalized radial frequency back to the original |
|
|
|
high_pass_notch_units_frequency_scale_factors(1,i) = ... |
|
|
|
band_elimination_poles_radial_frequencies(1,unit_index); |
|
|
|
% AEM(3) = 6, so the magnitude scaling will be performed to achieve a |
|
|
|
% capacitor value of 0.1uF using the eq. 6-33 |
|
|
|
high_pass_notch_units_amplitude_scale_factors(1,i) = ... |
|
|
|
high_pass_notch_units_C(1,i)/ ... |
|
|
|
(high_pass_notch_units_frequency_scale_factors(1,i)*0.1*10^(-6)); |
|
|
|
|
|
|
|
% Performs scaling |
|
|
|
high_pass_notch_units_R1(1,i) = high_pass_notch_units_R1(1,i)* ... |
|
|
|
high_pass_notch_units_amplitude_scale_factors(1,i); |
|
|
|
high_pass_notch_units_R2(1,i) = high_pass_notch_units_R2(1,i)* ... |
|
|
|
high_pass_notch_units_amplitude_scale_factors(1,i); |
|
|
|
high_pass_notch_units_R3(1,i) = high_pass_notch_units_R3(1,i)* ... |
|
|
|
high_pass_notch_units_amplitude_scale_factors(1,i); |
|
|
|
high_pass_notch_units_R4(1,i) = high_pass_notch_units_R4(1,i)* ... |
|
|
|
high_pass_notch_units_amplitude_scale_factors(1,i); |
|
|
|
high_pass_notch_units_C(1,i) = high_pass_notch_units_C(1,i)/ ... |
|
|
|
(high_pass_notch_units_frequency_scale_factors(1,i)* ... |
|
|
|
high_pass_notch_units_amplitude_scale_factors(1,i)); |
|
|
|
high_pass_notch_units_C1(1,i) = high_pass_notch_units_C1(1,i)/ ... |
|
|
|
(high_pass_notch_units_frequency_scale_factors(1,i)* ... |
|
|
|
high_pass_notch_units_amplitude_scale_factors(1,i)); |
|
|
|
|
|
|
|
% Builds unit's transfer function |
|
|
|
high_pass_notch_unit_numerator = [1 ... |
|
|
|
0 ... |
|
|
|
1/(high_pass_notch_units_R2(1,i)*high_pass_notch_units_C(1,i)^2* ... |
|
|
|
(high_pass_notch_units_k1(1,i)+1))]; |
|
|
|
high_pass_notch_unit_denominator = [1 ... |
|
|
|
(2+high_pass_notch_units_k1(1,i))/ ... |
|
|
|
(high_pass_notch_units_R2(1,i)*high_pass_notch_units_C(1,i)) ... |
|
|
|
1/(high_pass_notch_units_R2(1,i)*high_pass_notch_units_C(1,i)^2)]; |
|
|
|
|
|
|
|
high_pass_notch_units_transfer_functions(1,i) = tf( ... |
|
|
|
high_pass_notch_unit_numerator, high_pass_notch_unit_denominator); |
|
|
|
high_pass_notch_units_transfer_functions(1,i) = ... |
|
|
|
high_pass_notch_units_transfer_functions(1,i)* ... |
|
|
|
high_pass_notch_units_gain_high(1,i); |
|
|
|
end |
|
|
|
|
|
|
|
plot_transfer_function(high_pass_notch_units_transfer_functions(1,1)); |
|
|
|
%ltiview(high_pass_notch_units_transfer_functions(1,1)); |
|
|
|
|
|
|
|
%{ |
|
|
|
ltiview(high_pass_notch_units_transfer_functions(1,1), ... |
|
|
|
high_pass_notch_units_transfer_functions(1,2), ... |
|
|
|
series(high_pass_notch_units_transfer_functions(1,1), ... |
|
|
|
high_pass_notch_units_transfer_functions(1,2))); |
|
|
|
%} |
|
|
|
|
|
|
|
% ========== UNITS IMPLEMENTATION END ========== |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|