0
我们得到了一个任务来实现一个滤波器(数字高通IIR滤波器),以将频率降低到500 Hz以下并允许更高的频率。 使用S叮o01,我们构建了以下Matlab IIR滤波器
% Sampling Rate (Hz)
Fs = 46875;
% High-pass filter
N = 4; % Filter Order
Wn = 500/(46875/2); % Cutoff Frequency in terms of Passband/Nyquist frequency ratio
Rp = 0.5; % Passband ripple specification
Rs = 20; % Stopband attenuation
[Num,Den] = ellip(N,Rp,Rs,Wn,'high');
secondOrderSection = tf2sos(Num,Den)./2
的椭球功能可按然后我们计算使用L1范数的比例因子: 我们需要实现这个在16位爱特梅尔微控制器(AC3U3 Xplained),因此必须计算在Q_0.15形式的比例因子
% FIRST SECTION
firstScaleFactor = 1/(sum(abs(impz(1,secondOrderSection(1,4:6)))))
sf1_2_Q = round(firstScaleFactor*(2^15))
% SECOND SECTION
secondScaleFactor = 1/(sum(abs(impz(1,secondOrderSection(2,4:6)))))
sf2_2_Q = round(secondScaleFactor*(2^15))
的问题:我们的比例因子似乎有点低,第一缩放因子是77,第二个是14 有任何错误,在我们的计算?