Altera_Forum
Honored Contributor
17 years agoFilter Design using DSP Builder
Hi,
I tried to implement a filter design with the following equation: y(n) = -0.5y(n-2) - 0.25y(n-3) + x(n) using DSP builder which i attached the model file with this post. and when i simulate it i get the following result:yout = 0 1.0000 0 0 0 0 -0.5000 -0.2500 0 0 0 0.2500 0.2500 0 0 0 -0.2500 -0.2500 -0.2500 0 0 0 0 0 0 0 0 0 0 0 0 Then when i check in matlab i get the following result: >>num = [1];
>> den = [1 0 0.5 0.25];
>> [num,den] = eqtflength(num,den);
>> h = impz(num, den, 21)
h =
1.0000
0
-0.5000
-0.2500
0.2500
0.2500
-0.0625
-0.1875
-0.0313
0.1094
0.0625
-0.0469
-0.0586
0.0078
0.0410
0.0107
-0.0225
-0.0156
0.0085
0.0134
-0.0004 so obviously my filter design using dsp builder is not correct. but i dont know where gone wrong. any advice? could it be the pulse generator's setting?