Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions digitalfiltering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#include <math.h>
#include <QDebug>

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

DigitalFiltering::DigitalFiltering()
{
}
Expand Down Expand Up @@ -227,8 +231,9 @@ QVector<double> DigitalFiltering::filterSignal(const QVector<double> &signal, co
QVector<double> DigitalFiltering::generateFirFilter(double f_break, int bits, bool useHamming)
{
int taps = 1 << bits;
double imag[taps];
double filter_vector[taps];
std::vector<double> imag_v(taps), filter_vector_v(taps);
double *imag= &imag_v[0];
double *filter_vector = &filter_vector_v[0];

for(int i = 0;i < taps;i++) {
if (i < (int)((double)taps * f_break)) {
Expand Down
1 change: 1 addition & 0 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <QFileDialog>
#include <QFile>
#include <string.h>
#define _USE_MATH_DEFINES
#include <cmath>
#include <QMessageBox>
#include <QSerialPortInfo>
Expand Down
1 change: 1 addition & 0 deletions utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include "utility.h"
#define _USE_MATH_DEFINES
#include <cmath>

namespace {
Expand Down