aboutsummaryrefslogtreecommitdiffstats
path: root/src/OfdmGenerator.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-09-27 20:29:14 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-09-28 13:36:48 +0200
commit4574756f50fd34355aa9d6bfc8a5662f87e88661 (patch)
tree66f72df54f173e9d5ef23380ce61c75b9ba3318b /src/OfdmGenerator.h
parent16c4bcb085457514438d35bbbe11ef979e36bb85 (diff)
downloaddabmod-4574756f50fd34355aa9d6bfc8a5662f87e88661.tar.gz
dabmod-4574756f50fd34355aa9d6bfc8a5662f87e88661.tar.bz2
dabmod-4574756f50fd34355aa9d6bfc8a5662f87e88661.zip
Add CFR statistics to RC
Diffstat (limited to 'src/OfdmGenerator.h')
-rw-r--r--src/OfdmGenerator.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/OfdmGenerator.h b/src/OfdmGenerator.h
index ad39f5b..9ac0387 100644
--- a/src/OfdmGenerator.h
+++ b/src/OfdmGenerator.h
@@ -68,7 +68,13 @@ class OfdmGenerator : public ModCodec, public RemoteControllable
const std::string& parameter) const override;
protected:
- void cfr_one_iteration(complexf *symbol, const complexf *reference);
+ struct cfr_iter_stat_t {
+ size_t clip_count = 0;
+ size_t errclip_count = 0;
+ };
+
+ cfr_iter_stat_t cfr_one_iteration(
+ complexf *symbol, const complexf *reference);
fftwf_plan myFftPlan;
fftwf_complex *myFftIn, *myFftOut;
@@ -85,14 +91,16 @@ class OfdmGenerator : public ModCodec, public RemoteControllable
unsigned myZeroSize;
bool myCfr; // Whether to enable crest factor reduction
+ mutable std::mutex myCfrRcMutex;
float myCfrClip;
float myCfrErrorClip;
fftwf_plan myCfrFft;
fftwf_complex *myCfrPostClip;
fftwf_complex *myCfrPostFft;
- size_t myNumClip;
- size_t myNumErrorClip;
+ // Statistics for CFR
+ std::deque<double> myClipRatios;
+ std::deque<double> myErrorClipRatios;
};