Skip to content

Commit

Permalink
deploy: 9427b1d
Browse files Browse the repository at this point in the history
  • Loading branch information
ojdf committed Nov 13, 2023
0 parents commit afa8a41
Show file tree
Hide file tree
Showing 65 changed files with 9,238 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 82e8d32d00aa170127c2acddb1ff6620
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.
Binary file added .doctrees/autoapi/fast/comms/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/fast/conf/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/fast/fast/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/fast/funcs/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/fast/index.doctree
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/autoapi/index.doctree
Binary file not shown.
Binary file added .doctrees/configuration.doctree
Binary file not shown.
Binary file added .doctrees/environment.pickle
Binary file not shown.
Binary file added .doctrees/index.doctree
Binary file not shown.
Binary file added .doctrees/install.doctree
Binary file not shown.
Binary file added .doctrees/output.doctree
Binary file not shown.
Empty file added .nojekyll
Empty file.
54 changes: 54 additions & 0 deletions _sources/autoapi/fast/ao_power_spectra/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
:py:mod:`fast.ao_power_spectra`
===============================

.. py:module:: fast.ao_power_spectra
Module Contents
---------------

.. py:function:: zernike_ft(fabs, phi, D, n_noll)
.. py:function:: zernike_filter(fabs, fx, fy, D, n_noll, n_noll_start=1, gamma=None)
.. py:function:: zernike_squared_filter(fabs, fx, fy, D, n_noll, n_noll_start=1, gamma=None, plusminus=False)
.. py:function:: piston_gtilt_filter(fabs, fx, fy, D)
.. py:function:: piston_filter(fabs, D)
.. py:function:: tiptilt_filter(fabs, D)
.. py:function:: piston_tiptilt_filter(fabs, D)
.. py:function:: mask_lf(freq, d_WFS, modal=False, modal_mult=1, Zmax=None, D=None, Gtilt=False)
.. py:function:: mask_hf(freq, d_WFS, modal=False, modal_mult=1, Zmax=None, D=None, Gtilt=False)
.. py:function:: Jol_noise_openloop(freq, Dsubap, noise_variance, lf_mask)
.. py:function:: Jol_alias_openloop(freq, Dsubap, p, lf_mask, v=None, Delta_t=None, wvl=None, lmax=10, kmax=10, L0=numpy.inf, l0=1e-06)
.. py:function:: G_AO_PAOLA(freq, mask, mode='AO', h=None, v=None, dtheta=[0, 0], Tx=None, wvl=None, Zmax=None, tl=0, Delta_t=0, Dsubap=None, modal=False, modal_mult=1)
.. py:function:: logamp_powerspec(freq, h, cn2, wvl, pupilfilter=None, layer=True, L0=numpy.inf, l0=1e-06)
.. py:function:: DM_transfer_function(fx, fy, fabs, mode, Zmax=None, D=None, dsubap=None)
.. py:function:: G_AO_PAOLA_closedloop(fx, fy, fabs, h, dtheta=[0, 0], Delta_t=0.0, tl=0.0, gloop=1.0, v=None, dsubap=None, DM='perfect', Zmax=None, D=None, nu=1, modal=False, modal_mult=1)
202 changes: 202 additions & 0 deletions _sources/autoapi/fast/comms/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
:py:mod:`fast.comms`
====================

.. py:module:: fast.comms
.. autoapi-nested-parse::

Functions regarding optical communications



Module Contents
---------------

.. py:data:: logger
.. py:class:: Modulator(power, modulation, EsN0=None, symbols_per_iter=1000, data=None)
Takes array of optical powers and modulates/demodulates according to a modulation
scheme (OOK, BPSK, QPSK, QAM, etc) with random bits. Can add AWGN at a given
average signal-to-noise ratio.

This allows Monte Carlo computation of bit error rate or symbol error probability.

Parameters:
power (numpy.ndarray): array of optical powers
modulation (string): modulation scheme
EsN0 (float, optional): (average) symbol signal to noise ratio
symbols_per_iter (int, optional): Number of symbols per iteration of FAST.
Defaults to 1000.

.. py:method:: generate_symbols()
.. py:method:: modulate()
.. py:method:: demodulate()
.. py:method:: compute_sep()
Symbol error probability, from random bits


.. py:method:: compute_evm()
Error Vector Magnitude (EVM), from random bits


.. py:method:: run()
.. py:class:: FastFSOC(*args, **kwargs)
Subclass of Fast simulation object, adds optical comms functionality
(modulation, demodulation, generating random symbol sequences for testing)

.. py:method:: run()
.. py:method:: make_header(params)
.. py:function:: fade_prob(I, threshold, min_fades=30)
.. py:function:: fade_dur(I, threshold, dt=1, min_fades=30)
.. py:function:: ber_ook(EbN0, samples=None)
Bit Error Rate for On-Off-Keying communications channel.

Monte Carlo integration of Eq. 58 from Andrews and Phillips (2005) Ch 11.
Note that electrical SNR per bit (Eb/N0) is used, not OSNR as in A+P.

