当前位置:网站首页>[matlab] IIR filter
[matlab] IIR filter
2022-07-28 13:10:00 【Summer is cool and autumn falls】
List of articles
One .IIR filter
IIIR The unit impulse response of the filter is infinite ! Expressed by difference equation as :
It can be seen from the above formula , Calculate the output y(n) When , Previous output and input values are required . In other words ,iirl The filter has a feedback link . When a k a_k ak When it's zero , This filter has no feedback , Its unit shock response is limited , yes FIR filter . When a k a_k ak Not for 0 It is time to , yes IIR filter .
Two .IIR The structure of the filter
(1) direct I type
Obtained directly from the difference equation IIR The filter is called direct I Type structure , As shown in the figure below , On the left is the zero point part , On the right is the pole :
(2) direct II type
Merging the same delay units is direct II type 
3、 ... and . The reference sample
(1) Basic knowledge of




(2) direct I Type example
Design a filter with order 7, Sampling frequency is 20Mhz, Cut off frequency 5Mhz, The stopband attenuation is 60dB One of the matlab filter ( With cheby2 For example );
Method 1 : call matlab Built-in function
[b,a]=cheby2(n, R p R_p Rp, W n W_n Wn)
n: The order of the filter
R p R_p Rp: Maximum attenuation of passband ripple
W n W_n Wn: Cut off frequency ,fs Normalize to 2 π 2\pi 2π, W n = f s t o p / f s ∗ 2 W_n=f_{stop}/fs*2 Wn=fstop/fs∗2
clc;
clear all;
fs=2000e4;
f0=200e4;
f1=800e4;
M=1999;
n=0:(M-1);
N=11; % Quantized digits
% signal = sin(2*pi*f0/fs*n);
signal = sin(2*pi*f0/fs*n)+sin(2*pi*f1/fs*n);
[b,a]=cheby2(7,60,0.5); % 500/2000*2=0.5
signal_f = filter(b,a,signal);
fft_plot(signal,fs,' Signal before filtering ');
fft_plot(signal_f,fs,' Filtered signal ');
signal=round(signal./max(signal))*(2^N-1);
fid = fopen('sin1.txt','w');
fprintf(fid,'%d\n',signal); % x representative 16 Base number d For decimal
fclose(fid);
fft_plot(signal,fs,' The quantized signal before filtering ');
signal_f = filter(b,a,signal);
fft_plot(signal_f,fs,' Quantized signal after filtering ');
function fft_plot(y,fs,s_name)
L_i = 2^nextpow2(length(y)*100);
s_i_fft = fft(y,L_i);
s_i_fftshfit = fftshift(s_i_fft);
P = abs(s_i_fftshfit)/length(y)*2; % For non DC components or 0 It's divided by N multiply 2, For the DC component, it is directly divided by N
% fshift = (-L_i/2:L_i/2-1)*(fs/L_i);
fshift = linspace(-fs/2,fs/2,L_i);
figure;
plot(fshift,P);
title([s_name,' Bilateral spectrum of ']);
xlabel('f (Hz)');
ylabel('|P(f)|');
end
Method 2 :FDATOOL
The parameters are as follows :
choice Export

export SOS and G To the workspace , take SOS and G To [b,a], The formula is as follows :
[b1,a1]=sos2tf(SOS,G);
Usually observe the coefficient and find , The coefficients of the two designs are consistent .
matlab The simulation results are as follows :
As you can see from the diagram 8Mhz The signal of is filtered .
Method 3 :verilog The implementation of the 【 Specific references 2】
Simulation results :
Four . Reference material
边栏推荐
- 【嵌入式C基础】第4篇:运算符的使用
- Pointnet++ Chinese Translation
- Complete set of SSM framework online bookstore
- 线性分类器(CCF20200901)
- Application and download of dart 3D radiative transfer model
- Shenwenbo, researcher of the Hundred Talents Program of Zhejiang University: kernel security in the container scenario
- [graduation design] heart rate detection system based on single chip microcomputer - STM32 embedded Internet of things
- Cloud native - runtime environment
- 20220728 common methods of object class
- [embedded C foundation] Part 4: use of operators
猜你喜欢

RGB game atmosphere light touch chip-dlt8s04a-jericho

机器学习基础-贝叶斯分析-14

Machine learning practice - integrated learning-23

01 introduction to pyechars features, version and installation
![[embedded C foundation] Part 4: use of operators](/img/01/b3b6c093095dd6a076ae43521a1917.png)
[embedded C foundation] Part 4: use of operators

Sliding Window

Ccf201912-2 recycling station site selection

Brief introduction to JS operator

线性分类器(CCF20200901)
![[graduation design] smart home system based on ZigBee - single chip microcomputer Internet of things stm32](/img/c3/4268d7e4e1429f9b0d9d928790d740.png)
[graduation design] smart home system based on ZigBee - single chip microcomputer Internet of things stm32
随机推荐
子线程更新UI全解
Low code: reduce technical capability requirements and improve software development efficiency
【嵌入式C基础】第3篇:常量和变量
【嵌入式C基础】第2篇:进制转换与BCD编码
【嵌入式C基础】第7篇:C语言流程控制详讲
BA autoboot plug-in of uniapp application boot
Fundamentals of machine learning - principal component analysis pca-16
【嵌入式C基础】第1篇:基本数据类型
Analysis of Andriod low on memory printing principle
Black cat takes you to learn EMMC Protocol Part 24: detailed explanation of EMMC bus test program (cmd19 & cmd14)
[embedded C foundation] Part 2: binary conversion and BCD coding
[embedded C foundation] Part 9: basic usage of C language pointer
Android工程师,如何使用Kotlin提供生产力?
MySQL limit paging optimization
[embedded C foundation] Part 8: explanation of C language array
Fundamentals of machine learning Bayesian analysis-14
黑猫带你学eMMC协议第27篇:什么是eMMC的动态容量(Dynamic Capacity)?
Solution to the binary tree problem of niuke.com
Led aquarium lamp touch chip-dlt8t02s-jericho
Understanding of vite2

