kurtis.heimerl | 8aea56e | 2011-11-26 03:18:30 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Written by Thomas Tsou <ttsou@vt.edu> |
| 3 | * Based on code by Harvind S Samra <hssamra@kestrelsp.com> |
| 4 | * |
| 5 | * Copyright 2011 Free Software Foundation, Inc. |
| 6 | * |
| 7 | * This program is free software: you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU Affero General Public License as published by |
| 9 | * the Free Software Foundation, either version 3 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU Affero General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Affero General Public License |
| 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | * See the COPYING file in the main directory for details. |
| 20 | */ |
| 21 | |
| 22 | #ifndef RADIOVECTOR_H |
| 23 | #define RADIOVECTOR_H |
| 24 | |
| 25 | #include "sigProcLib.h" |
| 26 | #include "GSMCommon.h" |
Alexander Chemeris | d734e2d | 2013-06-16 14:30:58 +0400 | [diff] [blame] | 27 | #include "Interthread.h" |
kurtis.heimerl | 8aea56e | 2011-11-26 03:18:30 +0000 | [diff] [blame] | 28 | |
| 29 | class radioVector : public signalVector { |
| 30 | public: |
| 31 | radioVector(const signalVector& wVector, GSM::Time& wTime); |
Thomas Tsou | e0fa2bf | 2013-11-09 02:46:29 -0500 | [diff] [blame^] | 32 | radioVector(size_t size, GSM::Time& wTime); |
kurtis.heimerl | 0628613 | 2011-11-26 03:18:43 +0000 | [diff] [blame] | 33 | GSM::Time getTime() const; |
kurtis.heimerl | 8aea56e | 2011-11-26 03:18:30 +0000 | [diff] [blame] | 34 | void setTime(const GSM::Time& wTime); |
| 35 | bool operator>(const radioVector& other) const; |
| 36 | |
| 37 | private: |
| 38 | GSM::Time mTime; |
| 39 | }; |
| 40 | |
Thomas Tsou | fa3a787 | 2013-10-17 21:23:34 -0400 | [diff] [blame] | 41 | class noiseVector : std::vector<float> { |
| 42 | public: |
| 43 | noiseVector(size_t len = 0); |
| 44 | bool insert(float val); |
| 45 | float avg(); |
| 46 | |
| 47 | private: |
| 48 | std::vector<float>::iterator it; |
| 49 | }; |
| 50 | |
Thomas Tsou | 204a9f1 | 2013-10-29 18:34:16 -0400 | [diff] [blame] | 51 | class VectorFIFO : public InterthreadQueue<radioVector> { }; |
kurtis.heimerl | 8aea56e | 2011-11-26 03:18:30 +0000 | [diff] [blame] | 52 | |
| 53 | class VectorQueue : public InterthreadPriorityQueue<radioVector> { |
| 54 | public: |
| 55 | GSM::Time nextTime() const; |
| 56 | radioVector* getStaleBurst(const GSM::Time& targTime); |
| 57 | radioVector* getCurrentBurst(const GSM::Time& targTime); |
| 58 | }; |
| 59 | |
| 60 | #endif /* RADIOVECTOR_H */ |