mirror of
https://github.com/njchorda/MATLAB-Touchstone-Reader.git
synced 2026-02-25 02:50:45 -05:00
Changed s2abcd() to take in vectors
s2abcd() takes in vectors for two-port s-parameters instead of a 2x2 matrix
This commit is contained in:
10
SPARAMS.m
10
SPARAMS.m
@@ -816,11 +816,11 @@ classdef SPARAMS < handle
|
|||||||
S = [S11 S12;S21 S22];
|
S = [S11 S12;S21 S22];
|
||||||
end
|
end
|
||||||
|
|
||||||
function [A, B, C, D] = s2abcd(S, Z0)
|
function [A, B, C, D] = s2abcd(S11, S12, S21, S22, Z0)
|
||||||
A = ((1 + S(1,1)).*(1 - S(2,2)) + S(1,2).*S(2,1))./(2.*S(2,1));
|
A = ((1 + S11).*(1 - S22) + S12.*S21)./(2.*S21);
|
||||||
B = Z0*((1 + S(1,1)).*(1 + S(2,2)) - S(1,2).*S(2,1))./(2.*S(2,1));
|
B = Z0*((1 + S11).*(1 + S22) - S12.*S21)./(2.*S21);
|
||||||
C = (1/Z0)*((1 - S(1,1)).*(1 - S(2,2)) - S(1,2).*S(2,1))./(2*S(2,1));
|
C = (1/Z0)*((1 - S11).*(1 - S22) - S12.*S21)./(2*S21);
|
||||||
D = ((1 - S(1,1)).*(1 + S(2,2)) + S(1,2).*S(2,1))./(2*S(2,1));
|
D = ((1 - S11).*(1 + S22) + S12.*S21)./(2*S21);
|
||||||
end
|
end
|
||||||
|
|
||||||
function [S11, S21, S12, S22] = abcd2s(A, B, C, D, Z0)
|
function [S11, S21, S12, S22] = abcd2s(A, B, C, D, Z0)
|
||||||
|
|||||||
Reference in New Issue
Block a user