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()
|
||||
{
|
||||
printf("reseting Filter for Baud %f, %f\n", rtty_baud, samplerate); // print dot length
|
||||
int filter_length = 1024;
|
||||
|
||||
if (mark_filt) {
|
||||
mark_filt->rtty_filter(rtty_baud/samplerate);
|
||||
} else {
|
||||
mark_filt = new fftfilt(rtty_baud/samplerate, filter_length);
|
||||
mark_filt->rtty_filter(rtty_baud/samplerate);
|
||||
}
|
||||
|
||||
if (mark_filt) {
|
||||
mark_filt->rtty_filter(rtty_baud/samplerate);
|
||||
} else {
|
||||
mark_filt = new fftfilt(rtty_baud/samplerate, filter_length);
|
||||
mark_filt->rtty_filter(rtty_baud/samplerate);
|
||||
}
|
||||
|
||||
if (space_filt) {
|
||||
space_filt->rtty_filter(rtty_baud/samplerate);
|
||||
} else {
|
||||
space_filt = new fftfilt(rtty_baud/samplerate, filter_length);
|
||||
space_filt->rtty_filter(rtty_baud/samplerate);
|
||||
}
|
||||
if (space_filt) {
|
||||
space_filt->rtty_filter(rtty_baud/samplerate);
|
||||
} else {
|
||||
space_filt = new fftfilt(rtty_baud/samplerate, filter_length);
|
||||
space_filt->rtty_filter(rtty_baud/samplerate);
|
||||
}
|
||||
}
|
||||
|
||||
void rtty::restart()
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <memory.h>
|
||||
#include "configuration.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "fftfilt.h"
|
||||
|
@ -246,33 +247,35 @@ void fftfilt::rtty_filter(double f)
|
|||
// 1.4 .0054
|
||||
// 1.5 .0062
|
||||
// 1.6 .0076
|
||||
/*//////////////////////////////////jcoxon
|
||||
f *= 1.4;
|
||||
if(progdefaults.RTTY_BW <= 100){
|
||||
f *= 1.4;
|
||||
|
||||
double dht;
|
||||
for( int i = 0; i < flen2; ++i ) {
|
||||
double x = (double)i/(double)(flen2);
|
||||
double dht;
|
||||
for( int i = 0; i < flen2; ++i ) {
|
||||
double x = (double)i/(double)(flen2);
|
||||
|
||||
// raised cosine response (changed for -1.0...+1.0 times Nyquist-f
|
||||
// instead of books versions ranging from -1..+1 times samplerate)
|
||||
// raised cosine response (changed for -1.0...+1.0 times Nyquist-f
|
||||
// instead of books versions ranging from -1..+1 times samplerate)
|
||||
|
||||
dht =
|
||||
x <= 0 ? 1.0 :
|
||||
x > 2.0 * f ? 0.0 :
|
||||
cos((M_PI * x) / (f * 4.0));
|
||||
dht =
|
||||
x <= 0 ? 1.0 :
|
||||
x > 2.0 * f ? 0.0 :
|
||||
cos((M_PI * x) / (f * 4.0));
|
||||
|
||||
dht *= dht; // cos^2
|
||||
dht *= dht; // cos^2
|
||||
|
||||
// amplitude equalized nyquist-channel response
|
||||
dht /= sinc(2.0 * i * f);
|
||||
// amplitude equalized nyquist-channel response
|
||||
dht /= sinc(2.0 * i * f);
|
||||
|
||||
filter[i].real() = dht*cos((double)i* - 0.5*M_PI);
|
||||
filter[i].imag() = dht*sin((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[(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);
|
||||
}
|
||||
*///////////////////////////////////jcoxon
|
||||
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);
|
||||
}
|
||||
}
|
||||
else{
|
||||
}
|
||||
|
||||
// perform the reverse fft to obtain h(t)
|
||||
// for testing
|
||||
|
|
Ładowanie…
Reference in New Issue