📄 program_13_1.m
字号:
% Program 13_1
% Illustration of Up-Sampling by an Integer Factor
%
clf;
N = input('Input length = ');
L = input('Up-sampling Factor = ');
fo = input('Input signal frequency = ');
% Generate the input sinusoidal sequence
n = 0:N-1;
x = sin(2*pi*fo*n);
% Generate the up-sampled sequence
y = zeros(1, L*length(x));
y([1: L: length(y)]) = x;
% Plot the input and the output sequences
subplot(2,1,1)
stem(n,x);
title('Input Sequence');
xlabel('Time index n');ylabel('Amplitude');
subplot(2,1,2)
stem(n,y(1:length(x)));
title(['Output sequence up-sampled by', num2str(L)]);
xlabel('Time index n');ylabel('Amplitude');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -