added ddc_transition_bw()

This commit is contained in:
ha7ilm 2014-11-29 13:56:56 +01:00
parent 220855bf38
commit 87e1938b3a
7 changed files with 13 additions and 3 deletions

View File

@ -47,6 +47,12 @@ The filter envelope can be dragged at its ends and moved around to set the passb
However, if you hold the shift key, you can drag the center line (BFO) or the whole passband (PBS). However, if you hold the shift key, you can drag the center line (BFO) or the whole passband (PBS).
## Configuration tips
If you want to run OpenWebRX on a remote server instead of localhost, do not forget to set *server_hostname* in `config_webrx.py`, or you may get a WebSocket error.
DSP CPU usage can be fine-tuned in `plugins/dsp/csdr/plugin.py`: you can set transition bandwidths higher (thus degrade filter performance by decreasing the length of the kernel, but also decrease CPU usage).
## Todo ## Todo
Currently, clients use up a lot of bandwidth. This will be improved later. Currently, clients use up a lot of bandwidth. This will be improved later.

View File

@ -53,7 +53,7 @@ center_freq = 145525000
rf_gain = 5 rf_gain = 5
start_rtl_thread=True #rtl_sdr is more stable than rtl_tcp... start_rtl_thread=True #rtl_sdr is more stable than rtl_tcp...
start_rtl_command="rtl_sdr -s {samp_rate} -f {center_freq} - | nc -vvl 127.0.0.1 8888".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate) start_rtl_command="rtl_sdr -s {samp_rate} -f {center_freq} - | nc -vvl 127.0.0.1 -p 8888".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate)
#start_rtl_tcp_command="rtl_tcp -s 250000 -f 145525000 -g 0 -p 8888" #start_rtl_tcp_command="rtl_tcp -s 250000 -f 145525000 -g 0 -p 8888"
#You can use other SDR hardware as well, but if the command above outputs samples in a format other than [unsigned char], then the dsp plugin has to be slightly modified (at the csdr convert_u8_f part). #You can use other SDR hardware as well, but if the command above outputs samples in a format other than [unsigned char], then the dsp plugin has to be slightly modified (at the csdr convert_u8_f part).

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -14,8 +14,9 @@ class dsp_plugin:
self.low_cut = -4000 self.low_cut = -4000
self.high_cut = 4000 self.high_cut = 4000
self.bpf_transition_bw = 300 #Hz, and this is a constant self.bpf_transition_bw = 300 #Hz, and this is a constant
self.ddc_transition_bw_rate = 0.15 # of the IF sample rate
self.running = False self.running = False
chain_begin="nc localhost 4951 | csdr convert_u8_f | csdr shift_addition_cc --fifo {shift_pipe} | csdr fir_decimate_cc {decimation} 0.005 HAMMING | csdr bandpass_fir_fft_cc --fifo {bpf_pipe} {bpf_transition_bw} HAMMING | " chain_begin="nc localhost 4951 | csdr convert_u8_f | csdr shift_addition_cc --fifo {shift_pipe} | csdr fir_decimate_cc {decimation} {ddc_transition_bw} HAMMING | csdr bandpass_fir_fft_cc --fifo {bpf_pipe} {bpf_transition_bw} HAMMING | "
self.chains = { self.chains = {
"nfm" : chain_begin + "csdr fmdemod_quadri_cf | csdr limit_ff | csdr fractional_decimator_ff {last_decimation} | csdr deemphasis_nfm_ff 48000 | csdr fastagc_ff | csdr convert_f_i16", "nfm" : chain_begin + "csdr fmdemod_quadri_cf | csdr limit_ff | csdr fractional_decimator_ff {last_decimation} | csdr deemphasis_nfm_ff 48000 | csdr fastagc_ff | csdr convert_f_i16",
"am" : chain_begin + "csdr amdemod_cf | csdr fastdcblock_ff | csdr fractional_decimator_ff {last_decimation} | csdr agc_ff | csdr limit_ff | csdr convert_f_i16", "am" : chain_begin + "csdr amdemod_cf | csdr fastdcblock_ff | csdr fractional_decimator_ff {last_decimation} | csdr agc_ff | csdr limit_ff | csdr convert_f_i16",
@ -85,6 +86,9 @@ class dsp_plugin:
pass pass
os.mkfifo(path) os.mkfifo(path)
def ddc_transition_bw(self):
return self.ddc_transition_bw_rate*(self.if_samp_rate()/float(self.samp_rate))
def start(self): def start(self):
command_base=self.chains[self.demodulator] command_base=self.chains[self.demodulator]
@ -99,7 +103,7 @@ class dsp_plugin:
self.mkfifo(self.shift_pipe) self.mkfifo(self.shift_pipe)
#run the command #run the command
command=command_base.format(bpf_pipe=self.bpf_pipe,shift_pipe=self.shift_pipe,decimation=self.decimation,last_decimation=self.last_decimation,fft_size=self.fft_size,fft_block_size=self.fft_block_size(),bpf_transition_bw=float(self.bpf_transition_bw)/self.if_samp_rate()) command=command_base.format(bpf_pipe=self.bpf_pipe,shift_pipe=self.shift_pipe,decimation=self.decimation,last_decimation=self.last_decimation,fft_size=self.fft_size,fft_block_size=self.fft_block_size(),bpf_transition_bw=float(self.bpf_transition_bw)/self.if_samp_rate(),ddc_transition_bw=self.ddc_transition_bw())
print "[openwebrx-dsp-plugin:csdr] Command =",command print "[openwebrx-dsp-plugin:csdr] Command =",command
#code.interact(local=locals()) #code.interact(local=locals())
self.process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) self.process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)

Binary file not shown.