diff --git a/README.md b/README.md
index 959afdf..117aea6 100644
--- a/README.md
+++ b/README.md
@@ -318,7 +318,7 @@ It can decimate by a floating point ratio.
It uses Lagrance interpolation, where `num_poly_points` (12 by default) input samples are taken into consideration while calculating one output sample.
-It can use an additional FIR filter before applying the Lagrange interpolation. This filter can be activated by:
+It can filter the signal with an anti-aliasing FIR filter before applying the Lagrange interpolation. This filter is inactive by default, but can be activated by:
* passing only the `transition_bw`, or both the `transition_bw` and the `window` parameters of the filter,
* using the `--prefilter` switch after `num_poly_points` to switch this filter on with the default parameters.
diff --git a/grc_tests/test_fractional_decimator.grc b/grc_tests/test_fractional_decimator.grc
index 764b362..a763ddb 100644
--- a/grc_tests/test_fractional_decimator.grc
+++ b/grc_tests/test_fractional_decimator.grc
@@ -155,6 +155,60 @@
wx.SL_HORIZONTAL
+
+ variable
+
+ comment
+
+
+
+ _enabled
+ True
+
+
+ _coordinate
+ (480, 11)
+
+
+ _rotation
+ 0
+
+
+ id
+ num_poly_points
+
+
+ value
+ 20
+
+
+
+ variable
+
+ comment
+
+
+
+ _enabled
+ True
+
+
+ _coordinate
+ (608, 11)
+
+
+ _rotation
+ 0
+
+
+ id
+ prefilter
+
+
+ value
+ False
+
+
variable
@@ -386,7 +440,7 @@
commandline
- "csdr fractional_decimator_ff "+str(decimation)+" 20"
+ "csdr fractional_decimator_ff "+str(decimation)+" "+str(num_poly_points)+("" if not prefilter else " --prefilter")
comment
@@ -449,7 +503,7 @@
_coordinate
- (840, 379)
+ (784, 379)
_rotation
diff --git a/grc_tests/test_rational_resampler.grc b/grc_tests/test_rational_resampler.grc
index fe8e838..6cb477c 100644
--- a/grc_tests/test_rational_resampler.grc
+++ b/grc_tests/test_rational_resampler.grc
@@ -1,49 +1,49 @@
-
-
+
+
Tue Mar 17 19:40:27 2015
options
-
- id
- top_block
-
-
- _enabled
- True
-
-
- title
-
-
author
-
- description
-
-
window_size
1280, 1024
-
- generate_options
- wx_gui
-
category
Custom
- run_options
- prompt
+ comment
+
- run
+ description
+
+
+
+ _enabled
True
+
+ _coordinate
+ (10, 10)
+
+
+ _rotation
+ 0
+
+
+ generate_options
+ wx_gui
+
+
+ id
+ top_block
+
max_nouts
0
@@ -53,36 +53,32 @@
- alias
+ run_options
+ prompt
+
+
+ run
+ True
+
+
+ thread_safe_setters
- _coordinate
- (10, 10)
-
-
- _rotation
- 0
+ title
+
variable
- id
- decimation
+ comment
+
_enabled
True
-
- value
- 1
-
-
- alias
-
-
_coordinate
(376, 11)
@@ -91,110 +87,32 @@
_rotation
0
-
-
- variable
id
- interpolation
-
-
- _enabled
- True
+ decimation
value
- 4
-
-
- alias
-
-
-
- _coordinate
- (272, 11)
-
-
- _rotation
- 0
-
-
-
- variable
-
- id
- samp_rate
-
-
- _enabled
- True
-
-
- value
- 32000
-
-
- alias
-
-
-
- _coordinate
- (176, 11)
-
-
- _rotation
- 0
+ 1
variable_slider
- id
- frequency
-
-
- _enabled
- True
-
-
- label
+ comment
-
- value
- 1e3
-
-
- min
- 0
-
-
- max
- samp_rate/2
-
-
- num_steps
- 100
-
-
- style
- wx.SL_HORIZONTAL
-
converver
float_converter
- grid_pos
-
+ value
+ 1e3
- notebook
-
-
-
- alias
-
+ _enabled
+ True
_coordinate
@@ -204,431 +122,142 @@
_rotation
0
-
-
- wxgui_fftsink2
+
+ grid_pos
+ 2,1,1,1
+
id
- wxgui_fftsink2_0
+ frequency
+
+
+ label
+
+
+
+ max
+ samp_rate/2
+
+
+ min
+ 0
+
+
+ notebook
+
+
+
+ num_steps
+ 100
+
+
+ style
+ wx.SL_HORIZONTAL
+
+
+
+ variable
+
+ comment
+
_enabled
True
- type
- float
+ _coordinate
+ (272, 11)
- title
- Original signal
+ _rotation
+ 0
- samp_rate
+ id
+ interpolation
+
+
+ value
+ 4
+
+
+
+ variable
+
+ comment
+
+
+
+ _enabled
+ True
+
+
+ _coordinate
+ (176, 11)
+
+
+ _rotation
+ 0
+
+
+ id
samp_rate
- baseband_freq
- 0
-
-
- y_per_div
- 10
-
-
- y_divs
- 10
-
-
- ref_level
- 0
-
-
- ref_scale
- 2.0
-
-
- fft_size
- 1024
-
-
- fft_rate
- 15
-
-
- peak_hold
- False
-
-
- average
- False
-
-
- avg_alpha
- 0
-
-
- win
- None
-
-
- win_size
-
-
-
- grid_pos
-
-
-
- notebook
- nb0,1
-
-
- freqvar
- None
-
-
- alias
-
-
-
- affinity
-
-
-
- _coordinate
- (752, 379)
-
-
- _rotation
- 0
+ value
+ 32000
- wxgui_scopesink2
+ analog_sig_source_x
- id
- wxgui_scopesink2_0
-
-
- _enabled
- True
-
-
- type
- float
-
-
- title
- Original signal
-
-
- samp_rate
- samp_rate
-
-
- v_scale
- 0
-
-
- v_offset
- 0
-
-
- t_scale
- 0
-
-
- ac_couple
- False
-
-
- xy_mode
- False
-
-
- num_inputs
+ amp
1
-
- win_size
-
-
-
- grid_pos
-
-
-
- notebook
- nb0,0
-
-
- trig_mode
- wxgui.TRIG_MODE_AUTO
-
-
- y_axis_label
- Counts
-
alias
+
+ comment
+
+
affinity
-
- _coordinate
- (752, 259)
-
-
- _rotation
- 0
-
-
-
- wxgui_fftsink2
-
- id
- wxgui_fftsink2_0_0
-
_enabled
True
- type
- float
-
-
- title
- Resampled signal (csdr)
-
-
- samp_rate
- samp_rate*(interpolation/float(decimation))
-
-
- baseband_freq
- 0
-
-
- y_per_div
- 10
-
-
- y_divs
- 10
-
-
- ref_level
- 0
-
-
- ref_scale
- 2.0
-
-
- fft_size
- 1024
-
-
- fft_rate
- 15
-
-
- peak_hold
- False
-
-
- average
- False
-
-
- avg_alpha
- 0
-
-
- win
- None
-
-
- win_size
-
-
-
- grid_pos
-
-
-
- notebook
- nb1,1
-
-
- freqvar
- None
-
-
- alias
-
-
-
- affinity
-
+ freq
+ frequency
_coordinate
- (984, 195)
+ (104, 211)
_rotation
0
-
-
- wxgui_scopesink2
id
- wxgui_scopesink2_1
-
-
- _enabled
- True
-
-
- type
- float
-
-
- title
- Resampled signal (csdr)
-
-
- samp_rate
- samp_rate*(interpolation/float(decimation))
-
-
- v_scale
- 0
-
-
- v_offset
- 0
-
-
- t_scale
- 0
-
-
- ac_couple
- False
-
-
- xy_mode
- False
-
-
- num_inputs
- 1
-
-
- win_size
-
-
-
- grid_pos
-
-
-
- notebook
- nb1,0
-
-
- trig_mode
- wxgui.TRIG_MODE_AUTO
-
-
- y_axis_label
- Counts
-
-
- alias
-
-
-
- affinity
-
-
-
- _coordinate
- (984, 75)
-
-
- _rotation
- 0
-
-
-
- blocks_throttle
-
- id
- blocks_throttle_0
-
-
- _enabled
- True
-
-
- type
- float
-
-
- samples_per_second
- samp_rate
-
-
- vlen
- 1
-
-
- ignoretag
- True
-
-
- alias
-
-
-
- affinity
-
-
-
- minoutbuf
- 0
+ analog_sig_source_x_0
maxoutbuf
0
- _coordinate
- (312, 243)
-
-
- _rotation
+ minoutbuf
0
-
-
- analog_sig_source_x
- id
- analog_sig_source_x_0
-
-
- _enabled
- True
+ offset
+ 0
type
@@ -642,73 +271,123 @@
waveform
analog.GR_SIN_WAVE
-
- freq
- frequency
-
-
- amp
- 1
-
-
- offset
- 0
-
+
+
+ blocks_throttle
alias
+
+ comment
+
+
affinity
- minoutbuf
+ _enabled
+ True
+
+
+ _coordinate
+ (312, 243)
+
+
+ _rotation
0
+
+ id
+ blocks_throttle_0
+
+
+ ignoretag
+ True
+
maxoutbuf
0
- _coordinate
- (104, 211)
+ minoutbuf
+ 0
- _rotation
- 0
+ samples_per_second
+ samp_rate
+
+
+ type
+ float
+
+
+ vlen
+ 1
- notebook
+ ha5kfu_execproc_xx
- id
- nb0
+ alias
+
+
+
+ commandline
+ "csdr rational_resampler_ff %d %d 0.05"%(interpolation,decimation)
+
+
+ comment
+
+
+
+ affinity
+
_enabled
True
- style
- wx.NB_TOP
+ _coordinate
+ (752, 195)
- labels
- ['scope', 'fft']
+ _rotation
+ 0
- grid_pos
- 1,1,1,1
+ id
+ ha5kfu_execproc_xx_0
- notebook
-
+ maxoutbuf
+ 0
+
+ minoutbuf
+ 0
+
+
+ type
+ ff
+
+
+
+ notebook
alias
+
+ comment
+
+
+
+ _enabled
+ True
+
_coordinate
(8, 75)
@@ -717,37 +396,41 @@
_rotation
0
-
-
- notebook
+
+ grid_pos
+ 1,1,1,1
+
id
- nb1
-
-
- _enabled
- True
-
-
- style
- wx.NB_TOP
+ nb0
labels
['scope', 'fft']
-
- grid_pos
- 1,2,1,1
-
notebook
+
+ style
+ wx.NB_TOP
+
+
+
+ notebook
alias
+
+ comment
+
+
+
+ _enabled
+ True
+
_coordinate
(152, 75)
@@ -756,219 +439,41 @@
_rotation
0
-
-
- wxgui_scopesink2
-
- id
- wxgui_scopesink2_1_0
-
-
- _enabled
- True
-
-
- type
- float
-
-
- title
- Resampled signal (GNU Radio)
-
-
- samp_rate
- samp_rate*(interpolation/float(decimation))
-
-
- v_scale
- 0
-
-
- v_offset
- 0
-
-
- t_scale
- 0
-
-
- ac_couple
- False
-
-
- xy_mode
- False
-
-
- num_inputs
- 1
-
-
- win_size
-
-
grid_pos
-
+ 1,2,1,1
-
- notebook
- nb2,0
-
-
- trig_mode
- wxgui.TRIG_MODE_AUTO
-
-
- y_axis_label
- Counts
-
-
- alias
-
-
-
- affinity
-
-
-
- _coordinate
- (760, 603)
-
-
- _rotation
- 0
-
-
-
- wxgui_fftsink2
id
- wxgui_fftsink2_0_0_0
-
-
- _enabled
- True
-
-
- type
- float
-
-
- title
- Resampled signal (GNU Radio)
-
-
- samp_rate
- samp_rate*(interpolation/float(decimation))
-
-
- baseband_freq
- 0
-
-
- y_per_div
- 10
-
-
- y_divs
- 10
-
-
- ref_level
- 0
-
-
- ref_scale
- 2.0
-
-
- fft_size
- 1024
-
-
- fft_rate
- 15
-
-
- peak_hold
- False
-
-
- average
- False
-
-
- avg_alpha
- 0
-
-
- win
- None
-
-
- win_size
-
-
-
- grid_pos
-
-
-
- notebook
- nb2,1
-
-
- freqvar
- None
-
-
- alias
-
-
-
- affinity
-
-
-
- _coordinate
- (760, 723)
-
-
- _rotation
- 0
-
-
-
- notebook
-
- id
- nb2
-
-
- _enabled
- True
-
-
- style
- wx.NB_TOP
+ nb1
labels
['scope', 'fft']
-
- grid_pos
- 2,2,1,1
-
notebook
+
+ style
+ wx.NB_TOP
+
+
+
+ notebook
alias
+
+ comment
+
+
+
+ _enabled
+ True
+
_coordinate
(296, 75)
@@ -977,51 +482,51 @@
_rotation
0
+
+ grid_pos
+ 2,2,1,1
+
+
+ id
+ nb2
+
+
+ labels
+ ['scope', 'fft']
+
+
+ notebook
+
+
+
+ style
+ wx.NB_TOP
+
rational_resampler_xxx
-
- id
- rational_resampler_xxx_0
-
-
- _enabled
- True
-
-
- type
- fff
-
-
- interp
- interpolation
-
-
- decim
- decimation
-
-
- taps
- firdes.low_pass(5,1,0.5*min(1./interpolation,1./decimation),0.05)
-
-
- fbw
- 0
-
alias
+
+ comment
+
+
affinity
- minoutbuf
- 0
+ decim
+ decimation
- maxoutbuf
+ _enabled
+ True
+
+
+ fbw
0
@@ -1032,62 +537,601 @@
_rotation
0
-
-
- ha5kfu_execproc_xx
id
- ha5kfu_execproc_xx_0
+ rational_resampler_xxx_0
- _enabled
- True
+ interp
+ interpolation
+
+
+ maxoutbuf
+ 0
+
+
+ minoutbuf
+ 0
+
+
+ taps
+ firdes.low_pass(5,1,0.5*min(1./interpolation,1./decimation),0.05)
type
- ff
+ fff
+
+
+
+ wxgui_fftsink2
+
+ avg_alpha
+ 0
- commandline
- "csdr rational_resampler_ff %d %d 0.05"%(interpolation,decimation)
+ average
+ False
+
+
+ baseband_freq
+ 0
alias
+
+ comment
+
+
affinity
- minoutbuf
- 0
+ _enabled
+ True
- maxoutbuf
- 0
+ fft_size
+ 1024
+
+
+ freqvar
+ None
_coordinate
- (752, 195)
+ (752, 379)
_rotation
0
+
+ grid_pos
+
+
+
+ id
+ wxgui_fftsink2_0
+
+
+ notebook
+ nb0,1
+
+
+ peak_hold
+ False
+
+
+ ref_level
+ 0
+
+
+ ref_scale
+ 2.0
+
+
+ fft_rate
+ 15
+
+
+ samp_rate
+ samp_rate
+
+
+ title
+ Original signal
+
+
+ type
+ float
+
+
+ win_size
+
+
+
+ win
+ None
+
+
+ y_divs
+ 10
+
+
+ y_per_div
+ 10
+
+
+
+ wxgui_fftsink2
+
+ avg_alpha
+ 0
+
+
+ average
+ False
+
+
+ baseband_freq
+ 0
+
+
+ alias
+
+
+
+ comment
+
+
+
+ affinity
+
+
+
+ _enabled
+ True
+
+
+ fft_size
+ 1024
+
+
+ freqvar
+ None
+
+
+ _coordinate
+ (984, 195)
+
+
+ _rotation
+ 0
+
+
+ grid_pos
+
+
+
+ id
+ wxgui_fftsink2_0_0
+
+
+ notebook
+ nb1,1
+
+
+ peak_hold
+ False
+
+
+ ref_level
+ 0
+
+
+ ref_scale
+ 2.0
+
+
+ fft_rate
+ 15
+
+
+ samp_rate
+ samp_rate*(interpolation/float(decimation))
+
+
+ title
+ Resampled signal (csdr)
+
+
+ type
+ float
+
+
+ win_size
+
+
+
+ win
+ None
+
+
+ y_divs
+ 10
+
+
+ y_per_div
+ 10
+
+
+
+ wxgui_fftsink2
+
+ avg_alpha
+ 0
+
+
+ average
+ False
+
+
+ baseband_freq
+ 0
+
+
+ alias
+
+
+
+ comment
+
+
+
+ affinity
+
+
+
+ _enabled
+ True
+
+
+ fft_size
+ 1024
+
+
+ freqvar
+ None
+
+
+ _coordinate
+ (760, 723)
+
+
+ _rotation
+ 0
+
+
+ grid_pos
+
+
+
+ id
+ wxgui_fftsink2_0_0_0
+
+
+ notebook
+ nb2,1
+
+
+ peak_hold
+ False
+
+
+ ref_level
+ 0
+
+
+ ref_scale
+ 2.0
+
+
+ fft_rate
+ 15
+
+
+ samp_rate
+ samp_rate*(interpolation/float(decimation))
+
+
+ title
+ Resampled signal (GNU Radio)
+
+
+ type
+ float
+
+
+ win_size
+
+
+
+ win
+ None
+
+
+ y_divs
+ 10
+
+
+ y_per_div
+ 10
+
+
+
+ wxgui_scopesink2
+
+ ac_couple
+ False
+
+
+ alias
+
+
+
+ comment
+
+
+
+ affinity
+
+
+
+ _enabled
+ True
+
+
+ _coordinate
+ (752, 259)
+
+
+ _rotation
+ 0
+
+
+ grid_pos
+
+
+
+ id
+ wxgui_scopesink2_0
+
+
+ notebook
+ nb0,0
+
+
+ num_inputs
+ 1
+
+
+ samp_rate
+ samp_rate
+
+
+ t_scale
+ 0
+
+
+ title
+ Original signal
+
+
+ trig_mode
+ wxgui.TRIG_MODE_AUTO
+
+
+ type
+ float
+
+
+ v_offset
+ 0
+
+
+ v_scale
+ 0
+
+
+ win_size
+
+
+
+ xy_mode
+ False
+
+
+ y_axis_label
+ Counts
+
+
+
+ wxgui_scopesink2
+
+ ac_couple
+ False
+
+
+ alias
+
+
+
+ comment
+
+
+
+ affinity
+
+
+
+ _enabled
+ True
+
+
+ _coordinate
+ (984, 75)
+
+
+ _rotation
+ 0
+
+
+ grid_pos
+
+
+
+ id
+ wxgui_scopesink2_1
+
+
+ notebook
+ nb1,0
+
+
+ num_inputs
+ 1
+
+
+ samp_rate
+ samp_rate*(interpolation/float(decimation))
+
+
+ t_scale
+ 0
+
+
+ title
+ Resampled signal (csdr)
+
+
+ trig_mode
+ wxgui.TRIG_MODE_AUTO
+
+
+ type
+ float
+
+
+ v_offset
+ 0
+
+
+ v_scale
+ 0
+
+
+ win_size
+
+
+
+ xy_mode
+ False
+
+
+ y_axis_label
+ Counts
+
+
+
+ wxgui_scopesink2
+
+ ac_couple
+ False
+
+
+ alias
+
+
+
+ comment
+
+
+
+ affinity
+
+
+
+ _enabled
+ True
+
+
+ _coordinate
+ (760, 603)
+
+
+ _rotation
+ 0
+
+
+ grid_pos
+
+
+
+ id
+ wxgui_scopesink2_1_0
+
+
+ notebook
+ nb2,0
+
+
+ num_inputs
+ 1
+
+
+ samp_rate
+ samp_rate*(interpolation/float(decimation))
+
+
+ t_scale
+ 0
+
+
+ title
+ Resampled signal (GNU Radio)
+
+
+ trig_mode
+ wxgui.TRIG_MODE_AUTO
+
+
+ type
+ float
+
+
+ v_offset
+ 0
+
+
+ v_scale
+ 0
+
+
+ win_size
+
+
+
+ xy_mode
+ False
+
+
+ y_axis_label
+ Counts
+
-
- blocks_throttle_0
- ha5kfu_execproc_xx_0
- 0
- 0
-
-
- ha5kfu_execproc_xx_0
- wxgui_scopesink2_1
- 0
- 0
-
analog_sig_source_x_0
blocks_throttle_0
@@ -1095,8 +1139,14 @@
0
- ha5kfu_execproc_xx_0
- wxgui_fftsink2_0_0
+ blocks_throttle_0
+ ha5kfu_execproc_xx_0
+ 0
+ 0
+
+
+ blocks_throttle_0
+ rational_resampler_xxx_0
0
0
@@ -1113,14 +1163,14 @@
0
- blocks_throttle_0
- rational_resampler_xxx_0
+ ha5kfu_execproc_xx_0
+ wxgui_fftsink2_0_0
0
0
- rational_resampler_xxx_0
- wxgui_scopesink2_1_0
+ ha5kfu_execproc_xx_0
+ wxgui_scopesink2_1
0
0
@@ -1130,4 +1180,10 @@
0
0
+
+ rational_resampler_xxx_0
+ wxgui_scopesink2_1_0
+ 0
+ 0
+