#This work is licensed under the
#Creative Commons Attribution-Share Alike 3.0 United States License.
#To view a copy of this license, visit
#http://creativecommons.org/licenses/by-sa/3.0/us/ or send a letter to
#Creative Commons,
#171 Second Street, Suite 300,
#San Francisco, California, 94105, USA.

INPUT total_samples[s], max_matrix_channel[s], output_shift[s], rematrixed;
OUTPUT shifted;
VAR total_samples "total samples";
VAR max_matrix_channel "max matrix channel";
VAR output_shift "output shift";
VAR rematrixed "rematrixed";
VAR shifted "shifted";
for i <- 0 to total_samples[s] {
    for c <- 0 to (max_matrix_channel[s] + 1) {
        shifted[c][i] <- rematrixed[c][i] * 2 ^ output_shift[s];
    }
}
return shifted;
