我必须在 DF1 或 DF2 中实现二阶滤波器。我应该通过适当的寻址策略来避免内务操作。
我不明白“家务操作”是什么意思。任何人都可以帮助我或提出一个我可以找到更多信息的来源?
编辑 :
我使用 DF2 作为二阶滤波器:
正如 pichenettes 建议使用 Housekeeping 的那样,matlab 中的代码类似于:
%x=input sample
%state=containing old input values
%compute output value
y=b(1)*x+state(2)
%Update states
state(2)=b(2)*x-a(2)*y+state(1)
state(1)=b(3)*x-a(3)*y
没有家政服务会是这样的:
%compute output value
y=b(1)*x+state(pointer+1);
pointer=rem(pointer+1,N-1); %increment pointer in modulo form, N number of taps
%Update states
state(pointer+1)=b(2)*x-a(2)*y+state(pointer+1);
pointer=rem(pointer+1,N-1);
%Overwrite oldest sum with b(N-1).x
state(pointer+1)=b(3)*x-a(3)*y;
pointer=rem(pointer+1,N-1);%Increment pointer modulo-(N-1)
是这样吗?有什么错误吗?