Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Quantization Problem...Help Please

Hi i'm working on a 2 Channel QMF perfect reconstruction Filter bank using a tutorial in Matlab and i'm trying to implement the design on a Cyclone II FPGA board. after setting everything up i notice that i wasnt getting the expected results. so i decided to simulate it in Simulink. i notice that the filter is fine and works as expected, but when i changed the arithmetic to fixed point the filter started to behave differently, i'm not sure how to fix this problem. i have images and code Please help.[CODE]N = 99;

[H0,H1,G0,G1] = firpr2chfb(N,.45);

% Analysis filters (decimators).

Hlp = mfilt.firdecim(2,H0);

Hhp = mfilt.firdecim(2,H1);

% Synthesis filters (interpolators).

Glp = mfilt.firinterp(2,G0);

Ghp = mfilt.firinterp(2,G1);

Hlp.arithmetic = 'fixed';

Hlp.InputWordLength = 16;

Hlp.InputFracLength = 15;

Hlp.FilterInternals = 'FullPrecision';

%Hlp.OutputWordLength = 16;

%Hlp.OutputFracLength = 14;

Hlp.CoeffWordLength = 16;

Hlp.signed = true;

%Hlp.AccumWordLength = 20;

% Hlp.NumStateWordLength = 20;

% Hlp.DenStateWordLength = 20;

%Hlp.CastBeforeSum = false;

%Hlp.RoundMode = 'nearest';

%Hlp.OverflowMode = 'wrap';

%----------------------------------------------------------

Hhp.arithmetic = 'fixed';

Hhp.InputWordLength = 16;

Hhp.InputFracLength = 15;

Hhp.FilterInternals = 'FullPrecision';

%Hhp.OutputWordLength = 16;

Hhp.signed = true;

%Hhp.OutputFracLength = 14;

Hhp.CoeffWordLength = 16;

%Hhp.AccumWordLength = 20;

% Hhp.NumStateWordLength = 20;

% Hhp.DenStateWordLength = 20;

%Hhp.CastBeforeSum = false;

%Hhp.RoundMode = 'nearest';

%Hhp.OverflowMode = 'wrap';

%----------------------------------------------------------

Glp.arithmetic = 'fixed';

Glp.InputWordLength = 34;

Glp.InputFracLength = 33;

Glp.FilterInternals = 'FullPrecision';

%Glp.OutputWordLength = 32;

Glp.signed = true;

%Glp.OutputFracLength = 29;

Glp.CoeffWordLength = 16;

%Glp.AccumWordLength = 32;

% Glp.NumStateWordLength = 20;

% Glp.DenStateWordLength = 20;

% Glp.CastBeforeSum = false;

%Glp.RoundMode = 'nearest';

%Glp.OverflowMode = 'wrap';

%-----------------------------------------------------------

Ghp.arithmetic = 'fixed';

Ghp.InputWordLength = 34;

Ghp.InputFracLength = 33;

Ghp.FilterInternals = 'FullPrecision';

Ghp.signed = true;

%Ghp.OutputWordLength = 32;

%Ghp.OutputFracLength = 29;

Ghp.CoeffWordLength = 16;

%Ghp.AccumWordLength = 32;

% Ghp.NumStateWordLength = 20;

% Ghp.DenStateWordLength = 20;

% Ghp.CastBeforeSum = false;

%Ghp.RoundMode = 'nearest';

%Ghp.OverflowMode = 'wrap';

/CODE]

19 Replies