test_1_lin.m
来自「audio compression matlab code」· M 代码 · 共 35 行
M
35 行
clc; clear; clf;
% linear transforms
%the numbar of the inputs bits...
nbits_in = 15;
nbits_out = 7;
% define the range
x_min = - 2^nbits_in ;
x_max = + 2^nbits_in -1;
in_range = x_max - x_min;
step = 100;
x = x_min:step:x_max;
y_min = - 2^nbits_out ;
y_max = + 2^nbits_out -1;
out_range = y_max - y_min;
y = (out_range / in_range) .* x;
xb = (in_range / out_range) * y;
subplot(221), stairs(x,y); title('Compression');
axis([x_min x_max 5*y_min 5*y_max]);
subplot(222), stairs(y,xb); title('Expanding')
axis([5*y_min 5*y_max x_min x_max]);
subplot(223), plot(x, xb)
title('transfer characteristic');
subplot(224), stairs(x, (xb -x) ./ x .* 100);
axis([x_min x_max x_min x_max]);
title('Reconstruction Error [%]');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?