当前位置:网站首页>[FPGA] FIR filter - half band filter
[FPGA] FIR filter - half band filter
2022-07-28 13:10:00 【Summer is cool and autumn falls】
List of articles
1. Definition of half band filter
Half band filter is a special FIR filter , Its The order can only be even , Odd length . The filter coefficient except the intermediate value is 0.5 Outside , rest The coefficients of even numbers are 0( Therefore, the multiplication and addition operations during filtering are greatly saved ), Half band filter is a special low-pass FIR Digital filter . This filter is due to Passband and stopband are relative to one-half Nyquist Frequency symmetry , Therefore, nearly half of the filter coefficients are accurate to zero .
Half band FIR General frequency response of filter :
The amplitude frequency response is about π/ 2(fs/4) symmetry , The sampling rate is normalized to 2π radians/sec, The relationship between passband and stopband frequency is :
The passband and stopband ripple are equal , These characteristics are reflected in the impulse response of the filter ; for example , For filters with an odd number of tap coefficients , About half of the coefficients are zero and interlaced between non-zero coefficients . The figure below 3-20, Yes. 11 A tapped half band filter :

When realizing half band filter , The effective implementation structure obtained by using this feature is shown in the figure below :
Particular attention :
Digital filters are 2π The normalized ,2π Corresponding fs Sampling rate . This and FFT The result is the same . Sampling time discrete series , Spectrum to 2π For cycles ,( Also with Fs For cycles )
2 Usage example of half band filter
requirement : The signal frequency is 25hz and 50hz, The sampling rate is 120hz, Design a half band filter to filter out 50hz The frequency component of
Filter design process :
% The signal frequency is 25hz and 50hz, The sampling rate is 120hz, Design a half band filter to filter out 50hz The frequency component of
clear all;
clc;
fs=120;
f0=25;
f1=50;
N=256;
n=0:(N-1);
% signal = sin(2*pi*f0/fs*n);
signal = sin(2*pi*f0/fs*n)+sin(2*pi*f1/fs*n);
coff = [0,0.0671297764639564,0,-0.0953987484367994,0,0.314556319097219,0.500000000000000,0.314556319097219,0,-0.0953987484367994,0,0.0671297764639564,0];
signal_f = filter(coff,1,signal);
fft_plot(signal,fs,' Signal before filtering ');
fft_plot(signal_f,fs,' Filtered signal ');
function fft_plot(y,fs,s_name)
L_i = 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
The results are shown in the following figure :
Reference material :
【1】FPGA Signal processing series ——FIR Half band decimation filter
【2】MATLAB Generate FPGA COE Document XILINX FPGA Filter coefficients
【3】fdatool Toolbox design FIR Digital filter
边栏推荐
- LeetCode 42.接雨水
- [embedded explanation] key scanning based on finite state machine and stm32
- [embedded C foundation] Part 5: original code / inverse code / complement code
- Machine learning practice - logistic regression-19
- 【嵌入式C基础】第3篇:常量和变量
- 【嵌入式C基础】第9篇:C语言指针的基本用法
- Summary: idea problem record
- Dimming and color matching cool light touch chip-dlt8ma12ts-jericho
- [embedded C foundation] Part 2: binary conversion and BCD coding
- [pictures and texts] detailed tutorial of one click reinstallation of win11 system
猜你喜欢

机器学习实战-决策树-22

【嵌入式C基础】第4篇:运算符的使用
![[embedded C foundation] Part 6: super detailed explanation of common input and output functions](/img/eb/69264bc0d8e9349991b7b9e1b8ca22.png)
[embedded C foundation] Part 6: super detailed explanation of common input and output functions

Fundamentals of machine learning - principal component analysis pca-16

Cloud native - runtime environment

线性分类器(CCF20200901)

Comments are not allowed in JSON
![[basic teaching of Bi design] detailed explanation of OLED screen use - single chip microcomputer Internet of things](/img/76/820d4e357206f936b33da92a5e2b5b.png)
[basic teaching of Bi design] detailed explanation of OLED screen use - single chip microcomputer Internet of things

Leetcode 42. rainwater connection

Vs code is not in its original position after being updated
随机推荐
Science heavyweight: AI design protein has made another breakthrough, and it can design specific functional proteins
Linear classifier (ccf20200901)
The largest rectangle in leetcode84 histogram
Black cat takes you to learn EMMC protocol chapter 27: what is EMMC's dynamic capacity?
如何在 TiDB Cloud 上使用 Databricks 进行数据分析 | TiDB Cloud 使用指南
[graduation design] heart rate detection system based on single chip microcomputer - STM32 embedded Internet of things
【嵌入式C基础】第8篇:C语言数组讲解
[embedded C foundation] Part 4: use of operators
Phpstudy steps to quickly build a website (teach you to build it by hand)
线性分类器(CCF20200901)
Connected Block & food chain - (summary of parallel search set)
Low code: reduce technical capability requirements and improve software development efficiency
Chapter IX rest Service Security
机器学习基础-贝叶斯分析-14
MySQL is always installed unsuccessfully. Just do it like this
Comments are not allowed in JSON
.NET的求复杂类型集合的差集、交集、并集
Solution to using json.tojsonstring to display question marks in Chinese in Servlet
Sliding Window
Xampp Chinese tutorial guide