DigitalCommunications
DigitalCommunications.AWGNChannel
— Typemutable struct AWGNChannel
Additive white Gaussian noise channel.
!!! note If tsample
and tsymbol
are NaN
, then the channel operates in the vector channel mode. Otherwise, the channel operates in waveform channel mode.
Fields
esno::Float64
Value of the noise mode(may be
SNR
,EsNo
,EbNo
in dBtsample::Float64
Sampling period of the channel
tsymbol::Float64
Symbol duration if channel operates in waveform channel mode
DigitalCommunications.BitGenerator
— Typestruct BitGenerator
Bit stream generator
Fields
bits::Array{Bool,1}
Generated bits
DigitalCommunications.Detector
— Typestruct Detector{T}
Baseband optimal detector.
If elements of probs
are equal to each other, than detector detects symbols in the maximum likelihood (ML) mode. Otherwise, it detects in the maximum a posterior probabilities (MAP) mode.
Fields
refs::Any
Basis reference of the detector
probs::Array{Float64,1}
A priori probabilities of the message symbols
N0::Float64
2 times the power spectral density of channel noise
DigitalCommunications.GrayCoding
— Typestruct GrayCoding <: DigitalCommunications.AbstractCoding
Gray coding.
Fields
pairs::Dict{Array{Int64,1},Int64}
Example
julia> gc = GrayCoding(2)
GrayCoding(Dict([0, 1] => 2,[1, 1] => 3,[0, 0] => 1,[1, 0] => 4))
DigitalCommunications.Modulator
— Typestruct Modulator{T<:DigitalCommunications.AbstractScheme, S<:DigitalCommunications.AbstractPulse}
Baseband digital modulator.
!!! note tsample
determines the type of modulation. If tsample
is NaN
, the modulator transmits the vectors whose elements are the coefficients of the expansion of the symbol waveform over the orthogonal basis. Otherwise, the modulator trasmits the symbol waveform sampled by tsample
.
Fields
scheme::DigitalCommunications.AbstractScheme
Modulation scheme
pulse::DigitalCommunications.AbstractPulse
Modulation pulse energy
tsample::Float64
Sampling time.
DigitalCommunications.RaisedCosinePulse
— Typestruct RaisedCosinePulse <: DigitalCommunications.AbstractPulse
Raised coise pulse shapse of the form,
\[ p(t) = \begin{cases} \drac{A}{2}(1 - cos(w t) & 0 \leq t \leq T \ 0 & othersie \ \end{cases}\]
Fields
amplitude::Float64
duration::Float64
DigitalCommunications.RectangularPulse
— Typestruct RectangularPulse <: DigitalCommunications.AbstractPulse
RectangularPulse pulse shape of the form,
\[ p(t) = \begin{cases} A & 0 \leq t \leq T \ 0 & othersie \ \end{cases}\]
where $A$ is the amplitude and $T$ is the pulse duration.
Fields
amplitude::Float64
Amplitude
duration::Float64
Period
DigitalCommunications.SymbolGenerator
— Typestruct SymbolGenerator
Symbol generator
Fields
symbols::Array{Int64,1}
Generated symbols
DigitalCommunications.Q
— MethodQ(x)
Q-function defined as.
\[ Q(x) = \int_{x}^{\infty} exp(-\dfrac{x^2}{2}) dx\]
DigitalCommunications.alphabet
— FunctionReturns the alphabet of scheme
.
Example
julia> scheme = PSK(4)
4-PSK
julia> alphabet(scheme)
4-element Array{Array{Float64,1},1}:
[1.0, 0.0]
[6.123233995736766e-17, 1.0]
[-1.0, 1.2246467991473532e-16]
[-1.8369701987210297e-16, -1.0]
DigitalCommunications.alphabet
— Methodalphabet(scheme)
Returns $[0, 0, \ldots, 1, 0, \ldots, 0], \; m = 1, \ldots, M$ where the index of the nonzero element is $m$ and M
is the constellation size of the scheme
.
DigitalCommunications.alphabet
— Methodalphabet(scheme)
Returns $[cos(\theta_m), sin(\theta_m)], \; m = 1, \ldots, M$ where $\theta_m = \dfrac{2\pi(m - 1)}{M}$ and M
is the constellation size of the scheme
.
DigitalCommunications.alphabet
— Methodalphabet(scheme)
Returns $[2m - 1 - M, 2n - 1 - M], \; m, n = 1, \ldots, M$ where M
is the constellation size of the scheme
.
DigitalCommunications.alphabet
— Methodalphabet(scheme)
Returns $[2m - 1 - M], \; m = 1, \ldots, M$ where M
is constellation size of scheme
.
DigitalCommunications.bandwidth
— Methodbandwidth(pulse)
Returns the effetive bandwidth of the pulse
in units of Hz.
DigitalCommunications.basis
— Methodbasis(modulator)
Returns basis modulator
DigitalCommunications.berask
— Methodberask(γb, M)
Returns the probability of symbol error for the snr per bit γb
and constallation size M
for ASK and PAM signalling
DigitalCommunications.berfsk
— Methodberfsk(γs, M)
Returns the probability of symbol error for the snr per bit γb
and constallation size M
for FSK signalling
DigitalCommunications.berpsk
— Methodberpsk(γs, M)
Returns the probability of symbol error for the snr per bit γb
and constallation size M
for PSK signalling
DigitalCommunications.berqam
— Methodberqam(γb, M)
Returns the probability of symbol error for the snr per bit γb
and constallation size M
for QAM signalling
DigitalCommunications.constellation
— Methodconstellation(scheme)
Plots the constellation diagram of the modulator
.
DigitalCommunications.constelsize
— Methodconstelsize(scheme)
Returns the symbols size of scheme
.
Example
julia> sch = PSK(4);
julia> constelsize(sch)
4
DigitalCommunications.constelsize
— Methodconstelsize(coding)
Returns constellation size of the coding.
DigitalCommunications.constelsize
— Methodconstelsize(modulator)
Returns the constellation size of modulator
DigitalCommunications.dbtoval
— Methoddbtoval(γ)
Converts γ
from dB
value to its real value.
Example
julia> dbtoval(2) # γ = 2 dB
1.5848931924611136
DigitalCommunications.energy
— Functionenergy(s)
energy(s, ts)
Computes the energy of the discrete time signal s
sampled with ts
(defaults to 1) seconds.
DigitalCommunications.energy
— Methodenergy(pulse)
Returns the energy of the pulse pulse
Example
DigitalCommunications.invmap
— Methodinvmap(coding)
Returns the inverse of the mapping. Inverse mapping maps the levels to bit chunks.
Example
julia> gray = GrayCoding(3)
GrayCoding(Dict([0, 1, 1] => 3,[0, 0, 1] => 2,[1, 1, 0] => 5,[0, 0, 0] => 1,[1, 0, 0] => 8,[1, 0, 1] => 7,[0, 1, 0] => 4,[1, 1, 1] => 6))
julia> invmap(gray)
Dict{Int64,Array{Int64,1}} with 8 entries:
7 => [1, 0, 1]
4 => [0, 1, 0]
2 => [0, 0, 1]
3 => [0, 1, 1]
5 => [1, 1, 0]
8 => [1, 0, 0]
6 => [1, 1, 1]
1 => [0, 0, 0]
DigitalCommunications.isml
— Methodisml(detector)
Returns true if detector
is a maximum likelihood detector, i.e, a priori probabilities of its reference refs are equal.
DigitalCommunications.iswaveform
— Methodiswaveform(modulator)
Returns true if modulator a waveform modulator
DigitalCommunications.plotber
— Methodplotber(; scheme, snr_per_bit_range, krange, pltkwargs...)
Plots the probability of symbol error versus snr per bit for the signaling scheme
. snr_per_bit_range
is the snr per bit range and krange
is the symbol size of the M-ary signalling where $M=2^k$.
DigitalCommunications.scheme
— Methodscheme(modulator)
Returns scheme of the modulation modulator
.
DigitalCommunications.valtodb
— Methodvaltodb(val)
Converts val
tı dB scale.