>> n=31;%定义滤波器阶数32 fs=12
8*10^3; fc1=49; fc2=51; w1=2*pi*fc1/fs; w2=2*pi*fc2/fs;%参数转换,将模拟滤波器的技术指标转换为数字滤波器的技术指标 window=hanning(n+1);%使用hanning 窗函数 q=fir1(n,[w1/pi w2/pi],hanning(n+1));%滤波器时域函数,使用标准响应的加窗设计函数fir1 w=linspace(0,pi,512); h1=freqz(q,1,512);%进行512 个点的傅里叶变换 figure(2); plot(w/pi,20*log10(abs(h1))); title('滤波器频谱图'); xlabel('频率'); ylabel('幅度'); grid ; 设计FIR 低通滤波器,系统频率为50MHz,通带截止频率Fpass 为1MHz,阻带截止频率Fstop 为4MHz,通带最大衰减Apass 为1dB,阻带最小衰减Astop为30dB
程序和必要的程序注释 谢谢 最佳答案 只要用一个公式就行
library IEEE; use IEEE
STD_LOGIC_1164
ALL; use IEEE
STD_LOGIC_ARITH
ALL; use IEEE
STD_LOGIC_UNSIGNED
ALL; entity fir is Port (clk: in std_logic; reset: in std_logic; inpx: in std_logic_vector(11 downto 0); outy: out std_logic_vector(11 downto 0)); end fir; architecture beh of fir is sign