Main Content

rfwrite

Write RF network data to Touchstone®file

Description

example

rfwrite(数据,freq,filename)creates a Touchstone data

file,filename.rfwritetouchstone files output 16 digits.

Note

RF Toolbox™ does not support Touchstone 2.0 files.

example

rfwrite(netobj,filename)creates a Touchstone file from a network parameter object,netobj.

example

rfwrite(_____,Name,Value)creates a Touchstone file using the options specified in the name-value pair arguments for the file specified infilename. For example,rfwrite(S150,'passive150.s2p','FrequencyUnit','MHz')writes Touchstone filepassive150.s2pin MHz using the S-parameters stored in the variable,S150.

Examples

collapse all

Write a new Touchstone file from filedefault.s2pusing data and frequency values. The output is stored indefaultnew.s2p.

S50 =sparameters('default.s2p'); data = S50.Parameters; freq = S50.Frequencies; rfwrite(data, freq,'defaultnew.s2p')

Convert an existing Touchstone filepassive.s2pto S-parameters with a new resistance value.

S50 =sparameters('passive.s2p'); S100 = newref(S50,100);

Write a Touchstone filepassive100.s2pusing the new S-parameters.

rfwrite(S100,'passive100.s2p');

Convert an existing Touchstone filepassive.s2pto S-parameters with a new resistance value.

S50 =sparameters('passive.s2p'); S150 = newref(S50,150);

Write a Touchstone filepassive150.s2pinMHzusing the new S-parameters.

rfwrite(S150,'passive150.s2p','FrequencyUnit','MHz');

Convert an existing Touchstone filepassive.s2pto Y-parameters.

Y50 = yparameters('passive.s2p');

Write a Touchstone filepassive.y2pinMHzusing the new Y-parameters.

rfwrite(Y50,'passive.y2p','FrequencyUnit','MHz');

Input Arguments

collapse all

Number of ports and frequencies, specified as anN-by-N-by-Kmatrix, to create Touchstone file.Nis the number of ports of data to be written.Kis the number of frequencies.

Data Types:double
Complex Number Support:Yes

Value of frequencies, specified as a numeric vector of lengthK, represents the value of frequencies in Hz.

Data Types:double

Name of a Touchstone file, specified as a character vector.

Example:default.s2p

Data Types:char|string

Network parameter object, specified as a scalar, to create Touchstone file. Thenetobjcan be any one of the following types S-parameters, Y-parameters, Z-parameters, h-parameters, g-parameters, or ABCD-parameters.

Data Types:double
Complex Number Support:Yes

Name-Value Arguments

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, whereNameis the argument name andValueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

Example:rfwrite(S150,'passive150.s2p','FrequencyUnit','MHz')

Scaling unit for frequency value, specified as a comma-separated pair consisting of'Frequency Unit'和任何一个值所示值的总结。

Example:'FrequencyUnit','MHz'

Data Types:double

Network parameter type, specified as a comma-separated pair consisting of'Parameter'和任何一个值所示值的总结。This pair determines the parameter type the data has to be converted into in the Touchstone file.

Example:'Parameter','Z'

Data Types:double
Complex Number Support:Yes

File storage format, specified as a comma-separated pair consisting of'Format'和任何一个值所示值的总结。This pair determines the format to store the Touchstone file.

Example:'Format', 'MA'

Reference resistance, specified as a comma-separated pair consisting of'ReferenceResistance'and a positive scalar.

Example:'ReferenceResistance',100

Data Types:double

Flag to suppress the warning message while overwriting an existing file, specified as a comma-separated pair consisting of'ForceOverwrite'and a logical value. Set'ForceOverwrite'to true, to overwrite thefilenamewithout a warning message.

Example:'ForceOverwrite',true

Data Types:double

Version History

Introduced in R2014a