糊涂刺猬
2009-05-17, 09:41
下面这程序,我调试时出问题,但不知道怎样改,请高手帮我改下,谢谢~~~
源程序如下来源与dedekd )
clc
clear
close all
%==================================正弦波==================================
width=8; %宽度是8
depth=1024; %深度是1024
t=0:1e-8depth-1)*1e-8; %采样频率是100MHz
w=2*pi*1e6; %正弦波频率1MHz
sin_a=(sin(w*t)+1)/2; %归一化
sin_d=fix(sin_a*(2^width-1)); %量化
plot(sin_d);
axis([0,depth-1,0,2^width-1]);
源程序如下来源与dedekd )
clc
clear
close all
%==================================正弦波==================================
width=8; %宽度是8
depth=1024; %深度是1024
t=0:1e-8depth-1)*1e-8; %采样频率是100MHz
w=2*pi*1e6; %正弦波频率1MHz
sin_a=(sin(w*t)+1)/2; %归一化
sin_d=fix(sin_a*(2^width-1)); %量化
plot(sin_d);
axis([0,depth-1,0,2^width-1]);