这是一个FIR低筒滤波器吗wire[7:0] filter_coefficient1 = 8'd7; 28.wire[7:0] filter_coefficient2 = 8'd5; 29.wire[7:0] filter_coefficient3 = 8'd51; 30.wire[7:0] filter_coefficient4 = 8'd135; 31.wire[7:0] filter_coefficient5 = 8'd179; 32.wire[7:0] filter_coefficient6 = 8'd135; 33.wire[7:0] filter_coefficient7 = 8'd51; 34.wire[7:0] filter_coefficient8 = 8'd5; 35.wire[7:0] filter_coefficient9 = 8'd7; 36. 37.定义 9 个有符号整数型的寄存器变量,保存乘积结果 38.reg signed [16:0] result1=17'b0 ; 39.reg signed [16:0] result2=17'b0 ; 40.reg signed [16:0] result3=17'b0 ; 41.reg signed [16:0] result4=17'b0 ; 42.reg signed [16:0] result5=17'b0 ; 43.reg signed [16:0] result6=17'b0 ; 44.reg signed [16:0] result7=17'b0 ; 45.reg signed [16:0] result8=17'b0 ; 46.reg signed [16:0] result9=17'b0 ; 47. FIR 滤波器的输出值 48.always@(posedge clk_sample) 49. begin 50. result1 <= cascade delay1*filter_coefficient1 ; 51. result2 <= cascade delay2*filter_coefficient2 ; 52. result3 <= cascade delay3*filter_coefficient3 ; 53. result4 <= cascade delay4*filter_coefficient4 ; 54. result5 <= cascade delay5*filter_coefficient5 ; 55. result6 <= cascade delay6*filter_coefficient6 ; 56. result7 <= cascade delay7*filter_coefficient7; 57. result8 <= cascade delay8*filter_coefficient8; 58. result9 <= cascade delay9*filter_coefficient9 ; 59. output_data <= result1 + result2 + result3 + 60. result4 +result5 + result6 + result7 + 61. result8 + result9 ; 62. end
时间: 2024-03-22 18:40:53 浏览: 91
FIR_低通FIR滤波器_
5星 · 资源好评率100%
是的,这是一个FIR低通滤波器的代码实现。这个滤波器使用了9个系数,分别存储在filter_coefficient1到filter_coefficient9这9个寄存器变量中。这个滤波器的输入信号是通过cascade delay1到cascade delay9这9个寄存器变量中存储的。在每个采样时钟的上升沿触发时,滤波器将输入信号与系数相乘,并将乘积结果存储在result1到result9这9个寄存器变量中。最后,这9个乘积结果相加得到滤波器的输出值output_data。
阅读全文