A generalized architecture for linear transform