Unlike RF Blockset which has a 'Coupler' block for Simulink, there is no four port device rfckt object. In RF Toolbox, rfckt circuit objects are designed for chain of objects, i.e. we are limited to two port networks. As a workaround, if you could represent the Coupler as a 2 port network touchstone file, it will be possible to read the file and create a 'rfckt.passive' element with it. And then we can continue do the RF analysis on that network.
Please refer to the sample scripts below demonstrating this using two approaches -
1. Use the 'nport' object which reads both S-parameters and noise data from a Touchstone file. Then cascade them using an 'rfbudget' object. This sample script is the recommended and approach and it uses some functions which were released in MATLAB R2017a.
S3 = sparameters('default.s3p');
Coupler to to 2-port nport
S2 = snp2smp(S3);
rfwrite(S2, 'coupler2port.s2p')
Coupler2port = nport('coupler2port.s2p');
ckt1 = nport('default.s2p');
ckt_cascade = rfbudget([Coupler2port ckt1],[2e9:1e9:10e9],-30,10);
show(ckt_cascade);
To export the network into Simulink, i.e. RF Blockset please uncomment and execute the command below
2. Use the 'rfckt.amplifier' object which contains both S-parameter and noise data. Then cascade them using 'rfckt.cascade'. This approach is not recommended, as it might be not available in future releases.
ckt = read(rfckt.passive,'default.s3p');
s3p = ckt.NetworkData.Data;
Z0 = ckt.NetworkData.Z0;
Coupler to to 2-port rfckt.amplifier
s2p = snp2smp(s3p,Z0);
rfwrite(s2p,ckt.NetworkData.Freq,'coupler2port_ckt.s2p')
Coupler2port = read(rfckt.amplifier,'coupler2port_ckt.s2p');
ckt1 = read(rfckt.amplifier,'default.s2p');
ckt_cascade = rfckt.cascade('Ckts', {Coupler2port, ckt1});
analyze(ckt_cascade, 2.9e9)
Best Answer