IIR fixed-point implementation
I was wondering if anyone can recommend me good books or papers on
fixed-point IIR implementation strategies on FPGAs or CPUs. Especially
regarding fc versus Fs and coefficient quantization. I have issues
with an order-1 DC-removal filter with Fs = 100 MHz and Fcut = 250
kHz. Basically, I need lots of precision in the intermediate
calculations which impact the number of bits for the multiplier and
thus the maximum frequency of my FPGA design.
On 11/14/2011 1:15 PM, Benjamin Couillard wrote:
> HI everyone,
> I was wondering if anyone can recommend me good...Fixed Point IIR implementation
I would like to implement a IIR Biquad filter using the fixed point
Hence to reduced the intermediate states I plan to use the following trick:
s(k) = x(k) -a1*s(k-1) -a2*s(k-2)
y(n) = b0*s(k) + b1*s(k-1) + b2*s(k-2)
The I can compute each y, saving only 2 states (s(k-1) a�nd s(k-2))...
BUT ... in order to scale my coefficients or input, I need to know what
are the boundaries of the s(k) serie... in order to find a proper Fixed
Point format for my coefficients..
So my questions are :
* for which conditions, s(k) is bounded
* If the s(k) is bounded, what are the b...IIR biquad implementation in fixed point / integer
I tried implementing a LPF biquad (that works perfectly in floating
point) with: a = [1.00000, -1.90887, 0.91129], b = [6.1150e-04,
1.2230e-03, 6.1150e-04] in fixed point / integer, with 16 bit
coefficients, 10 bit input signal and a 32 bit accumulator. I suspect
the coefficient resolution is not enough.
- the direct form 1 and direct form 2 transposed structures, but the
output is zero if the input signal is not very high -- because of the
small b coefficients, the signal is attenuated very much in the FIR
portion of the filter and is lost;
int biquad_ab(d, a0...couple of questions on practical IIR filter implementation on fixed point systems
I am a professional programmer, but I am doing DSP just as a hobby.
Three years ago I designed a morse / PSK31 decoder on a 16bit no-
multiplier controller. After rouhgly 3 years of absence in the DSP
field I am back to design a HAM shortwave software defined radio using
a beautiful new part from Texas Instruments - TLV320AIC3254 codec with
miniDSP core. The part could do all the signal processing I need with
just a 5x5mm board space including earphone driver. That's an
engineer's dream come true.
The goal is to downconvert a SSB voice channel down to audio with a
quadrature m...Fixed point implementation of 4'th order IIR filters
Does anyone have some guidelines on how to implement a 4'th order low-pass
Butterworth IIR filter in fixed point. My cut-off frequency is relatively
close to the DC frequency so high precision is needed for the coefficients.
What about realization structure and so on!
I have implemented the bit-flipping algorithm in
http://www.cmsa.wmin.ac.uk/~artur/pdf/Paper16.pdf for quantization of
and it indeed works, but does some other techniques allow for further
reductions of number of bits used to represent the coefficients.
I've found the normalized lattice-ladder...floating point to fixed point conversion-in implementation of navigation system algorithm
I have a floating point c code to implement a navigation system
In order to implement it in the 64x+ fixed point DSP processor, i need to
have the code in fixed point. I learnt that there are few processor
specific IQmath libraries aiding this purpose. Is it practical to write
the code using these libraries or should i manually write codes for each
operation by scaling the inputs for each line of the code, in which case i
have to create look up table for the trigonometric functions etc which is a
harder process to begin with..
On 2/13/12 11:38 AM, divya_di...fixed point implementation
i want to implement the equation
p3 = p3*0.5/cos(3*PI/8);
into 16bit processor, where p3 is a 16 bit value;
any pointers as to how to go about it
> i want to implement the equation
> p3 = p3*0.5/cos(3*PI/8);
> into 16bit processor, where p3 is a 16 bit value;
> any pointers as to how to go about it
It looks like '0.5/cos(3*PI/8)' is a constant, so simplify it.
cos(3*PI/8) = 0.99978861
0.5/0.99978861 = 0.50010571
Depending on the algorithm you might get away with simply dividing by 2:
p3 >...fixed point IIR coeffs
Hi i am using built-in Matlab functions to design IIR fixed point filter. For example:
[b a] = cheby1(2,6,0.25)
hd = dfilt.df1(b,a)
Is there a simple method to check the coefficient values for fixed arithmetic? Precisely the ones which will appear in HDL code ( generatehdl(hd) ). Because i want to make a parametrized filter with a coefficient lookup table for different cutoff frequencies.
...LMS fixed point implementation
I need a fixed point implementation for the LMS algorithm;I have to
implement it on a TI dsp board (c6711 or a c5000); can anyone suggest
me where I can find this code?
thank you guys!
It is a single step for fixed point LMS.
c_ptr points to coefficient, r_ptr points to history.
muErr = e * mu;
mu = 2048(trial), using fixed mu;
accA, accB are at least 32 bit accumulators.
/* Macro: Performs single step of filter and adapt */
#define ADAPT_AND_FILTER(accA, accB, muErr, c_ptr, r_ptr) \
accB = 16384; \
accB += ((i3...IIR with fixed-point numbers?
What�s the best way to determine the required number of bits necessary in a
fixed-point IIR-filter? To avoid overflow during calculations.
"Elektro" <email@example.com> wrote in
> What�s the best way to determine the required number of bits necessary
> in a fixed-point IIR-filter? To avoid overflow during calculations.
The number of bits needed in an IIR filter depends on many factors
including the coefficients of the filter, the desired performance of the
filter and the implementation of the filt...bit flipping for fixed point implementation!
Has anyone tried to implement the algorithms presented in the following
I'd be happy to see the code then if possible
...About range estimation for fixed point implementation
I am reading a paper about fixed point implementation. The author has
given an example for input range estimation for multi user detection.
It is said "From the characteristic of the Gold code, we know that the
maximum value of cross-correlation coefficients is the auto
correlation of any particular spreading sequence,i.e., rang R is
R=2x(2^r-1), where the spreading gain is 2^r-1". I can understand the
maximum value part but I don't know how to deduce the range estimation
is 2 x (spreading gain). Is there anybody explain to me? Many thanks.
Zhi <firstname.lastname@example.org> ...Fixed point number hardware implementation
I want to know which is the right way of implementing and usage of
fixed point number data types in hardware(industry standard)..I have
referred various FIR
implementations where they are mostly handling filter coefficients as
integer(truncating from fixed or floating point using MATLAB) or
binary.Is it difficult to handle and implement real(fraction) numbers
coefficients values directly in the hardware?
sample Filter coefficients generated by FDA tool:
fixed point=0.211944580078125 or
16-bit signed integer= 13890 or
fixed point binary =0011011001000010
all t...IIR Filter fixed point DSP
I am trying to design a IIR filter using a 16-bit fixed point DSP. I nee
to calculate the coeff in the form of second order sections. I would lik
to do this with MATLAB. Does anyone have some MATLAB code that will d
this. I found a routine on Texas Instrument site but as well as the coef
it creates some scaling factors for the inputs. I dont want this as I hav
seen other programs such as Filter Express that just give the Coeff.
This message was sent using the Comp.DSP web interface o
OK. You have several kinds of IIR filter, for instance elliptic (the
be...FFT resolution in fixed-point implementation
What is the effect of lowered resolution of intermediate results on an FFT? I
am considering a number of implementation choices for a fixed-point FFT. The
time-series data is inherently 16-bit integers (audio data). I want to do a
8192-point FFT on this data. Because of the need to explicitly handle overflows
(in the butterfly operations) in a fixed-point implementation, it is
convenient to limit the resolution of the intermediate results. There is a
definite tradeoff between speed and how I check for overflow. I am also limited
by the C language. Ideally I would like to multiply two...fixed FFT point implementation woes
I am trying to create a mex file that does fixed point FFT (512
point?). I am generally ok with creating a C code in single precision
to compute the the result and have ensured that it works fine as i get
the correct result. (i read it back and plotted it in matlab.)
the problem comes in when i try to convert it to fixed point. My
input data is 24 bits integer. In addition, I take the sine and cosine
twiddles to also be 24 bits... I do the cos(2*pi*n/N) and sin(2*pi/N)
for n from 0 to 255 the multply the result by ((2^23)-1) and store it
in a look up table.
What i really dun qu...sin/cos implementation in fixed-point
Here's my problem. I converted some code from floating-point to fixed
point. Currently, for sin/cos/tan I'm using the floating point math.h
functions. I have two base formats q.22 and q.28 that I use and play
I was initially using 1024 values sin/cos tables (in q.28 format).
However, I'm finding that this is not giving me good-enough precision.
I'm getting abosolute differences of about 0.004-0.008 between the
floating point sin/cos and the lookup tables. The alogrithm (I'm
using) seems very sensitive and I'd like to achieve an absolute error
of 0.000001 ...Simulink release 14 fixed point toolbox (not the MATLAB fixed point toolbox)
For those of you who have said product on your computer and working
correctly, could you please tell me under what headings the fixed point
blocks appear in the Simulink library browser? I want to be able to tell
tech support exactly what I am supposed to be seeing but am in fact not
seeing. Older versions of MATLAB called the product the "fixed point
blockset" but I want a witness with release 14 because they have obviously
changed the product a bit.
...Goertzel fixed point implementation question
I have found fixed point implementation of Goertzel algorithm in boo
“Real – Time Digital Signal Processing – Implementations an
Applications”. I will paste here a part of code responsible bo
computing recursive path.
void gFilter (short *d, short in, short coef)
d = in >> 7; // Get input with scale down by 7 bit
AC0 = (long) d * coef;
AC0 >>= 14;
AC0 -= d;
d += (short)AC0;
d = d; // Update delay-line buffer
d = d;
Book explains that this operation (AC0 >>= 14) aligns multiplicatio
product to be...What is 'single precision' for in fixed point 'Fixed-Point Basics'?
The text below the dot line is except from Matlab help/Fixed-Point Toolbox. I do not understand the meaning of "single-precision". In the text I cannot relate single-precision to fixed-point in any means.
Could you explain it to me? Thanks
Many textbooks also do roundoff error analysis for "single-precision" fixed-point products and sums with fractional numbers. In this example, we simulate 8-bit unsigned fractional numbers (all values between 0 and 1).
U8 = numerictype('Signed',0,'WordLength',8,'FractionLength',8)
...Floating point to fixed point
Trying to figure out how I can get the output of the ifft
function (floating point) to be converted to a fixed point
representation. For example, the complex pair -0.087335 + -
0.049411i should map to 1111101001111010 (-1414)+
1111110011100111i (-793). I realized it wasn't as simple
as multiplying by 16384
In article <email@example.com>,
Anthony <firstname.lastname@example.org> wrote:
>Trying to figure out how I can get the output of the ifft
>function (floating point) to be converted to a fixed point
>representation. For example, the complex p...Fixing the fix fixes.
Sad. Someday in the distant future, they might get it right. Maybe with
OSXII - but it's doubtful.
...Fixed-point implementation of levinson durbin algorithm
Any links to a fixed point implementation of the Levinson Durbin
algorithm ...something like this:
void levdur(pLpcCoeff, pAutoCorr, pReflec, nOrder)
where pLpcCoeff is a pointer to the lpc coefficients
where pAutoCorr is a pointer to the autocorrelation coefficients
(range -40 to 40)
where pReflec is a pointer to the reflection coefficients
where nOrder is 10
The autocorrelation sequence is a 32bit array where values are in Q15
>Any links to a fixed point implementation of the Levinson Durbin
>algorithm ...something like this:
>void levdur(...multirate implementation on fix point DSP and efficiency
I have a question to try to find a way to improve my processing.
I use a multirate filter with decimation.
There is a decimation by 40. One FIr is used then decimation, and the
IIR with decimation, then a second IIR with decimation, then again one
IIR and decimation and at last one FIr .
I use a fix point DSP. The filter are designed in 16 bits inputs / output
(32 bits for computation).
It appears that the results is that i have in output a 12bits resoutio
and 4 lsb bits are lost during the stages.
How can i improve this?
Should i change the IIR design? or thedecimation?
thank yo...Fixed Point implementation of C exponent function
I tried to google a lot searching for fixed point implementation of
exponent function y = exp(x) (e to the power x) but could not find it.
Also I think there is no post on this group also. I found some CORDIC
implementations but those were in C++. I need lightweight
implementation in C.
I want to use this function in an image processing algorithm to be
implemented on a VLIW-DSP which doesn't have a floating point unit.
I will appreciate in anyone here can suggest a plain C - code which
handles both positive and negative arguments (x<0 and x<=0) ,with