?? program_08_06.m
字號:
% Program 8_6
% Illustration of Filtering by a Lowpass FIR Filter
%
% Determine the FIR filter coefficients
f = [0 0.3 0.5 1];
m = [1 1 0 0];
num = remez(9,f,m);
% Generate the input sequence
k = 1:51;
w1 = 0.75*pi;w2 = 0.2*pi;
A = 1.5;B = 2.0;
x1 = A*cos(w1*(k-1)); x2 = B*cos(w2*(k-1));
x = x1+x2;
% Filter the input sequence
si = [zeros(1,9)];
y = filter(num,1,x,si);
% Plot the input and the output sequences
subplot(2,1,1)
stem(k-1,x);
xlabel('Time index n'); ylabel('Amplitude');
title('Input Sequence');
subplot(2,1,2)
stem(k-1,y);
xlabel('Time index n'); ylabel('Amplitude');
title('Output Sequence');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -