Robochameleon
v1.0
|
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 | |
![]() | |
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. | |
![]() | |
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. | |
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:
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.
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
x | input signal |
Rs | baud rate |
Fawg | signal sampling rate |
y | noisy signal |