Hello all,
i am trying to use a FIR IP core 5 in spartan3.
i designed and quantized filter in matlab and used core generator to create it.
i want my system to work in 40MHz clock frequency and 10 MHz input sampling frequency. input and output should be 12 bit.
i changed all the parameters but the output of simulation always look weird!!
when i look at the output, i think that it looks like the input but FIR filter cuts down both sides of input.
any help is appreciated.
It looks like that you did not convert the output values to signed values. if ouput is 12 bit signed then the
maximum value could be 2047 not 4000 ...
change the signal values to signed in vhdl simulator and then write to file or use code like below in MATLAB to correct values.
Code:
for i=1:length(Out)
if (Out(i)>=2048)
Out(i) = Out(i) -4096;
end;
end;
it seems to be an overflow.
by this description and images it's not easy to say where is the problem but u can check some points.
try answering this questions:
1) how do u converted coefficients from MATLAB to be used in FIR Core. is FIR parameters selected carefully? plz place the XCO file to be discussed.
2) how do you truncated 32 bit output of FIR to 12 bit?
1) i used matlab's fdatool to quantize designed filter and created .COE file for fir core.
i put 4 images of designed filter and quantization process here.