Main Content

horizontalBathtub

Horizontal bathtub curve

Description

example

s = horizontalBathtub(ed) returns a structure containing information of horizontalBathtub curve for the System object™.

Note

This method is available when both of these conditions apply:

  • EnableMeasurements is true

  • ShowBathtub is 'Horizontal' or 'Both'

Examples

collapse all

Display the eye diagram for a waveform having dual-dirac and random jitter. Generate and plot the horizontal and vertical bathtub curves.

Specify the sample rate, the samples per symbol, and the number of traces parameters.

fs = 1000;
sps = 200;
numTraces = 1000;

Create an eye diagram object.

ed = comm.EyeDiagram('SampleRate',fs,'SamplesPerSymbol',sps, ...
    'SampleOffset',sps/2,'DisplayMode','2D color histogram', ...
    'ColorScale','Logarithmic','EnableMeasurements',true, ...
    'ShowBathtub','Both','YLimits',[-1.2 1.2]);

Generate a waveform having dual-dirac and random jitter. Specify 3 ms rise and fall times.

src = commsrc.pattern('SamplesPerSymbol',sps, ...
    'RiseTime',3e-3,'FallTime', 3e-3);
src.Jitter = commsrc.combinedjitter('RandomJitter','on', ...
    'DiracJitter','on','DiracDelta',[-5e-04 5e-04],'RandomStd',2e-4);

Generate two symbols for each trace.

x = src.generate(numTraces*2);

Pass the signal through an AWGN channel with a fixed seed for repeatable results.

randStream = RandStream('mt19937ar','Seed',5489);
y = awgn(x,30,'measured',randStream);

Display the eye diagram.

ed(y)

Eye diagram showing horizontal and vertical bathtubs and measurements

Generate the horizontal bathtub data for the eye diagram. Plot the curve.

hb = horizontalBathtub(ed)
semilogy([hb.LeftThreshold],[hb.BER],'b', ...
    [hb.RightThreshold],[hb.BER],'b')
grid
hb = 

  1x13 struct array with fields:

    BER
    LeftThreshold
    RightThreshold

Horizontal bathtub data for the eye diagram

Generate the vertical bathtub data for the eye diagram. Plot the curve.

vb = verticalBathtub(ed)
semilogx([vb.BER],[vb.LowerThreshold],'b', ...
    [vb.BER],[vb.UpperThreshold],'b')
grid
vb = 

  1x13 struct array with fields:

    BER
    UpperThreshold
    LowerThreshold

Vertical bathtub data for the eye diagram

Input Arguments

collapse all

Eye Diagram System object, where you get the bathtub curve information from.

Output Arguments

collapse all

Structure containing information about the horizontal bathtub curve.

Bit error rate values, mapped on the Y-axis of the horizontalBathtub plot against the corresponding LeftThreshold and RightThreshold values on the x-axis, specified as a scalar.

Data Types: double

Left threshold values, mapped on the x-axis in the plot against corresponding BER values on the x-axis.

Data Types: double

Right threshold values, mapped on the x-axis in the plot against corresponding BER values on the x-axis.

Data Types: double

Introduced in R2016b