class Digiproc::RectangularWindow

A basic ReactangularWindow used when making a digital filter

Public Class Methods

new(size: ) click to toggle source

Initialize with a size: Integer Number of datapoints

Calls superclass method Digiproc::WindowStrategy::new
# File lib/strategies/window/rectangular_window.rb, line 7
def initialize(size: )
    super(size: size)
    calculate
end

Public Instance Methods

find_size(freq) click to toggle source

Find the size given an input frequency in rad/s

# File lib/strategies/window/rectangular_window.rb, line 13
def find_size(freq)
    size = 0.9 / freq
    make_odd(size.ceil)
end
transition_width() click to toggle source

Return the transition width based on the @size

# File lib/strategies/window/rectangular_window.rb, line 19
def transition_width
    0.9 / @size
end