File: fir_filter_dialog.h

package info (click to toggle)
edfbrowser 2.00%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,372 kB
  • sloc: cpp: 82,561; ansic: 11,314; sh: 178; xml: 19; makefile: 12
file content (189 lines) | stat: -rw-r--r-- 3,741 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/*
***************************************************************************
*
* Author: Teunis van Beelen
*
* Copyright (C) 2018 - 2023 Teunis van Beelen
*
* Email: teuniz@protonmail.com
*
***************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
***************************************************************************
*/



#ifndef ADD_FIR_FILTERFORM1_H
#define ADD_FIR_FILTERFORM1_H



#include "qt_headers.h"

#include <stdlib.h>
#include <string.h>

#include "global.h"
#include "mainwindow.h"
#include "utils.h"

#include "filt/fir_filter.h"
#include "filt/remez.h"
#include "filt/wind_sinc.h"
#include "filtercurve.h"



class UI_Mainwindow;


class UI_FIRFilterRZ_thread : public QThread
{
public:

struct rz_params_struct
{
  int band_num;
  double sf;
  double start_hz[32];
  double stop_hz[32];
  double gain[32];
  double ripple[32];
  double *f_taps;
  int tap_num;
  int abort;
}rz_params;

UI_FIRFilterRZ_thread();
~UI_FIRFilterRZ_thread();

private:

void run();

};


class UI_FIRFilterDialog : public QObject
{
  Q_OBJECT

public:
  UI_FIRFilterDialog(char *recent_dir=NULL, char *save_dir=NULL, QWidget *parent=0);
  ~UI_FIRFilterDialog();

  UI_Mainwindow *mainwindow;


private:

QDialog        *firfilterdialog;

QTabWidget     *tabholder;

QWidget        *sinc_tab,
               *pm_tab;

QPushButton    *CancelButton,
               *ApplyButton,
               *helpButton,
               *fileButton,
               *pm_add_passband_button,
               *pm_add_stopband_button,
               *pm_design_button,
               *sinc_design_button;

QComboBox      *pm_predefined_cbox,
               *sinc_type_cbox;

QListWidget    *signals_list;

QPlainTextEdit *textEdit;

QLabel         *listlabel,
               *varsLabel,
               *freqresplabel,
               *filt_descr_label;

QSpinBox       *db_min_spinbox,
               *db_max_spinbox;

QDoubleSpinBox *pm_sf_spinbox,
               *sinc_sf_spinbox,
               *sinc_cutoff1_spinbox,
               *sinc_cutoff2_spinbox,
               *sinc_trans_bw_spinbox;

QCheckBox      *plotphasecheckbox;

QTableWidget *pm_param_table;

FilterCurve    *curve1;

UI_FIRFilterRZ_thread *thrd;

int n_taps,
    db_max_i,
    db_min_i,
    plot_phase,
    fir_model;

double *taps,
       *z,
       *deg;

char *textbuf,
     *recent_opendir,
     *recent_savedir,
     filter_description_txt_1[512],
     filter_description_txt_2[512];

int pm_add_table_row(void);

private slots:

void ApplyButtonClicked();
void check_text();
void helpbuttonpressed();
void filebuttonpressed();
void db_min_spinbox_changed(int);
void db_max_spinbox_changed(int);
void plotphasecheckbox_changed(int);
void selected_signals_changed();
void pm_add_passband_button_pressed();
void pm_add_stopband_button_pressed();
void pm_design_button_pressed();
void pm_tabel_cell_pressed(int, int);
void pm_predefined_cbox_changed(int);
void pm_paramtable_rowcount_changed();
void current_tab_changed(int);
void sinc_design_button_pressed();
void sinc_type_cbox_changed(int);
void gain_spinbox_changed(double);

};



#endif // ADD_FIR_FILTERFORM1_H