aboutsummaryrefslogtreecommitdiffstats
path: root/lib/decoding
diff options
context:
space:
mode:
authorPiotr Krysik <ptrkrysik@gmail.com>2017-08-23 16:02:19 +0200
committerPiotr Krysik <ptrkrysik@gmail.com>2017-08-23 16:02:19 +0200
commita6268a5bc188ebe5eefed356d76b299a5c56756b (patch)
tree4f2b56412561ca5a0e845b9ef43d948b5291bc8c /lib/decoding
parentb9a87a18fb1b3a78f03e795479d815b2b2cda734 (diff)
Big update of copyright statements so they can be automatically processed to produce debian/copyright file
Diffstat (limited to 'lib/decoding')
-rw-r--r--lib/decoding/control_channels_decoder_impl.cc2
-rw-r--r--lib/decoding/control_channels_decoder_impl.h2
-rw-r--r--lib/decoding/osmocom/coding/gsm0503_coding.h22
-rw-r--r--lib/decoding/osmocom/coding/gsm0503_conv.c1
-rw-r--r--lib/decoding/osmocom/coding/gsm0503_interleaving.h22
-rw-r--r--lib/decoding/osmocom/coding/gsm0503_mapping.h21
-rw-r--r--lib/decoding/osmocom/coding/gsm0503_parity.h21
-rw-r--r--lib/decoding/osmocom/coding/gsm0503_tables.h21
-rw-r--r--lib/decoding/sch.c2
-rw-r--r--lib/decoding/tch_f_decoder_impl.cc51
-rw-r--r--lib/decoding/tch_f_decoder_impl.h14
11 files changed, 160 insertions, 19 deletions
diff --git a/lib/decoding/control_channels_decoder_impl.cc b/lib/decoding/control_channels_decoder_impl.cc
index 71695e2..a6abaa3 100644
--- a/lib/decoding/control_channels_decoder_impl.cc
+++ b/lib/decoding/control_channels_decoder_impl.cc
@@ -1,7 +1,7 @@
/* -*- c++ -*- */
/*
* @file
- * @author Piotr Krysik <ptrkrysik@gmail.com>
+ * @author (C) 2014 by Piotr Krysik <ptrkrysik@gmail.com>
* @section LICENSE
*
* Gr-gsm is free software; you can redistribute it and/or modify
diff --git a/lib/decoding/control_channels_decoder_impl.h b/lib/decoding/control_channels_decoder_impl.h
index 1117940..3464324 100644
--- a/lib/decoding/control_channels_decoder_impl.h
+++ b/lib/decoding/control_channels_decoder_impl.h
@@ -1,7 +1,7 @@
/* -*- c++ -*- */
/*
* @file
- * @author Piotr Krysik <ptrkrysik@gmail.com>
+ * @author (C) 2014 by Piotr Krysik <ptrkrysik@gmail.com>
* @section LICENSE
*
* Gr-gsm is free software; you can redistribute it and/or modify
diff --git a/lib/decoding/osmocom/coding/gsm0503_coding.h b/lib/decoding/osmocom/coding/gsm0503_coding.h
index 83cdbd5..5e3e9db 100644
--- a/lib/decoding/osmocom/coding/gsm0503_coding.h
+++ b/lib/decoding/osmocom/coding/gsm0503_coding.h
@@ -1,3 +1,25 @@
+/*
+ * (C) 2013 by Andreas Eversberg <jolly@eversberg.eu>
+ * (C) 2015 by Alexander Chemeris <Alexander.Chemeris@fairwaves.co>
+ * (C) 2016 by Tom Tsou <tom.tsou@ettus.com>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
#pragma once
#include <stdint.h>
diff --git a/lib/decoding/osmocom/coding/gsm0503_conv.c b/lib/decoding/osmocom/coding/gsm0503_conv.c
index f275ea4..5ab63a6 100644
--- a/lib/decoding/osmocom/coding/gsm0503_conv.c
+++ b/lib/decoding/osmocom/coding/gsm0503_conv.c
@@ -1,4 +1,3 @@
-
/*
* Copyright (C) 2011-2016 Sylvain Munaut <tnt@246tNt.com>
* Copyright (C) 2016 sysmocom s.f.m.c. GmbH
diff --git a/lib/decoding/osmocom/coding/gsm0503_interleaving.h b/lib/decoding/osmocom/coding/gsm0503_interleaving.h
index f97dff4..05c0365 100644
--- a/lib/decoding/osmocom/coding/gsm0503_interleaving.h
+++ b/lib/decoding/osmocom/coding/gsm0503_interleaving.h
@@ -1,3 +1,25 @@
+/*
+ * (C) 2013 by Andreas Eversberg <jolly@eversberg.eu>
+ * (C) 2016 by Tom Tsou <tom.tsou@ettus.com>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
#pragma once
#include <osmocom/core/bits.h>
diff --git a/lib/decoding/osmocom/coding/gsm0503_mapping.h b/lib/decoding/osmocom/coding/gsm0503_mapping.h
index 4c6550a..417a94f 100644
--- a/lib/decoding/osmocom/coding/gsm0503_mapping.h
+++ b/lib/decoding/osmocom/coding/gsm0503_mapping.h
@@ -1,3 +1,24 @@
+/*
+ * (C) 2013 by Andreas Eversberg <jolly@eversberg.eu>
+ * (C) 2016 by Tom Tsou <tom.tsou@ettus.com>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
#pragma once
#include <osmocom/core/bits.h>
diff --git a/lib/decoding/osmocom/coding/gsm0503_parity.h b/lib/decoding/osmocom/coding/gsm0503_parity.h
index 540124a..6d8a062 100644
--- a/lib/decoding/osmocom/coding/gsm0503_parity.h
+++ b/lib/decoding/osmocom/coding/gsm0503_parity.h
@@ -1,3 +1,24 @@
+/*
+ * (C) 2013 by Andreas Eversberg <jolly@eversberg.eu>
+ * (C) 2016 by Tom Tsou <tom.tsou@ettus.com>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
#pragma once
#include <osmocom/core/crcgen.h>
diff --git a/lib/decoding/osmocom/coding/gsm0503_tables.h b/lib/decoding/osmocom/coding/gsm0503_tables.h
index e6761ca..4976c81 100644
--- a/lib/decoding/osmocom/coding/gsm0503_tables.h
+++ b/lib/decoding/osmocom/coding/gsm0503_tables.h
@@ -1,3 +1,24 @@
+/*
+ * (C) 2013 by Andreas Eversberg <jolly@eversberg.eu>
+ * (C) 2016 by Tom Tsou <tom.tsou@ettus.com>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
#pragma once
#include <stdint.h>
diff --git a/lib/decoding/sch.c b/lib/decoding/sch.c
index 24cee30..6d2e3eb 100644
--- a/lib/decoding/sch.c
+++ b/lib/decoding/sch.c
@@ -1,7 +1,7 @@
/* -*- c++ -*- */
/*
* @file
- * @author Piotr Krysik <ptrkrysik@gmail.com>
+ * @author (C) 2014 by Piotr Krysik <ptrkrysik@gmail.com>
* @section LICENSE
*
* Gr-gsm is free software; you can redistribute it and/or modify
diff --git a/lib/decoding/tch_f_decoder_impl.cc b/lib/decoding/tch_f_decoder_impl.cc
index 5b77be2..1f22cf2 100644
--- a/lib/decoding/tch_f_decoder_impl.cc
+++ b/lib/decoding/tch_f_decoder_impl.cc
@@ -1,7 +1,8 @@
/* -*- c++ -*- */
/*
* @file
- * @author Roman Khassraf <rkhassraf@gmail.com>
+ * @author (C) 2015 by Roman Khassraf <rkhassraf@gmail.com>
+ * (C) 2017 by Piotr Krysik <ptrkrysik@gmail.com>
* @section LICENSE
*
* Gr-gsm is free software; you can redistribute it and/or modify
@@ -296,26 +297,60 @@ namespace gr {
unsigned tail = mTCHU.peekField(185, 4);
bool good = (sentParity == calcParity) && (tail == 0);
-
if (good)
{
uint8_t frameBuffer[33];
- sbit_t bursts_s[116 * 8];
- int n_errors, n_bits_total;
+ sbit_t bursts_s[116 * 8];
+ int n_errors, n_bits_total;
unsigned int mTCHFrameLength;
-
- ubits2sbits(bursts_u, bursts_s, 116 * 8);
+ ubits2sbits(bursts_u, bursts_s, 116 * 8);
if (d_tch_mode == TCH_FS) // GSM-FR
{
mTCHFrameLength = 33;
gsm0503_tch_fr_decode(frameBuffer, bursts_s, 1, 0, &n_errors, &n_bits_total);
- std::cout << "Errors: " << n_errors << std::endl;
+ //std::cout << "Errors: " << n_errors << std::endl;
}
else if (d_tch_mode == TCH_EFR) // GSM-EFR
{
+ unsigned char mFrameHeader = 0x3c;
+
+ // AMR Frame, consisting of a 8 bit frame header, plus the payload from decoding
+ BitVector amrFrame(244 + 8); // Same output length as AMR 12.2
+ BitVector payload = amrFrame.tail(8);
+
+ BitVector TCHW(260), EFRBits(244);
+
+ // write frame header
+ amrFrame.fillField(0, mFrameHeader, 8);
+
+ // Undo Um's EFR bit ordering.
+ mTCHD.unmap(GSM::g660BitOrder, 260, TCHW);
+
+ // Remove repeating bits and CRC to get raw EFR frame (244 bits)
+ for (unsigned k=0; k<71; k++)
+ EFRBits[k] = TCHW[k] & 1;
+
+ for (unsigned k=73; k<123; k++)
+ EFRBits[k-2] = TCHW[k] & 1;
+
+ for (unsigned k=125; k<178; k++)
+ EFRBits[k-4] = TCHW[k] & 1;
+
+ for (unsigned k=180; k<230; k++)
+ EFRBits[k-6] = TCHW[k] & 1;
+
+ for (unsigned k=232; k<252; k++)
+ EFRBits[k-8] = TCHW[k] & 1;
+
+ // Map bits as AMR 12.2k
+ EFRBits.map(GSM::gAMRBitOrderTCH_AFS12_2, 244, payload);
+
+ // Put the whole frame (hdr + payload)
mTCHFrameLength = 32;
- gsm0503_tch_fr_decode(frameBuffer, bursts_s, 1, 1, &n_errors, &n_bits_total);
+ amrFrame.pack(frameBuffer);
+ //when itegrating with libosmocore lines above can be removed and line below uncommented, efr decoding with libosmocore need to be tested however
+ //gsm0503_tch_fr_decode(frameBuffer, bursts_s, 1, 1, &n_errors, &n_bits_total);
}
message_port_pub(pmt::mp("voice"), pmt::cons(pmt::PMT_NIL, pmt::make_blob(frameBuffer,mTCHFrameLength)));
}
diff --git a/lib/decoding/tch_f_decoder_impl.h b/lib/decoding/tch_f_decoder_impl.h
index 0119b5a..cac245a 100644
--- a/lib/decoding/tch_f_decoder_impl.h
+++ b/lib/decoding/tch_f_decoder_impl.h
@@ -1,7 +1,7 @@
/* -*- c++ -*- */
/*
* @file
- * @author Roman Khassraf <rkhassraf@gmail.com>
+ * @author (C) 2015 by Roman Khassraf <rkhassraf@gmail.com>
* @section LICENSE
*
* Gr-gsm is free software; you can redistribute it and/or modify
@@ -23,12 +23,12 @@
#ifndef INCLUDED_GSM_TCH_F_DECODER_IMPL_H
#define INCLUDED_GSM_TCH_F_DECODER_IMPL_H
-#include "AmrCoder.h"
-#include "BitVector.h"
-#include "GSM503Tables.h"
-#include "GSM610Tables.h"
-#include "GSM660Tables.h"
-#include "ViterbiR204.h"
+#include "openbts/AmrCoder.h"
+#include "openbts/BitVector.h"
+#include "openbts/GSM503Tables.h"
+#include "openbts/GSM610Tables.h"
+#include "openbts/GSM660Tables.h"
+#include "openbts/ViterbiR204.h"
#include <grgsm/decoding/tch_f_decoder.h>