Main Content

viewGain

Plot output receiver power or output phase shift as a function of input receiver power

Since R2024a

    Description

    View signal distortion as a function of input power

    viewGain(recvr) plots the output power of the first channel of the receiver, recvr, as a function of input power into the receiver due to the gain specified by the GainMethod property.

    example

    viewGain(recvr,Type=PT) specifies the type of plot, PT. Setting PT="AmAm" plots the receiver output power as a function of input power. Setting PT="AmPm" plots the receiver output phase shift as a function of input power. The default is "AmAm".

    viewGain(recvr,Parent=hax) plots the output receiver power or phase shift on the hax axes.

    viewGain(recvr,ChannelIndex=cidx) plots the output receiver power or phase shift for the cidx channel.

    Examples

    collapse all

    Model a two-channel receiver for an LFM pulse. Construct a phased.Receiver System object™ with 20 dB Gain and set the GainMethod to "Cubic Polynomial" with an OIP3 of 30. Display the gain curve.

    fs = 10e6;
    waveform = phased.LinearFMWaveform('SampleRate',fs, ...
        'PulseWidth',1e-5,'SweepBandwidth',5e6);
    wav = waveform();
    recvr = phased.Receiver(GainMethod="Cubic polynomial", ...
        Gain=[19,25],OIP3=[11,29],PhaseOffset=[0,45]);
    y = recvr(wav);
    viewGain(recvr,'ChannelIndex',1,'Parent',gca);
    hold on
    viewGain(recvr,'ChannelIndex',2,'Parent',gca);
    legend('Channel 1, Gain = 19','Channel 2, Gain = 25', ...
        'Location','SouthEast')
    hold off

    Figure contains an axes object. The axes object with title Receiver Gain Method Plot, xlabel Input Power (dBm), ylabel Output Power (dBm) contains 2 objects of type line. These objects represent Channel 1, Gain = 19, Channel 2, Gain = 25.

    Employ a receiver using a lookup table gain model to simulate non-linear gain behavior. Specify noise using noise temperature. Display the receiver phase shift.

    Create an LFM waveform using the phased.LinearFMWaveform System object™.

    fs = 1e7;
    waveform = phased.LinearFMWaveform(SampleRate=fs,...
        PulseWidth=1e-5,SweepBandwidth=5e6);
    wav = waveform();

    Create a receiver using the phased.Receiver System object.

    pw = [-10 -5 0 5 10 15 20 25 30 35 40]';
    pw1 = ones(size(pw));
    pw2 = [-3.8 -1.9 0 1.9 3.8 5.9 8.2 10 14 18 23]';
    tbl = [pw,pw1,pw2];
    
    recvr = phased.Receiver(GainMethod="Lookup table",Table=tbl, ...
        NoiseMethod="Noise temperature", ...
        NoiseTemperature=290, ...
        SampleRate=fs);

    Pass the waveform through the receiver.

    y = recvr(wav);

    Display the receiver phase shift using viewGain.

    viewGain(recvr,Type="AmPm")

    Figure contains an axes object. The axes object with title Receiver Gain Method Plot, xlabel Input Power (dBm), ylabel Phase Shift (deg) contains an object of type line.

    Input Arguments

    collapse all

    Receiver, specified as a phased.Receiver System object.

    Plot type specified as "AmAm" or "AmPm". Use this argument with the Type property.

    Example: "AmPm"

    Data Types: char | string

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: Parent=5,ChannelIndex=3

    Parent plot axes, specified as an axes handle. When 'Parent' is not set, a new axes is created.

    Example: Parent=4

    Data Types: double

    Channel index, specified as a positive scalar.

    Example: ChannelIndex=8

    Data Types: double

    Plot type, specified as "AmAm" or "AmPm". Selecting Type="AmAm" plots the output power as a function of input power. Selecting Typo="AmPm" plots the output phase shift as a function of input power. Use this Name-value pair with the PT input argument.

    Example: Type="AmPm"

    Data Types: char | string

    Version History

    Introduced in R2024a

    expand all

    See Also