changes
This commit is contained in:
parent
f3a0bc1c2f
commit
1f84540955
|
|
@ -60,7 +60,7 @@ LDFLAGS_Pissb = $(LDFLAGS) -lsndfile -lliquid
|
|||
$(CC) $(CFLAGS) -c -o pifmrds/rds.o pifmrds/rds.c
|
||||
$(CC) $(CFLAGS) -c -o pifmrds/control_pipe.o pifmrds/control_pipe.c
|
||||
$(CC) $(CFLAGS) -c -o pifmrds/waveforms.o pifmrds/waveforms.c
|
||||
$(CC) $(CFLAGS) -c -o pifmrds/rds_wav.o pifmrds/rds_wav.c
|
||||
# $(CC) $(CFLAGS) -c -o pifmrds/rds_wav.o pifmrds/rds_wav.c
|
||||
$(CC) $(CFLAGS) -c -o pifmrds/fm_mpx.o pifmrds/fm_mpx.c
|
||||
$(CC) -o pifmrds/rds_wav pifmrds/rds_wav.o pifmrds/rds.o pifmrds/waveforms.o pifmrds/fm_mpx.o -lm -lsndfile
|
||||
$(CXX) $(CXXFLAGS) -Wno-write-strings -o ../pifmrds pifmrds/rds.o pifmrds/waveforms.o pifmrds/pi_fm_rds.cpp pifmrds/fm_mpx.o pifmrds/control_pipe.o -lm -lsndfile -lrt -lpthread -L/opt/vc/lib -lrpitx
|
||||
|
|
|
|||
|
|
@ -137,13 +137,13 @@ int fm_mpx_open(char *filename, size_t len, int raw, double preemphasis, int raw
|
|||
// IIR pre-emphasis filter
|
||||
// Reference material: http://jontio.zapto.org/hda1/preempiir.pdf
|
||||
double tau=preemphasis;
|
||||
double delta=1.96e-6;
|
||||
double delta=1/(2*PI*20000);//double delta=1.96e-6;
|
||||
double taup, deltap, bp, ap, a0, a1, b1;
|
||||
taup=1.0/(2.0*(in_samplerate*FIR_PHASES))/tan( 1.0/(2*tau*(in_samplerate*FIR_PHASES) ));
|
||||
deltap=1.0/(2.0*(in_samplerate*FIR_PHASES))/tan( 1.0/(2*delta*(in_samplerate*FIR_PHASES) ));
|
||||
bp=sqrt( -taup*taup + sqrt(taup*taup*taup*taup + 8.0*taup*taup*deltap*deltap) ) / 2.0 ;
|
||||
ap=sqrt( 2*bp*bp + taup*taup );
|
||||
a0=( 2.0*ap + 1/(in_samplerate*FIR_PHASES) )/(2.0*bp + 1/(in_samplerate*FIR_PHASES) );
|
||||
a0=( 2.0*ap + 1.0/(in_samplerate*FIR_PHASES) )/(2.0*bp + 1.0/(in_samplerate*FIR_PHASES) );
|
||||
// a1=(-2.0*ap + 1/(in_samplerate*FIR_PHASES) )/(2.0*bp + 1/(in_samplerate*FIR_PHASES) ); //ORI
|
||||
// b1=( 2.0*bp + 1/(in_samplerate*FIR_PHASES) )/(2.0*bp + 1/(in_samplerate*FIR_PHASES) ); //ORI
|
||||
a1=(-2.0*ap + 1.0/(in_samplerate*FIR_PHASES) )/(2.0*bp + 1.0/(in_samplerate*FIR_PHASES) );
|
||||
|
|
|
|||
|
|
@ -23,4 +23,4 @@
|
|||
|
||||
extern int fm_mpx_open(char *filename, size_t len, int raw, double preemphasis, int rawSampleRate, int rawChannels);
|
||||
extern int fm_mpx_get_samples(float *mpx_buffer, int drds);
|
||||
extern int fm_mpx_close();
|
||||
extern int fm_mpx_close();
|
||||
|
|
|
|||
|
|
@ -228,6 +228,7 @@ int main(int argc, char **argv) {
|
|||
int deviation = 75000;
|
||||
int alternative_freq[100] = {};
|
||||
float ppm = 0;
|
||||
int bypassfreqrange = 0;
|
||||
int custom_deviation = 0;
|
||||
// Parse command-line arguments
|
||||
for(int i=1; i<argc; i++) {
|
||||
|
|
@ -240,7 +241,7 @@ int main(int argc, char **argv) {
|
|||
} else if(strcmp("-freq", arg)==0 && param != NULL) {
|
||||
i++;
|
||||
carrier_freq = 1e6 * atof(param);
|
||||
if(carrier_freq < 64e6 || carrier_freq > 108e6)
|
||||
if((carrier_freq < 64e6 || carrier_freq > 108e6) && bypassfreqrange == 0)
|
||||
fatal("Incorrect frequency specification. Must be in megahertz, of the form 107.9, between 64 and 108. (going that low for UKF radios, such as the UNITRA Jowita or other old band FM Radios)\n");
|
||||
} else if(strcmp("-pi", arg)==0 && param != NULL) {
|
||||
i++;
|
||||
|
|
@ -268,6 +269,9 @@ int main(int argc, char **argv) {
|
|||
} else if(strcmp("-ta", arg)==0) {
|
||||
i++;
|
||||
ta = 1;
|
||||
} else if(strcmp("-bfr", arg)==0) {
|
||||
i++;
|
||||
bypassfreqrange = 1;
|
||||
} else if(strcmp("-tp", arg)==0) {
|
||||
i++;
|
||||
tp = 1;
|
||||
|
|
@ -311,6 +315,8 @@ int main(int argc, char **argv) {
|
|||
i++;
|
||||
if(strcmp("us", param)==0) {
|
||||
preemp = 75e-6; //usa
|
||||
} else if(strcmp("22", param)==0) {
|
||||
preemp = 22e-6; //22
|
||||
}
|
||||
} else if(strcmp("-af", arg)==0 && param != NULL) {
|
||||
i++;
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue