fixed calculation of amplitude weight in get_ir()