Moved frequency response algorithm into code