synth_filter_decim2.m
来自「This lab exercise will introduce you to 」· M 代码 · 共 36 行
M
36 行
% AccelDSP 8.1.1 build 690 Production, compiled Apr 26 2006
%
% THIS IS UNPUBLISHED, LICENSED SOFTWARE THAT IS THE CONFIDENTIAL
% AND PROPRIETARY PROPERTY OF XILINX OR ITS LICENSORS
%
% Copyright(c) Xilinx, Inc., 2000-2006, All Rights Reserved.
% Reproduction or reuse, in any form, without the explicit written
% consent of Xilinx, Inc., is strictly prohibited.
function [FilterOut,valid] = synth_filter_decim2(FilterIn)
coeff = load('b.txt');
persistent tap_delay count sum1 sum2
if isempty(tap_delay)
tap_delay = zeros(1,length(coeff));
count = 0;
sum1 = 0;
sum2 = 0;
end
% Perform sum of products for the polyphase decimation by 2 filter
if count == 0
sum1 = tap_delay(2:2:end) * coeff(end:-2:2)';
count = 1;
valid = 0;
else
sum2 = tap_delay(2:2:end) * coeff(end-1:-2:1)';
count = 0;
valid = 1;
end
FilterOut = sum1+sum2;
% Shift tap delay line
tap_delay = [tap_delay(2:length(coeff)) FilterIn];
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?