SVN r8748
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
// -*- Mode: C++ -*-
|
||||
#ifndef ASTRO_H
|
||||
#define ASTRO_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QScopedPointer>
|
||||
|
||||
#include "Radio.hpp"
|
||||
|
||||
class QSettings;
|
||||
class Configuration;
|
||||
namespace Ui {
|
||||
class Astro;
|
||||
}
|
||||
|
||||
class Astro final
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
using Frequency = Radio::Frequency;
|
||||
using FrequencyDelta = Radio::FrequencyDelta;
|
||||
|
||||
explicit Astro(QSettings * settings, Configuration const *, QWidget * parent = nullptr);
|
||||
~Astro ();
|
||||
|
||||
struct Correction
|
||||
{
|
||||
Correction ()
|
||||
: rx {0}
|
||||
, tx {0}
|
||||
{}
|
||||
Correction (Correction const&) = default;
|
||||
Correction& operator = (Correction const&) = default;
|
||||
|
||||
FrequencyDelta rx;
|
||||
FrequencyDelta tx;
|
||||
};
|
||||
Correction astroUpdate(QDateTime const& t,
|
||||
QString const& mygrid,
|
||||
QString const& hisgrid,
|
||||
Frequency frequency,
|
||||
bool dx_is_self,
|
||||
bool bTx,
|
||||
bool no_tx_QSY,
|
||||
int TR_period);
|
||||
|
||||
bool doppler_tracking () const;
|
||||
Q_SLOT void nominal_frequency (Frequency rx, Frequency tx);
|
||||
Q_SIGNAL void tracking_update () const;
|
||||
|
||||
protected:
|
||||
void hideEvent (QHideEvent *) override;
|
||||
void closeEvent (QCloseEvent *) override;
|
||||
|
||||
private slots:
|
||||
void on_rbConstFreqOnMoon_clicked();
|
||||
void on_rbFullTrack_clicked();
|
||||
void on_rbOwnEcho_clicked();
|
||||
void on_rbNoDoppler_clicked();
|
||||
void on_rbOnDxEcho_clicked(bool);
|
||||
void on_rbCallDx_clicked();
|
||||
void on_cbDopplerTracking_toggled(bool);
|
||||
|
||||
private:
|
||||
void read_settings ();
|
||||
void write_settings ();
|
||||
void check_split ();
|
||||
|
||||
QSettings * settings_;
|
||||
Configuration const * configuration_;
|
||||
QScopedPointer<Ui::Astro> ui_;
|
||||
|
||||
qint32 m_DopplerMethod;
|
||||
int m_dop;
|
||||
int m_dop00;
|
||||
int m_dx_two_way_dop;
|
||||
};
|
||||
|
||||
inline
|
||||
bool operator == (Astro::Correction const& lhs, Astro::Correction const& rhs)
|
||||
{
|
||||
return lhs.rx == rhs.rx && lhs.tx == rhs.tx;
|
||||
}
|
||||
|
||||
inline
|
||||
bool operator != (Astro::Correction const& lhs, Astro::Correction const& rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
#endif // ASTRO_H
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Example of decoding a (7,4) Hamming code using exhaustive enumeration and
|
||||
# probability propagation, with an Additive White Gaussian Noise channel with
|
||||
# noise standard deviation of 0.5, for which Eb/N0 = 5.44 dB.
|
||||
#
|
||||
# Testing is done by transmitting zero blocks, which is sufficient because
|
||||
# both the channel and the decoding procedure are symmetrical. WARNING: But
|
||||
# things can easily become non-symmetrical with bugs, so this technique should
|
||||
# be used with caution, and only when necessary for performance reasons.
|
||||
# Decoding is done three times, once minimizing block error probability, once
|
||||
# minimizing bit error probability, and once by up to 200 iterations of
|
||||
# probability propagation.
|
||||
|
||||
set -e # Stop if an error occurs
|
||||
set -v # Echo commands as they are read
|
||||
|
||||
make-pchk ex-ham7a.pchk 3 7 0:0 0:3 0:4 0:5 1:1 1:3 1:4 1:6 2:2 2:4 2:5 2:6
|
||||
make-gen ex-ham7a.pchk ex-ham7a.gen dense
|
||||
transmit 7x100000 ex-ham7a.rec 1 awgn 0.5
|
||||
|
||||
# DECODE BY ENUMERATION TO MINIMIZE BLOCK ERROR PROBABILITY
|
||||
|
||||
decode ex-ham7a.pchk ex-ham7a.rec ex-ham7a.dec-blk awgn 0.5 \
|
||||
enum-block ex-ham7a.gen
|
||||
verify ex-ham7a.pchk ex-ham7a.dec-blk ex-ham7a.gen
|
||||
|
||||
# DECODE BY ENUMERATION TO MINIMIZE BIT ERROR PROBABILITY
|
||||
|
||||
decode ex-ham7a.pchk ex-ham7a.rec ex-ham7a.dec-bit awgn 0.5 \
|
||||
enum-bit ex-ham7a.gen
|
||||
verify ex-ham7a.pchk ex-ham7a.dec-bit ex-ham7a.gen
|
||||
|
||||
# DECODE BY PROBABILITY PROPAGATION
|
||||
|
||||
decode ex-ham7a.pchk ex-ham7a.rec ex-ham7a.dec-prp awgn 0.5 \
|
||||
prprp 200
|
||||
verify ex-ham7a.pchk ex-ham7a.dec-prp ex-ham7a.gen
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Example of coding using a (7,4) Hamming code, with transmission through
|
||||
# a Binary Symmetric Channel with error probability of 0.05.
|
||||
#
|
||||
# This example shows how random source messages can be encoded as codewords,
|
||||
# transmitted through the simulated channel, decoded, and the message bits
|
||||
# extracted from the codewords. The final result is in ex-ham7b.ext, which can
|
||||
# be compared to ex-ham7b.src.
|
||||
|
||||
set -e # Stop if an error occurs
|
||||
set -v # Echo commands as they are read
|
||||
|
||||
make-pchk ex-ham7b.pchk 3 7 0:0 0:3 0:4 0:5 1:1 1:3 1:4 1:6 2:2 2:4 2:5 2:6
|
||||
make-gen ex-ham7b.pchk ex-ham7b.gen dense
|
||||
rand-src ex-ham7b.src 1 4x1000
|
||||
encode ex-ham7b.pchk ex-ham7b.gen ex-ham7b.src ex-ham7b.enc
|
||||
transmit ex-ham7b.enc ex-ham7b.rec 1 bsc 0.05
|
||||
decode ex-ham7b.pchk ex-ham7b.rec ex-ham7b.dec bsc 0.05 enum-bit ex-ham7b.gen
|
||||
verify ex-ham7b.pchk ex-ham7b.dec ex-ham7b.gen ex-ham7b.src
|
||||
extract ex-ham7b.gen ex-ham7b.dec ex-ham7b.ext
|
||||
@@ -0,0 +1,48 @@
|
||||
subroutine encode204(message,codeword)
|
||||
! Encode an 68-bit message and return a 204-bit codeword.
|
||||
! The generator matrix has dimensions (136,68).
|
||||
! The code is a (204,68) regular ldpc code with column weight 3.
|
||||
! The code was generated using the PEG algorithm.
|
||||
! After creating the codeword, the columns are re-ordered according to
|
||||
! "colorder" to make the codeword compatible with the parity-check matrix
|
||||
!
|
||||
|
||||
include "ldpc_204_68_params.f90"
|
||||
|
||||
integer*1 codeword(N)
|
||||
integer*1 gen(M,K)
|
||||
integer*1 itmp(N)
|
||||
integer*1 message(K)
|
||||
integer*1 pchecks(M)
|
||||
logical first
|
||||
data first/.true./
|
||||
|
||||
save first,gen
|
||||
|
||||
if( first ) then ! fill the generator matrix
|
||||
gen=0
|
||||
do i=1,M
|
||||
do j=1,17
|
||||
read(g(i)(j:j),"(Z1)") istr
|
||||
do jj=1, 4
|
||||
icol=(j-1)*4+jj
|
||||
if( btest(istr,4-jj) ) gen(i,icol)=1
|
||||
enddo
|
||||
enddo
|
||||
enddo
|
||||
first=.false.
|
||||
endif
|
||||
|
||||
do i=1,M
|
||||
nsum=0
|
||||
do j=1,K
|
||||
nsum=nsum+message(j)*gen(i,j)
|
||||
enddo
|
||||
pchecks(i)=mod(nsum,2)
|
||||
enddo
|
||||
itmp(1:M)=pchecks
|
||||
itmp(M+1:N)=message(1:K)
|
||||
codeword(colorder+1)=itmp(1:N)
|
||||
|
||||
return
|
||||
end subroutine encode204
|
||||
Reference in New Issue
Block a user