Robochameleon  v1.0
Public Member Functions | Public Attributes | List of all members
SNR_v1 Class Reference

Signal-to-noise (SNR) loading block. More...

Inherits unit.

Public Member Functions

function SNR_v1 (in param)
 class constructor
 
function addNoise (in obj, in x, in Rs, in Fawg)
 Add noise. More...
 
function traverse (in obj, in sig)
 main function
 
- Public Member Functions inherited from unit
function traverseNode (in obj)
 Set unique ID when creating a unit. More...
 
function connectOutput (in obj, in uobj, in unitOutput, in nextUnitInput)
 Specify where signal should go next. More...
 
function connectOutputs (in obj, in units, in destInputs)
 Specify where signal should go next. More...
 
function writeInputBuffer (in obj, in sig, in inputId)
 write input buffer
 
function horzcat (in varargin)
 horizontal concatenation
 
function vertcat (in varargin)
 vertical concatenation
 
function setparams (in obj, in params, in REQUIRED_PARAMS, in QUIET_PARAMS)
 set parameters More...
 
function view (in obj)
 Show interactive GUI through unit_view-class.
 

Public Attributes

Property nInputs
 Number of inputs.
 
Property nOutputs
 Number of outputs.
 
Property SNR
 Desired SNR (per bit) in dB.
 
Property M
 Constellation order.
 
- Public Attributes inherited from unit
Property inputBuffer
 Buffer for storing inputs as we traverse the graph.
 
Property nextNodes
 Children nodes.
 
Property destInputs
 Destination inputs in children.
 
Property results
 For storing results.
 
Property label
 
Property draw
 enable/disable plotting
 
Property nInputs
 Number of signals traverse expects.
 
Property nOutputs
 Number of outputs traverse expects.
 

Detailed Description

Signal-to-noise (SNR) loading block.

Adds noise based on desired SNR per bit and constellation order.

All the input power is considered signal power. If you need to set the SNR to a particular value, for now, use OSNR_v1 with appropriate parameters instead. This block is meant for easy comparison to theory.

Example:

param = struct('SNR', 20, 'M', 4);
snr = SNR_v1(param);
param.sig.L = 10e6;
param.sig.Fs = 64e9;
param.sig.Fc = 193.1e12;
param.sig.Rs = 10e9;
param.sig.PCol = [pwr(20,{-2,'dBm'}), pwr(-inf,{-inf,'dBm'})];
E = rand(1000,2);
sIn = signal_interface(E, param.sig);
sOut = snr.traverse(sIn);
sOut.P.getOSNR(sOut)

This will generate a signal (in this example, of noise), then add more noise to it using snr. The optical SNR (OSNR) is then calculated using pwr::getOSNR. This is not the most effective way to convert SNR to OSNR, just an example.

See also
OSNR_v1
Author
Miguel Iglesias Olmedo
Version
1

Definition at line 36 of file SNR_v1.m.

Member Function Documentation

function SNR_v1::addNoise ( in  obj,
in  x,
in  Rs,
in  Fawg 
)

Add noise.

This function was copied from an older version of the code

Parameters
xinput signal
Rsbaud rate
Fawgsignal sampling rate
Return values
ynoisy signal

The documentation for this class was generated from the following file: