diff --git a/gr-tempest/include/tempest/CMakeLists.txt b/gr-tempest/include/tempest/CMakeLists.txt new file mode 100644 index 0000000..06c7e4e --- /dev/null +++ b/gr-tempest/include/tempest/CMakeLists.txt @@ -0,0 +1,36 @@ +# Copyright 2011,2012 Free Software Foundation, Inc. +# +# This file was generated by gr_modtool, a tool from the GNU Radio framework +# This file is a part of gr-tempest +# +# GNU Radio 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 3, or (at your option) +# any later version. +# +# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Install public header files +######################################################################## +install(FILES + api.h + sampling_synchronization.h + framing.h + Hsync.h + normalize_flow.h + fine_sampling_synchronization.h + sync_detector.h + frame_drop.h + fft_peak_fine_sampling_sync.h + infer_screen_resolution.h + ssamp_correction.h DESTINATION include/tempest +) diff --git a/gr-tempest/include/tempest/Hsync.h b/gr-tempest/include/tempest/Hsync.h new file mode 100644 index 0000000..34a18ad --- /dev/null +++ b/gr-tempest/include/tempest/Hsync.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* +* Copyright 2020 +* Federico "Larroca" La Rocca +* +* Instituto de Ingenieria Electrica, Facultad de Ingenieria, +* Universidad de la Republica, Uruguay. +* +* This 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 3, or (at your option) +* any later version. +* +* This software 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 software; see the file COPYING. If not, write to +* the Free Software Foundation, Inc., 51 Franklin Street, +* Boston, MA 02110-1301, USA. +*/ + + +#ifndef INCLUDED_TEMPEST_HSYNC_H +#define INCLUDED_TEMPEST_HSYNC_H + +#include +#include + +namespace gr { + namespace tempest { + + /*! + * \brief <+description of block+> + * \ingroup tempest + * + */ + class TEMPEST_API Hsync : virtual public gr::block + { + public: + typedef std::shared_ptr sptr; + + /*! + * \brief Return a shared_ptr to a new instance of tempest::Hsync. + * + * To avoid accidental use of raw pointers, tempest::Hsync's + * constructor is in a private implementation + * class. tempest::Hsync::make is the public interface for + * creating new instances. + */ + static sptr make(int Htotal, int delay); + + virtual void set_Htotal_and_delay(int Htotal, int delay) = 0; + }; + + } // namespace tempest +} // namespace gr + +#endif /* INCLUDED_TEMPEST_HSYNC_H */ + diff --git a/gr-tempest/include/tempest/api.h b/gr-tempest/include/tempest/api.h new file mode 100644 index 0000000..6c5e585 --- /dev/null +++ b/gr-tempest/include/tempest/api.h @@ -0,0 +1,34 @@ +/* + * Copyright 2011 Free Software Foundation, Inc. + * + * This file was generated by gr_modtool, a tool from the GNU Radio framework + * This file is a part of gr-tempest + * + * GNU Radio 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 3, or (at your option) + * any later version. + * + * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_TEMPEST_API_H +#define INCLUDED_TEMPEST_API_H + +#include + +#ifdef gnuradio_tempest_EXPORTS +#define TEMPEST_API __GR_ATTR_EXPORT +#else +#define TEMPEST_API __GR_ATTR_IMPORT +#endif + +#endif /* INCLUDED_TEMPEST_API_H */ diff --git a/gr-tempest/include/tempest/fft_peak_fine_sampling_sync.h b/gr-tempest/include/tempest/fft_peak_fine_sampling_sync.h new file mode 100644 index 0000000..dd3f45d --- /dev/null +++ b/gr-tempest/include/tempest/fft_peak_fine_sampling_sync.h @@ -0,0 +1,60 @@ +/* -*- c++ -*- */ +/* + * Copyright 2020 + * Federico "Larroca" La Rocca + * + * Instituto de Ingenieria Electrica, Facultad de Ingenieria, + * Universidad de la Republica, Uruguay. + * + * This 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 3, or (at your option) + * any later version. + * + * This software 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef INCLUDED_TEMPEST_FFT_PEAK_FINE_SAMPLING_SYNC_H +#define INCLUDED_TEMPEST_FFT_PEAK_FINE_SAMPLING_SYNC_H + +#include +#include + +namespace gr { + namespace tempest { + + /*! + * \brief <+description of block+> + * \ingroup tempest + * + */ + class TEMPEST_API fft_peak_fine_sampling_sync : virtual public gr::block + { + public: + typedef std::shared_ptr sptr; + + /*! + * \brief Return a shared_ptr to a new instance of tempest::fft_peak_fine_sampling_sync. + * + * To avoid accidental use of raw pointers, tempest::fft_peak_fine_sampling_sync's + * constructor is in a private implementation + * class. tempest::fft_peak_fine_sampling_sync::make is the public interface for + * creating new instances. + */ + static sptr make(int sample_rate, int size, int refresh_rate, int Vvisible, int Hvisible, bool automatic_mode); + }; + + } // namespace tempest +} // namespace gr + +#endif /* INCLUDED_TEMPEST_FFT_PEAK_FINE_SAMPLING_SYNC_H */ + diff --git a/gr-tempest/include/tempest/fine_sampling_synchronization.h b/gr-tempest/include/tempest/fine_sampling_synchronization.h new file mode 100644 index 0000000..9b34fd5 --- /dev/null +++ b/gr-tempest/include/tempest/fine_sampling_synchronization.h @@ -0,0 +1,64 @@ +/* -*- c++ -*- */ +/* + * Copyright 2020 + * Federico "Larroca" La Rocca + * + * Instituto de Ingenieria Electrica, Facultad de Ingenieria, + * Universidad de la Republica, Uruguay. + * + * This 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 3, or (at your option) + * any later version. + * + * This software 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + * + */ + + +#ifndef INCLUDED_TEMPEST_FINE_SAMPLING_SYNCHRONIZATION_H +#define INCLUDED_TEMPEST_FINE_SAMPLING_SYNCHRONIZATION_H + +#include +#include + +namespace gr { + namespace tempest { + + /*! + * \brief <+description of block+> + * \ingroup tempest + * + */ + class TEMPEST_API fine_sampling_synchronization : virtual public gr::block + { + public: + typedef std::shared_ptr sptr; + + /*! + * \brief Return a shared_ptr to a new instance of tempest::fine_sampling_synchronization. + * + * To avoid accidental use of raw pointers, tempest::fine_sampling_synchronization's + * constructor is in a private implementation + * class. tempest::fine_sampling_synchronization::make is the public interface for + * creating new instances. + */ + static sptr make(int Htotal, int Vtotal, int correct_sampling, float max_deviation, float update_proba); + + virtual void set_Htotal_Vtotal(int Htotal, int Vtotal) = 0; + }; + + } // namespace tempest +} // namespace gr + +#endif /* INCLUDED_TEMPEST_FINE_SAMPLING_SYNCHRONIZATION_H */ + + diff --git a/gr-tempest/include/tempest/frame_drop.h b/gr-tempest/include/tempest/frame_drop.h new file mode 100644 index 0000000..d373322 --- /dev/null +++ b/gr-tempest/include/tempest/frame_drop.h @@ -0,0 +1,60 @@ +/* -*- c++ -*- */ +/* + * Copyright 2020 + * Federico "Larroca" La Rocca + * + * Instituto de Ingenieria Electrica, Facultad de Ingenieria, + * Universidad de la Republica, Uruguay. + * + * This 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 3, or (at your option) + * any later version. + * + * This software 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef INCLUDED_TEMPEST_FRAME_DROP_H +#define INCLUDED_TEMPEST_FRAME_DROP_H + +#include +#include + +namespace gr { + namespace tempest { + + /*! + * \brief <+description of block+> + * \ingroup tempest + * + */ + class TEMPEST_API frame_drop : virtual public gr::block + { + public: + typedef std::shared_ptr sptr; + + /*! + * \brief Return a shared_ptr to a new instance of tempest::frame_drop. + * + * To avoid accidental use of raw pointers, tempest::frame_drop's + * constructor is in a private implementation + * class. tempest::frame_drop::make is the public interface for + * creating new instances. + */ + static sptr make(int Htotal, int Vtotal, int correct_sampling, float max_deviation, float update_proba, double actual_samp_rate); + }; + + } // namespace tempest +} // namespace gr + +#endif /* INCLUDED_TEMPEST_FRAME_DROP_H */ + diff --git a/gr-tempest/include/tempest/framing.h b/gr-tempest/include/tempest/framing.h new file mode 100644 index 0000000..cb689a6 --- /dev/null +++ b/gr-tempest/include/tempest/framing.h @@ -0,0 +1,63 @@ +/* -*- c++ -*- */ +/* + * Copyright 2020 + * Federico "Larroca" La Rocca + * + * Instituto de Ingenieria Electrica, Facultad de Ingenieria, + * Universidad de la Republica, Uruguay. + * + * This 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 3, or (at your option) + * any later version. + * + * This software 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + * + */ + + +#ifndef INCLUDED_TEMPEST_FRAMING_H +#define INCLUDED_TEMPEST_FRAMING_H + +#include +#include + +namespace gr { + namespace tempest { + + /*! + * \brief <+description of block+> + * \ingroup tempest + * + */ + class TEMPEST_API framing : virtual public gr::block + { + public: + typedef std::shared_ptr sptr; + + /*! + * \brief Return a shared_ptr to a new instance of tempest::framing. + * + * To avoid accidental use of raw pointers, tempest::framing's + * constructor is in a private implementation + * class. tempest::framing::make is the public interface for + * creating new instances. + */ + static sptr make(int Htotal, int Vtotal, int Hdisplay, int Vdisplay); + + virtual void set_Htotal_and_Vtotal(int Htotal, int Vtotal) = 0; + }; + + } // namespace tempest +} // namespace gr + +#endif /* INCLUDED_TEMPEST_FRAMING_H */ + diff --git a/gr-tempest/include/tempest/infer_screen_resolution.h b/gr-tempest/include/tempest/infer_screen_resolution.h new file mode 100644 index 0000000..2f7df2c --- /dev/null +++ b/gr-tempest/include/tempest/infer_screen_resolution.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* + * Copyright 2020 + * Federico "Larroca" La Rocca + * + * Instituto de Ingenieria Electrica, Facultad de Ingenieria, + * Universidad de la Republica, Uruguay. + * + * This 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 3, or (at your option) + * any later version. + * + * This software 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef INCLUDED_TEMPEST_INFER_SCREEN_RESOLUTION_H +#define INCLUDED_TEMPEST_INFER_SCREEN_RESOLUTION_H + +#include +#include + +namespace gr { + namespace tempest { + + /*! + * \brief <+description of block+> + * \ingroup tempest + * + */ + class TEMPEST_API infer_screen_resolution : virtual public gr::block + { + public: + typedef std::shared_ptr sptr; + + virtual void set_refresh_rate(float refresh_rate) = 0; + + /*! + * \brief Return a shared_ptr to a new instance of tempest::infer_screen_resolution. + * + * To avoid accidental use of raw pointers, tempest::infer_screen_resolution's + * constructor is in a private implementation + * class. tempest::infer_screen_resolution::make is the public interface for + * creating new instances. + */ + static sptr make(int sample_rate, int fft_size, float refresh_rate, bool automatic_mode); + }; + + } // namespace tempest +} // namespace gr + +#endif /* INCLUDED_TEMPEST_INFER_SCREEN_RESOLUTION_H */ + diff --git a/gr-tempest/include/tempest/normalize_flow.h b/gr-tempest/include/tempest/normalize_flow.h new file mode 100644 index 0000000..56e7a7c --- /dev/null +++ b/gr-tempest/include/tempest/normalize_flow.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* + * Copyright 2020 + * Federico "Larroca" La Rocca + * + * Instituto de Ingenieria Electrica, Facultad de Ingenieria, + * Universidad de la Republica, Uruguay. + * + * This 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 3, or (at your option) + * any later version. + * + * This software 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef INCLUDED_TEMPEST_NORMALIZE_FLOW_H +#define INCLUDED_TEMPEST_NORMALIZE_FLOW_H + +#include +#include + +namespace gr { + namespace tempest { + + /*! + * \brief Normalizes a flow between min and max. To be less CPU-intensive, it randomly chooses when to update the signal's maximum. + * \ingroup tempest + * + */ + class TEMPEST_API normalize_flow : virtual public gr::sync_block + { + public: + typedef std::shared_ptr sptr; + + /*! + * \brief Return a shared_ptr to a new instance of tempest::normalize_flow. + * + * To avoid accidental use of raw pointers, tempest::normalize_flow's + * constructor is in a private implementation + * class. tempest::normalize_flow::make is the public interface for + * creating new instances. + */ + static sptr make(float min, float max, int window, float alpha_avg, float update_proba); + + virtual void set_min_max(float min, float max) = 0; + }; + + } // namespace tempest +} // namespace gr + +#endif /* INCLUDED_TEMPEST_NORMALIZE_FLOW_H */ + diff --git a/gr-tempest/include/tempest/sampling_synchronization.h b/gr-tempest/include/tempest/sampling_synchronization.h new file mode 100644 index 0000000..5cef21f --- /dev/null +++ b/gr-tempest/include/tempest/sampling_synchronization.h @@ -0,0 +1,65 @@ +/* -*- c++ -*- */ +/* + * Copyright 2020 + * Federico "Larroca" La Rocca + * + * Instituto de Ingenieria Electrica, Facultad de Ingenieria, + * Universidad de la Republica, Uruguay. + * + * This 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 3, or (at your option) + * any later version. + * + * This software 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef INCLUDED_TEMPEST_SAMPLING_SYNCHRONIZATION_H +#define INCLUDED_TEMPEST_SAMPLING_SYNCHRONIZATION_H + +#include +#include + +namespace gr { + namespace tempest { + + /*! + * \brief It correlates the signal and estimates what's the most probable line length. It then corrects the sampling rate so that the line length's is Htotal. + * \ingroup tempest + * + */ + class TEMPEST_API sampling_synchronization : virtual public gr::block + { + public: + typedef std::shared_ptr sptr; + + /*! + * \brief Return a shared_ptr to a new instance of tempest::sampling_synchronization. + * + * To avoid accidental use of raw pointers, tempest::sampling_synchronization's + * constructor is in a private implementation + * class. tempest::sampling_synchronization::make is the public interface for + * creating new instances. + */ + static sptr make(int Htotal, double manual_correction); + + virtual void set_Htotal(int Htotal) = 0; + + virtual void set_manual_correction(double correction) = 0; + + }; + + } // namespace tempest +} // namespace gr + +#endif /* INCLUDED_TEMPEST_SAMPLING_SYNCHRONIZATION_H */ + diff --git a/gr-tempest/include/tempest/ssamp_correction.h b/gr-tempest/include/tempest/ssamp_correction.h new file mode 100644 index 0000000..107b6c8 --- /dev/null +++ b/gr-tempest/include/tempest/ssamp_correction.h @@ -0,0 +1,61 @@ +/* -*- c++ -*- */ +/* + * Copyright 2020 + * Federico "Larroca" La Rocca + * + * Instituto de Ingenieria Electrica, Facultad de Ingenieria, + * Universidad de la Republica, Uruguay. + * + * This 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 3, or (at your option) + * any later version. + * + * This software 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef INCLUDED_TEMPEST_SSAMP_CORRECTION_H +#define INCLUDED_TEMPEST_SSAMP_CORRECTION_H + +#include +#include + +namespace gr { + namespace tempest { + + /*! + * \brief <+description of block+> + * \ingroup tempest + * + */ + class TEMPEST_API ssamp_correction : virtual public gr::block + { + public: + typedef std::shared_ptr sptr; + + /*! + * \brief Return a shared_ptr to a new instance of tempest::ssamp_correction. + * + * To avoid accidental use of raw pointers, tempest::ssamp_correction's + * constructor is in a private implementation + * class. tempest::ssamp_correction::make is the public interface for + * creating new instances. + */ + static sptr make(int Htotal, int Vtotal, int correct_sampling, float max_deviation); + virtual void set_Htotal_Vtotal(int Htotal, int Vtotal) = 0; + }; + + } // namespace tempest +} // namespace gr + +#endif /* INCLUDED_TEMPEST_SSAMP_CORRECTION_H */ + diff --git a/gr-tempest/include/tempest/sync_detector.h b/gr-tempest/include/tempest/sync_detector.h new file mode 100644 index 0000000..0f3db13 --- /dev/null +++ b/gr-tempest/include/tempest/sync_detector.h @@ -0,0 +1,60 @@ +/* -*- c++ -*- */ +/* + * Copyright 2020 + * Federico "Larroca" La Rocca + * + * Instituto de Ingenieria Electrica, Facultad de Ingenieria, + * Universidad de la Republica, Uruguay. + * + * This 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 3, or (at your option) + * any later version. + * + * This software 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef INCLUDED_TEMPEST_SYNC_DETECTOR_H +#define INCLUDED_TEMPEST_SYNC_DETECTOR_H + +#include +#include + +namespace gr { + namespace tempest { + + /*! + * \brief <+description of block+> + * \ingroup tempest + * + */ + class TEMPEST_API sync_detector : virtual public gr::block + { + public: + typedef std::shared_ptr sptr; + + /*! + * \brief Return a shared_ptr to a new instance of tempest::sync_detector. + * + * To avoid accidental use of raw pointers, tempest::sync_detector's + * constructor is in a private implementation + * class. tempest::sync_detector::make is the public interface for + * creating new instances. + */ + static sptr make(int hscreen, int vscreen, int hblanking, int vblanking); + }; + + } // namespace tempest +} // namespace gr + +#endif /* INCLUDED_TEMPEST_SYNC_DETECTOR_H */ +