kopia lustrzana https://github.com/jamescoxon/dl-fldigi
rodzic
5dc3851b33
commit
0a8f4a3b75
|
@ -52,6 +52,17 @@
|
||||||
// probably only need a single instance of g_fft !!
|
// probably only need a single instance of g_fft !!
|
||||||
// use for both forward and reverse
|
// use for both forward and reverse
|
||||||
|
|
||||||
|
void fftfilt::clear_filter()
|
||||||
|
{
|
||||||
|
memset(filter, 0, flen * sizeof(cmplx));
|
||||||
|
memset(timedata, 0, flen * sizeof(cmplx));
|
||||||
|
memset(freqdata, 0, flen * sizeof(cmplx));
|
||||||
|
memset(output, 0, flen * sizeof(cmplx));
|
||||||
|
memset(ovlbuf, 0, flen2 * sizeof(cmplx));
|
||||||
|
memset(ht, 0, flen * sizeof(cmplx));
|
||||||
|
inptr = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void fftfilt::init_filter()
|
void fftfilt::init_filter()
|
||||||
{
|
{
|
||||||
flen2 = flen >> 1;
|
flen2 = flen >> 1;
|
||||||
|
@ -63,15 +74,12 @@ void fftfilt::init_filter()
|
||||||
output = new cmplx[flen];
|
output = new cmplx[flen];
|
||||||
ovlbuf = new cmplx[flen2];
|
ovlbuf = new cmplx[flen2];
|
||||||
ht = new cmplx[flen];
|
ht = new cmplx[flen];
|
||||||
|
}
|
||||||
|
|
||||||
memset(filter, 0, flen * sizeof(cmplx));
|
// number of samples needed to completely flush the filter
|
||||||
memset(timedata, 0, flen * sizeof(cmplx));
|
int fftfilt::flush_size()
|
||||||
memset(freqdata, 0, flen * sizeof(cmplx));
|
{
|
||||||
memset(output, 0, flen * sizeof(cmplx));
|
return flen - inptr;
|
||||||
memset(ovlbuf, 0, flen2 * sizeof(cmplx));
|
|
||||||
memset(ht, 0, flen * sizeof(cmplx));
|
|
||||||
|
|
||||||
inptr = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -112,6 +120,7 @@ fftfilt::~fftfilt()
|
||||||
|
|
||||||
void fftfilt::create_filter(double f1, double f2)
|
void fftfilt::create_filter(double f1, double f2)
|
||||||
{
|
{
|
||||||
|
clear_filter();
|
||||||
// initialize the filter to zero
|
// initialize the filter to zero
|
||||||
memset(ht, 0, flen * sizeof(cmplx));
|
memset(ht, 0, flen * sizeof(cmplx));
|
||||||
|
|
||||||
|
@ -179,7 +188,7 @@ void fftfilt::create_filter(double f1, double f2)
|
||||||
fspec.close();
|
fspec.close();
|
||||||
delete [] revht;
|
delete [] revht;
|
||||||
*/
|
*/
|
||||||
pass = 2;
|
pass = 1;//2; oh wow ... been wrong for years!
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -54,6 +54,7 @@ protected:
|
||||||
0.08 * cos(4.0 * M_PI * i / len));
|
0.08 * cos(4.0 * M_PI * i / len));
|
||||||
}
|
}
|
||||||
void init_filter();
|
void init_filter();
|
||||||
|
void clear_filter();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
fftfilt(double f1, double f2, int len);
|
fftfilt(double f1, double f2, int len);
|
||||||
|
@ -71,6 +72,7 @@ public:
|
||||||
void rtty_filter(double);
|
void rtty_filter(double);
|
||||||
|
|
||||||
int run(const cmplx& in, cmplx **out);
|
int run(const cmplx& in, cmplx **out);
|
||||||
|
int flush_size();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Ładowanie…
Reference in New Issue