From 2ba0040ba415dbe3f2444096fc71a457a9ddb4ef Mon Sep 17 00:00:00 2001 From: Vanya Sergeev Date: Sat, 2 Jul 2016 07:51:41 -0700 Subject: [PATCH] blocks/signal: rename argument window_type to window in filters --- radio/blocks/signal/bandpassfilter.lua | 8 ++++---- radio/blocks/signal/bandstopfilter.lua | 8 ++++---- radio/blocks/signal/complexbandpassfilter.lua | 8 ++++---- radio/blocks/signal/complexbandstopfilter.lua | 8 ++++---- radio/blocks/signal/highpassfilter.lua | 8 ++++---- radio/blocks/signal/hilberttransform.lua | 8 ++++---- radio/blocks/signal/lowpassfilter.lua | 8 ++++---- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/radio/blocks/signal/bandpassfilter.lua b/radio/blocks/signal/bandpassfilter.lua index b704e7566..a51dcba70 100644 --- a/radio/blocks/signal/bandpassfilter.lua +++ b/radio/blocks/signal/bandpassfilter.lua @@ -10,7 +10,7 @@ -- @tparam {number,number} cutoffs Cutoff frequencies in Hz -- @tparam[opt=nil] number nyquist Nyquist frequency, if specifying -- normalized cutoff frequencies --- @tparam[opt='hamming'] string window_type Window type +-- @tparam[opt='hamming'] string window Window type -- -- @signature in:ComplexFloat32 > out:ComplexFloat32 -- @signature in:Float32 > out:Float32 @@ -29,10 +29,10 @@ local FIRFilterBlock = require('radio.blocks.signal.firfilter') local BandpassFilterBlock = block.factory("BandpassFilterBlock", FIRFilterBlock) -function BandpassFilterBlock:instantiate(num_taps, cutoffs, nyquist, window_type) +function BandpassFilterBlock:instantiate(num_taps, cutoffs, nyquist, window) assert(num_taps, "Missing argument #1 (num_taps)") self.cutoffs = assert(cutoffs, "Missing argument #2 (cutoffs)") - self.window_type = window_type or "hamming" + self.window = window or "hamming" self.nyquist = nyquist FIRFilterBlock.instantiate(self, types.Float32.vector(num_taps)) @@ -44,7 +44,7 @@ function BandpassFilterBlock:initialize() -- Generate taps local cutoffs = {self.cutoffs[1]/nyquist, self.cutoffs[2]/nyquist} - local taps = filter_utils.firwin_bandpass(self.taps.length, cutoffs, self.window_type) + local taps = filter_utils.firwin_bandpass(self.taps.length, cutoffs, self.window) self.taps = types.Float32.vector_from_array(taps) FIRFilterBlock.initialize(self) diff --git a/radio/blocks/signal/bandstopfilter.lua b/radio/blocks/signal/bandstopfilter.lua index 20944a6d3..fbd745f66 100644 --- a/radio/blocks/signal/bandstopfilter.lua +++ b/radio/blocks/signal/bandstopfilter.lua @@ -10,7 +10,7 @@ -- @tparam {number,number} cutoffs Cutoff frequencies in Hz -- @tparam[opt=nil] number nyquist Nyquist frequency, if specifying -- normalized cutoff frequencies --- @tparam[opt='hamming'] string window_type Window type +-- @tparam[opt='hamming'] string window Window type -- -- @signature in:ComplexFloat32 > out:ComplexFloat32 -- @signature in:Float32 > out:Float32 @@ -29,10 +29,10 @@ local FIRFilterBlock = require('radio.blocks.signal.firfilter') local BandstopFilterBlock = block.factory("BandstopFilterBlock", FIRFilterBlock) -function BandstopFilterBlock:instantiate(num_taps, cutoffs, nyquist, window_type) +function BandstopFilterBlock:instantiate(num_taps, cutoffs, nyquist, window) assert(num_taps, "Missing argument #1 (num_taps)") self.cutoffs = assert(cutoffs, "Missing argument #2 (cutoffs)") - self.window_type = window_type or "hamming" + self.window = window or "hamming" self.nyquist = nyquist FIRFilterBlock.instantiate(self, types.Float32.vector(num_taps)) @@ -44,7 +44,7 @@ function BandstopFilterBlock:initialize() -- Generate taps local cutoffs = {self.cutoffs[1]/nyquist, self.cutoffs[2]/nyquist} - local taps = filter_utils.firwin_bandstop(self.taps.length, cutoffs, self.window_type) + local taps = filter_utils.firwin_bandstop(self.taps.length, cutoffs, self.window) self.taps = types.Float32.vector_from_array(taps) FIRFilterBlock.initialize(self) diff --git a/radio/blocks/signal/complexbandpassfilter.lua b/radio/blocks/signal/complexbandpassfilter.lua index cae07b184..64a95db24 100644 --- a/radio/blocks/signal/complexbandpassfilter.lua +++ b/radio/blocks/signal/complexbandpassfilter.lua @@ -11,7 +11,7 @@ -- @tparam {number,number} cutoffs Cutoff frequencies in Hz -- @tparam[opt=nil] number nyquist Nyquist frequency, if specifying -- normalized cutoff frequencies --- @tparam[opt='hamming'] string window_type Window type +-- @tparam[opt='hamming'] string window Window type -- -- @signature in:ComplexFloat32 > out:ComplexFloat32 -- @@ -32,10 +32,10 @@ local FIRFilterBlock = require('radio.blocks.signal.firfilter') local ComplexBandpassFilterBlock = block.factory("ComplexBandpassFilterBlock", FIRFilterBlock) -function ComplexBandpassFilterBlock:instantiate(num_taps, cutoffs, nyquist, window_type) +function ComplexBandpassFilterBlock:instantiate(num_taps, cutoffs, nyquist, window) assert(num_taps, "Missing argument #1 (num_taps)") self.cutoffs = assert(cutoffs, "Missing argument #2 (cutoffs)") - self.window_type = window_type or "hamming" + self.window = window or "hamming" self.nyquist = nyquist FIRFilterBlock.instantiate(self, types.ComplexFloat32.vector(num_taps)) @@ -47,7 +47,7 @@ function ComplexBandpassFilterBlock:initialize() -- Generate taps local cutoffs = {self.cutoffs[1]/nyquist, self.cutoffs[2]/nyquist} - local taps = filter_utils.firwin_complex_bandpass(self.taps.length, cutoffs, self.window_type) + local taps = filter_utils.firwin_complex_bandpass(self.taps.length, cutoffs, self.window) self.taps = types.ComplexFloat32.vector_from_array(taps) FIRFilterBlock.initialize(self) diff --git a/radio/blocks/signal/complexbandstopfilter.lua b/radio/blocks/signal/complexbandstopfilter.lua index 52dd189bf..876be7a1f 100644 --- a/radio/blocks/signal/complexbandstopfilter.lua +++ b/radio/blocks/signal/complexbandstopfilter.lua @@ -11,7 +11,7 @@ -- @tparam {number,number} cutoffs Cutoff frequencies in Hz -- @tparam[opt=nil] number nyquist Nyquist frequency, if specifying -- normalized cutoff frequencies --- @tparam[opt='hamming'] string window_type Window type +-- @tparam[opt='hamming'] string window Window type -- -- @signature in:ComplexFloat32 > out:ComplexFloat32 -- @@ -32,10 +32,10 @@ local FIRFilterBlock = require('radio.blocks.signal.firfilter') local ComplexBandstopFilterBlock = block.factory("ComplexBandstopFilterBlock", FIRFilterBlock) -function ComplexBandstopFilterBlock:instantiate(num_taps, cutoffs, nyquist, window_type) +function ComplexBandstopFilterBlock:instantiate(num_taps, cutoffs, nyquist, window) assert(num_taps, "Missing argument #1 (num_taps)") self.cutoffs = assert(cutoffs, "Missing argument #2 (cutoffs)") - self.window_type = window_type or "hamming" + self.window = window or "hamming" self.nyquist = nyquist FIRFilterBlock.instantiate(self, types.ComplexFloat32.vector(num_taps)) @@ -47,7 +47,7 @@ function ComplexBandstopFilterBlock:initialize() -- Generate taps local cutoffs = {self.cutoffs[1]/nyquist, self.cutoffs[2]/nyquist} - local taps = filter_utils.firwin_complex_bandstop(self.taps.length, cutoffs, self.window_type) + local taps = filter_utils.firwin_complex_bandstop(self.taps.length, cutoffs, self.window) self.taps = types.ComplexFloat32.vector_from_array(taps) FIRFilterBlock.initialize(self) diff --git a/radio/blocks/signal/highpassfilter.lua b/radio/blocks/signal/highpassfilter.lua index adc670ff9..8c8ccab68 100644 --- a/radio/blocks/signal/highpassfilter.lua +++ b/radio/blocks/signal/highpassfilter.lua @@ -10,7 +10,7 @@ -- @tparam number cutoff Cutoff frequency in Hz -- @tparam[opt=nil] number nyquist Nyquist frequency, if specifying a -- normalized cutoff frequency --- @tparam[opt='hamming'] string window_type Window type +-- @tparam[opt='hamming'] string window Window type -- -- @signature in:ComplexFloat32 > out:ComplexFloat32 -- @signature in:Float32 > out:Float32 @@ -29,10 +29,10 @@ local FIRFilterBlock = require('radio.blocks.signal.firfilter') local HighpassFilterBlock = block.factory("HighpassFilterBlock", FIRFilterBlock) -function HighpassFilterBlock:instantiate(num_taps, cutoff, nyquist, window_type) +function HighpassFilterBlock:instantiate(num_taps, cutoff, nyquist, window) assert(num_taps, "Missing argument #1 (num_taps)") self.cutoff = assert(cutoff, "Missing argument #2 (cutoff)") - self.window_type = window_type or "hamming" + self.window = window or "hamming" self.nyquist = nyquist FIRFilterBlock.instantiate(self, types.Float32.vector(num_taps)) @@ -43,7 +43,7 @@ function HighpassFilterBlock:initialize() local nyquist = self.nyquist or (self:get_rate()/2) -- Generate taps - local taps = filter_utils.firwin_highpass(self.taps.length, self.cutoff/nyquist, self.window_type) + local taps = filter_utils.firwin_highpass(self.taps.length, self.cutoff/nyquist, self.window) self.taps = types.Float32.vector_from_array(taps) FIRFilterBlock.initialize(self) diff --git a/radio/blocks/signal/hilberttransform.lua b/radio/blocks/signal/hilberttransform.lua index 5c915eae7..76f53f1e6 100644 --- a/radio/blocks/signal/hilberttransform.lua +++ b/radio/blocks/signal/hilberttransform.lua @@ -7,7 +7,7 @@ -- @category Spectrum Manipulation -- @block HilbertTransformBlock -- @tparam number num_taps Number of FIR taps, must be odd --- @tparam[opt='hamming'] string window_type Window type +-- @tparam[opt='hamming'] string window Window type -- -- @signature in:Float32 > out:ComplexFloat32 -- @@ -24,13 +24,13 @@ local filter_utils = require('radio.blocks.signal.filter_utils') local HilbertTransformBlock = block.factory("HilbertTransformBlock") -function HilbertTransformBlock:instantiate(num_taps, window_type) +function HilbertTransformBlock:instantiate(num_taps, window) assert(num_taps, "Missing argument #1 (num_taps)") assert((num_taps % 2) == 1, "Number of taps must be odd") - window_type = window_type or "hamming" + window = window or "hamming" -- Generate Hilbert transform taps - local taps = filter_utils.fir_hilbert_transform(num_taps, window_type) + local taps = filter_utils.fir_hilbert_transform(num_taps, window) self.hilbert_taps = types.Float32.vector_from_array(taps) self:add_type_signature({block.Input("in", types.Float32)}, {block.Output("out", types.ComplexFloat32)}) diff --git a/radio/blocks/signal/lowpassfilter.lua b/radio/blocks/signal/lowpassfilter.lua index c0b1fe38d..d032cabfd 100644 --- a/radio/blocks/signal/lowpassfilter.lua +++ b/radio/blocks/signal/lowpassfilter.lua @@ -10,7 +10,7 @@ -- @tparam number cutoff Cutoff frequency in Hz -- @tparam[opt=nil] number nyquist Nyquist frequency, if specifying a -- normalized cutoff frequency --- @tparam[opt='hamming'] string window_type Window type +-- @tparam[opt='hamming'] string window Window type -- -- @signature in:ComplexFloat32 > out:ComplexFloat32 -- @signature in:Float32 > out:Float32 @@ -29,10 +29,10 @@ local FIRFilterBlock = require('radio.blocks.signal.firfilter') local LowpassFilterBlock = block.factory("LowpassFilterBlock", FIRFilterBlock) -function LowpassFilterBlock:instantiate(num_taps, cutoff, nyquist, window_type) +function LowpassFilterBlock:instantiate(num_taps, cutoff, nyquist, window) assert(num_taps, "Missing argument #1 (num_taps)") self.cutoff = assert(cutoff, "Missing argument #2 (cutoff)") - self.window_type = window_type or "hamming" + self.window = window or "hamming" self.nyquist = nyquist FIRFilterBlock.instantiate(self, types.Float32.vector(num_taps)) @@ -43,7 +43,7 @@ function LowpassFilterBlock:initialize() local nyquist = self.nyquist or (self:get_rate()/2) -- Generate taps - local taps = filter_utils.firwin_lowpass(self.taps.length, self.cutoff/nyquist, self.window_type) + local taps = filter_utils.firwin_lowpass(self.taps.length, self.cutoff/nyquist, self.window) self.taps = types.Float32.vector_from_array(taps) FIRFilterBlock.initialize(self)