-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImpedance_Calculate1.m
42 lines (30 loc) · 1.19 KB
/
Impedance_Calculate1.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
% Access the RF budget object
rf_budget = evalin('base', 'RCArfbv2');
% Perform additional analysis or calculations
% For example, calculate the overall transducer gain
overall_gain = rf_budget.TransducerGain;
disp(['Overall Transducer Gain: ', num2str(overall_gain), ' dB']);
% Compute the RF budget to ensure all calculations are up-to-date
computeBudget(rf_budget);
% Inspect the NetworkData object
disp(rf_budget.Elements(1).NetworkData);
properties(rf_budget.Elements(1).NetworkData);
% Example frequency for sparameters function
freq = 4.4e9;
% Extract S-parameters using the sparameters function
s_params_obj = sparameters(rf_budget.Elements(1).NetworkData, freq);
s_params = s_params_obj.Parameters;
% Define the reference impedance (usually 50 ohms)
z0 = 50;
% Convert S-parameters to Z-parameters
z_params = s2z(s_params, z0);
% Calculate the input impedance (Z11)
input_impedance = z_params(1,1,:);
disp(['Input Impedance: ', num2str(input_impedance), ' ohms']);
% Plot the Smith chart
h = smithplot(s_params_obj);
title('Smith Chart of S-parameters at 4.4 GHz');
% Customize markers
hold on;
plot(real(input_impedance), imag(input_impedance), 'ro', 'MarkerSize', 10, 'LineWidth', 2);
hold off;