class Digiproc::KaiserWindow

kaiser Window Used to improve digital filters by using a non-retangular frequency domain window NOT COMPLETE TODO: Finish this Window

Public Class Methods

new(size: , stopband_db: nil, beta: nil) click to toggle source
Calls superclass method Digiproc::WindowStrategy::new
# File lib/strategies/window/kaiser_window.rb, line 9
def initialize(size: , stopband_db: nil, beta: nil)
    raise ArgumentError.new("Must have a stopband or a beta") if stopband_db.nil? && beta.nil?
    super(size: size)
    size = @size
    @equation = lambda { |n|  }
    calculate
    @values = @values.take(@size)
end

Public Instance Methods

beta_for_db(db) click to toggle source
# File lib/strategies/window/kaiser_window.rb, line 18
def beta_for_db(db)
    if db <= 21
        return 0
    elsif db < 50
        return 0.5842*((db - 21) ** 0.4) + 0.07886 * (db - 21)
    else
        return 0.1102*(db - 8.7)
    end
end