Module: Radio::Filter::Mix

Includes:
SetupFir
Defined in:
lib/radio/filters/fir.rb

Instance Method Summary collapse

Methods included from SetupFir

#decimation_fir=, #decimation_mix=, #interpolation_fir=, #interpolation_mix=

Instance Method Details

#call(data, &block) ⇒ Object



195
196
197
# File 'lib/radio/filters/fir.rb', line 195

def call data, &block
  call! data.dup, &block
end

#call!(data) {|data.collect! do |v| v * @decimation_phase *= @decimation_inc end| ... } ⇒ Object

Yields:

  • (data.collect! do |v| v * @decimation_phase *= @decimation_inc end)


198
199
200
201
202
203
# File 'lib/radio/filters/fir.rb', line 198

def call! data
  @decimation_phase /= @decimation_phase.abs
  yield(data.collect! do |v|
    v * @decimation_phase *= @decimation_inc
  end)
end