kopia lustrzana https://github.com/jamescoxon/dl-fldigi
added if clause to allow new filter code to be used if baud <= 100, if higher then no filter - this allows higher baud rates to be usable in dl-fldigi
rodzic
ef1619e37f
commit
501f86909b
|
@ -193,21 +193,23 @@ rtty::~rtty()
|
||||||
|
|
||||||
void rtty::reset_filters()
|
void rtty::reset_filters()
|
||||||
{
|
{
|
||||||
|
printf("reseting Filter for Baud %f, %f\n", rtty_baud, samplerate); // print dot length
|
||||||
int filter_length = 1024;
|
int filter_length = 1024;
|
||||||
|
|
||||||
if (mark_filt) {
|
|
||||||
mark_filt->rtty_filter(rtty_baud/samplerate);
|
if (mark_filt) {
|
||||||
} else {
|
mark_filt->rtty_filter(rtty_baud/samplerate);
|
||||||
mark_filt = new fftfilt(rtty_baud/samplerate, filter_length);
|
} else {
|
||||||
mark_filt->rtty_filter(rtty_baud/samplerate);
|
mark_filt = new fftfilt(rtty_baud/samplerate, filter_length);
|
||||||
}
|
mark_filt->rtty_filter(rtty_baud/samplerate);
|
||||||
|
}
|
||||||
|
|
||||||
if (space_filt) {
|
if (space_filt) {
|
||||||
space_filt->rtty_filter(rtty_baud/samplerate);
|
space_filt->rtty_filter(rtty_baud/samplerate);
|
||||||
} else {
|
} else {
|
||||||
space_filt = new fftfilt(rtty_baud/samplerate, filter_length);
|
space_filt = new fftfilt(rtty_baud/samplerate, filter_length);
|
||||||
space_filt->rtty_filter(rtty_baud/samplerate);
|
space_filt->rtty_filter(rtty_baud/samplerate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtty::restart()
|
void rtty::restart()
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "fftfilt.h"
|
#include "fftfilt.h"
|
||||||
|
@ -246,33 +247,35 @@ void fftfilt::rtty_filter(double f)
|
||||||
// 1.4 .0054
|
// 1.4 .0054
|
||||||
// 1.5 .0062
|
// 1.5 .0062
|
||||||
// 1.6 .0076
|
// 1.6 .0076
|
||||||
/*//////////////////////////////////jcoxon
|
if(progdefaults.RTTY_BW <= 100){
|
||||||
f *= 1.4;
|
f *= 1.4;
|
||||||
|
|
||||||
double dht;
|
double dht;
|
||||||
for( int i = 0; i < flen2; ++i ) {
|
for( int i = 0; i < flen2; ++i ) {
|
||||||
double x = (double)i/(double)(flen2);
|
double x = (double)i/(double)(flen2);
|
||||||
|
|
||||||
// raised cosine response (changed for -1.0...+1.0 times Nyquist-f
|
// raised cosine response (changed for -1.0...+1.0 times Nyquist-f
|
||||||
// instead of books versions ranging from -1..+1 times samplerate)
|
// instead of books versions ranging from -1..+1 times samplerate)
|
||||||
|
|
||||||
dht =
|
dht =
|
||||||
x <= 0 ? 1.0 :
|
x <= 0 ? 1.0 :
|
||||||
x > 2.0 * f ? 0.0 :
|
x > 2.0 * f ? 0.0 :
|
||||||
cos((M_PI * x) / (f * 4.0));
|
cos((M_PI * x) / (f * 4.0));
|
||||||
|
|
||||||
dht *= dht; // cos^2
|
dht *= dht; // cos^2
|
||||||
|
|
||||||
// amplitude equalized nyquist-channel response
|
// amplitude equalized nyquist-channel response
|
||||||
dht /= sinc(2.0 * i * f);
|
dht /= sinc(2.0 * i * f);
|
||||||
|
|
||||||
filter[i].real() = dht*cos((double)i* - 0.5*M_PI);
|
filter[i].real() = dht*cos((double)i* - 0.5*M_PI);
|
||||||
filter[i].imag() = dht*sin((double)i* - 0.5*M_PI);
|
filter[i].imag() = dht*sin((double)i* - 0.5*M_PI);
|
||||||
|
|
||||||
filter[(flen-i)%flen].real() = dht*cos((double)i*+0.5*M_PI);
|
filter[(flen-i)%flen].real() = dht*cos((double)i*+0.5*M_PI);
|
||||||
filter[(flen-i)%flen].imag() = dht*sin((double)i*+0.5*M_PI);
|
filter[(flen-i)%flen].imag() = dht*sin((double)i*+0.5*M_PI);
|
||||||
}
|
}
|
||||||
*///////////////////////////////////jcoxon
|
}
|
||||||
|
else{
|
||||||
|
}
|
||||||
|
|
||||||
// perform the reverse fft to obtain h(t)
|
// perform the reverse fft to obtain h(t)
|
||||||
// for testing
|
// for testing
|
||||||
|
|
Ładowanie…
Reference in New Issue