diff -Nru edfbrowser-1.67+dfsg/about_dialog.cpp edfbrowser-1.68+dfsg/about_dialog.cpp --- edfbrowser-1.67+dfsg/about_dialog.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/about_dialog.cpp 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -30,8 +30,6 @@ #include "about_dialog.h" - - UI_Aboutwindow::UI_Aboutwindow(UI_Mainwindow *mainwindow) { char str[512]; @@ -65,10 +63,10 @@ textedit1->setReadOnly(true); textedit1->setLineWrapMode(QTextEdit::NoWrap); textedit1->setPlainText( - "\n " PROGRAM_NAME " " PROGRAM_VERSION "\n" + "\n " PROGRAM_NAME " version " PROGRAM_VERSION " " PROGRAM_BETA_SUFFIX " " THIS_APP_BITS_W "\n" "\n This program is made by Teunis van Beelen.\n" "\n Copyright (C) 2007 - 2019 Teunis van Beelen.\n" - "\n Email: teuniz@gmail.com\n" + "\n Email: teuniz@protonmail.com\n" "\n Disclaimer:\n" " Despite this software is intend to be useful, there is no warranty, use this software at your own risk!\n" " EDFbrowser may NOT be used in safety-critical applications, such as life-support medical systems.\n" diff -Nru edfbrowser-1.67+dfsg/about_dialog.h edfbrowser-1.68+dfsg/about_dialog.h --- edfbrowser-1.67+dfsg/about_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/about_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/active_file_chooser.cpp edfbrowser-1.68+dfsg/active_file_chooser.cpp --- edfbrowser-1.67+dfsg/active_file_chooser.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/active_file_chooser.cpp 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/active_file_chooser.h edfbrowser-1.68+dfsg/active_file_chooser.h --- edfbrowser-1.67+dfsg/active_file_chooser.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/active_file_chooser.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/adjustfiltersettings.cpp edfbrowser-1.68+dfsg/adjustfiltersettings.cpp --- edfbrowser-1.67+dfsg/adjustfiltersettings.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/adjustfiltersettings.cpp 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/adjustfiltersettings.h edfbrowser-1.68+dfsg/adjustfiltersettings.h --- edfbrowser-1.67+dfsg/adjustfiltersettings.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/adjustfiltersettings.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/annotations_dock.cpp edfbrowser-1.68+dfsg/annotations_dock.cpp --- edfbrowser-1.67+dfsg/annotations_dock.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/annotations_dock.cpp 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/annotations_dock.h edfbrowser-1.68+dfsg/annotations_dock.h --- edfbrowser-1.67+dfsg/annotations_dock.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/annotations_dock.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/annotlist_filter_dialog.cpp edfbrowser-1.68+dfsg/annotlist_filter_dialog.cpp --- edfbrowser-1.67+dfsg/annotlist_filter_dialog.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/annotlist_filter_dialog.cpp 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2017 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/annotlist_filter_dialog.h edfbrowser-1.68+dfsg/annotlist_filter_dialog.h --- edfbrowser-1.67+dfsg/annotlist_filter_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/annotlist_filter_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2017 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/ascii2edf.cpp edfbrowser-1.68+dfsg/ascii2edf.cpp --- edfbrowser-1.67+dfsg/ascii2edf.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/ascii2edf.cpp 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2008 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/ascii2edf.h edfbrowser-1.68+dfsg/ascii2edf.h --- edfbrowser-1.67+dfsg/ascii2edf.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/ascii2edf.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2008 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/ascii_export.cpp edfbrowser-1.68+dfsg/ascii_export.cpp --- edfbrowser-1.67+dfsg/ascii_export.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/ascii_export.cpp 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/ascii_export.h edfbrowser-1.68+dfsg/ascii_export.h --- edfbrowser-1.67+dfsg/ascii_export.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/ascii_export.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/averager_curve_wnd.cpp edfbrowser-1.68+dfsg/averager_curve_wnd.cpp --- edfbrowser-1.67+dfsg/averager_curve_wnd.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/averager_curve_wnd.cpp 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2011 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/averager_curve_wnd.h edfbrowser-1.68+dfsg/averager_curve_wnd.h --- edfbrowser-1.67+dfsg/averager_curve_wnd.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/averager_curve_wnd.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2011 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/averager_dialog.cpp edfbrowser-1.68+dfsg/averager_dialog.cpp --- edfbrowser-1.67+dfsg/averager_dialog.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/averager_dialog.cpp 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2011 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -489,7 +489,7 @@ char *viewbuf; - long long s, s2; + unsigned long long s, s2; double dig_value=0.0, f_tmp=0.0; diff -Nru edfbrowser-1.67+dfsg/averager_dialog.h edfbrowser-1.68+dfsg/averager_dialog.h --- edfbrowser-1.67+dfsg/averager_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/averager_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2011 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/bdf2edf.cpp edfbrowser-1.68+dfsg/bdf2edf.cpp --- edfbrowser-1.67+dfsg/bdf2edf.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/bdf2edf.cpp 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/bdf2edf.h edfbrowser-1.68+dfsg/bdf2edf.h --- edfbrowser-1.67+dfsg/bdf2edf.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/bdf2edf.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/bdf_triggers.cpp edfbrowser-1.68+dfsg/bdf_triggers.cpp --- edfbrowser-1.67+dfsg/bdf_triggers.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/bdf_triggers.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/bdf_triggers.h edfbrowser-1.68+dfsg/bdf_triggers.h --- edfbrowser-1.67+dfsg/bdf_triggers.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/bdf_triggers.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/bi9800.cpp edfbrowser-1.68+dfsg/bi9800.cpp --- edfbrowser-1.67+dfsg/bi9800.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/bi9800.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/bi9800.h edfbrowser-1.68+dfsg/bi9800.h --- edfbrowser-1.67+dfsg/bi9800.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/bi9800.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/biosemi2bdfplus.cpp edfbrowser-1.68+dfsg/biosemi2bdfplus.cpp --- edfbrowser-1.67+dfsg/biosemi2bdfplus.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/biosemi2bdfplus.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/biosemi2bdfplus.h edfbrowser-1.68+dfsg/biosemi2bdfplus.h --- edfbrowser-1.67+dfsg/biosemi2bdfplus.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/biosemi2bdfplus.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/biox2edf.cpp edfbrowser-1.68+dfsg/biox2edf.cpp --- edfbrowser-1.67+dfsg/biox2edf.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/biox2edf.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2015 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/biox2edf.h edfbrowser-1.68+dfsg/biox2edf.h --- edfbrowser-1.67+dfsg/biox2edf.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/biox2edf.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2015 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/check_edf_file.cpp edfbrowser-1.68+dfsg/check_edf_file.cpp --- edfbrowser-1.67+dfsg/check_edf_file.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/check_edf_file.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/check_edf_file.h edfbrowser-1.68+dfsg/check_edf_file.h --- edfbrowser-1.67+dfsg/check_edf_file.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/check_edf_file.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/check_for_updates.cpp edfbrowser-1.68+dfsg/check_for_updates.cpp --- edfbrowser-1.67+dfsg/check_for_updates.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/check_for_updates.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2013 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/check_for_updates.h edfbrowser-1.68+dfsg/check_for_updates.h --- edfbrowser-1.67+dfsg/check_for_updates.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/check_for_updates.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2013 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/colordialog.cpp edfbrowser-1.68+dfsg/colordialog.cpp --- edfbrowser-1.67+dfsg/colordialog.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/colordialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/colordialog.h edfbrowser-1.68+dfsg/colordialog.h --- edfbrowser-1.67+dfsg/colordialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/colordialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/date_time_stamp_parser.c edfbrowser-1.68+dfsg/date_time_stamp_parser.c --- edfbrowser-1.67+dfsg/date_time_stamp_parser.c 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/date_time_stamp_parser.c 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2014 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/date_time_stamp_parser.h edfbrowser-1.68+dfsg/date_time_stamp_parser.h --- edfbrowser-1.67+dfsg/date_time_stamp_parser.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/date_time_stamp_parser.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2014 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/debian/changelog edfbrowser-1.68+dfsg/debian/changelog --- edfbrowser-1.67+dfsg/debian/changelog 2019-01-30 08:31:22.000000000 +0000 +++ edfbrowser-1.68+dfsg/debian/changelog 2019-08-19 06:53:47.000000000 +0000 @@ -1,3 +1,11 @@ +edfbrowser (1.68+dfsg-1) unstable; urgency=medium + + * New upstream version + * debhelper-compat 12 + * Standards-Version: 4.4.0 + + -- Andreas Tille Mon, 19 Aug 2019 08:53:47 +0200 + edfbrowser (1.67+dfsg-1) unstable; urgency=medium * New upstream version diff -Nru edfbrowser-1.67+dfsg/debian/compat edfbrowser-1.68+dfsg/debian/compat --- edfbrowser-1.67+dfsg/debian/compat 2019-01-30 08:31:22.000000000 +0000 +++ edfbrowser-1.68+dfsg/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -12 diff -Nru edfbrowser-1.67+dfsg/debian/control edfbrowser-1.68+dfsg/debian/control --- edfbrowser-1.67+dfsg/debian/control 2019-01-30 08:31:22.000000000 +0000 +++ edfbrowser-1.68+dfsg/debian/control 2019-08-19 06:53:47.000000000 +0000 @@ -3,14 +3,14 @@ Uploaders: Andreas Tille Section: science Priority: optional -Build-Depends: debhelper (>= 12~), +Build-Depends: debhelper-compat (= 12), qt5-qmake, qtbase5-dev, qtbase5-dev-tools, libqt5opengl5-dev, qttools5-dev-tools, libedf-dev -Standards-Version: 4.3.0 +Standards-Version: 4.4.0 Vcs-Browser: https://salsa.debian.org/med-team/edfbrowser Vcs-Git: https://salsa.debian.org/med-team/edfbrowser.git Homepage: http://www.teuniz.net/edfbrowser/ diff -Nru edfbrowser-1.67+dfsg/doc/manual.html edfbrowser-1.68+dfsg/doc/manual.html --- edfbrowser-1.67+dfsg/doc/manual.html 2019-01-26 13:36:35.917155377 +0000 +++ edfbrowser-1.68+dfsg/doc/manual.html 2019-08-05 19:13:43.579000862 +0000 @@ -7,7 +7,7 @@ -

EDFbrowser 1.67 manual

+

EDFbrowser 1.68 manual


@@ -421,10 +421,12 @@ shown on the screen. Increasing or decreasing the FFT blocksize affects the FFT resolution.
The default FFT blocksize can be set in Settings menu.
So, if the samplefrequency of the selected signal is 256Hz, the timescale is set to 10 seconds and
- the FFT-blocksize is 512, the number of FFT's performed is (10 seconds x 256 Hz) / 512 = 5.
+ the FFT-blocksize is 512, the number of FFT's performed (with a rectangular window) is (10 seconds x 256 Hz) / 512 = 5.
The output of the five FFT's are averaged.
In case you set the FFT blocksize equal to timescale x samplefrequency, exactly one FFT will be performed.

+ It's possible to let the FFT blocks overlap eachother.
+
This powerspectrum is static and will not update when you change the fileposition (pressing PgUp/PgDn etc.).
This way you can compare multiple powerspectra from different signals and/or filepositions.

@@ -513,7 +515,7 @@ in the waveform of the QRS complex (like notch-filters do).

The following rules apply:
- - The samplefrequency of the ECG recording must be at least 500 Hz
+ - The samplefrequency of the ECG recording must be at least 240 Hz
- The samplefrequency of the ECG recording must be an integer multiple of the powerline frequency
- The physical dimension (units) of the ECG signal must be expressed in uV, mV or V.

@@ -713,7 +715,7 @@

Crosshairs

- You can use one or two crosshairs for precise measurements. Leftclick on the signallabel
+ You can use one or two crosshairs for precise measurements. Press Alt+Shift+C or Leftclick on the signallabel
of the signal of interest. A small dialog will appear. Click on Crosshair. A crosshair will
appear. Drag and drop the crosshair with the left mousebutton. Now you can add another crosshair.
The second crosshair will show you the differences (delta) in time and value of the signal(s).
@@ -1902,7 +1904,7 @@ Q. I think I found a bug. Where do I report it?

A. First check if you are using the latest version of EDFbrowser.
- If the bug persists, send an email to teuniz@gmail.com + If the bug persists, send an email to teuniz@protonmail.com


