📄 examp47.m
字号:
clc,echo on
%EXAMPLE 47
N=200;t=(0:N-1)*0.01; % Time array
x=sin(2*pi*t); % DT sampled signal
d=max(x)-min(x); % Dynamic range
b=3;L=2^b; % Number of levels
s=d/L; % Step size
y=s*round(x/s); % round (use FLOOR to truncate)
plot(t,x);hold on, % Overplot CT signal samples
dtplot(t,y);hold off,pause(2) % And quantized signal.
e=x-y;hist(e,L); % Error signal and its histogram.
snra=10*log10(sum(x.*x)/sum(e.*e)) % Quantization SNR
echo off %end of example
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -