www.gusucode.com > rf 案例源码程序 matlab代码 > rf/RFchainObjectExampleExample.m

    %% RFchain object example
% 
%
%% Create an rfchain object

% Copyright 2015 The MathWorks, Inc.

rfch = rfchain;
%% Add stage 1 and stage 2 with gain, noise figure, oip3
addstage(rfch, 21, 15, 30, 'Name', 'amp1');
addstage(rfch, -5, 6, Inf, 'Name', 'filt1');
%% Add stage 3 and stage 4 with gain, noise figure, iip3
addstage(rfch, 7, 5, 'IIP3', 10, 'Name', 'lna1');
addstage(rfch, 12, 14, 'IIP3', 20, 'Name', 'amp2');
%% Calculate the gain, noise figure, oip3, iip3 of each stage
g = cumgain(rfch);
nf = cumnoisefig(rfch);
oip3val = cumoip3(rfch);
iip3val = cumiip3(rfch);
%% View the results on a table and plot it
worksheet(rfch)
figure
plot(rfch)