diff -Nru edfbrowser-1.67+dfsg/ecg_export.cpp edfbrowser-1.68+dfsg/ecg_export.cpp --- edfbrowser-1.67+dfsg/ecg_export.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/ecg_export.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2011 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/ecg_export.h edfbrowser-1.68+dfsg/ecg_export.h --- edfbrowser-1.67+dfsg/ecg_export.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/ecg_export.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2011 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/ecg_filter.c edfbrowser-1.68+dfsg/ecg_filter.c --- edfbrowser-1.67+dfsg/ecg_filter.c 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/ecg_filter.c 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2011 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/ecg_filter.h edfbrowser-1.68+dfsg/ecg_filter.h --- edfbrowser-1.67+dfsg/ecg_filter.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/ecg_filter.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2011 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/ecg_statistics.c edfbrowser-1.68+dfsg/ecg_statistics.c --- edfbrowser-1.67+dfsg/ecg_statistics.c 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/ecg_statistics.c 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2018 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/ecg_statistics.h edfbrowser-1.68+dfsg/ecg_statistics.h --- edfbrowser-1.67+dfsg/ecg_statistics.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/ecg_statistics.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2018 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/edf_annotations.cpp edfbrowser-1.68+dfsg/edf_annotations.cpp --- edfbrowser-1.67+dfsg/edf_annotations.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/edf_annotations.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/edf_annotations.h edfbrowser-1.68+dfsg/edf_annotations.h --- edfbrowser-1.67+dfsg/edf_annotations.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/edf_annotations.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/edf_annot_list.c edfbrowser-1.68+dfsg/edf_annot_list.c --- edfbrowser-1.67+dfsg/edf_annot_list.c 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/edf_annot_list.c 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/edf_annot_list.h edfbrowser-1.68+dfsg/edf_annot_list.h --- edfbrowser-1.67+dfsg/edf_annot_list.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/edf_annot_list.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/edfbrowser_plugin_import.cpp edfbrowser-1.68+dfsg/edfbrowser_plugin_import.cpp --- edfbrowser-1.67+dfsg/edfbrowser_plugin_import.cpp 1970-01-01 00:00:00.000000000 +0000 +++ edfbrowser-1.68+dfsg/edfbrowser_plugin_import.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -0,0 +1,15 @@ +// This file is autogenerated by qmake. It imports static plugin classes for +// static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS. variables. +#include +Q_IMPORT_PLUGIN(QCupsPrinterSupportPlugin) +Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) +Q_IMPORT_PLUGIN(QGifPlugin) +Q_IMPORT_PLUGIN(QICNSPlugin) +Q_IMPORT_PLUGIN(QICOPlugin) +Q_IMPORT_PLUGIN(QJpegPlugin) +Q_IMPORT_PLUGIN(QMngPlugin) +Q_IMPORT_PLUGIN(QTgaPlugin) +Q_IMPORT_PLUGIN(QTiffPlugin) +Q_IMPORT_PLUGIN(QWbmpPlugin) +Q_IMPORT_PLUGIN(QWebpPlugin) +Q_IMPORT_PLUGIN(QGenericEnginePlugin) diff -Nru edfbrowser-1.67+dfsg/edfbrowser.pro edfbrowser-1.68+dfsg/edfbrowser.pro --- edfbrowser-1.67+dfsg/edfbrowser.pro 2019-01-26 13:36:35.941155254 +0000 +++ edfbrowser-1.68+dfsg/edfbrowser.pro 2019-08-05 19:13:43.599000837 +0000 @@ -143,6 +143,13 @@ HEADERS += third_party/kiss_fft/_kiss_fft_guts.h HEADERS += third_party/kiss_fft/kiss_fftr.h +HEADERS += third_party/smarc/filtering.h +HEADERS += third_party/smarc/multi_stage.h +HEADERS += third_party/smarc/polyfilt.h +HEADERS += third_party/smarc/smarc.h +HEADERS += third_party/smarc/stage_impl.h +HEADERS += third_party/smarc/remez_lp.h + SOURCES += main.cpp SOURCES += mainwindow_constr.cpp SOURCES += mainwindow.cpp @@ -239,6 +246,13 @@ SOURCES += third_party/kiss_fft/kiss_fft.c SOURCES += third_party/kiss_fft/kiss_fftr.c +SOURCES += third_party/smarc/filtering.c +SOURCES += third_party/smarc/multi_stage.c +SOURCES += third_party/smarc/polyfilt.c +SOURCES += third_party/smarc/smarc.c +SOURCES += third_party/smarc/stage_impl.c +SOURCES += third_party/smarc/remez_lp.c + RESOURCES = images.qrc diff -Nru edfbrowser-1.67+dfsg/edf_compat.cpp edfbrowser-1.68+dfsg/edf_compat.cpp --- edfbrowser-1.67+dfsg/edf_compat.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/edf_compat.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/edf_compat.h edfbrowser-1.68+dfsg/edf_compat.h --- edfbrowser-1.67+dfsg/edf_compat.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/edf_compat.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/edf_helper.c edfbrowser-1.68+dfsg/edf_helper.c --- edfbrowser-1.67+dfsg/edf_helper.c 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/edf_helper.c 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/edf_helper.h edfbrowser-1.68+dfsg/edf_helper.h --- edfbrowser-1.67+dfsg/edf_helper.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/edf_helper.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/edfplusd_cnv.cpp edfbrowser-1.68+dfsg/edfplusd_cnv.cpp --- edfbrowser-1.67+dfsg/edfplusd_cnv.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/edfplusd_cnv.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -376,7 +376,7 @@ former_timestamp = next_timestamp - edfhdr->long_data_record_duration; } - if(next_timestamp!=(former_timestamp + edfhdr->long_data_record_duration)) + if(next_timestamp != (long long)(former_timestamp + edfhdr->long_data_record_duration)) { chunk_endtime = next_timestamp; diff -Nru edfbrowser-1.67+dfsg/edfplusd_cnv.h edfbrowser-1.68+dfsg/edfplusd_cnv.h --- edfbrowser-1.67+dfsg/edfplusd_cnv.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/edfplusd_cnv.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/edit_annotation_dock.cpp edfbrowser-1.68+dfsg/edit_annotation_dock.cpp --- edfbrowser-1.67+dfsg/edit_annotation_dock.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/edit_annotation_dock.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/edit_annotation_dock.h edfbrowser-1.68+dfsg/edit_annotation_dock.h --- edfbrowser-1.67+dfsg/edit_annotation_dock.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/edit_annotation_dock.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/edit_predefined_mtg.cpp edfbrowser-1.68+dfsg/edit_predefined_mtg.cpp --- edfbrowser-1.67+dfsg/edit_predefined_mtg.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/edit_predefined_mtg.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/edit_predefined_mtg.h edfbrowser-1.68+dfsg/edit_predefined_mtg.h --- edfbrowser-1.67+dfsg/edit_predefined_mtg.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/edit_predefined_mtg.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/emsa2edf.cpp edfbrowser-1.68+dfsg/emsa2edf.cpp --- edfbrowser-1.67+dfsg/emsa2edf.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/emsa2edf.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/emsa2edf.h edfbrowser-1.68+dfsg/emsa2edf.h --- edfbrowser-1.67+dfsg/emsa2edf.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/emsa2edf.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/export_annotations.cpp edfbrowser-1.68+dfsg/export_annotations.cpp --- edfbrowser-1.67+dfsg/export_annotations.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/export_annotations.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/export_annotations.h edfbrowser-1.68+dfsg/export_annotations.h --- edfbrowser-1.67+dfsg/export_annotations.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/export_annotations.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/export_filtered_signals.cpp edfbrowser-1.68+dfsg/export_filtered_signals.cpp --- edfbrowser-1.67+dfsg/export_filtered_signals.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/export_filtered_signals.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2017 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/export_filtered_signals.h edfbrowser-1.68+dfsg/export_filtered_signals.h --- edfbrowser-1.67+dfsg/export_filtered_signals.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/export_filtered_signals.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2017 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/fft_wrap.c edfbrowser-1.68+dfsg/fft_wrap.c --- edfbrowser-1.67+dfsg/fft_wrap.c 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/fft_wrap.c 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2018 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -33,7 +33,7 @@ static void set_gain_unity(double *, int); -struct fft_wrap_settings_struct * fft_wrap_create(double *buf, int buf_size, int dft_size, int window_type) +struct fft_wrap_settings_struct * fft_wrap_create(double *buf, int buf_size, int dft_size, int window_type, int overlap) { struct fft_wrap_settings_struct *st; @@ -42,12 +42,14 @@ if(dft_size < 4) return NULL; if(dft_size & 1) dft_size--; if((window_type < 0) || (window_type > 7)) return NULL; + if((overlap < 1) || (overlap > 5)) return NULL; st = (struct fft_wrap_settings_struct *)calloc(1, sizeof(struct fft_wrap_settings_struct)); if(st == NULL) return NULL; st->sz_in = buf_size; st->dft_sz = dft_size; st->wndw_type = window_type; + st->overlap = overlap; st->blocks = 1; @@ -108,7 +110,7 @@ void fft_wrap_run(struct fft_wrap_settings_struct *st) { - int i, j; + int i, j, k; if(st == NULL) return; if(st->sz_in < 4) return; @@ -118,14 +120,13 @@ if(st->buf_out == NULL) return; if(st->kiss_fftbuf == NULL) return; + st->blocks_processed = 0; + if(st->wndw_type) { if(st->buf_wndw == NULL) return; - if(st->wndw_type) - { - window_func(st->buf_in, st->buf_wndw, st->buf_wndw_coef, st->dft_sz, st->wndw_type, 0); - } + window_func(st->buf_in, st->buf_wndw, st->buf_wndw_coef, st->dft_sz, st->wndw_type, 0); kiss_fftr(st->cfg, st->buf_wndw, st->kiss_fftbuf); } @@ -139,8 +140,31 @@ st->buf_out[i] = ((st->kiss_fftbuf[i].r * st->kiss_fftbuf[i].r) + (st->kiss_fftbuf[i].i * st->kiss_fftbuf[i].i)) / st->sz_out; } + st->blocks_processed++; + for(j=1; jblocks; j++) { + for(k=1; koverlap; k++) + { + if(st->wndw_type) + { + window_func(st->buf_in + (j * st->dft_sz) - ((st->dft_sz / st->overlap) * k), st->buf_wndw, st->buf_wndw_coef, st->dft_sz, st->wndw_type, j); + + kiss_fftr(st->cfg, st->buf_wndw, st->kiss_fftbuf); + } + else + { + kiss_fftr(st->cfg, st->buf_in + (j * st->dft_sz) - ((st->dft_sz / st->overlap) * k), st->kiss_fftbuf); + } + + for(i=0; isz_out; i++) + { + st->buf_out[i] += ((st->kiss_fftbuf[i].r * st->kiss_fftbuf[i].r) + (st->kiss_fftbuf[i].i * st->kiss_fftbuf[i].i)) / st->sz_out; + } + + st->blocks_processed++; + } + if(st->wndw_type) { window_func(st->buf_in + (j * st->dft_sz), st->buf_wndw, st->buf_wndw_coef, st->dft_sz, st->wndw_type, j); @@ -156,6 +180,8 @@ { st->buf_out[i] += ((st->kiss_fftbuf[i].r * st->kiss_fftbuf[i].r) + (st->kiss_fftbuf[i].i * st->kiss_fftbuf[i].i)) / st->sz_out; } + + st->blocks_processed++; } if(st->smpls_left) @@ -174,18 +200,16 @@ for(i=0; isz_out; i++) { st->buf_out[i] += ((st->kiss_fftbuf[i].r * st->kiss_fftbuf[i].r) + (st->kiss_fftbuf[i].i * st->kiss_fftbuf[i].i)) / st->sz_out; - - st->buf_out[i] /= (st->blocks + 1); } + + st->blocks_processed++; } - else + + if(st->blocks_processed > 1) { - if(st->blocks > 1) + for(i=0; isz_out; i++) { - for(i=0; isz_out; i++) - { - st->buf_out[i] /= st->blocks; - } + st->buf_out[i] /= st->blocks_processed; } } } diff -Nru edfbrowser-1.67+dfsg/fft_wrap.h edfbrowser-1.68+dfsg/fft_wrap.h --- edfbrowser-1.67+dfsg/fft_wrap.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/fft_wrap.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2018 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -61,6 +61,8 @@ int blocks; int smpls_left; int wndw_type; + int overlap; + int blocks_processed; double *buf_in; double *buf_wndw; double *buf_wndw_coef; @@ -70,7 +72,7 @@ }; -struct fft_wrap_settings_struct * fft_wrap_create(double *, int, int, int); +struct fft_wrap_settings_struct * fft_wrap_create(double *, int, int, int, int); void fft_wrap_run(struct fft_wrap_settings_struct *); void free_fft_wrap(struct fft_wrap_settings_struct *); diff -Nru edfbrowser-1.67+dfsg/filter.c edfbrowser-1.68+dfsg/filter.c --- edfbrowser-1.67+dfsg/filter.c 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/filter.c 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/filtercurve.cpp edfbrowser-1.68+dfsg/filtercurve.cpp --- edfbrowser-1.67+dfsg/filtercurve.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/filtercurve.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/filtercurve.h edfbrowser-1.68+dfsg/filtercurve.h --- edfbrowser-1.67+dfsg/filtercurve.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/filtercurve.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/filter_dialog.cpp edfbrowser-1.68+dfsg/filter_dialog.cpp --- edfbrowser-1.67+dfsg/filter_dialog.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/filter_dialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/filter_dialog.h edfbrowser-1.68+dfsg/filter_dialog.h --- edfbrowser-1.67+dfsg/filter_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/filter_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/filteredblockread.cpp edfbrowser-1.68+dfsg/filteredblockread.cpp --- edfbrowser-1.67+dfsg/filteredblockread.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/filteredblockread.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2012 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -36,7 +36,7 @@ if(i_signalcomp == NULL) { datarecord_cnt = -1; - total_samples = -1; + total_samples = -1LL; return NULL; } @@ -46,7 +46,7 @@ if(hdr == NULL) { datarecord_cnt = -1; - total_samples = -1; + total_samples = -1LL; return NULL; } @@ -55,7 +55,7 @@ if(inputfile == NULL) { datarecord_cnt = -1; - total_samples = -1; + total_samples = -1LL; return NULL; } @@ -65,14 +65,14 @@ if((datarecord_cnt > hdr->datarecords) || (datarecord_cnt < 1)) { datarecord_cnt = -1; - total_samples = -1; + total_samples = -1LL; return NULL; } samples_per_datrec = hdr->edfparam[signalcomp->edfsignal[0]].smp_per_record; - total_samples = samples_per_datrec * datarecord_cnt; + total_samples = (long long)samples_per_datrec * (long long)datarecord_cnt; if(processed_samples_buf != NULL) { @@ -82,7 +82,7 @@ if(processed_samples_buf == NULL) { datarecord_cnt = -1; - total_samples = -1; + total_samples = -1LL; return NULL; } @@ -95,7 +95,7 @@ if(readbuf == NULL) { datarecord_cnt = -1; - total_samples = -1; + total_samples = -1LL; free(processed_samples_buf); processed_samples_buf = NULL; @@ -108,7 +108,7 @@ } -int FilteredBlockReadClass::samples_in_buf(void) +long long FilteredBlockReadClass::samples_in_buf(void) { return total_samples; } @@ -120,7 +120,7 @@ processed_samples_buf = NULL; datarecord_cnt = -1; - total_samples = -1; + total_samples = -1LL; inputfile = NULL; hdr = NULL; @@ -144,7 +144,9 @@ int FilteredBlockReadClass::process_signalcomp(int datarecord_start) { - int j, k, s; + int j, k; + + long long s; double dig_value=0.0, f_tmp=0.0; @@ -200,14 +202,14 @@ readbuf + (signalcomp->edfhdr->recordsize * (s / samples_per_datrec)) + signalcomp->edfhdr->edfparam[signalcomp->edfsignal[j]].buf_offset - + ((s % samples_per_datrec) * 3))); + + ((s % samples_per_datrec) * 3LL))); var.four[2] = *((unsigned char *)( readbuf + (signalcomp->edfhdr->recordsize * (s / samples_per_datrec)) + signalcomp->edfhdr->edfparam[signalcomp->edfsignal[j]].buf_offset - + ((s % samples_per_datrec) * 3) - + 2)); + + ((s % samples_per_datrec) * 3LL) + + 2LL)); if(var.four[2]&0x80) { diff -Nru edfbrowser-1.67+dfsg/filteredblockread.h edfbrowser-1.68+dfsg/filteredblockread.h --- edfbrowser-1.67+dfsg/filteredblockread.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/filteredblockread.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2012 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -58,9 +58,10 @@ int datarecord_cnt, samples_per_datrec, - total_samples, skip_filters; + long long total_samples; + char *readbuf; double *processed_samples_buf, @@ -70,7 +71,7 @@ public: double * init_signalcomp(struct signalcompblock *, int, int); int process_signalcomp(int); - int samples_in_buf(void); + long long samples_in_buf(void); FilteredBlockReadClass(); ~FilteredBlockReadClass(); }; diff -Nru edfbrowser-1.67+dfsg/filter.h edfbrowser-1.68+dfsg/filter.h --- edfbrowser-1.67+dfsg/filter.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/filter.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/fino2edf.cpp edfbrowser-1.68+dfsg/fino2edf.cpp --- edfbrowser-1.67+dfsg/fino2edf.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/fino2edf.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2008 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/fino2edf.h edfbrowser-1.68+dfsg/fino2edf.h --- edfbrowser-1.67+dfsg/fino2edf.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/fino2edf.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2008 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/fir_filter.c edfbrowser-1.68+dfsg/fir_filter.c --- edfbrowser-1.67+dfsg/fir_filter.c 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/fir_filter.c 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2018 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * ************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/fir_filter_dialog.cpp edfbrowser-1.68+dfsg/fir_filter_dialog.cpp --- edfbrowser-1.67+dfsg/fir_filter_dialog.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/fir_filter_dialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2018 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/fir_filter_dialog.h edfbrowser-1.68+dfsg/fir_filter_dialog.h --- edfbrowser-1.67+dfsg/fir_filter_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/fir_filter_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2018 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/fir_filter.h edfbrowser-1.68+dfsg/fir_filter.h --- edfbrowser-1.67+dfsg/fir_filter.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/fir_filter.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2018 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/flywheel.cpp edfbrowser-1.68+dfsg/flywheel.cpp --- edfbrowser-1.67+dfsg/flywheel.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/flywheel.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2012 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/flywheel.h edfbrowser-1.68+dfsg/flywheel.h --- edfbrowser-1.67+dfsg/flywheel.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/flywheel.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2012 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/fma_ecg2edf.cpp edfbrowser-1.68+dfsg/fma_ecg2edf.cpp --- edfbrowser-1.67+dfsg/fma_ecg2edf.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/fma_ecg2edf.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2015 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/fma_ecg2edf.h edfbrowser-1.68+dfsg/fma_ecg2edf.h --- edfbrowser-1.67+dfsg/fma_ecg2edf.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/fma_ecg2edf.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2015 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/global.h edfbrowser-1.68+dfsg/global.h --- edfbrowser-1.67+dfsg/global.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/global.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -29,6 +29,20 @@ #ifndef EDFBROWSER_GLOBAL_H #define EDFBROWSER_GLOBAL_H +#if !defined(__GNUC__) +#if defined(__APPLE__) || defined(__MACH__) || defined(__APPLE_CC__) +/* nothing */ +#else +#error "You need the GNU C compiler!" +#endif +#endif + +#if defined(__LP64__) || defined(__MINGW64__) +#define THIS_APP_BITS_W "64-bit" +#else +#define THIS_APP_BITS_W "32-bit" +#endif + #include #if defined(__APPLE__) || defined(__MACH__) || defined(__APPLE_CC__) @@ -44,7 +58,8 @@ #endif #define PROGRAM_NAME "EDFbrowser" -#define PROGRAM_VERSION "1.67" +#define PROGRAM_VERSION "1.68" +#define PROGRAM_BETA_SUFFIX "" #define MINIMUM_QT4_VERSION 0x040701 #define MINIMUM_QT5_VERSION 0x050901 #define MAXFILES 32 @@ -66,8 +81,7 @@ #define MAXZSCOREDIALOGS 32 #define MAXZOOMHISTORY 16 /* 200 bpm x 60 min. x 24 hours x 2 days */ -//#define STATISTICS_IVAL_LIST_SZ 576000 -#define STATISTICS_IVAL_LIST_SZ 10000 +#define STATISTICS_IVAL_LIST_SZ 576000 #define ANNOT_ID_NK_TRIGGER 0 @@ -150,7 +164,7 @@ int nk_triggers_read; int genuine_biosemi; double data_record_duration; - long long long_data_record_duration; + unsigned long long long_data_record_duration; long long viewtime; long long starttime_offset; long long prefiltertime; @@ -164,13 +178,13 @@ int filenum; struct edfhdrblock *edfhdr; int num_of_signals; - int viewbufsize; - int viewbufoffset; - long long records_in_viewbuf; - long long samples_in_viewbuf; - long long samples_on_screen; - long long sample_start; - long long sample_stop; + unsigned long long viewbufsize; + unsigned long long viewbufoffset; + unsigned long long records_in_viewbuf; + unsigned long long samples_in_viewbuf; + unsigned long long samples_on_screen; + unsigned long long sample_start; + unsigned long long sample_stop; int timeoffset; int sample_timeoffset; int pixels_shift; diff -Nru edfbrowser-1.67+dfsg/header_editor.cpp edfbrowser-1.68+dfsg/header_editor.cpp --- edfbrowser-1.67+dfsg/header_editor.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/header_editor.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/header_editor.h edfbrowser-1.68+dfsg/header_editor.h --- edfbrowser-1.67+dfsg/header_editor.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/header_editor.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * Binary files /tmp/tmp11L212/eCfY7k9fae/edfbrowser-1.67+dfsg/images/splash.png and /tmp/tmp11L212/KsPBTGQEOz/edfbrowser-1.68+dfsg/images/splash.png differ diff -Nru edfbrowser-1.67+dfsg/import_annotations.cpp edfbrowser-1.68+dfsg/import_annotations.cpp --- edfbrowser-1.67+dfsg/import_annotations.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/import_annotations.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/import_annotations.h edfbrowser-1.68+dfsg/import_annotations.h --- edfbrowser-1.67+dfsg/import_annotations.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/import_annotations.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/jump_dialog.cpp edfbrowser-1.68+dfsg/jump_dialog.cpp --- edfbrowser-1.67+dfsg/jump_dialog.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/jump_dialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/jump_dialog.h edfbrowser-1.68+dfsg/jump_dialog.h --- edfbrowser-1.67+dfsg/jump_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/jump_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/load_montage_dialog.cpp edfbrowser-1.68+dfsg/load_montage_dialog.cpp --- edfbrowser-1.67+dfsg/load_montage_dialog.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/load_montage_dialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/load_montage_dialog.h edfbrowser-1.68+dfsg/load_montage_dialog.h --- edfbrowser-1.67+dfsg/load_montage_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/load_montage_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/main.cpp edfbrowser-1.68+dfsg/main.cpp --- edfbrowser-1.67+dfsg/main.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/main.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -7,6 +7,9 @@ #include #include #include +#include +#include +#include #include "mainwindow.h" @@ -18,6 +21,13 @@ // app.setAttribute(Qt::AA_DontUseNativeMenuBar); QPixmap pixmap(":/images/splash.png"); + + QPainter p(&pixmap); + QFont sansFont("Noto Sans", 10); + p.setFont(sansFont); + p.setPen(Qt::black); + p.drawText(250, 260, 300, 30, Qt::AlignLeft | Qt::TextSingleLine, "version " PROGRAM_VERSION " " PROGRAM_BETA_SUFFIX " " THIS_APP_BITS_W); + QSplashScreen splash(pixmap, Qt::WindowStaysOnTopHint); QTimer t1; diff -Nru edfbrowser-1.67+dfsg/mainwindow_constr.cpp edfbrowser-1.68+dfsg/mainwindow_constr.cpp --- edfbrowser-1.67+dfsg/mainwindow_constr.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/mainwindow_constr.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -33,11 +33,13 @@ UI_Mainwindow::UI_Mainwindow() { - int i, j, k; + int i, j, k, pxw; - setMinimumSize(640, 480); - setWindowTitle(PROGRAM_NAME); - setWindowIcon(QIcon(":/images/edf.png")); + char str[1024]={""}; + + QPixmap pxm(500, 100); + + QPainter p_aint(&pxm); myfont = new QFont; @@ -49,16 +51,39 @@ monofont->setFamily("courier"); monofont->setPixelSize(12); + + QApplication::setFont(*myfont); #else - myfont->setFamily("Arial"); - myfont->setPixelSize(12); + myfont->setFamily("Noto Sans"); + for(i=20; i>7; i--) + { + myfont->setPixelSize(i); + + p_aint.setFont(*myfont); + + pxw = p_aint.boundingRect(0, 0, 500, 100, Qt::AlignLeft | Qt::TextSingleLine, "ABCDEFGHIJKLMNOPQRSTUVWXYZ").width(); + +// printf("i is: %i width is: %i\n", i, pxw); + + if(pxw < 203) break; + } + font_size = i; + + myfont->setPixelSize(font_size); monofont->setFamily("andale mono"); monofont->setPixelSize(12); -#endif QApplication::setFont(*myfont); + sprintf(str, "font: %ipx;", font_size); + setStyleSheet(str); +#endif + + setMinimumSize(640, 480); + setWindowTitle(PROGRAM_NAME); + setWindowIcon(QIcon(":/images/edf.png")); + setlocale(LC_NUMERIC, "C"); pixelsizefactor = 0.0294382; @@ -121,6 +146,7 @@ toolbar_stats.active = 0; toolbar_stats.annot_label[0] = 0; toolbar_stats.annot_list = NULL; + toolbar_stats.ival = (double *)calloc(1, sizeof(double) * STATISTICS_IVAL_LIST_SZ); recent_montagedir[0] = 0; recent_savedir[0] = 0; @@ -875,6 +901,11 @@ connect(Escape_act, SIGNAL(triggered()), this, SLOT(Escape_fun())); maincurve->addAction(Escape_act); + next_crosshair = new QAction("Next Crosshair", this); + next_crosshair->setShortcut(Qt::ALT + Qt::SHIFT + Qt::Key_C); + connect(next_crosshair, SIGNAL(triggered()), maincurve, SLOT(next_crosshair_triggered())); + maincurve->addAction(next_crosshair); + positionslider = new QSlider(Qt::Horizontal); positionslider->setRange(0, 1000000); positionslider->setSingleStep(10000); @@ -1068,7 +1099,14 @@ v_nr = 0x10000 * atoi(v_str); v_nr += 0x100 * atoi(v_str + 2); - v_nr += atoi(v_str + 4); + if(v_str[3] == '.') + { + v_nr += atoi(v_str + 4); + } + else + { + v_nr += atoi(v_str + 5); + } if((v_nr < MINIMUM_QT4_VERSION) || ((v_nr >= 0x050000) && (v_nr < MINIMUM_QT5_VERSION))) { @@ -1088,6 +1126,11 @@ } pixmap = new QPixmap(":/images/splash.png"); + QPainter p(pixmap); + QFont sansFont("Noto Sans", 10); + p.setFont(sansFont); + p.setPen(Qt::black); + p.drawText(250, 260, 300, 30, Qt::AlignLeft | Qt::TextSingleLine, "version " PROGRAM_VERSION " " PROGRAM_BETA_SUFFIX " " THIS_APP_BITS_W); splash = new QSplashScreen(this, *pixmap, Qt::WindowStaysOnTopHint); update_checker = NULL; diff -Nru edfbrowser-1.67+dfsg/mainwindow.cpp edfbrowser-1.68+dfsg/mainwindow.cpp --- edfbrowser-1.67+dfsg/mainwindow.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/mainwindow.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -46,6 +46,7 @@ delete playback_realtime_time; delete playback_realtime_timer; if(update_checker != NULL) delete update_checker; + free(toolbar_stats.ival); } @@ -1611,7 +1612,7 @@ if((edfhdr->edfplus || edfhdr->bdfplus) && (!live_stream_active)) { - if((edfhdr->datarecords * (long long)edfhdr->recordsize) <= maxfilesize_to_readin_annotations) + if((edfhdr->datarecords * (unsigned long long)edfhdr->recordsize) <= maxfilesize_to_readin_annotations) { EDF_annotations annotations; @@ -1641,7 +1642,7 @@ if((edfhdr->bdf && (!edfhdr->bdfplus) && read_biosemi_status_signal) && (!live_stream_active)) { - if((edfhdr->datarecords * (long long)edfhdr->recordsize) <= maxfilesize_to_readin_annotations) + if((edfhdr->datarecords * (unsigned long long)edfhdr->recordsize) <= maxfilesize_to_readin_annotations) { BDF_triggers bdf_triggers_obj; @@ -3536,6 +3537,7 @@ "Ctrl++\t\tzoom in\n" "Ctrl+-\t\tzoom out\n" "F1 - F8\t\tload predefined montage\n" + "Alt+Shift+C\t\tcrosshair\n" "Esc\t\tremove crosshairs or floating ruler\n" "\nafter zooming in by dragging a rectangle:\n" @@ -3557,9 +3559,7 @@ "Keep middle mousebutton pressed to drag horizontally\n" "\nCtrl+Space\t\tToggle Playback or Pause\n" -#ifdef Q_OS_LINUX - "Ctrl+Shift+V\t\tToggle Playback with video" -#endif + "Ctrl+Shift+V\t\tToggle Playback with video\n" ); messagewindow.exec(); @@ -3883,6 +3883,9 @@ + + + diff -Nru edfbrowser-1.67+dfsg/mainwindow.h edfbrowser-1.68+dfsg/mainwindow.h --- edfbrowser-1.67+dfsg/mainwindow.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/mainwindow.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -94,12 +94,14 @@ #include #include #include +#include #include #include #include #include #include +#include #include "global.h" #include "viewcurve.h" @@ -238,10 +240,11 @@ viewtime_indicator_type, mainwindow_title_type, linear_interpol, - average_period; + average_period, + font_size; - long long pagetime, - maxfilesize_to_readin_annotations; + unsigned long long pagetime, + maxfilesize_to_readin_annotations; char *viewbuf, viewtime_string[128], @@ -269,7 +272,7 @@ struct{ int sz; int active; - double ival[STATISTICS_IVAL_LIST_SZ]; + double *ival; char annot_label[MAX_ANNOTATION_LEN + 1]; struct annotation_list *annot_list; } toolbar_stats; @@ -444,7 +447,8 @@ *absolut_timesync_act, *no_timesync_act, *user_def_sync_act, - *sel_viewtime_act[MAXFILES]; + *sel_viewtime_act[MAXFILES], + *next_crosshair; QActionGroup *AmplitudeGroup, *DisplayGroup, diff -Nru edfbrowser-1.67+dfsg/manscan2edf.cpp edfbrowser-1.68+dfsg/manscan2edf.cpp --- edfbrowser-1.67+dfsg/manscan2edf.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/manscan2edf.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2013 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/manscan2edf.h edfbrowser-1.68+dfsg/manscan2edf.h --- edfbrowser-1.67+dfsg/manscan2edf.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/manscan2edf.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2013 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/mit2edf.cpp edfbrowser-1.68+dfsg/mit2edf.cpp --- edfbrowser-1.67+dfsg/mit2edf.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/mit2edf.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2014 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -847,7 +847,7 @@ /////////////////// Start conversion ////////////////////////////////////////// - int k, blocks, tmp1, tmp2, l_end=0; + int k, blocks, tmp1, tmp2, l_end=0, odd_even=0; fseeko(data_inputfile, 0LL, SEEK_SET); @@ -887,18 +887,19 @@ { for(j=0; jsetGeometry(20, 535, 310, 25); - label4_12->setText("Use linear interpolation"); + label4_12->setText("Use linear interpolation for plotting"); + label4_12->setToolTip("Enabling this option will avoid the \"stairstep\" effect and will make the signal look smoother."); checkbox4_6 = new QCheckBox(tab4); checkbox4_6->setGeometry(325, 538, 20, 20); checkbox4_6->setTristate(false); + checkbox4_6->setToolTip("Enabling this option will avoid the \"stairstep\" effect and will make the signal look smoother."); if(mainwindow->linear_interpol) { checkbox4_6->setCheckState(Qt::Checked); diff -Nru edfbrowser-1.67+dfsg/options_dialog.h edfbrowser-1.68+dfsg/options_dialog.h --- edfbrowser-1.67+dfsg/options_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/options_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/pagetime_dialog.cpp edfbrowser-1.68+dfsg/pagetime_dialog.cpp --- edfbrowser-1.67+dfsg/pagetime_dialog.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/pagetime_dialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/pagetime_dialog.h edfbrowser-1.68+dfsg/pagetime_dialog.h --- edfbrowser-1.67+dfsg/pagetime_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/pagetime_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/plif_ecg_subtract_filter.c edfbrowser-1.68+dfsg/plif_ecg_subtract_filter.c --- edfbrowser-1.67+dfsg/plif_ecg_subtract_filter.c 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/plif_ecg_subtract_filter.c 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2017 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * ************************************************************************** * @@ -65,7 +65,7 @@ /* * - * sf: samplefrequency (must be >= 500Hz and must be an integer multiple of the powerline frequency) + * sf: samplefrequency (must be >= 240Hz and must be an integer multiple of the powerline frequency) * * pwlf: powerline frequency (must be set to 50Hz or 60Hz) * @@ -80,7 +80,7 @@ struct plif_subtract_filter_settings *st; /* perform some sanity checks */ - if(sf < 500) return NULL; /* we need at least the samplefrequency considered the "gold standard" */ + if(sf < 240) return NULL; if((pwlf != 50) && (pwlf != 60)) return NULL; /* powerline frequency must be either 50 or 60Hz */ diff -Nru edfbrowser-1.67+dfsg/plif_ecg_subtract_filter_dialog.cpp edfbrowser-1.68+dfsg/plif_ecg_subtract_filter_dialog.cpp --- edfbrowser-1.67+dfsg/plif_ecg_subtract_filter_dialog.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/plif_ecg_subtract_filter_dialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2017 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -70,7 +70,7 @@ list->setSelectionBehavior(QAbstractItemView::SelectRows); list->setSelectionMode(QAbstractItemView::ExtendedSelection); list->setToolTip("Only signals with a physical dimension V, mV or uV and\n" - "a samplerate of >= 500Hz and\n" + "a samplerate of >= 240Hz and\n" "an integer ratio to 50 or 60 Hz will be listed here."); CancelButton = new QPushButton(plifecgfilterdialog); @@ -90,7 +90,7 @@ { sf = mainwindow->signalcomp[i]->edfhdr->edfparam[mainwindow->signalcomp[i]->edfsignal[0]].sf_int; - if(sf < 500) /* don't list signals that have low samplerate */ + if(sf < 240) /* don't list signals that have low samplerate */ { continue; } diff -Nru edfbrowser-1.67+dfsg/plif_ecg_subtract_filter_dialog.h edfbrowser-1.68+dfsg/plif_ecg_subtract_filter_dialog.h --- edfbrowser-1.67+dfsg/plif_ecg_subtract_filter_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/plif_ecg_subtract_filter_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2017 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/plif_ecg_subtract_filter.h edfbrowser-1.68+dfsg/plif_ecg_subtract_filter.h --- edfbrowser-1.67+dfsg/plif_ecg_subtract_filter.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/plif_ecg_subtract_filter.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2017 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/popup_save_cancelwindow.cpp edfbrowser-1.68+dfsg/popup_save_cancelwindow.cpp --- edfbrowser-1.67+dfsg/popup_save_cancelwindow.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/popup_save_cancelwindow.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/popup_save_cancelwindow.h edfbrowser-1.68+dfsg/popup_save_cancelwindow.h --- edfbrowser-1.67+dfsg/popup_save_cancelwindow.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/popup_save_cancelwindow.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/print_to_bdf.cpp edfbrowser-1.68+dfsg/print_to_bdf.cpp --- edfbrowser-1.67+dfsg/print_to_bdf.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/print_to_bdf.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2008 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -55,15 +55,16 @@ const int smpl_div_arr[14]={100,80,64,50,40,32,20,16,10, 8, 5, 4, 2, 1}; - long long duration, - smpls_written[MAXSIGNALS], - s2, - preamble=0LL, - smpls_preamble[MAXSIGNALS], - taltime=0LL, + long long taltime=0LL, l_temp, referencetime, - annot_difftime=0LL; + annot_difftime=0LL, + s2; + + unsigned long long duration, + smpls_written[MAXSIGNALS], + preamble=0LL, + smpls_preamble[MAXSIGNALS]; char path[MAX_PATH_LENGTH], scratchpad[4096], @@ -149,7 +150,7 @@ for(i=0; iedfhdr->long_data_record_duration>duration) + if(signalcomp[i]->edfhdr->long_data_record_duration > duration) { duration = signalcomp[i]->edfhdr->long_data_record_duration; n = i; @@ -1301,7 +1302,7 @@ l_temp = annot_ptr->onset - annot_difftime; - if((l_temp >= 0LL) && (l_temp < (mainwindow->pagetime + TIME_DIMENSION))) + if((l_temp >= 0LL) && ((unsigned long long)l_temp < (mainwindow->pagetime + TIME_DIMENSION))) { tallen += fprintf(outputfile, "%+i.%07i", (int)(l_temp / TIME_DIMENSION), diff -Nru edfbrowser-1.67+dfsg/print_to_bdf.h edfbrowser-1.68+dfsg/print_to_bdf.h --- edfbrowser-1.67+dfsg/print_to_bdf.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/print_to_bdf.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2008 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/print_to_edf.cpp edfbrowser-1.68+dfsg/print_to_edf.cpp --- edfbrowser-1.67+dfsg/print_to_edf.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/print_to_edf.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2008 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -55,16 +55,17 @@ const int smpl_div_arr[14]={100,80,64,50,40,32,20,16,10, 8, 5, 4, 2, 1}; - long long duration, - smpls_written[MAXSIGNALS], - s2, - preamble=0LL, - smpls_preamble[MAXSIGNALS], + long long s2, taltime=0LL, l_temp, referencetime, annot_difftime=0LL; + unsigned long long duration, + smpls_written[MAXSIGNALS], + preamble=0LL, + smpls_preamble[MAXSIGNALS]; + char path[MAX_PATH_LENGTH], scratchpad[4096], datrecduration[32], @@ -1261,7 +1262,7 @@ l_temp = annot_ptr->onset - annot_difftime; - if((l_temp >= 0LL) && (l_temp < (mainwindow->pagetime + TIME_DIMENSION))) + if((l_temp >= 0LL) && (l_temp < (long long)(mainwindow->pagetime + TIME_DIMENSION))) { tallen += fprintf(outputfile, "%+i.%07i", (int)(l_temp / TIME_DIMENSION), diff -Nru edfbrowser-1.67+dfsg/print_to_edf.h edfbrowser-1.68+dfsg/print_to_edf.h --- edfbrowser-1.67+dfsg/print_to_edf.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/print_to_edf.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2008 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/ravg_filter.c edfbrowser-1.68+dfsg/ravg_filter.c --- edfbrowser-1.67+dfsg/ravg_filter.c 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/ravg_filter.c 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/ravg_filter.h edfbrowser-1.68+dfsg/ravg_filter.h --- edfbrowser-1.67+dfsg/ravg_filter.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/ravg_filter.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/raw2edf.cpp edfbrowser-1.68+dfsg/raw2edf.cpp --- edfbrowser-1.67+dfsg/raw2edf.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/raw2edf.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2012 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/raw2edf.h edfbrowser-1.68+dfsg/raw2edf.h --- edfbrowser-1.67+dfsg/raw2edf.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/raw2edf.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2012 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/README.txt edfbrowser-1.68+dfsg/README.txt --- edfbrowser-1.67+dfsg/README.txt 2019-01-26 13:36:35.985155030 +0000 +++ edfbrowser-1.68+dfsg/README.txt 2019-08-05 19:13:43.603000831 +0000 @@ -8,11 +8,7 @@ If you want to use Qt5, it must be version >= 5.9.1. For info how to compile Qt5 from source, scroll down. -The GCC compiler on Linux or Mingw-w64 on windows. - -http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.8.2/threads-posix/dwarf/i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z/download - -Do not use microsoft tools or compilers! +EDFbrowser is a Linux & GCC & GNU make project. Other tools or compilers are not supported. Introduction @@ -26,7 +22,7 @@ Build and run without "installing" ================================== -You need to have Qt and GCC (Mingw-w64 on Windows) installed. +You need to have Qt and GCC and Make installed. Extract the sourcefile and enter the following commands: @@ -87,7 +83,7 @@ sudo dnf install mesa-libGL-devel cups-devel libx11-dev openSUSE: sudo zypper install -t pattern devel_basis - sudo zypper install xorg-x11-devel cups-devel freetype-devel fontconfig-devel + sudo zypper install xorg-x11-devel cups-devel freetype-devel fontconfig-devel libxkbcommon-devel libxkbcommon-x11-devel ############################################################################################# # # @@ -95,7 +91,7 @@ # # # This will not mess with your system libraries. The new compiled libraries will be stored # # # -# in a new and separate directory: /usr/local/Qt-5.9.7-static # +# in a new and separate directory: /usr/local/Qt-5.12.3-static # # # # It will not interfere with other Qt programs. # # # @@ -105,20 +101,20 @@ cd Qt5-source -wget http://ftp1.nluug.nl/languages/qt/official_releases/qt/5.9/5.9.7/single/qt-everywhere-opensource-src-5.9.7.tar.xz +wget http://ftp1.nluug.nl/languages/qt/official_releases/qt/5.12/5.12.3/single/qt-everywhere-src-5.12.3.tar.xz here is a list of download mirrors: https://download.qt.io/static/mirrorlist/ -The Qt source package you are going to need is: qt-everywhere-opensource-src-5.9.7.tar.xz +The Qt source package you are going to need is: qt-everywhere-src-5.12.3.tar.xz -tar -xvf qt-everywhere-opensource-src-5.9.7.tar.xz +tar -xvf qt-everywhere-src-5.12.3.tar.xz -cd qt-everywhere-opensource-src-5.9.7 +cd qt-everywhere-src-5.12.3 -./configure -v -prefix /usr/local/Qt-5.9.7-static -release -opensource -confirm-license -c++std c++11 -static -accessibility -fontconfig -skip qtdeclarative -skip qtconnectivity -skip qtmultimedia -no-qml-debug -qt-zlib -no-mtdev -no-journald -qt-libpng -qt-libjpeg -system-freetype -qt-harfbuzz -no-openssl -no-libproxy -no-glib -nomake examples -nomake tests -no-compile-examples -cups -no-evdev -no-dbus -no-eglfs -qreal double -no-opengl -skip qtlocation -skip qtsensors -skip qtwayland -skip qtgamepad -skip qtserialbus +./configure -v -prefix /usr/local/Qt-5.12.3-static -release -opensource -confirm-license -c++std c++11 -static -accessibility -fontconfig -skip qtdeclarative -skip qtconnectivity -skip qtmultimedia -qt-zlib -no-mtdev -no-journald -qt-libpng -qt-libjpeg -system-freetype -qt-harfbuzz -no-openssl -no-libproxy -no-glib -nomake examples -nomake tests -no-compile-examples -cups -no-evdev -no-dbus -no-eglfs -qreal double -no-opengl -skip qtlocation -skip qtsensors -skip qtwayland -skip qtgamepad -skip qtserialbus -skip qt3d -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtspeech -skip qtwebengine -(takes about 1.5 minutes) +(takes about 2 minutes) -make -j8 +make -j6 (change option -j according to number of available cpu cores e.g -j4 or -j8) (takes about 11 minutes) @@ -126,9 +122,9 @@ Now go to the directory that contains the EDFbrowser sourcecode and enter the following commands: -/usr/local/Qt-5.9.7-static/bin/qmake +/usr/local/Qt-5.12.3-static/bin/qmake -make -j8 +make -j6 (change option -j according to number of available cpu cores e.g -j4 or -j8) sudo make install diff -Nru edfbrowser-1.67+dfsg/read_write_settings.cpp edfbrowser-1.68+dfsg/read_write_settings.cpp --- edfbrowser-1.67+dfsg/read_write_settings.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/read_write_settings.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/reduce_signals.cpp edfbrowser-1.68+dfsg/reduce_signals.cpp --- edfbrowser-1.67+dfsg/reduce_signals.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/reduce_signals.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/reduce_signals.h edfbrowser-1.68+dfsg/reduce_signals.h --- edfbrowser-1.67+dfsg/reduce_signals.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/reduce_signals.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/save_annots.cpp edfbrowser-1.68+dfsg/save_annots.cpp --- edfbrowser-1.67+dfsg/save_annots.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/save_annots.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/save_annots.h edfbrowser-1.68+dfsg/save_annots.h --- edfbrowser-1.67+dfsg/save_annots.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/save_annots.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/save_montage_dialog.cpp edfbrowser-1.68+dfsg/save_montage_dialog.cpp --- edfbrowser-1.67+dfsg/save_montage_dialog.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/save_montage_dialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/save_montage_dialog.h edfbrowser-1.68+dfsg/save_montage_dialog.h --- edfbrowser-1.67+dfsg/save_montage_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/save_montage_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/scp_ecg2edf.cpp edfbrowser-1.68+dfsg/scp_ecg2edf.cpp --- edfbrowser-1.67+dfsg/scp_ecg2edf.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/scp_ecg2edf.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2013 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/scp_ecg2edf.h edfbrowser-1.68+dfsg/scp_ecg2edf.h --- edfbrowser-1.67+dfsg/scp_ecg2edf.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/scp_ecg2edf.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2013 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/show_actual_montage_dialog.cpp edfbrowser-1.68+dfsg/show_actual_montage_dialog.cpp --- edfbrowser-1.67+dfsg/show_actual_montage_dialog.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/show_actual_montage_dialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/show_actual_montage_dialog.h edfbrowser-1.68+dfsg/show_actual_montage_dialog.h --- edfbrowser-1.67+dfsg/show_actual_montage_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/show_actual_montage_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/show_edf_hdr.cpp edfbrowser-1.68+dfsg/show_edf_hdr.cpp --- edfbrowser-1.67+dfsg/show_edf_hdr.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/show_edf_hdr.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/show_edf_hdr.h edfbrowser-1.68+dfsg/show_edf_hdr.h --- edfbrowser-1.67+dfsg/show_edf_hdr.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/show_edf_hdr.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/signal_chooser.cpp edfbrowser-1.68+dfsg/signal_chooser.cpp --- edfbrowser-1.67+dfsg/signal_chooser.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/signal_chooser.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/signal_chooser.h edfbrowser-1.68+dfsg/signal_chooser.h --- edfbrowser-1.67+dfsg/signal_chooser.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/signal_chooser.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/signalcurve.cpp edfbrowser-1.68+dfsg/signalcurve.cpp --- edfbrowser-1.67+dfsg/signalcurve.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/signalcurve.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -1625,7 +1625,7 @@ if(upperlabel1[0] != 0) { - painter->drawText(curve_w / 2 - 200, 20, 400, 16, Qt::AlignCenter | Qt::TextSingleLine, upperlabel1); + painter->drawText(curve_w / 2 - 225, 20, 450, 16, Qt::AlignCenter | Qt::TextSingleLine, upperlabel1); } if(lowerlabel[0] != 0) @@ -2481,8 +2481,8 @@ void SignalCurve::setUpperLabel1(const char *str) { - strncpy(upperlabel1, str, 64); - upperlabel1[63] = 0; + strncpy(upperlabel1, str, 128); + upperlabel1[127] = 0; update(); } diff -Nru edfbrowser-1.67+dfsg/signalcurve.h edfbrowser-1.68+dfsg/signalcurve.h --- edfbrowser-1.67+dfsg/signalcurve.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/signalcurve.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -232,7 +232,7 @@ char h_label[32], v_label[21], - upperlabel1[64], + upperlabel1[128], upperlabel2[64], lowerlabel[64], extra_button_txt[16], diff -Nru edfbrowser-1.67+dfsg/signals_dialog.cpp edfbrowser-1.68+dfsg/signals_dialog.cpp --- edfbrowser-1.67+dfsg/signals_dialog.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/signals_dialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/signals_dialog.h edfbrowser-1.68+dfsg/signals_dialog.h --- edfbrowser-1.67+dfsg/signals_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/signals_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/special_button.cpp edfbrowser-1.68+dfsg/special_button.cpp --- edfbrowser-1.67+dfsg/special_button.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/special_button.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/special_button.h edfbrowser-1.68+dfsg/special_button.h --- edfbrowser-1.67+dfsg/special_button.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/special_button.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2009 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/spectrumanalyzer.cpp edfbrowser-1.68+dfsg/spectrumanalyzer.cpp --- edfbrowser-1.67+dfsg/spectrumanalyzer.cpp 2019-01-26 13:36:35.941155254 +0000 +++ edfbrowser-1.68+dfsg/spectrumanalyzer.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -81,6 +81,8 @@ window_type = 0; + overlap = 1; + for(i=strlen(signalcomp->edfhdr->filename); i>0; i--) { if((signalcomp->edfhdr->filename[i-1]=='/')||(signalcomp->edfhdr->filename[i-1]=='\\')) break; @@ -143,7 +145,7 @@ SpectrumDialog = new QDialog(); SpectrumDialog->setAttribute(Qt::WA_DeleteOnClose, true); - SpectrumDialog->setMinimumSize(650, 530); + SpectrumDialog->setMinimumSize(650, 565); SpectrumDialog->setSizeGripEnabled(true); SpectrumDialog->setModal(false); SpectrumDialog->setWindowFlags(Qt::Window | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); @@ -308,6 +310,14 @@ dftsz_spinbox->setSingleStep(2); dftsz_spinbox->setValue(dftblocksize); + overlap_box = new QComboBox; + overlap_box->setMinimumSize(70, 25); + overlap_box->addItem("Overlap: 0%"); + overlap_box->addItem("Overlap: 50%"); + overlap_box->addItem("Overlap: 67%"); + overlap_box->addItem("Overlap: 75%"); + overlap_box->addItem("Overlap: 80%"); + vlayout3 = new QVBoxLayout; vlayout3->addStretch(100); vlayout3->addWidget(flywheel1, 100); @@ -331,6 +341,7 @@ vlayout2->addWidget(windowBox); vlayout2->addWidget(dftsz_box); vlayout2->addWidget(dftsz_spinbox); + vlayout2->addWidget(overlap_box); spanSlider = new QSlider; spanSlider->setOrientation(Qt::Horizontal); @@ -403,10 +414,11 @@ QObject::connect(dftsz_spinbox, SIGNAL(valueChanged(int)), this, SLOT(dftsz_value_changed(int))); QObject::connect(windowBox, SIGNAL(currentIndexChanged(int)), this, SLOT(windowBox_changed(int))); QObject::connect(dftsz_box, SIGNAL(currentIndexChanged(int)), this, SLOT(dftsz_box_changed(int))); + QObject::connect(overlap_box, SIGNAL(currentIndexChanged(int)), this, SLOT(overlap_box_changed(int))); SpectrumDialog->show(); - SpectrumDialog->resize(650, 530); + SpectrumDialog->resize(650, 565); } @@ -485,6 +497,26 @@ } +void UI_FreqSpectrumWindow::overlap_box_changed(int idx) +{ + if(busy) return; + + if(overlap == (idx + 1)) return; + + overlap = idx + 1; + + busy = 1; + + malloc_err = 0; + + curve1->setUpdatesEnabled(false); + + QApplication::setOverrideCursor(Qt::WaitCursor); + + start(); +} + + void UI_FreqSpectrumWindow::update_flywheel(int new_value) { flywheel_value += new_value; @@ -558,17 +590,20 @@ break; case FFT_WNDW_TYPE_HAMMING : sprintf(str, "FFT window function: Hamming\n"); break; - case FFT_WNDW_TYPE_NUTTALL3B : sprintf(str, "FFT window function: Nuttall3b\n"); - break; case FFT_WNDW_TYPE_4TERM_BLACKMANHARRIS : sprintf(str, "FFT window function: 4-term Blackman-Harris\n"); break; case FFT_WNDW_TYPE_7TERM_BLACKMANHARRIS : sprintf(str, "FFT window function: 7-term Blackman-Harris\n"); break; + case FFT_WNDW_TYPE_NUTTALL3B : sprintf(str, "FFT window function: Nuttall3b\n"); + break; case FFT_WNDW_TYPE_NUTTALL4C : sprintf(str, "FFT window function: Nuttall4c\n"); break; case FFT_WNDW_TYPE_HANN : sprintf(str, "FFT window function: Hann\n"); break; + case FFT_WNDW_TYPE_HFT223D : sprintf(str, "FFT window function: HFT223D\n"); + break; } + sprintf(str + strlen(str), "Overlap: %i %%\n", overlap); sprintf(str + strlen(str), "FFT resolution: %f Hz\n", freqstep); sprintf(str + strlen(str), "Data Samples: %i\n", fft_data->sz_in); sprintf(str + strlen(str), "Power Samples: %i\n", fft_data->sz_out); @@ -578,7 +613,8 @@ for(i=0; isz_out; i++) { - fprintf(outputfile, "%.16f\t%.16f\n", freqstep * i, buf2[i]); +// fprintf(outputfile, "%.16f\t%.16f\n", freqstep * i, buf2[i]); + fprintf(outputfile, "%e\t%e\n", freqstep * i, buf2[i]); } fclose (outputfile); @@ -743,7 +779,7 @@ { int i, j, k; - long long s, s2; + unsigned long long s, s2; double dig_value=0.0, f_tmp=0.0; @@ -924,7 +960,7 @@ } // end of first_run free_fft_wrap(fft_data); - fft_data = fft_wrap_create(buf1, fft_inputbufsize, dftblocksize, window_type); + fft_data = fft_wrap_create(buf1, fft_inputbufsize, dftblocksize, window_type, overlap); if(fft_data == NULL) { // printf("buf1: %p fft_inputbufsize: %i dftblocksize: %i window_type: %i\n", @@ -1205,7 +1241,7 @@ strcpy(str, "FFT resolution: "); convert_to_metric_suffix(str + strlen(str), freqstep, 3); remove_trailing_zeros(str); - sprintf(str + strlen(str), "Hz %i blocks of %i samples", fft_data->blocks, fft_data->dft_sz); + sprintf(str + strlen(str), "Hz %i blocks of %i samples", fft_data->blocks_processed, fft_data->dft_sz); curve1->setUpperLabel1(str); diff -Nru edfbrowser-1.67+dfsg/spectrumanalyzer.h edfbrowser-1.68+dfsg/spectrumanalyzer.h --- edfbrowser-1.67+dfsg/spectrumanalyzer.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/spectrumanalyzer.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -118,7 +118,8 @@ QSpinBox *dftsz_spinbox; QComboBox *windowBox, - *dftsz_box; + *dftsz_box, + *overlap_box; UI_Flywheel *flywheel1; @@ -130,7 +131,8 @@ spectrumdialognumber, flywheel_value, first_run, - fft_inputbufsize; + fft_inputbufsize, + overlap; volatile int busy, @@ -171,6 +173,7 @@ void dftsz_value_changed(int); void windowBox_changed(int); void dftsz_box_changed(int); +void overlap_box_changed(int); }; diff -Nru edfbrowser-1.67+dfsg/spectrum_dock.cpp edfbrowser-1.68+dfsg/spectrum_dock.cpp --- edfbrowser-1.67+dfsg/spectrum_dock.cpp 2019-01-26 13:36:35.937155275 +0000 +++ edfbrowser-1.68+dfsg/spectrum_dock.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -80,6 +80,8 @@ window_type = 0; + overlap = 1; + if(mainwindow->spectrumdock_sqrt) { dock = new QDockWidget("Amplitude Spectrum", w_parent); @@ -225,6 +227,14 @@ windowBox->setCurrentIndex(window_type); windowBox->setToolTip("Window"); + overlap_box = new QComboBox; + overlap_box->setMinimumSize(70, 25); + overlap_box->addItem("Overlap: 0%"); + overlap_box->addItem("Overlap: 50%"); + overlap_box->addItem("Overlap: 67%"); + overlap_box->addItem("Overlap: 75%"); + overlap_box->addItem("Overlap: 80%"); + dftsz_label = new QLabel; dftsz_label->setText("Blocksize:"); dftsz_label->setMinimumSize(100, 25); @@ -260,6 +270,7 @@ vlayout2->addWidget(windowBox); vlayout2->addWidget(dftsz_label); vlayout2->addWidget(dftsz_spinbox); + vlayout2->addWidget(overlap_box); spanSlider = new QSlider; spanSlider->setOrientation(Qt::Horizontal); @@ -333,6 +344,7 @@ QObject::connect(dock, SIGNAL(visibilityChanged(bool)), this, SLOT(open_close_dock(bool))); QObject::connect(dftsz_spinbox, SIGNAL(valueChanged(int)), this, SLOT(dftsz_value_changed(int))); QObject::connect(windowBox, SIGNAL(currentIndexChanged(int)), this, SLOT(windowBox_changed(int))); + QObject::connect(overlap_box, SIGNAL(currentIndexChanged(int)), this, SLOT(overlap_box_changed(int))); } @@ -364,6 +376,20 @@ } +void UI_SpectrumDockWindow::overlap_box_changed(int idx) +{ + if(busy) return; + + if(overlap == (idx + 1)) return; + + overlap = idx + 1; + + init_maxvalue = 1; + + update_curve(); +} + + void UI_SpectrumDockWindow::open_close_dock(bool) { if(mainwindow->files_open != 1 || signal_nr < 0) @@ -517,6 +543,25 @@ fprintf(outputfile, "%s", str); fprintf(outputfile, "Signal: %s\n", signalcomp->signallabel); sprintf(str, "FFT blocksize: %i\n", fft_data->dft_sz); + switch(fft_data->wndw_type) + { + case FFT_WNDW_TYPE_RECT : sprintf(str, "FFT window function: None\n"); + break; + case FFT_WNDW_TYPE_HAMMING : sprintf(str, "FFT window function: Hamming\n"); + break; + case FFT_WNDW_TYPE_4TERM_BLACKMANHARRIS : sprintf(str, "FFT window function: 4-term Blackman-Harris\n"); + break; + case FFT_WNDW_TYPE_7TERM_BLACKMANHARRIS : sprintf(str, "FFT window function: 7-term Blackman-Harris\n"); + break; + case FFT_WNDW_TYPE_NUTTALL3B : sprintf(str, "FFT window function: Nuttall3b\n"); + break; + case FFT_WNDW_TYPE_NUTTALL4C : sprintf(str, "FFT window function: Nuttall4c\n"); + break; + case FFT_WNDW_TYPE_HANN : sprintf(str, "FFT window function: Hann\n"); + break; + case FFT_WNDW_TYPE_HFT223D : sprintf(str, "FFT window function: HFT223D\n"); + break; + } sprintf(str + strlen(str), "FFT resolution: %f Hz\n", freqstep); sprintf(str + strlen(str), "Data Samples: %i\n", fft_data->sz_in); sprintf(str + strlen(str), "Power Samples: %i\n", fft_data->sz_out); @@ -526,7 +571,8 @@ for(i=0; isz_out; i++) { - fprintf(outputfile, "%.16f\t%.16f\n", freqstep * i, buf2[i]); +// fprintf(outputfile, "%.16f\t%.16f\n", freqstep * i, buf2[i]); + fprintf(outputfile, "%e\t%e\n", freqstep * i, buf2[i]); } fclose (outputfile); @@ -839,7 +885,7 @@ fft_inputbufsize=0; // fft_outputbufsize; - long long s, s2; + unsigned long long s, s2; char str[1024]; @@ -1087,7 +1133,7 @@ } free_fft_wrap(fft_data); - fft_data = fft_wrap_create(buf1, fft_inputbufsize, dftblocksize, window_type); + fft_data = fft_wrap_create(buf1, fft_inputbufsize, dftblocksize, window_type, overlap); if(fft_data == NULL) { QMessageBox messagewindow(QMessageBox::Critical, "Error", "The system was not able to provide enough resources (memory) to perform the requested action."); @@ -1285,7 +1331,7 @@ strcpy(str, "FFT resolution: "); convert_to_metric_suffix(str + strlen(str), freqstep, 3); remove_trailing_zeros(str); - sprintf(str + strlen(str), "Hz %i blocks of %i samples", fft_data->blocks, fft_data->dft_sz); + sprintf(str + strlen(str), "Hz %i blocks of %i samples", fft_data->blocks_processed, fft_data->dft_sz); curve1->setUpperLabel1(str); curve1->setUpperLabel2(signallabel); diff -Nru edfbrowser-1.67+dfsg/spectrum_dock.h edfbrowser-1.68+dfsg/spectrum_dock.h --- edfbrowser-1.67+dfsg/spectrum_dock.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/spectrum_dock.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2010 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -151,13 +151,12 @@ QSpinBox *dftsz_spinbox; - QComboBox *windowBox; + QComboBox *windowBox, + *overlap_box; UI_Flywheel *flywheel1; - int samples, - buf1_sz, - dftblocksize, + int dftblocksize, window_type, steps, spectrumdock_sqrt, @@ -166,7 +165,11 @@ flywheel_value, init_maxvalue, signal_nr, - set_settings; + set_settings, + overlap; + + unsigned long long samples, + buf1_sz; volatile int busy; @@ -206,6 +209,7 @@ void update_flywheel(int); void dftsz_value_changed(int); void windowBox_changed(int); +void overlap_box_changed(int); void open_close_dock(bool); }; diff -Nru edfbrowser-1.67+dfsg/spike_filter.c edfbrowser-1.68+dfsg/spike_filter.c --- edfbrowser-1.67+dfsg/spike_filter.c 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/spike_filter.c 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2014 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/spike_filter_dialog.cpp edfbrowser-1.68+dfsg/spike_filter_dialog.cpp --- edfbrowser-1.67+dfsg/spike_filter_dialog.cpp 2019-01-26 13:36:35.941155254 +0000 +++ edfbrowser-1.68+dfsg/spike_filter_dialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2014 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/spike_filter_dialog.h edfbrowser-1.68+dfsg/spike_filter_dialog.h --- edfbrowser-1.67+dfsg/spike_filter_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/spike_filter_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2014 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/spike_filter.h edfbrowser-1.68+dfsg/spike_filter.h --- edfbrowser-1.67+dfsg/spike_filter.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/spike_filter.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2014 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/statistics_dialog.cpp edfbrowser-1.68+dfsg/statistics_dialog.cpp --- edfbrowser-1.67+dfsg/statistics_dialog.cpp 2019-01-26 13:36:35.941155254 +0000 +++ edfbrowser-1.68+dfsg/statistics_dialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2011 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/statistics_dialog.h edfbrowser-1.68+dfsg/statistics_dialog.h --- edfbrowser-1.67+dfsg/statistics_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/statistics_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2011 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/third_party/smarc/filtering.c edfbrowser-1.68+dfsg/third_party/smarc/filtering.c --- edfbrowser-1.67+dfsg/third_party/smarc/filtering.c 1970-01-01 00:00:00.000000000 +0000 +++ edfbrowser-1.68+dfsg/third_party/smarc/filtering.c 2019-08-05 19:13:43.583000857 +0000 @@ -0,0 +1,113 @@ +/** + * Smarc + * + * Copyright (c) 2009-2011 Institut Télécom - Télécom Paristech + * Télécom ParisTech / dept. TSI + * + * Authors : Benoit Mathieu, Jacques Prado + * + * This file is part of Smarc. + * + * Smarc is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Smarc 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include "filtering.h" + +#ifndef __SSE2__ + +double filter(double *filt, double *signal, int K) +{ + int k; + register double v = 0.0; + for (k=0;k + +double basic_filter(double *filt, double *signal, int K) +{ + int k; +// printf("basic filter for K=%i\n",K); + register double v = 0.0; + for (k=0;k. + */ + +#ifndef FILTER_H_ +#define FILTER_H_ + +double filter(double *, double *, int); + +#endif /* FILTER_H_ */ diff -Nru edfbrowser-1.67+dfsg/third_party/smarc/multi_stage.c edfbrowser-1.68+dfsg/third_party/smarc/multi_stage.c --- edfbrowser-1.67+dfsg/third_party/smarc/multi_stage.c 1970-01-01 00:00:00.000000000 +0000 +++ edfbrowser-1.68+dfsg/third_party/smarc/multi_stage.c 2019-08-05 19:13:43.583000857 +0000 @@ -0,0 +1,592 @@ +/** + * Smarc + * + * Copyright (c) 2009-2011 Institut Télécom - Télécom Paristech + * Télécom ParisTech / dept. TSI + * + * Authors : Benoit Mathieu, Jacques Prado + * + * This file is part of Smarc. + * + * Smarc is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Smarc 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + + +#include "multi_stage.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "stdio.h" +#include "math.h" +#include "remez_lp.h" + +int find_pgcd(int a, int b) { + int r; + if (b > a) { + r = a; + a = b; + b = r; + } + r = a % b; + while (r != 0) { + a = b; + b = r; + r = a % b; + } + return b; +} + +struct PPredef { + int Q; + int P; + char* def; +}; + +static const int s_predefs_size = 40; +// less operations +static const struct PPredef s_predefs[] = { + { 1, 4, "2/1 2/1"}, + { 1, 6, "2/1 3/1"}, + { 1, 8, "2/1 2/1 2/1"}, + { 1, 12, "2/1 2/1 3/1"}, + { 1, 16, "2/1 2/1 2/1 2/1"}, + { 1, 24, "2/1 2/1 2/1 3/1"}, + { 3, 4, "2/1 2/3"}, + { 3, 8, "2/1 4/3"}, + { 4, 1, "1/2 1/2"}, + { 6, 1, "1/2 1/3"}, + { 8, 1, "1/2 1/2 1/2"}, + { 4, 3, "3/2 1/2"}, + { 8, 3, "1/2 3/4"}, + { 12, 1, "1/2 1/2 1/3"}, + { 16, 1, "1/2 1/2 1/2 1/2"}, + { 24, 1, "1/2 1/2 1/2 1/3"}, + { 40, 147, "1/2 3/2 7/2 7/5"}, + { 80, 147, "7/5 7/4 3/2 1/2"}, + { 80, 441, "3/2 3/2 7/4 7/5"}, + { 147, 40, "2/1 2/3 2/7 5/7"}, + { 147, 80, "5/7 4/7 2/3 2/1"}, + { 147, 160, "4/7 2/1 4/3 5/7"}, + { 147, 320, "4/7 4/1 4/3 5/7"}, + { 147, 640, "2/1 4/1 4/7 4/3 5/7"}, + { 147, 1280, "4/1 4/1 4/7 4/3 5/7"}, + { 147, 2560, "2/1 4/1 4/1 4/7 4/3 5/7"}, + { 160, 147, "7/5 3/4 1/2 7/4"}, + { 160, 441, "7/5 7/4 3/2 3/2 1/2"}, + { 320, 147, "7/4 1/4 3/4 7/5"}, + { 320, 441, "3/4 3/4 7/4 7/5"}, + { 441, 80, "2/3 2/3 4/7 5/7"}, + { 441, 160, "5/7 4/7 2/3 2/3 2/1"}, + { 441, 320, "4/7 4/3 4/3 5/7"}, + { 441, 640, "2/1 4/7 4/3 4/3 5/7"}, + { 441, 1280, "4/1 4/7 4/3 4/3 5/7"}, + { 640, 147, "1/2 1/4 7/4 3/4 7/5"}, + { 640, 441, "1/2 7/4 3/4 3/4 7/5"}, + { 1280, 147, "1/4 1/4 7/4 3/4 7/5"}, + { 1280, 441, "1/4 7/4 3/4 3/4 7/5"}, + { 2560, 147, "1/2 1/4 1/4 7/4 3/4 7/5"} +}; + +void destroy_multistagedef(struct PMultiStageDef* pdef) { + if (pdef) { + if (pdef->nb_stages > 0) { + free(pdef->L); + } + free(pdef); + } +} + +int compare_ratios(const void* e1, const void* e2) { + const int* p1 = (const int*) e1; + const int* p2 = (const int*) e2; + if ((p1[0] > p1[1]) && (p2[0] < p2[1])) + return -1; + if ((p2[0] > p2[1]) && (p1[0] < p1[1])) + return 1; + return (p1[0] * p2[1] - p1[1] * p2[0]); +// return 0; // keep original order +} + +void reorder_stages(struct PMultiStageDef* pdef) { + int* ratios = malloc(2 * pdef->nb_stages * sizeof(int)); + int s; + for (s = 0; s < pdef->nb_stages; s++) { + ratios[2 * s] = pdef->L[s]; + ratios[2 * s + 1] = pdef->M[s]; + } + qsort(ratios, pdef->nb_stages, 2 * sizeof(int), compare_ratios); + for (s = 0; s < pdef->nb_stages; s++) { + pdef->L[s] = ratios[2 * s]; + pdef->M[s] = ratios[2 * s + 1]; + } + free(ratios); +} + +void check_stages(struct PMultiStageDef* pdef) { + // sort ratios + int* at_end = malloc(2* pdef->nb_stages * sizeof(int)); + int end_index = 0; + int pos_index = 0; + int Mprod = 1; + int Lprod = 1; + int s, e; + for (s=0;snb_stages;s++) { + Mprod *= pdef->M[s]; + Lprod *= pdef->L[s]; + } + int minPQ = (Mprod < Lprod) ? Mprod : Lprod; + int fin = Mprod; + Mprod = 1; + Lprod = 1; + for (s=0;snb_stages;s++) { + if (fin*Lprod*pdef->L[s] < minPQ*Mprod*pdef->M[s]) { + // invalid step, put it at the end + at_end[2*end_index] = pdef->L[s]; + at_end[2*end_index+1] = pdef->M[s]; + end_index++; + } else { + // keep it + if (pos_index!=s) { + pdef->L[pos_index] = pdef->L[s]; + pdef->M[pos_index] = pdef->M[s]; + } + pos_index++; + Lprod *= pdef->L[s]; + Mprod *= pdef->M[s]; + } + } + // report at_end + for (e=0;eL[pos_index] = at_end[2*e]; + pdef->M[pos_index] = at_end[2*e+1]; + pos_index++; + } + free(at_end); +} + +int factors(int value, int* res, int* resSize) { + int i = 0; + int p = 2; + int f; + while (value > 1 && i < *resSize && p <= value) { + if (value % p == 0) { + res[i++] = p; + value /= p; + } else { + // find next prime + int notprime = 1; + while (notprime) { + p++; + notprime = 0; + for (f = 2; f <= (p / 2); f++) { + if (p % f == 0) { + notprime = 1; + break; + } + } + } + } + } + *resSize = i; + return value; +} + +struct PMultiStageDef* get_predef_ratios(int fsin, int fsout) { + int pgcd = find_pgcd(fsin,fsout); + int P = fsout / pgcd; + int Q = fsin / pgcd; + int i, c, s; + for (i = 0; i < s_predefs_size; i++) { + if ((s_predefs[i].P == P) && (s_predefs[i].Q == Q)) { + struct PMultiStageDef* pdef = malloc(sizeof(struct PMultiStageDef)); + char* def = s_predefs[i].def; + pdef->nb_stages = 0; + for (c=0;c<(int)strlen(def);c++) + if (def[c]=='/') pdef->nb_stages++; + pdef->L = malloc(2 * pdef->nb_stages * sizeof(int)); + pdef->M = &pdef->L[pdef->nb_stages]; + char* pos = def; + for (s = 0; s < pdef->nb_stages; s++) { + pdef->L[s] = atoi(pos); + while (*pos!='/') pos++; + pos++; + pdef->M[s] = atoi(pos); + if (s==pdef->nb_stages-1) + break; + while (*pos!=' ') pos++; + pos++; + } + reorder_stages(pdef); + return pdef; + } + } + return NULL; +} + +struct PMultiStageDef* get_user_ratios(int fsin __attribute__((unused)), int fsout __attribute__((unused)), const char* userdef) { + struct PMultiStageDef* pdef = malloc(sizeof(struct PMultiStageDef)); + + int s; + // compute nb stages + pdef->nb_stages = 0; + const char* pch = strchr(userdef, '/'); + while (pch != NULL) { + pdef->nb_stages++; + pch = strchr(pch + 1, '/'); + } + + // parse L M + pdef->L = malloc(2 * pdef->nb_stages * sizeof(int)); + pdef->M = &pdef->L[pdef->nb_stages]; + pch = userdef; + for (s = 0; s < pdef->nb_stages; s++) { + pdef->L[s] = atoi(pch); + if (pdef->L[s] <= 0) + goto error; + pch = strchr(pch, '/'); + if (pch == NULL) + goto error; + pch++; + pdef->M[s] = atoi(pch); + if (pdef->M[s] <= 0) + goto error; + if (s < (pdef->nb_stages - 1)) { + pch = strchr(pch, ' '); + if (pch == NULL) + goto error; + pch++; + } + } + reorder_stages(pdef); + return pdef; + + error: printf("ERROR: cannot parse multistage user definition '%s'\n", + userdef); + free(pdef); + return NULL; +} + +void find_ratio(double rat, double tol, int* L, int* M) { + double r = rat; + int p2 = 0, q2 = 1; + int p1 = 1, q1 = 0; + int p, q; + while (1) { + int a = (int) floor(r); + + p = a * p1 + p2; + q = a * q1 + q2; + double c = (double) p / q; + if (fabs(rat - c) < tol) + break; + r = 1.0 / (r - a); + p2 = p1; + q2 = q1; + p1 = p; + q1 = q; + } + *L = p; + *M = q; +} + +#define MAX_FACTORS 10 + +struct PMultiStageDef* build_auto_ratios(int fsin, int fsout, double tol) { + int L = 0; + int M = 0; + int i, s; + double rat = (double) fsin / fsout; + find_ratio(rat, tol * rat, &M, &L); + + int nbL = MAX_FACTORS; + int* LL = malloc(nbL * sizeof(int)); + if (factors(L, LL, &nbL) != 1) { + free(LL); + printf("WARNING: too many factors for %i !\n", L); + return NULL; + } + + int nbM = MAX_FACTORS; + int* MM = malloc(nbM * sizeof(int)); + if (factors(M, MM, &nbM) != 1) { + free(MM); + printf("ERROR: too many factors for %i !\n", M); + return NULL; + } + + if (nbL < nbM) { + memmove(&LL[nbM - nbL], LL, nbL * sizeof(int)); + for (i = 0; i < (nbM - nbL); i++) + LL[i] = 1; + nbL = nbM; + } + if (nbM < nbL) { + for (i = nbM; i < nbL; i++) + MM[i] = 1; + nbM = nbL; + } + + struct PMultiStageDef* pdef = malloc(sizeof(struct PMultiStageDef)); + pdef->nb_stages = nbL; + pdef->L = malloc(2 * nbL * sizeof(int)); + pdef->M = &pdef->L[nbL]; + for (s = 0; s < nbL; s++) { + pdef->L[s] = LL[s]; + pdef->M[s] = MM[s]; + } + free(LL); + free(MM); + + reorder_stages(pdef); + return pdef; +} + +#define MAX_INT_NUMBER (1<<30) +#define MAX_NB_STAGES 5 +#define FACTOR_MAX 21 +#define MAX_FREQ_FACTOR 4 +#define MAX_FILTER_LENGTH 4000 + +void next_factor(int* current, int* remains, int factormax) { + int N = *current * *remains; + int i; + for (i= 1 + *current;(i<=factormax) && (i*2<=N);i++) { + if (N%i==0) { + *current = i; + *remains = N / i; + return; + } + } + if (*current!=N && N<=factormax) { + *current = N; + *remains = 1; + return; + } + *remains = N; + *current = 1; + return; +} + +void print_stage_def(char* msg, struct PMultiStageDef* def) { + printf("%s ",msg); + int i; + for (i=0;inb_stages;i++) + printf(" %i/%i",def->L[i],def->M[i]); + printf("\n"); +} + +int find_next_stages(int L, int M, struct PMultiStageDef* def, int factormax) { +// print_stage_def("find next stage of",def); + int minLM = (Lnb_stages - 1; + int rL = def->L[stage]; + int rM = def->M[stage]; + stage--; + // iterate to find next valid stage with + while (stage>=0) { +// printf("stage %i: %i/%i rL=%i rM=%i\n",stage,def->L[stage],def->M[stage],rL,rM); + // if no more L nor M factors we are done + if (rL==1 && rM==1) { + def->nb_stages = stage; + return 1; + } + // if maximum number of stage has been reach we are done + if (stage==MAX_NB_STAGES-1) { + if (rL>factormax || rM>factormax) { + // invalid stage, pop + stage--; + continue; + } + def->nb_stages = MAX_NB_STAGES; + def->L[stage] = rL; + def->M[stage] = rM; + return 1; + } + // try to increase M +// printf("try to increment M: %i %i\n",def->M[stage],rM); + next_factor(&def->M[stage],&rM,factormax); + if (def->M[stage] == 1) { + // try to increase L +// printf("try to increment L: %i %i\n",def->L[stage],rL); + next_factor(&def->L[stage],&rL,factormax); + if (def->L[stage]==1) { + // pop current stage +// printf("no more possibilities, pop stage\n"); + stage--; + continue; + } + } + // check stage is valid + { + int currentFS = L * rM / rL; + if (currentFS>maxFreq) + continue; + if (currentFSM[stage] *= rM; + rM = 1; + continue; + } + } + // push stage +// printf("choose %i/%i\n",def->L[stage],def->M[stage]); + stage++; + def->L[stage] = 1; + def->M[stage] = 1; + } + // no more stages found + return 0; +} + +int get_max_prime_factor(int N) { + int maxp=1; + int i; + while (N>maxp) { + int p=1; + for (i=2;i*i<=N;i++) { + if (N%i==0) { + p = i; + break; + } + } + if (p==1) + p=N; + if (p>maxp) + maxp = p; + N /= p; + } + return maxp; +} + +struct PMultiStageDef* build_fast_ratios(int fsin, int fsout, double tol, double bandwidth, double rp, double rs) +{ + int L = 0; + int M = 0; + int i, s; + double rat = (double) fsin / fsout; + find_ratio(rat, tol * rat, &M, &L); + +// printf("build fast ratios for %i/%i\n",L,M); + + // allocate all memory contiguously + struct PMultiStageDef* best = malloc(2*sizeof(struct PMultiStageDef) + 4*MAX_NB_STAGES*sizeof(int)); + best->L = (int*) (best + 1); + best->M = best->L + MAX_NB_STAGES; + struct PMultiStageDef* current = (struct PMultiStageDef*) (best->M + MAX_NB_STAGES); + current->L = (int*) (current + 1); + current->M = (int*) (current->L + MAX_NB_STAGES); + + // check factor_max + int factor_max = FACTOR_MAX; + { + int max_prime = get_max_prime_factor(L); + if (factor_maxnb_stages = 2; + current->L[0] = 1; + current->M[0] = 1; + current->L[1] = L; + current->M[1] = M; + int nbTest = 0; + while (find_next_stages(L,M,current,factor_max)) { +// print_stage_def("got stage ",current); + nbTest++; + // compute ops + dev[0] = (pow(10, rp / 20.0) - 1) / (current->nb_stages *(pow(10, rp / 20.0) + 1)); + dev[1] = pow(10, -rs / 20.0); + double fs = (double) fsin; + double ops = 0.0; + for (s=0;snb_stages;s++) { + const int cL = current->L[s]; + const int cM = current->M[s]; + double fmax = fs * cL; + bands[1] = fpass / fmax; + bands[2] = (cL>cM) ? (fs-fstop) / fmax : (fs*cL/cM - fstop) / fmax; + int flen = remez_lp_order(bands, mag, dev, weight); + { + int k=(flen-1)/(2*cM); + while (2*k*cM+1 < flen) + k++; + flen = 2*k*cM+1; + } + if (flen>MAX_FILTER_LENGTH) + { +// printf("- %i/%i filter too long !\n",cL,cM); + ops = MAX_INT_NUMBER; + break; + } + double stage_ops = flen*fs / cM; +// printf("- %i/%i : flen=%i ops=%0.2f\n",cL,cM,flen,stage_ops); + ops += stage_ops; + fs = (fs * cL) / cM; + } +// printf("total ops = %0.2f\n",ops); + if (opsnb_stages = current->nb_stages; + for (i=0;inb_stages;i++) { + best->L[i] = current->L[i]; + best->M[i] = current->M[i]; + } + } + } +// printf("have test %i combinaison\n",nbTest); +// print_stage_def("best one is",best); +// printf("width %0.2f operations\n",best_ops); + + // prepare output + struct PMultiStageDef* pdef = malloc(sizeof(struct PMultiStageDef)); + pdef->nb_stages = best->nb_stages; + pdef->L = malloc(2 * best->nb_stages * sizeof(int)); + pdef->M = &pdef->L[best->nb_stages]; + for (s = 0; s < pdef->nb_stages; s++) { + pdef->L[s] = best->L[s]; + pdef->M[s] = best->M[s]; + } + + // free working memory + free(best); + free(bands); + + return pdef; +} + diff -Nru edfbrowser-1.67+dfsg/third_party/smarc/multi_stage.h edfbrowser-1.68+dfsg/third_party/smarc/multi_stage.h --- edfbrowser-1.67+dfsg/third_party/smarc/multi_stage.h 1970-01-01 00:00:00.000000000 +0000 +++ edfbrowser-1.68+dfsg/third_party/smarc/multi_stage.h 2019-08-05 19:13:43.583000857 +0000 @@ -0,0 +1,46 @@ +/** + * Smarc + * + * Copyright (c) 2009-2011 Institut Télécom - Télécom Paristech + * Télécom ParisTech / dept. TSI + * + * Authors : Benoit Mathieu, Jacques Prado + * + * This file is part of Smarc. + * + * Smarc is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Smarc 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#ifndef MULTI_STAGE_H_ +#define MULTI_STAGE_H_ + +/** + * Definition of a multistage filter plan. + * - nb_stages: number of stages + * - L: array of nb_stages interpolation factors + * - M: array of nb_stages decimation factors + */ +struct PMultiStageDef { + int nb_stages; + int* L; + int* M; +}; + +struct PMultiStageDef* get_predef_ratios(int fsin, int fsout); +struct PMultiStageDef* get_user_ratios(int fsin, int fsout, const char* userdef); +struct PMultiStageDef* build_auto_ratios(int fsin, int fsout, double tol); +struct PMultiStageDef* build_fast_ratios(int fsin, int fsout, double tol, double bandwidth,double rp,double rs); +void destroy_multistagedef(struct PMultiStageDef*); + +#endif /* MULTI_STAGE_H_ */ diff -Nru edfbrowser-1.67+dfsg/third_party/smarc/polyfilt.c edfbrowser-1.68+dfsg/third_party/smarc/polyfilt.c --- edfbrowser-1.67+dfsg/third_party/smarc/polyfilt.c 1970-01-01 00:00:00.000000000 +0000 +++ edfbrowser-1.68+dfsg/third_party/smarc/polyfilt.c 2019-08-05 19:13:43.583000857 +0000 @@ -0,0 +1,151 @@ +/** + * Smarc + * + * Copyright (c) 2009-2011 Institut Télécom - Télécom Paristech + * Télécom ParisTech / dept. TSI + * + * Authors : Benoit Mathieu, Jacques Prado + * + * This file is part of Smarc. + * + * Smarc is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Smarc 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include "polyfilt.h" + +#include +#include +#include +#include + +void polyfiltLM(struct PSFilter *pfilt, struct PSState *pstate, + double *signal, int signalLen, int *nbRead, double *output, + int outputLen, int *nbWritten) { + const int M = pfilt->M; + const int L = pfilt->L; + const int K = pfilt->K; + + int signalPos = 0; + int outPos = 0; + int phase = pstate->phase; + + // skip first sample for delays + if (pstate->skip>0) + { + const int maxAdvance = (M + L - 1) / L; + while (pstate->skip>0 && ((signalPos+maxAdvance)skip--; + phase += M; + signalPos += phase / L; + phase = phase % L; + } + } + + // process filtering + while ((signalPos+K<=signalLen) && (outPosfilters + phase*K,signal + signalPos, K); + + // consume samples + phase += M; + signalPos += phase / L; + phase = phase % L; + } + + // report state values + pstate->phase = phase; + *nbRead = signalPos; + *nbWritten = outPos; +} + + +void polyfiltM(struct PSFilter *pfilt, struct PSState *pstate, + double *signal, int signalLen, int *nbConsume, + double *output, int outputLen, int *nbWritten) { + const int M = pfilt->M; + const int K = pfilt->K; + double* filt = pfilt->filters; + + int signalPos = 0; + int outPos = 0; + + // skip first sample for delays + while (pstate->skip>0 && ((signalPos+M)skip--; + signalPos += M; + } + + // process filtering + while (((signalPos+K)<=signalLen) && (outPosL; + const int K = pfilt->K; + + int signalPos = 0; + int outPos = 0; + int phase = pstate->phase; + + // skip first sample for delays + while (pstate->skip>0 && signalPosskip--; + phase++; + if (phase==L) { + signalPos++; + phase = 0; + } + } + + // compute first output to reach phase 0 + while (signalPos+K<=signalLen && outPosfilters + phase*K; +// for (int k=0;kfilters + phase*K, signal+signalPos, K); + phase++; + if (phase==L) { + signalPos++; + phase=0; + } + } + + // report state values + pstate->phase = phase; + *nbRead = signalPos; + *nbWritten = outPos; +} diff -Nru edfbrowser-1.67+dfsg/third_party/smarc/polyfilt.h edfbrowser-1.68+dfsg/third_party/smarc/polyfilt.h --- edfbrowser-1.67+dfsg/third_party/smarc/polyfilt.h 1970-01-01 00:00:00.000000000 +0000 +++ edfbrowser-1.68+dfsg/third_party/smarc/polyfilt.h 2019-08-05 19:13:43.583000857 +0000 @@ -0,0 +1,79 @@ +/** + * Smarc + * + * Copyright (c) 2009-2011 Institut Télécom - Télécom Paristech + * Télécom ParisTech / dept. TSI + * + * Authors : Benoit Mathieu, Jacques Prado + * + * This file is part of Smarc. + * + * Smarc is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Smarc 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#ifndef POLYFILTLM_H_ +#define POLYFILTLM_H_ + +#include "smarc.h" +#include "stage_impl.h" + +/** + * Filter signal with a L/M filter (interpolation factor and decimation factor are not 1) + * - pfilt [IN]: filter to use + * - pstate [IN/OUT]: filter state + * - signal [IN]: input signal + * - signalLen [IN]: input signal length + * - nbRead [OUT]: number of samples read from input signal + * - output [OUT]: output array + * - outputLen [IN]: length of output array. Maximum number of samples to write + * - nbWritten [OUT]: number of samples effectively written + * - w [IN]: workspace to use for temporary results. + */ +void polyfiltLM(struct PSFilter* pfilt, struct PSState* pstate, + double *, int, int *, + double *, int, int *); + +/** + * Filter signal with a decimation filter (interpolation factor L is 1) + * - pfilt [IN]: filter to use + * - pstate [IN/OUT]: filter state + * - signal [IN]: input signal + * - signalLen [IN]: input signal length + * - nbRead [OUT]: number of samples read from input signal + * - output [OUT]: output array + * - outputLen [IN]: length of output array. Maximum number of samples to write + * - nbWritten [OUT]: number of samples effectively written + * - w [IN]: workspace to use for temporary results. + */ +void polyfiltM(struct PSFilter* pfilt, struct PSState* pstate, + double *, int, int *, + double *, int, int *); + +/** + * Filter signal with a interpolation filter (decimation factor M is 1) + * - pfilt [IN]: filter to use + * - pstate [IN/OUT]: filter state + * - signal [IN]: input signal + * - signalLen [IN]: input signal length + * - nbRead [OUT]: number of samples read from input signal + * - output [OUT]: output array + * - outputLen [IN]: length of output array. Maximum number of samples to write + * - nbWritten [OUT]: number of samples effectively written + * - w [IN]: workspace to use for temporary results. + */ +void polyfiltL(struct PSFilter *, struct PSState *, + double *, int, int *, + double *, int, int *); + +#endif /* POLYFILTLM_H_ */ diff -Nru edfbrowser-1.67+dfsg/third_party/smarc/remez_lp.c edfbrowser-1.68+dfsg/third_party/smarc/remez_lp.c --- edfbrowser-1.67+dfsg/third_party/smarc/remez_lp.c 1970-01-01 00:00:00.000000000 +0000 +++ edfbrowser-1.68+dfsg/third_party/smarc/remez_lp.c 2019-08-05 19:13:43.583000857 +0000 @@ -0,0 +1,608 @@ +/** + * Smarc + * + * Copyright (c) 2009-2011 Institut Télécom - Télécom Paristech + * Télécom ParisTech / dept. TSI + * + * Authors : Benoit Mathieu, Jacques Prado + * + * This file is part of Smarc. + * + * Smarc is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Smarc 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + + +/******************************************************************************** + * Adaptation de l'algorithme Parks-McClellan pour les FIR de type 1 et 2 + * d'apres le livre "Theory and applications of digital signal processing" de + * L.R. Rabiner et B. Gold et le programme fortran "A computer program for + * designing optimum linear phase digital filters" de J.H. McClellan, T.W. Parks + * et L.R. Rabiner. + ********************************************************************************/ + + +#include "remez_lp.h" +#include +#include +#include +#include + +#define GRIDDENSITY 16 +#define MAXITERATIONS 250 + +#define min(a,b) ((a)<(b)?(a):(b)) +#define max(a,b) ((a)>(b)?(a):(b)) + +double remlpord(double f1, double f2, double d1, double d2) { + static double A1A3[3] = {5.309e-03, 7.114e-02, -4.761e-01}; + static double A4A6[3] = {-2.660e-03, -5.941e-01, -4.278e-01}; + + int i; + d1 = log10(d1); + d2 = log10(d2); + + double lh[3] = { d1 * d1, d1, 1}; + double DD1[3] = {0,0,0}; + for (i=0;i<3;i++) + DD1[i] = d2*A1A3[i] + A4A6[i]; + double D = 0.0; + for (i = 0; i < 3; i++) + D += DD1[i]*lh[i]; + double fK = 11.01217 + (d1 - d2) * 0.51244; + double df = f2 - f1; + return D / df - fK * df + 1; +} + +int remez_lp_order(const double* fcuts, const double* mag __attribute__((unused)), const double* dev, + double* weight) { + int N = ceil(remlpord(fcuts[1], fcuts[2], dev[0], dev[1])); + double maxdev = (dev[0] > dev[1] ? dev[0] : dev[1]); + weight[0] = maxdev / dev[0]; + weight[1] = maxdev / dev[1]; + return N; +} + + +void build_grid(int lgfiltre, int nfcns, const double* bands, int nbands __attribute__((unused)), int lgrid, int nodd, const double* dev, const double* weight, + double** FreqGrille, int* taillegrilledense, double** des, double** wt) +{ + int k, np = floor(0.5+(nfcns*bands[1]) / (0.5+(bands[1]-bands[2]))); + if (np==0) + np++; + int ns = nfcns+1-np; + if (ns<=1) + ns = 2; + while ((np+ns-1)*lgrid+2 <= lgfiltre) + lgrid *= 2; + + *taillegrilledense = (np+ns-1)*lgrid+2; + *FreqGrille = malloc(*taillegrilledense * sizeof(double)); + *des = malloc(*taillegrilledense * sizeof(double)); + *wt = malloc(*taillegrilledense * sizeof(double)); + + double delf = 1.0 / (lgrid * np); + for (k=0;k(0.5-delf)) + (*taillegrilledense)--; +} + +/** + * Coefficients pour l'interpolation de Lagrange + * fonction D du Fortran + */ +double dd(int k,int n, int m, const double* x) +{ + int l, ll; + double d=1; + double q=x[k]; + for (l=0;l0) + { + iter++; + if (iter>MAXITERATIONS) + break; + for (i=0;i0? -1 : 1); + delta *= -nu; + { + int add = 1; + for (i=0;i0) // on inverse le test goto 220 + { + comp = nut*E; + l++; // etiquette 210 + while (lklow) // on inverse le test goto 250 + { + dtemp = gee(FreqGrille,ad,x,y,des,wt,comp,nut,l,nz,&E); + if (dtemp>0 || jchnge>0) // groupe les tests goto 230 et goto 225 + break; + l--; // etiquette 235 + } + if (l<=klow) // test goto 240 + { + l = iExt[j-1] + 1; // etiquette 250 + if (jchnge>0) // test goto 215 + { + iExt[j-1] = l-1; // on refait 215 + j++; + klow = l-1; + jchnge++; // extrema ont change + } else { // sinon on a fait l-2 au lieu de l-1 (220 et 225) + l++; + while (l0) + break; + l++; // sinon on a fait l-2 au lieu de l-1 (220 et 225) + } + if (l0) // on n'est pas passe dans le while precedent + { + comp = nut*E; + l++; + while (l= kup + j++; + klow = l-1; + jchnge++; + } else { // if l < kup && dtemp > 0 n'est pas verifie + klow = iExt[j-1]; + j++; + } + } + } else if (dtemp>0) { // ici l > klow + comp = nut*E; + l--; + while (l>klow) // tant que l > klow on fait la couble entre 200 et goto 200 + { + dtemp = gee(FreqGrille,ad,x,y,des,wt,comp,nut,l,nz,&E); + if (dtemp<=0) + break; + comp = nut*E; + l--; + } + klow = iExt[j-1]; + iExt[j-1] = l+1; + j++; + jchnge++; + } else { + klow = iExt[j-1]; + j++; + } + } + } + while (j==nzz) // etiquette 300 + { + k1 = min(k1,iExt[0]); // if k1.GT.iExt(1) + knz = max(knz,iExt[nz-1]); // if knz.LT.iExt(nz) + nut1 = nut; + nut = -nu; + l = 0; + kup = k1; + comp = comp*1.00001; + luck = 1; + flag = 1; // test de bascule pour le goto 310 + while (l0) + { + comp = nut*E; + j = nzz; + l++; + while (lklow) + { + dtemp = gee(FreqGrille,ad,x,y,des,wt,comp,nut,l,nz,&E); + if (dtemp>0) // on inverse le test pour le break dans le if suivant + { + j = nzz; + comp = nut*E; + luck += 10; + l--; // etiquette 330 + while (l>klow) // on inverse le test goto 340 + { + dtemp = gee(FreqGrille,ad,x,y,des,wt,comp,nut,l,nz,&E); + if (dtemp<=0) + break; + comp = nut*E; + l--; + } + klow = iExt[j-1]; + iExt[j-1] = l+1; + j++; + jchnge++; // extrema ont change + flag = 0; // on est passe, bascule = 0 + break; + } + l--; + } + if (flag) + { + if (luck != 6) // on inverse le test en 340 + { + for (i=nfcns-1;i>0;i--) + iExt[i] = iExt[i-1]; + iExt[0] = k1; + jchnge ++; + } + break; + } + } + } + if (j>nzz) // arrive-t-on en 320 ? + { + if (luck>9) // oui, et luck>9 alors goto 350 + { + for (i=0;iklow) // tant que l > klow, on fait ce qui est sous 330 + { + dtemp = gee(FreqGrille,ad,x,y,des,wt,comp,nut,l,nz,&E); + if (dtemp>0) + { + j = nzz; + comp = nut*E; + luck += 10; + l--; + while (l > klow) + { + dtemp = gee(FreqGrille,ad,x,y,des,wt,comp,nut,l,nz,&E); + if (dtemp<=0) + break; + comp = nut*E; + l--; + } + klow = iExt[j-1]; + iExt[j-1] = l+1; + j++; + jchnge++; + for (i=0;i0;i--) + iExt[i] = iExt[i-1]; + iExt[0] = k1; + jchnge ++; + } + } + } + } + return 0; +} + +void build_rep_imp(int nfcns, const double* ad, double* x, const double* y, int nodd, double* h) +{ + // Transformee de Fourier inverse + double* a = malloc((nfcns+1)*sizeof(double)); + double* alpha = malloc((nfcns+2)*sizeof(double)); + int nz = nfcns+1; + int nzz = nz+1; + int nm1 = nfcns-1; + int i, j; + double fsh = 1.0e-6; + x[nzz-1] = -2; + double cn = 2*nfcns-1; + double delf = 1.0 / cn; + int l=0; + for (j=0;j= fsh + // on boucle sur l=l+1 et xe = x(l) + while ((xt <= xe) && ((xe-xt) >= fsh)) + xe = x[++l]; + if ((xt-xe) < fsh) + a[j] = y[l]; + else { + double sum = 0; + double dot = 0; + for (i=0;i 1) // etiquette 430 + l--; + } + double dden = PI2 / cn; + for (j=0;j. + */ + +#ifndef __REMEZ_LP_H__ +#define __REMEZ_LP_H__ + +#define PI 3.1415926535897932 +#define PI2 6.2831853071795865 + +/** + * Compute minimal length of lowpass filter for given parameters (Remez's method) + * - fcuts [IN]: frequency bands (normalized form). Should be [0 fpass fcut 0.5] + * - mag [IN]: amplitudes in given bands. should be [1 0] for a lowpass filter + * - dev [IN]: accepted ripple factor in given bands. + * - weight [OUT]: weights to use in remez_lp + * return filter length. + */ +int remez_lp_order(const double* fcuts, const double* mag, const double* dev, + double* weight); + +/** + * Applying Remez method to build a lowpass filter matching the given parameters. + * - h [OUT]: array where to write result filter (already allocated) + * - filterLen [IN]: filter length (computed by remez_lp_order) + * - bands [IN]: frequency bands (normalized form). Should be [0 fpass fcut 0.5] + * - dev [IN]: accepted ripple factor in given bands + * - weight [IN]: weight computed by remez_lp_order + * return 0 if success -1 if failed + */ +int remez_lp(double h[], int filterLen, + double bands[], double dev[], double weight[]); + +#endif /* __REMEZ_H__ */ + diff -Nru edfbrowser-1.67+dfsg/third_party/smarc/smarc.c edfbrowser-1.68+dfsg/third_party/smarc/smarc.c --- edfbrowser-1.67+dfsg/third_party/smarc/smarc.c 1970-01-01 00:00:00.000000000 +0000 +++ edfbrowser-1.68+dfsg/third_party/smarc/smarc.c 2019-08-05 19:13:43.583000857 +0000 @@ -0,0 +1,405 @@ +/** + * Smarc + * + * Copyright (c) 2009-2011 Institut Télécom - Télécom Paristech + * Télécom ParisTech / dept. TSI + * + * Authors : Benoit Mathieu, Jacques Prado + * + * This file is part of Smarc. + * + * Smarc is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Smarc 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include "smarc.h" +#include "stage_impl.h" +#include "multi_stage.h" +#include "polyfilt.h" +#include +#include +#include +#include + +#define FIRST_BUFFER_SIZE 512 + +struct PFilter +{ + int fsin; + int fsout; + double fpass; + double fstop; + double rp; + double rs; + int nb_stages; + struct PSFilter** filter; +}; + +int smarc_get_fs_in(struct PFilter* pfilt) +{ + return pfilt->fsin; +} + +int smarc_get_fs_out(struct PFilter* pfilt) +{ + return pfilt->fsout; +} + +int smarc_get_output_buffer_size(struct PFilter* pfilt,int inSize) +{ + int i; + int outSize = 1 + (int) ceil((double)inSize * (double) pfilt->fsout / (double) pfilt->fsin); + double stage_fsout = pfilt->fsin; + for (i=0;inb_stages;i++) + { + stage_fsout *= (double)pfilt->filter[i]->L / (double)pfilt->filter[i]->M; + outSize += ceil( pfilt->fsout * pfilt->filter[i]->filter_delay / stage_fsout); + } + return outSize; +} + + +struct PFilter* smarc_init_pfilter(int fsin, const int fsout, double bandwidth, double rp, double rs, double tol, const char* userratios, int searchfastconversion) +{ + int i; + if (fsout==fsin) + { + printf("ERROR: in and out samplerates are equals ! (%i Hz)\n",fsin); + return NULL; + } + + struct PMultiStageDef* pdef; + if (userratios!=NULL && strlen(userratios)>0) + { + pdef = get_user_ratios(fsin,fsout,userratios); + if (!pdef) + return NULL; + } else if (searchfastconversion) { + pdef = build_fast_ratios(fsin,fsout,tol,bandwidth,rp,rs); + } else { + pdef = get_predef_ratios(fsin,fsout); + if (!pdef) + { + pdef = build_auto_ratios(fsin,fsout, tol); + } + } + + if (!pdef) + { + printf("ERROR: cannot design multistage samplerate converter ! try to increase tolerance or define it yourself.\n"); + return NULL; + } + + struct PFilter* pfilt = malloc(sizeof(struct PFilter)); + pfilt->fsin = fsin; + pfilt->fsout = fsout; + pfilt->rp = rp; + pfilt->rs = rs; + + pfilt->nb_stages = pdef->nb_stages; + pfilt->filter = malloc(pfilt->nb_stages*sizeof(struct PSFilter*)); + + pfilt->fstop = (fsin>fsout ? fsout/2 : fsin/2); + double fpass = bandwidth*pfilt->fstop; + pfilt->fpass = fpass; + double stage_fsin = fsin; + for (i=0;inb_stages;i++) + { + double fstop = 0; + double fmax = pdef->L[i]*stage_fsin; + if (pdef->L[i] > pdef->M[i]) + { + // interpolation + fstop = stage_fsin - pfilt->fstop; + } else { + // decimation + fstop = ((stage_fsin * pdef->L[i]) / pdef->M[i]) - (pfilt->fstop); + } + pfilt->filter[i] = init_psfilter(pdef->L[i],pdef->M[i], + fpass / fmax,fstop / fmax,rp,rs,pdef->nb_stages); + if (pfilt->filter[i]==NULL) + return NULL; + stage_fsin = (stage_fsin * pdef->L[i]) / pdef->M[i]; + } + if (fabs(stage_fsin - fsout) > tol*fsin) + { + printf("ERROR: multistage filter output %f != %i ! (there should be an error in multistage definition)\n", stage_fsin,fsout); + return NULL; + } else if (stage_fsin!=fsout) + { + printf("WARNING: output samplerate is %f\n",stage_fsin); + } + + destroy_multistagedef(pdef); + + return pfilt; +} + +void smarc_destroy_pfilter(struct PFilter* pfilt) +{ + int i; + for (i=0;inb_stages;i++) + destroy_psfilter(pfilt->filter[i]); + free(pfilt->filter); + free(pfilt); +} + +void smarc_print_pfilter(struct PFilter* pfilt) +{ + int s; + printf("multi-stage polyphase resample from %iHz to %iHz\n",pfilt->fsin,pfilt->fsout); + printf(" passband to %0.2fHz, passband ripple factor %0.2fdB\n",pfilt->fpass,pfilt->rp); + printf(" stopband from %0.2fHz, stopband ripple factor %0.2fdB\n", pfilt->fstop,pfilt->rs); + printf("successive resample stages are :\n"); + for (s=0;snb_stages;s++) + printf(" %i / %i : filter length = %i, delay = %i\n",pfilt->filter[s]->L,pfilt->filter[s]->M,pfilt->filter[s]->flen,pfilt->filter[s]->filter_delay); +} + +struct PStageBuffer +{ + double* data; + int size; + int pos; +}; + +struct PState +{ + int nb_stages; + struct PSState** state; + struct PStageBuffer** buffer; + // flush vars + double* flush_buf; + int flush_size; + int flush_pos; + int flush_stage; +}; + +struct PState* smarc_init_pstate(struct PFilter* pfilt) +{ + int i; + struct PState* pstate = malloc(sizeof(struct PState)); + pstate->nb_stages = pfilt->nb_stages; + pstate->flush_buf = NULL; + + // init states + pstate->state = malloc(pstate->nb_stages*sizeof(struct PSState*)); + for (i=0;inb_stages;i++) + pstate->state[i] = init_psstate(pfilt->filter[i]); + + // init buffers + pstate->buffer = malloc((pstate->nb_stages+1)*sizeof(struct PStageBuffer*)); + int total_size = 0; + int current_buffer_size = 0; + for (i=0;inb_stages+1;i++) + { + struct PStageBuffer* cbuf = malloc(sizeof(struct PStageBuffer)); + pstate->buffer[i] = cbuf; + if (i==0) { + current_buffer_size = FIRST_BUFFER_SIZE; + } + else { + current_buffer_size = current_buffer_size * pfilt->filter[i-1]->L / pfilt->filter[i-1]->M + 1; + } + int filter_len = 0; + if (inb_stages) + filter_len = pfilt->filter[i]->K - 1; + cbuf->size = current_buffer_size + filter_len; + cbuf->pos = 0; +// printf("buffer %i has buffer size %i + %i = %i \n",i,current_buffer_size,filter_len,cbuf->size); + total_size += cbuf->size; + } + + // allocate all buffer contiguously + pstate->buffer[0]->data = (double*) malloc(total_size*sizeof(double)); + for (i=1;inb_stages+1;i++) + pstate->buffer[i]->data = pstate->buffer[i-1]->data + pstate->buffer[i-1]->size; + + // reset pstate before returning it + smarc_reset_pstate(pstate,pfilt); + return pstate; +} + +void smarc_destroy_pstate(struct PState* pstate) +{ + int i; + for (i=0;inb_stages;i++) + destroy_psstate(pstate->state[i]); + free(pstate->buffer[0]->data); + for (i=0;inb_stages+1;i++) + free(pstate->buffer[i]); + if (pstate->flush_buf) + free(pstate->flush_buf); + free(pstate->buffer); + free(pstate); +} + +void smarc_reset_pstate(struct PState* pstate, struct PFilter* pfilt) +{ + int i, k; + for (i=0;inb_stages;i++) + reset_psstate(pstate->state[i],pfilt->filter[i]); + for (i=0;inb_stages;i++) { + struct PStageBuffer* buf = pstate->buffer[i]; + buf->pos = pfilt->filter[i]->K - 1; + for (k=0;kpos;k++) + buf->data[k] = 0; + } + pstate->buffer[pstate->nb_stages]->pos = 0; + if (pstate->flush_buf) { + free(pstate->flush_buf); + pstate->flush_buf = NULL; + } + pstate->flush_stage = 0; + pstate->flush_pos = 0; + pstate->flush_size = 0; +} + +int smarc_resample(struct PFilter* pfilt, struct PState* pstate, + const double* signal, + int signalLength, + double* output, + int outputLength) +{ + int nbRead = 0; + int nbWritten = 0; + int i; + unsigned char inputRemains = 1; // use it as a flag + while (inputRemains && nbWrittenbuffer[0]; + int toRead = fbuf->size - fbuf->pos; + if (toRead>signalLength-nbRead) + toRead = signalLength - nbRead; + else + inputRemains = 1; +// printf("Push %i sample in first buffer %i/%i\n",toRead,fbuf->pos,fbuf->size); + if (toRead>0) { + memcpy(fbuf->data + fbuf->pos, signal + nbRead, toRead*sizeof(double)); + fbuf->pos += toRead; + nbRead += toRead; + } + } + // process all stages + for (i=0;inb_stages;i++) + { + struct PSFilter* filt = pfilt->filter[i]; + struct PSState* state = pstate->state[i]; + struct PStageBuffer* inbuf = pstate->buffer[i]; + struct PStageBuffer* outbuf = pstate->buffer[i+1]; + int nbStageRead; + int nbStageWritten; + polyfiltLM(filt,state,inbuf->data,inbuf->pos,&nbStageRead,outbuf->data + outbuf->pos,outbuf->size - outbuf->pos,&nbStageWritten); + +// printf("stage %i: read %i [%i/%i] write %i [%i/%i] K=%i\n",i,nbStageRead,inbuf->pos,inbuf->size,nbStageWritten,outbuf->pos,outbuf->size,filt->K); + + // keep non processed input + if (nbStageReadpos) { + memmove(inbuf->data, inbuf->data + nbStageRead, (inbuf->pos - nbStageRead)*sizeof(double)); + } + inbuf->pos -= nbStageRead; + if (inbuf->pos>filt->K-1) + inputRemains = 1; + + // update output pos + outbuf->pos += nbStageWritten; + } + // report last buffer to output + { + struct PStageBuffer* lbuf = pstate->buffer[pstate->nb_stages]; + int toWrite = lbuf->pos; + if (nbWritten + toWrite >= outputLength) { + printf("WARNING: cannot write all output samples, please provide larger output buffer !"); + toWrite = outputLength - nbWritten; + } +// printf("write %i samples from last buf %i/%i into output buffer %i/%i\n",toWrite,lbuf->pos,lbuf->size,*nbWritten,outputLength); + if (toWrite>0) + memcpy(output + nbWritten,lbuf->data,toWrite*sizeof(double)); + if (toWritepos) + memmove(lbuf->data,lbuf->data+toWrite,(lbuf->pos-toWrite)*sizeof(double)); + nbWritten += toWrite; + lbuf->pos -= toWrite; + } + } + return nbWritten; +} + +int smarc_resample_flush(struct PFilter* pfilt, struct PState* pstate, + double* output, + int outputLength) +{ + int nbWritten = 0; + int k; + // flush all stages + while (pstate->flush_stagenb_stages && nbWrittenflush_stage,pstate->flush_pos,pstate->flush_size); + struct PSFilter* filt = pfilt->filter[pstate->flush_stage]; + struct PStageBuffer* inbuf = pstate->buffer[pstate->flush_stage]; + if (pstate->flush_buf==NULL) { + int toFlush = filt->K - 1 - inbuf->pos + (filt->filter_delay * filt->M) / filt->L; + if (toFlush<(inbuf->size-inbuf->pos)) { +// printf("flushing straight %i samples\n",toFlush); + // just write flush samples into buffer + for (k=0;kdata[inbuf->pos+k] = inbuf->data[inbuf->pos - 2 - k]; + inbuf->pos += toFlush; + } else { + // remember samples to flush + pstate->flush_buf = (double*) malloc(toFlush*sizeof(double)); + pstate->flush_size = toFlush; + for (k=0;kflush_buf[k] = inbuf->data[inbuf->pos - 2 - k]; + // fill inbuf + for (k=0;ksize-inbuf->pos;k++) + inbuf->data[inbuf->pos+k] = pstate->flush_buf[k]; +// printf("flushing %i/%i samples\n", inbuf->size-inbuf->pos, toFlush); + pstate->flush_pos = inbuf->size-inbuf->pos; + inbuf->pos = inbuf->size; + } + } else { + // continue flushing + int toWrite = inbuf->size - inbuf->pos; + if (toWrite> (pstate->flush_size-pstate->flush_pos)) + toWrite = pstate->flush_size-pstate->flush_pos; + for (k=0;kdata[inbuf->pos+k] = pstate->flush_buf[pstate->flush_pos+k]; +// printf("flushing next %i samples starting at %i/%i\n",toWrite,pstate->flush_pos,pstate->flush_size); + pstate->flush_pos += toWrite; + inbuf->pos += toWrite; + } + + // process filtering + nbWritten += smarc_resample(pfilt,pstate,NULL,0,output + nbWritten, outputLength - nbWritten); + + // check if all have been read + if ((inbuf->posK) && (pstate->flush_pos==pstate->flush_size)) { + // end flushing this stage + if (pstate->flush_buf) { + free(pstate->flush_buf); + pstate->flush_buf = NULL; + pstate->flush_pos = 0; + pstate->flush_size = 0; + } + pstate->flush_stage++; + } + } + return nbWritten; +} + + + + + diff -Nru edfbrowser-1.67+dfsg/third_party/smarc/smarc.h edfbrowser-1.68+dfsg/third_party/smarc/smarc.h --- edfbrowser-1.67+dfsg/third_party/smarc/smarc.h 1970-01-01 00:00:00.000000000 +0000 +++ edfbrowser-1.68+dfsg/third_party/smarc/smarc.h 2019-08-05 19:13:43.583000857 +0000 @@ -0,0 +1,138 @@ +/** + * Smarc + * + * Copyright (c) 2009-2011 Institut Télécom - Télécom Paristech + * Télécom ParisTech / dept. TSI + * + * Authors : Benoit Mathieu, Jacques Prado + * + * This file is part of Smarc. + * + * Smarc is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Smarc 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#ifndef SMARC_H_ +#define SMARC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * PFilter represent a multi-stage polyphase filter + */ +struct PFilter; + +/** + * Build a PFilter with given parameter. Given pointer must be free by calling destroy_pfilter function + * - fsin (IN) : frequency samplerate of input signal + * - fsout (IN) : desired frequency samplerate for output signal + * - bandwidth (IN) : bandwidth to keep, real in 0..1. For example, 0.95 means that 95% of maximum + * possible bandwidth is kept. Too high value may results in impossible filter to design. + * - rp (IN) : Passband ripple factor, in dB. + * - rs (IN) : Stopband ripple factor, in dB. + * - tol (IN) : samplerate conversion error tolerance. Usual value for tol is 0.000001. Usual frequencies conversion + * has exact samplerate conversion, but for unusual frequencies, in particular when fsin or fsout + * are large prime numbers, the user should accept a tolerance otherwise the filter may + * be impossible to design. + * - userratios (IN) : ratios to use to build multistage samplerate converter, in following format : + * 'L1/M2 L2/M2 ...'. This parameter is optional. + * - searchfastconversion (IN) : if 1 try to search fastest conversion stages. This may fail. + * if 0 use safe default conversion stages. + */ +struct PFilter* smarc_init_pfilter(int fsin, const int fsout, + double bandwidth, double rp, double rs, + double tol, const char* userratios, int searchfastconversion); + +/** + * release PFilter + */ +void smarc_destroy_pfilter(struct PFilter*); + +/** + * returns input frequency samplerate for PFilter + */ +int smarc_get_fs_in(struct PFilter*); + +/** + * return output frequency samplerate for PFilter + */ +int smarc_get_fs_out(struct PFilter*); + +/** + * return a recommended output buffer size to safely resample + * input signal chunks of length inSize with filter pfilt + */ +int smarc_get_output_buffer_size(struct PFilter* pfilt,int inSize); + +/** + * print PFilter informations to standard output + */ +void smarc_print_pfilter(struct PFilter*); + +/** + * PState represent a filter state. A PFilter may be used to filter several channels, each channels having its own PState. + */ +struct PState; + +/** + * Create a PState for a given PFilter. Returned pointer must be freed by destroy_pstate() + */ +struct PState* smarc_init_pstate(struct PFilter*); + +/** + * Free PState + */ +void smarc_destroy_pstate(struct PState*); + +/** + * Reset PState so that it can be used to process another signal. + */ +void smarc_reset_pstate(struct PState*, struct PFilter*); + +/** + * Resample a chunk of signal. + * - pfilter [IN]: PFilter used to resample + * - pstate [IN/OUT]: current state of resampler + * - signal [IN]: array holding signal to resample + * - signalLength [IN]: length of signal to resample + * - output [OUT]: buffer where to write resampled signal + * - outputLength [IN]: size of output buffer. + * Returns the number of output samples written. + */ +int smarc_resample(struct PFilter* pfilter, struct PState* pstate, + const double* signal, + int signalLength, + double* output, + int outputLength); + +/** + * Flush all sample in state considering there will be no more input signal. + * This function must be called only once. + * - pfilter [IN]: PFilter used to resample + * - pstate [IN/OUT]: current state of resampler + * - output [OUT]: buffer where to write resampled signal + * - outputLength [IN]: size of output buffer. + * Returns the number of output samples written. + */ +int smarc_resample_flush(struct PFilter*, struct PState*, + double* output, + int outputLength); + +#ifdef __cplusplus +} +#endif + + +#endif /* SMARC_H_ */ diff -Nru edfbrowser-1.67+dfsg/third_party/smarc/stage_impl.c edfbrowser-1.68+dfsg/third_party/smarc/stage_impl.c --- edfbrowser-1.67+dfsg/third_party/smarc/stage_impl.c 1970-01-01 00:00:00.000000000 +0000 +++ edfbrowser-1.68+dfsg/third_party/smarc/stage_impl.c 2019-08-05 19:13:43.583000857 +0000 @@ -0,0 +1,172 @@ +/** + * Smarc + * + * Copyright (c) 2009-2011 Institut Télécom - Télécom Paristech + * Télécom ParisTech / dept. TSI + * + * Authors : Benoit Mathieu, Jacques Prado + * + * This file is part of Smarc. + * + * Smarc is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Smarc 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include "stage_impl.h" +#include "filtering.h" +#include "polyfilt.h" + +#include +#include +#include +#include +#include "malloc.h" + +#include "remez_lp.h" + +#define MAX_FILTER_LENGTH 8192 + +void build_filter(double fpass, double fstop, + double rp, double rs, int rpFactor, double** h, int* len, int lenStep) { + int i; + double *bands, *mag, *dev, *weight; + +// printf("build filter %f %f %f, %f/%i %f (lenstep=%i)\n",fpass,fstop,fmax,rp,rpFactor, rs,lenStep); + + bands = malloc(10 * sizeof(double)); + mag = &bands[4]; + dev = &mag[2]; + weight = &dev[2]; + + bands[0] = 0; + bands[1] = fpass; + bands[2] = fstop; + bands[3] = 0.5; + + mag[0] = 1; + mag[1] = 0; + + dev[0] = (pow(10, rp / 20.0) - 1) / (rpFactor *(pow(10, rp / 20.0) + 1)); + dev[1] = pow(10, -rs / 20.0); + + int n = remez_lp_order(bands, mag, dev, weight); + + // filter length must be 2*K*lenStep+1 so that delay is integer + { + int k = 1; + while (2*k*lenStep + 1 < n) + k++; + *len = 2*k*lenStep + 1; + } + + if (n>MAX_FILTER_LENGTH) + { + free(bands); + *len = 0; + printf("ERROR: cannot build remez filter, it's too long ! (%i) try with other parameters\n",n); + return; + } + + *h = malloc((*len) * sizeof(double)); + for (i = 0; i < *len; i++) + (*h)[i] = 0; + int iRc = remez_lp(*h, *len, bands, mag, weight); + if (iRc) + { + free(*h); + *h = NULL; + *len = 0; + } + + free(bands); +} + +struct PSFilter* init_psfilter(int L, int M, + double fpass, double fstop, + double rp, double rs, int rpFactor) { + + double* h = 0; + int Lenh, i, k; + + build_filter(fpass,fstop,rp, rs, rpFactor, &h, &Lenh,M); + if (Lenh==0) + { + printf("ERROR: cannot build filter %i/%i (within a %i stage filter) with parameters fpass=%0.2f fstop=%0.2f rp=%0.2f rs=%0.2f\n",L,M,rpFactor, fpass,fstop,rp,rs); + return NULL; + } + // ensure Lenh > M+L-1 + // (this is generally already true, but must check it for polyfiltLM) + while (Lenh<(L+M-1)) + Lenh += 2 * M; + + struct PSFilter* pfilt = malloc(sizeof(struct PSFilter)); + + // adjust filter gain + if (L>1) + for (i = 0; i < Lenh; i++) + h[i] *= L; + + // filters + int K = Lenh / L; + if (Lenh > K*L) + K++; + pfilt->filters = malloc(L*K*sizeof(double)); + + if (L==1) + { + // decimation filter (only one filter) + for (k=0;kfilters[K-1-k] = h[k]; + } else { + // filter with interpolation (one filter per interpolation tap) + for (i=0;ifilters[i*K] = 0.0; + for (i=0;ifilters[(i%L)*K+K-1-i/L] = h[i]; + } + } + + free(h); + + pfilt->flen = Lenh; + pfilt->M = M; + pfilt->L = L; + pfilt->K = K; + pfilt->filter_delay = (Lenh - 1) / (2*M); + + return pfilt; +} + +void destroy_psfilter(struct PSFilter* pfilt) { + free(pfilt->filters); + free(pfilt); +} + +struct PSState* init_psstate(struct PSFilter* pfilt) { + struct PSState* pstate = (struct PSState*) malloc(sizeof(struct PSState)); + pstate->skip = 0; + pstate->phase = 0; + reset_psstate(pstate,pfilt); + return pstate; +} + +void destroy_psstate(struct PSState* pstate) { + free(pstate); +} + +void reset_psstate(struct PSState* pstate, const struct PSFilter* pfilt) { + pstate->skip=pfilt->filter_delay; + pstate->phase = 0; +} + diff -Nru edfbrowser-1.67+dfsg/third_party/smarc/stage_impl.h edfbrowser-1.68+dfsg/third_party/smarc/stage_impl.h --- edfbrowser-1.67+dfsg/third_party/smarc/stage_impl.h 1970-01-01 00:00:00.000000000 +0000 +++ edfbrowser-1.68+dfsg/third_party/smarc/stage_impl.h 2019-08-05 19:13:43.583000857 +0000 @@ -0,0 +1,100 @@ +/** + * Smarc + * + * Copyright (c) 2009-2011 Institut Télécom - Télécom Paristech + * Télécom ParisTech / dept. TSI + * + * Authors : Benoit Mathieu, Jacques Prado + * + * This file is part of Smarc. + * + * Smarc is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Smarc 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#ifndef POLYPHASE_DECL_H_ +#define POLYPHASE_DECL_H_ + +#include "filtering.h" + +#define FILT(pfilt,m,l) &pfilt->filters[(m*L+l)*K] +#define FILT_STATE(pstate,m) &pstate->yi[m*(K-1)] + +/** + * Defines a filter stage. + * - flen: length of remez filter. (L*M*K) + * - L: interpolation factor + * - M: decimation factor + * - K: sub-filter length + * - filters: array of L*M sub filters of length K. (total size is flen) + */ +struct PSFilter { + int flen; + int L; + int M; + int K; + + double* filters; + int filter_delay; +}; + +/** + * Initialize PSFilter struct with given parameters + * - L [IN]: interpolation factor + * - M [IN]: decimation factor + * - fpass [IN]: start of lowpass filter transition band, in normalized form (0records_in_viewbuf * (long long)signalcomp[i]->edfhdr->recordsize; - } - - if(l_temp >= 0x80000000) +// printf("debug: totalsize is: %llu\n", totalsize); + if(totalsize >= UINT_MAX) // 4.2GB on 32-bit systems, muuuuch bigger on 64-bit systems { live_stream_active = 0; - QMessageBox messagewindow(QMessageBox::Critical, "Error", "Internal error: Memory limit protection:\n\"prefilterbuf\""); +#if defined(__LP64__) || defined(__MINGW64__) + QMessageBox messagewindow(QMessageBox::Critical, "Error", "Somehow you hit the memory limit...\n" + "Decrease the timescale and/or number of traces and try again."); +#else + QMessageBox messagewindow(QMessageBox::Critical, "Error", "You have hit the memory limit of 4.2GB.\n" + "Decrease the timescale and/or number of traces and try again."); +#endif messagewindow.exec(); remove_all_signals(); @@ -257,11 +260,11 @@ signalcomp[i]->prefilter_starttime = datarecords * signalcomp[i]->edfhdr->long_data_record_duration; - if((signalcomp[i]->viewbufsize>0)&&(datarecordsedfhdr->datarecords)) + if((signalcomp[i]->viewbufsize > 0) && (datarecords < signalcomp[i]->edfhdr->datarecords)) { fseeko(signalcomp[i]->edfhdr->file_hdl, (long long)(signalcomp[i]->edfhdr->hdrsize + (datarecords * signalcomp[i]->edfhdr->recordsize)), SEEK_SET); - if(signalcomp[i]->viewbufsize>((signalcomp[i]->edfhdr->datarecords - datarecords) * signalcomp[i]->edfhdr->recordsize)) + if(signalcomp[i]->viewbufsize > (unsigned long long)((signalcomp[i]->edfhdr->datarecords - datarecords) * signalcomp[i]->edfhdr->recordsize)) { signalcomp[i]->viewbufsize = (signalcomp[i]->edfhdr->datarecords - datarecords) * signalcomp[i]->edfhdr->recordsize; } @@ -295,11 +298,11 @@ signalcomp[i]->prefilter_starttime = datarecords * signalcomp[i]->edfhdr->long_data_record_duration; - if((signalcomp[i]->viewbufsize>0)&&(datarecordsedfhdr->datarecords)) + if((signalcomp[i]->viewbufsize > 0) && (datarecordsedfhdr->datarecords)) { fseeko(signalcomp[i]->edfhdr->file_hdl, (long long)(signalcomp[i]->edfhdr->hdrsize + (datarecords * signalcomp[i]->edfhdr->recordsize)), SEEK_SET); - if(signalcomp[i]->viewbufsize>((signalcomp[i]->edfhdr->datarecords - datarecords) * signalcomp[i]->edfhdr->recordsize)) + if(signalcomp[i]->viewbufsize > (unsigned long long)((signalcomp[i]->edfhdr->datarecords - datarecords) * signalcomp[i]->edfhdr->recordsize)) { signalcomp[i]->viewbufsize = (signalcomp[i]->edfhdr->datarecords - datarecords) * signalcomp[i]->edfhdr->recordsize; } @@ -592,24 +595,25 @@ viewbuf = NULL; } - for(i=0, l_temp=0; irecords_in_viewbuf * (long long)signalcomp[i]->edfhdr->recordsize; - } - - if(l_temp >= 0x80000000) + if(totalsize) { - live_stream_active = 0; - QMessageBox messagewindow(QMessageBox::Critical, "Error", "The system was not able to provide enough resources (memory) to perform the requested action.\n" - "Decrease the timescale and try again."); - messagewindow.exec(); +// printf("debug: totalsize is: %llu\n", totalsize); + if(totalsize >= UINT_MAX) // 4.2GB on 32-bit systems, muuuuch bigger on 64-bit systems + { + live_stream_active = 0; +#if defined(__LP64__) || defined(__MINGW64__) + QMessageBox messagewindow(QMessageBox::Critical, "Error", "Somehow you hit the memory limit...\n" + "Decrease the timescale and/or number of traces and try again."); +#else + QMessageBox messagewindow(QMessageBox::Critical, "Error", "You have hit the memory limit of 4.2GB.\n" + "Decrease the timescale and/or number of traces and try again."); +#endif + messagewindow.exec(); - remove_all_signals(); - return; - } + remove_all_signals(); + return; + } - if(totalsize) - { viewbuf = (char *)malloc(totalsize); if(viewbuf==NULL) { @@ -638,7 +642,14 @@ dif = signalcomp[i]->edfhdr->datarecords - datarecords; - if(dif<=0) +// printf("signalcomp[%i]->viewbufoffset: %llu\n" +// "signalcomp[%i]->records_in_viewbuf: %llu\n" +// "signalcomp[%i]->edfhdr->recordsize: %i\n" +// "dif: %lli\n" +// "datarecords: %lli\n", +// i, signalcomp[i]->viewbufoffset, i, signalcomp[i]->records_in_viewbuf, i, signalcomp[i]->edfhdr->recordsize, dif, datarecords); + + if(dif <= 0) { memset(viewbuf + signalcomp[i]->viewbufoffset, 0, signalcomp[i]->records_in_viewbuf * signalcomp[i]->edfhdr->recordsize); @@ -646,7 +657,7 @@ } else { - if(difrecords_in_viewbuf) + if(dif < (long long)signalcomp[i]->records_in_viewbuf) { readsize = dif * signalcomp[i]->edfhdr->recordsize; @@ -711,7 +722,7 @@ } else { - if(difrecords_in_viewbuf) + if((unsigned long long)dif < signalcomp[i]->records_in_viewbuf) { if(!skip) { @@ -875,19 +886,19 @@ record_duration -= pagetime; - if(edfheaderlist[sel_viewtime]->viewtime<=0) + if(edfheaderlist[sel_viewtime]->viewtime <= 0) { positionslider->setValue(0); } else { - if(edfheaderlist[sel_viewtime]->viewtime>=record_duration) + if(edfheaderlist[sel_viewtime]->viewtime >= record_duration) { positionslider->setValue(1000000); } else { - if(record_durationsetValue(1000000); } diff -Nru edfbrowser-1.67+dfsg/viewcurve.cpp edfbrowser-1.68+dfsg/viewcurve.cpp --- edfbrowser-1.67+dfsg/viewcurve.cpp 2019-01-26 13:36:35.941155254 +0000 +++ edfbrowser-1.68+dfsg/viewcurve.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -1528,7 +1528,7 @@ if(((l_tmp + annot->long_duration) > (mainwindow->edfheaderlist[i]->viewtime - TIME_DIMENSION)) && (!annot->hided)) { - if(l_tmp > (mainwindow->edfheaderlist[i]->viewtime + mainwindow->pagetime)) + if(l_tmp > (long long)(mainwindow->edfheaderlist[i]->viewtime + mainwindow->pagetime)) { break; } @@ -1994,7 +1994,7 @@ l_tmp = annot->onset - mainwindow->edfheaderlist[i]->starttime_offset; - if(l_tmp > (mainwindow->edfheaderlist[i]->viewtime + mainwindow->pagetime)) + if(l_tmp > (long long)(mainwindow->edfheaderlist[i]->viewtime + mainwindow->pagetime)) { break; } @@ -2274,8 +2274,10 @@ } painter->setPen((Qt::GlobalColor)signalcomp[i]->color); - // Don't update the onset time when changing file position -// mainwindow->annotationEditDock->annotEditSetOnset(crosshair_1.time_relative); + if((!crosshair_1.moving) && (!mainwindow->annotationEditDock->dockedit->isHidden())) + { + mainwindow->annotationEditDock->annotEditSetOnset(crosshair_1.time_relative); + } } } @@ -2473,7 +2475,7 @@ char *viewbuf; - long long s, s2; + unsigned long long s, s2; double dig_value=0.0, f_tmp=0.0; @@ -2902,17 +2904,22 @@ x2 = (int)(((double)(s + 1)) / signalcomp[i]->sample_pixel_ratio); y2 = value; - if(signalcomp[i]->samples_on_screen < w) + if(signalcomp[i]->samples_on_screen < (unsigned long long)w) { if(linear_interpol) { - x1 = (int)(((double)(s - 1)) / signalcomp[i]->sample_pixel_ratio); - x2 = (int)((double)s / signalcomp[i]->sample_pixel_ratio); + if(s>signalcomp[i]->sample_start) + { + x1 = (int)(((double)(s - 1)) / signalcomp[i]->sample_pixel_ratio); + x2 = (int)((double)s / signalcomp[i]->sample_pixel_ratio); - graphicBuf[screensamples[i]].graphicLine[i].x1 = x1 - signalcomp[i]->pixels_shift; - graphicBuf[screensamples[i]].graphicLine[i].y1 = y1; - graphicBuf[screensamples[i]].graphicLine[i].x2 = x2 - signalcomp[i]->pixels_shift; - graphicBuf[screensamples[i]].graphicLine[i].y2 = y2; + graphicBuf[screensamples[i]].graphicLine[i].x1 = x1 - signalcomp[i]->pixels_shift; + graphicBuf[screensamples[i]].graphicLine[i].y1 = y1; + graphicBuf[screensamples[i]].graphicLine[i].x2 = x2 - signalcomp[i]->pixels_shift; + graphicBuf[screensamples[i]].graphicLine[i].y2 = y2; + + screensamples[i]++; + } } else { @@ -2930,9 +2937,9 @@ graphicBuf[screensamples[i]].graphicLine[i].x2 = x1 - signalcomp[i]->pixels_shift; graphicBuf[screensamples[i]].graphicLine[i].y2 = y2; } - } - screensamples[i]++; + screensamples[i]++; + } } else { @@ -2982,7 +2989,7 @@ { if(printing) { - if(s==((int)((double)(crosshair_1.x_position * printsize_x_factor + (double)signalcomp[i]->pixels_shift) * signalcomp[i]->sample_pixel_ratio))) + if(s == (unsigned long long)((double)(crosshair_1.x_position * printsize_x_factor + (double)signalcomp[i]->pixels_shift) * signalcomp[i]->sample_pixel_ratio)) { crosshair_1.y_value = value; crosshair_1.value = dig_value * signalcomp[i]->edfhdr->edfparam[signalcomp[i]->edfsignal[0]].bitvalue; @@ -2992,7 +2999,7 @@ } else { - if(s==((int)((double)(crosshair_1.x_position + signalcomp[i]->pixels_shift) * signalcomp[i]->sample_pixel_ratio))) + if(s == (unsigned long long)((double)(crosshair_1.x_position + signalcomp[i]->pixels_shift) * signalcomp[i]->sample_pixel_ratio)) { crosshair_1.y_value = value; crosshair_1.value = dig_value * signalcomp[i]->edfhdr->edfparam[signalcomp[i]->edfsignal[0]].bitvalue; @@ -3006,7 +3013,7 @@ { if(printing) { - if(s==((int)((double)(crosshair_2.x_position * printsize_x_factor + (double)signalcomp[i]->pixels_shift) * signalcomp[i]->sample_pixel_ratio))) + if(s == (unsigned long long)((double)(crosshair_2.x_position * printsize_x_factor + (double)signalcomp[i]->pixels_shift) * signalcomp[i]->sample_pixel_ratio)) { crosshair_2.y_value = value; crosshair_2.value = dig_value * signalcomp[i]->edfhdr->edfparam[signalcomp[i]->edfsignal[0]].bitvalue; @@ -3016,7 +3023,7 @@ } else { - if(s==((int)((double)(crosshair_2.x_position + signalcomp[i]->pixels_shift) * signalcomp[i]->sample_pixel_ratio))) + if(s == (unsigned long long)((double)(crosshair_2.x_position + signalcomp[i]->pixels_shift) * signalcomp[i]->sample_pixel_ratio)) { crosshair_2.y_value = value; crosshair_2.value = dig_value * signalcomp[i]->edfhdr->edfparam[signalcomp[i]->edfsignal[0]].bitvalue; @@ -3079,7 +3086,7 @@ runin_samples, stat_zero_crossing; - long long s, s2; + unsigned long long s, s2; double dig_value, f_tmp; @@ -3123,7 +3130,7 @@ signalcomp->pixels_shift = signalcomp->sample_timeoffset_part / signalcomp->sample_pixel_ratio; - for(s=signalcomp->sample_start; ssamples_on_screen; s++) + for(s=signalcomp->sample_start; s < signalcomp->samples_on_screen; s++) { if(s>=signalcomp->sample_stop) break; @@ -3405,17 +3412,22 @@ x2 = (int)(((double)(s + 1)) / signalcomp->sample_pixel_ratio); y2 = value; - if(signalcomp->samples_on_screen < w) + if(signalcomp->samples_on_screen < (unsigned long long)w) { if(linear_interpol) { - x1 = (int)(((double)(s - 1)) / signalcomp->sample_pixel_ratio); - x2 = (int)((double)s / signalcomp->sample_pixel_ratio); + if(s>signalcomp->sample_start) + { + x1 = (int)(((double)(s - 1)) / signalcomp->sample_pixel_ratio); + x2 = (int)((double)s / signalcomp->sample_pixel_ratio); - graphicBuf[*screensamples].graphicLine[i].x1 = x1 - signalcomp->pixels_shift; - graphicBuf[*screensamples].graphicLine[i].y1 = y1; - graphicBuf[*screensamples].graphicLine[i].x2 = x2 - signalcomp->pixels_shift; - graphicBuf[*screensamples].graphicLine[i].y2 = y2; + graphicBuf[*screensamples].graphicLine[i].x1 = x1 - signalcomp->pixels_shift; + graphicBuf[*screensamples].graphicLine[i].y1 = y1; + graphicBuf[*screensamples].graphicLine[i].x2 = x2 - signalcomp->pixels_shift; + graphicBuf[*screensamples].graphicLine[i].y2 = y2; + + (*screensamples)++; + } } else { @@ -3433,9 +3445,9 @@ graphicBuf[*screensamples].graphicLine[i].x2 = x1 - signalcomp->pixels_shift; graphicBuf[*screensamples].graphicLine[i].y2 = y2; } - } - (*screensamples)++; + (*screensamples)++; + } } else { @@ -3485,7 +3497,7 @@ { if(printing) { - if(s==((int)((double)(crosshair_1->x_position * printsize_x_factor + (double)signalcomp->pixels_shift) * signalcomp->sample_pixel_ratio))) + if(s == (unsigned long long)((double)(crosshair_1->x_position * printsize_x_factor + (double)signalcomp->pixels_shift) * signalcomp->sample_pixel_ratio)) { crosshair_1->y_value = value; crosshair_1->value = dig_value * signalcomp->edfhdr->edfparam[signalcomp->edfsignal[0]].bitvalue; @@ -3495,7 +3507,7 @@ } else { - if(s==((int)((double)(crosshair_1->x_position + signalcomp->pixels_shift) * signalcomp->sample_pixel_ratio))) + if(s == (unsigned long long)((double)(crosshair_1->x_position + signalcomp->pixels_shift) * signalcomp->sample_pixel_ratio)) { crosshair_1->y_value = value; crosshair_1->value = dig_value * signalcomp->edfhdr->edfparam[signalcomp->edfsignal[0]].bitvalue; @@ -3509,7 +3521,7 @@ { if(printing) { - if(s==((int)((double)(crosshair_2->x_position * printsize_x_factor + (double)signalcomp->pixels_shift) * signalcomp->sample_pixel_ratio))) + if(s == ((double)(crosshair_2->x_position * printsize_x_factor + (double)signalcomp->pixels_shift) * signalcomp->sample_pixel_ratio)) { crosshair_2->y_value = value; crosshair_2->value = dig_value * signalcomp->edfhdr->edfparam[signalcomp->edfsignal[0]].bitvalue; @@ -3519,7 +3531,7 @@ } else { - if(s==((int)((double)(crosshair_2->x_position + signalcomp->pixels_shift) * signalcomp->sample_pixel_ratio))) + if(s == ((double)(crosshair_2->x_position + signalcomp->pixels_shift) * signalcomp->sample_pixel_ratio)) { crosshair_2->y_value = value; crosshair_2->value = dig_value * signalcomp->edfhdr->edfparam[signalcomp->edfsignal[0]].bitvalue; @@ -4435,7 +4447,7 @@ crosshair_2.moving = 0; crosshair_2.file_num = mainwindow->signalcomp[signal_nr]->filenum; - crosshair_2.x_position = w * 0.3; + crosshair_2.x_position = w * 0.6; crosshair_2.y_position = h * 0.7; drawCurve_stage_1(); @@ -4446,6 +4458,82 @@ } +void ViewCurve::next_crosshair_triggered() +{ + int i, n=0; + + if(!mainwindow->signalcomps) return; + + for(i=0; isignalcomps; i++) + { + if(mainwindow->signalcomp[i]->hascursor1) + { + n = i; + + break; + } + } + + if((!crosshair_1.active) || crosshair_2.active) + { + if(!crosshair_1.active) + { + n = 0; + } + else if(crosshair_2.active) + { + n++; + + n %= mainwindow->signalcomps; + } + + for(i=0; isignalcomps; i++) + { + mainwindow->signalcomp[i]->hascursor1 = 0; + mainwindow->signalcomp[i]->hascursor2 = 0; + } + crosshair_1.value = 0.0; + crosshair_2.value = 0.0; + mainwindow->signalcomp[n]->hascursor1 = 1; + use_move_events = 0; + setMouseTracking(true); + crosshair_1.active = 1; + crosshair_2.active = 0; + crosshair_1.moving = 0; + crosshair_2.moving = 0; + crosshair_1.file_num = mainwindow->signalcomp[n]->filenum; + + crosshair_1.x_position = w * 0.3; + crosshair_1.y_position = h * 0.7; + + drawCurve_stage_1(); + } + else + { + if(!crosshair_2.active) + { + for(i=0; isignalcomps; i++) + { + mainwindow->signalcomp[i]->hascursor2 = 0; + } + crosshair_2.value = 0.0; + mainwindow->signalcomp[n]->hascursor2 = 1; + use_move_events = 0; + setMouseTracking(true); + crosshair_2.active = 1; + crosshair_1.moving = 0; + crosshair_2.moving = 0; + crosshair_2.file_num = mainwindow->signalcomp[n]->filenum; + + crosshair_2.x_position = w * 0.6; + crosshair_2.y_position = h * 0.7; + + drawCurve_stage_1(); + } + } +} + + void ViewCurve::resizeEvent(QResizeEvent *rs_event) { drawCurve_stage_1(); diff -Nru edfbrowser-1.67+dfsg/viewcurve.h edfbrowser-1.68+dfsg/viewcurve.h --- edfbrowser-1.67+dfsg/viewcurve.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/viewcurve.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * @@ -205,7 +205,7 @@ void print_to_pdf(); void print_to_image(int, int); void print_to_printer(); - + void next_crosshair_triggered(); private: diff -Nru edfbrowser-1.67+dfsg/view_montage_dialog.cpp edfbrowser-1.68+dfsg/view_montage_dialog.cpp --- edfbrowser-1.67+dfsg/view_montage_dialog.cpp 2019-01-26 13:36:35.941155254 +0000 +++ edfbrowser-1.68+dfsg/view_montage_dialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/view_montage_dialog.h edfbrowser-1.68+dfsg/view_montage_dialog.h --- edfbrowser-1.67+dfsg/view_montage_dialog.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/view_montage_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/wav2edf.cpp edfbrowser-1.68+dfsg/wav2edf.cpp --- edfbrowser-1.67+dfsg/wav2edf.cpp 2019-01-26 13:36:35.941155254 +0000 +++ edfbrowser-1.68+dfsg/wav2edf.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2011 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/wav2edf.h edfbrowser-1.68+dfsg/wav2edf.h --- edfbrowser-1.67+dfsg/wav2edf.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/wav2edf.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2011 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/xml.c edfbrowser-1.68+dfsg/xml.c --- edfbrowser-1.67+dfsg/xml.c 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/xml.c 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/xml.h edfbrowser-1.68+dfsg/xml.h --- edfbrowser-1.67+dfsg/xml.h 2019-01-26 13:36:35.929155316 +0000 +++ edfbrowser-1.68+dfsg/xml.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2007 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/z_ratio_filter.c edfbrowser-1.68+dfsg/z_ratio_filter.c --- edfbrowser-1.67+dfsg/z_ratio_filter.c 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/z_ratio_filter.c 2019-08-05 19:13:43.591000847 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2012 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/z_ratio_filter.h edfbrowser-1.68+dfsg/z_ratio_filter.h --- edfbrowser-1.67+dfsg/z_ratio_filter.h 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/z_ratio_filter.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2012 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/z_score_dialog.cpp edfbrowser-1.68+dfsg/z_score_dialog.cpp --- edfbrowser-1.67+dfsg/z_score_dialog.cpp 2019-01-26 13:36:35.941155254 +0000 +++ edfbrowser-1.68+dfsg/z_score_dialog.cpp 2019-08-05 19:13:43.595000842 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2012 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** * diff -Nru edfbrowser-1.67+dfsg/z_score_dialog.h edfbrowser-1.68+dfsg/z_score_dialog.h --- edfbrowser-1.67+dfsg/z_score_dialog.h 2019-01-26 13:36:35.933155295 +0000 +++ edfbrowser-1.68+dfsg/z_score_dialog.h 2019-08-05 19:13:43.587000852 +0000 @@ -5,7 +5,7 @@ * * Copyright (C) 2012 - 2019 Teunis van Beelen * -* Email: teuniz@gmail.com +* Email: teuniz@protonmail.com * *************************************************************************** *