⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 program_11_7.m

📁 matlab写的数字信号处理源代码,简化你的信号处理的工作。
💻 M
字号:
% Program 11_7
% Sigma-Delta A/D Converter Operation
%

colordef black;
wo = 2*pi*0.01;
N = input('Type in the length of input sequence = ');
n = 1:1:N;
m = n-1;
A = input('Type in the amplitude of the input = ');
x = A*cos(wo*m);
figure(1)
axis([0 N-1 -1.2 1.2]);
plot(m,x,'g',m,zeros(size(m)),'w');
xlabel('Time'); ylabel('Amplitude');
title('Input analog signal');
figure(2)
y = zeros(1,N+1);
v0 = 0;
for k = 2:1:N+1;
   v1 = x(k-1) - y(k-1) + v0;
   if v1 >= 0;
      y(k) = 1;
   else
      y(k) = -1;
   end
   v0 = v1;
end
yn = y(2:N+1);
axis([0 N-1 -1.2 1.2]);
stairs(m, yn,'g');
hold on
plot(m,zeros(size(m)),'w')
xlabel('Time'); ylabel('Amplitude');
title('Output of sigma-delta quantizer');
Y = fft(yn);
pause
H = [1 1 0.5 zeros(1,N-5) 0.5 1];
YF = Y.*H;
out = ifft(YF);
axis([0 N-1 -1.2 1.2]);
plot(m,out);
xlabel('Time'); ylabel('Amplitude');
title('Lowpass filtered output');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -