Module: Radio::Filter::Fir::Complex

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

Instance Method Summary collapse

Instance Method Details

#call(data) {|out| ... } ⇒ Object

Yields:

  • (out)


180
181
182
183
184
185
186
187
188
189
# File 'lib/radio/filters/fir.rb', line 180

def call data
  out = NArray.scomplex data.size
  data.size.times do |i|
    @decimation_fir_pos = @decimation_fir_size if @decimation_fir_pos == 0
    @decimation_fir_pos -= 1
    @decimation_buf[@decimation_fir_pos] = data[i..i]
    out[i] = @decimation_fir_coef[@decimation_fir_pos].mul_accum @decimation_buf, 0
  end
  yield out
end