Args:
EbN0 (float): average signal-to-noise ratio per bit Eb/N0 in electrical domain, dB
samples (numpy.ndarray, optional): random samples of received power from FAST.
If None is provided, assume no atmosphere (i.e. intensity pdf = delta function)

Returns:
Bit error rate for OOK


.. py:function:: sep_qam(M, EsN0, samples=None)
Symbol error probabilty for square M-ary QAM, from Rice.

Parameters:
M (int): Number of symbols (must be perfect square)
EsN0 (float): Average electrical symbol signal-to-noise ratio [dB]
samples (numpy.ndarray, optional): random samples of received power from FAST.


.. py:function:: ber_qam(M, EbN0, samples=None)
Bit error rate for square M-ary QAM, from Rice. Assumes only nearest neighbour
bit errors and Gray coding, i.e. 1 bit error per symbol error.

Parameters:
M (int): Number of symbols (must be perfect square)
EbN0 (float): Average electrical signal-to-noise ratio per bit [dB]
samples (numpy.ndarray, optional): random samples of received power from FAST.


.. py:function:: Q(x)
Q function from Rice book


.. py:function:: generalised_mutual_information_qam(samples, M, npxls, EsN0, N0=None, shot=False)
Generalised Mutual Information (GMI), adapted from Alvarado et al (2016)
[10.1109/JLT.2015.2450537] and Cho et al (2017) [10.1109/ECOC.2017.8345872].

Assumes
1) Perfect interleaving (no correlation between bits)
2) Bit-wise decoder (no memory of other bits sent)
3) Gray encoding of QAM symbols
4) Soft decision decoding with FEC

Args:
samples (numpy.ndarray): Array of Monte Carlo complex field measurements or amplitudes
M (int): number of symbols (must be perfect square)
npxls (int): Number of pixels to use for binning
EsN0 (float): Symbol signal-to-noise ratio [dB]
N0 (float, optional): Noise variance (overrides EsN0, can be set to 0)

Returns:
GMI (float): the generalised mutual information value, in bits/symbol


.. py:function:: mutual_information_qam(samples, M, npxls, EsN0, N0=None, shot=False)
Equation 16 from Alvarado et al (2016) 10.1109/JLT.2015.2450537.

This is for a memoryless receiver (no knowledge of other bits transmitted)


.. py:function:: convolve_awgn_qam(samples, M, npxls, EsN0, N0=None, region_size='individual', shot=False)
Method of computing received I-Q plane for M-ary QAM under AWGN assumptions
given a series of complex field measurements.

Bins the Monte Carlo field measurements into a 2D array of npxls x npxls bins.
The overall size of the 2d array is determined by the decision region size,
which depends on the M-ary QAM constellation. This is then convolved with a
gaussian to include AWGN.

By integrating this distribution, and averaging over all constellation regions,
we can obtain the probability that a transmitted symbol ends up outside the
decision region, i.e. a symbol error. This [may be] more robust than simply
adding AWGN to the individual Monte Carlo datapoints, because that method
is limited by the number of samples.

Args:
samples (numpy.ndarray): Array of Monte Carlo complex field measurements or amplitudes
M (int): number of symbols (must be perfect square)
npxls (int): Number of pixels to use for binning
EsN0 (float): Symbol signal-to-noise ratio [dB]
N0 (float, optional): Noise variance (overrides EsN0, can be set to 0)
separate (bool, optional): Separate each region of the constellation (default: True)
region_size (str, optional): "individual" or "full" region to define the PDF (default: "individual")

Returns:
out (numpy.ndarray): (nsymbols x npxls x npxls) array consisting of the
binned histogram for each symbol.


.. py:function:: define_constellation(modulation)
Define constellations for coherent modulation schemes. Schemes supported:

OOK - On-Off Keying
BPSK - Binary Phase Shift Keying
QPSK - Quadrature Phase Shift Keying
QAM - Quadrature Amplitude Modulation
M-PSK - M-ary PSK (e.g. 16-PSK)
M-QAM - M-ary QAM (e.g. 16-QAM)

Parameters:
modulation (string): Modulation scheme (e.g. "BPSK" or "64-QAM")

Returns:
constellation (numpy.ndarray): Complex array representing the constellation,
of dimension (nsymbols), real and imaginary parts correspond to the
two axes of the modulation.


.. py:function:: flip_bits(data, ber)
46 changes: 46 additions & 0 deletions _sources/autoapi/fast/conf/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
:py:mod:`fast.conf`
===================

.. py:module:: fast.conf
.. autoapi-nested-parse::

Needs to read in python/YAML file and spit out a dictionary, taking into account
default values for certain parameters.



Module Contents
---------------

.. py:data:: logger
.. py:class:: ConfigParser(fname_or_dict)
.. py:method:: load(fname)
Load config file into dictionary

Parameters:
fname (string): config file location


.. py:method:: check()
Check loaded config dictionary for missing values. If they exist, replace
with defualt values


.. py:method:: set_defaults()
Set defualt values for all config parameters from global DEFAULTS dictionary



.. py:data:: DEFAULTS
Loading

0 comments on commit afa8a41

Please sign in to comment.