MATLAB: Can I specify a frequency-dependent IP3 parameter in the RF Blockset

blocksetip3RFRF Toolboxs-parameters

I am using the s-Parameters Mixer in the RF Blockset 2.0 (R2007a) and would like to enter the IP3 parameter as a function of frequency. The block mask does not allow me to enter a vector in this field.

Best Answer

This enhancement has been incorporated in Release 2008b (R2008b). For previous product releases, read below for any possible workarounds:
To work around this issue, use the General Circuit Element block from the Black Box Elements library. Use the following command line functionality to define an RFCKT object called mixer that specifies the mixer behavior and then set the 'RFCKT object' parameter of the General Circuit Element block to the MATLAB variable mixer:
% mixer for the mask parameter ‘RFCKT object’ of the General Circuit Element block % is an RFCKT.MIXER object and should be created in MATLAB workspace:
mixer = rfckt.mixer;
% Create data objects for frequency-dependent S-parameters, spot noise and IP3:
freq = [1e9 1.4e9]; % two frequencies


sparams(:,:,1) = [-0.7247 - 0.4813i 0; -0.6857 + 1.7827i -0.0741 - 0.3216i];
sparams(:,:,2) = [-0.7318 - 0.4715i 0.0014 + 0.0005i; -0.6560 + 1.7980i -0.0761 - 0.3190i];
sparamsData = rfdata.network('Type', 'S', 'Freq', freq, 'Data', sparams);
freq = [1e9 1.4e9]; % two frequencies
fmin = [12.08 13.40]; % Minimum noise figure in dB
gopt = [0.2484-1.2102j 1.0999-0.9295j];
% "gopt" is a source reflection coefficient to realize minimum noise figure
rn = [0.26 0.45]; % Equivalent normalized noise resistance
noiseData = rfdata.noise('Freq', freq, 'FMIN', fmin, 'GAMMAOPT', gopt, 'RN', rn);
freq = [1e9 1.4e9]; % two frequencies
ip3 = [0.001 0.05]; % IP3 in Watts at two frequencies
ip3Data = rfdata.ip3('Type', 'IIP3', 'Freq', freq, 'Data', ip3);
% Set mixer’s three properties: NetworkData, NoiseData and NonlinearData with
% three data objects:
mixer.NetworkData = sparamsData
mixer.NoiseData = noiseData
mixer.NonlinearData = ip3Data