简体   繁体   English

Matlab IIR滤波器

[英]Matlab IIR filter

We were given a task to implement a filter(digital high pass IIR filter) to reduce frequencies below 500 Hz and allow higher frequencies. 我们的任务是实现一个滤波器(数字高通IIR滤波器),以降低500 Hz以下的频率并允许更高的频率。 Using the sptool, and the ellip funciton we constructed the following 使用sptool和椭圆函数,我们构造了以下内容

% 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

We then calculated the scalefactors using L1 norm: We need to implement this on a 16 bit atmel microcontroller, (AC3U3 Xplained) and must therefore calculate the scalefactors in Q_0.15 form 然后,我们使用L1范数计算比例因子:我们需要在16位atmel微控制器(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))

The Problem: Our scalefactors seems to be a bit low, First scale factor is 77, second is 14. Is there any errors in our calculations? 问题:我们的比例因子似乎有点低,第一个比例因子是77,第二个比例因子是14。我们的计算中是否有错误?

德州仪器(TI)的本应用笔记概述了定点滤波器实现中避免溢出的技术。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM