Reply by Jon Harris August 15, 20052005-08-15
"mariya" <angelique1@jippii.fi> wrote in message 
news:wOqdnY01yLwmSp3eRVn-gg@giganews.com...
> >>Integer probably won't do. You almost certainly need to deal with >>fractions. You will likely have to deal with fixed point, which requires > >>adjusting (shifting) the results of multiplications when using integer >>multipliers. Maybe you can find a C++ fixed-point math class. That's one > >>more thing to understand, so for now it is probably simpler to work in >>float if you can afford the time. >> >>Jerry > > ************************************************************* > > Definitely it would be much easier to stick with the float type but my big > concern is that this filtering involves a convolution with an ADC input of > type unsigned int, i have tried in some ways to convert them and i get the > truncation error... I am affraid i cannot use the c++ fixed-point class as > i am not familier with this language!! > thanx!
Why not just convert to ADC data to float?
Reply by Jerry Avins August 15, 20052005-08-15
Rune Allnor wrote:

   ...

> Divide and concer!
If that's about cells, it probably should be "divide and cancer." Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Bhaskar Thiagarajan August 15, 20052005-08-15
"Rune Allnor" <allnor@tele.ntnu.no> wrote in message
news:1124139431.418779.300590@f14g2000cwb.googlegroups.com...
> > mariya skrev: > > thanx again, i will try to work out all these and see where it leads! By > > the way what do u mean by "ofgf-line float algorithms"? > > > > >Divide and concer! // did u mean divide and convert?? > > Nope, it was supposed to be "divide and conquer" (just hope > it got write know... ;)
Sometimes these smelling pistakes can be a pine ;-) Cheers Bhaskar
> Thanks, Bhaskar, for correcting my blunders! > > Rune >
Reply by Rune Allnor August 15, 20052005-08-15
mariya skrev:
> thanx again, i will try to work out all these and see where it leads! By > the way what do u mean by "ofgf-line float algorithms"? > > >Divide and concer! // did u mean divide and convert??
Nope, it was supposed to be "divide and conquer" (just hope it got write know... ;) Thanks, Bhaskar, for correcting my blunders! Rune
Reply by Jerry Avins August 15, 20052005-08-15
mariya wrote:
>>Integer probably won't do. You almost certainly need to deal with >>fractions. You will likely have to deal with fixed point, which requires > > >>adjusting (shifting) the results of multiplications when using integer >>multipliers. Maybe you can find a C++ fixed-point math class. That's one > > >>more thing to understand, so for now it is probably simpler to work in >>float if you can afford the time. >> >>Jerry > > > ************************************************************* > > Definitely it would be much easier to stick with the float type but my big > concern is that this filtering involves a convolution with an ADC input of > type unsigned int, i have tried in some ways to convert them and i get the > truncation error... I am affraid i cannot use the c++ fixed-point class as > i am not familier with this language!!
I don't know C++ either. In C, I would cast the ADC values to float, do all calculations including dither (if that's part of the plan.) By scaling so that rounding to integer makes sizes the output to be suitable for the DAC, the job is done. Jerry Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Bhaskar Thiagarajan August 15, 20052005-08-15
"mariya" <angelique1@jippii.fi> wrote in message
news:zq6dnf2_3b8MdZ3eRVn-sw@giganews.com...
> thanx again, i will try to work out all these and see where it leads! By > the way what do u mean by "ofgf-line float algorithms"?
That was a typo - should've been "off-line float algorithms" and by this he means that you should get your FIR filter working using floating point data that you generate/synthesize instead of using data from a real A/D. This will let you focus on the FIR algorithm instead of the data types. Get it to work using known float data and then you can modify it for limited precision data from an A/D. Cheers Bhaskar
> > >Divide and concer! // did u mean divide and convert?? > > > >Rune > > ************************************************************** > >The numerical formats seem to be additional problems to the > >basic FIR filter algorithm. I wouyld suggest you start out > >with an ofgf-line float algorithms, so that you can check that > >the filter works and you understand the basics. > > > >Next, convert to whatever numerical format else than float, > >and see that it works. Only then, start messing with real-time > >ADCs and the likes. > > > >Divide and concer! > > > >Rune > > > > > > > > This message was sent using the Comp.DSP web interface on > www.DSPRelated.com
Reply by mariya August 15, 20052005-08-15
thanx again, i will try to work out all these and see where it leads! By
the way what do u mean by "ofgf-line float algorithms"?

>Divide and concer! // did u mean divide and convert?? > >Rune
**************************************************************
>The numerical formats seem to be additional problems to the >basic FIR filter algorithm. I wouyld suggest you start out >with an ofgf-line float algorithms, so that you can check that >the filter works and you understand the basics. > >Next, convert to whatever numerical format else than float, >and see that it works. Only then, start messing with real-time >ADCs and the likes. > >Divide and concer! > >Rune > >
This message was sent using the Comp.DSP web interface on www.DSPRelated.com
Reply by Rune Allnor August 15, 20052005-08-15
mariya skrev:
> >Integer probably won't do. You almost certainly need to deal with > >fractions. You will likely have to deal with fixed point, which requires > > >adjusting (shifting) the results of multiplications when using integer > >multipliers. Maybe you can find a C++ fixed-point math class. That's one > > >more thing to understand, so for now it is probably simpler to work in > >float if you can afford the time. > > > >Jerry > > ************************************************************* > > Definitely it would be much easier to stick with the float type but my big > concern is that this filtering involves a convolution with an ADC input of > type unsigned int, i have tried in some ways to convert them and i get the > truncation error... I am affraid i cannot use the c++ fixed-point class as > i am not familier with this language!! > thanx!
The numerical formats seem to be additional problems to the basic FIR filter algorithm. I wouyld suggest you start out with an ofgf-line float algorithms, so that you can check that the filter works and you understand the basics. Next, convert to whatever numerical format else than float, and see that it works. Only then, start messing with real-time ADCs and the likes. Divide and concer! Rune
Reply by mariya August 15, 20052005-08-15
>Integer probably won't do. You almost certainly need to deal with >fractions. You will likely have to deal with fixed point, which requires
>adjusting (shifting) the results of multiplications when using integer >multipliers. Maybe you can find a C++ fixed-point math class. That's one
>more thing to understand, so for now it is probably simpler to work in >float if you can afford the time. > >Jerry
************************************************************* Definitely it would be much easier to stick with the float type but my big concern is that this filtering involves a convolution with an ADC input of type unsigned int, i have tried in some ways to convert them and i get the truncation error... I am affraid i cannot use the c++ fixed-point class as i am not familier with this language!! thanx! This message was sent using the Comp.DSP web interface on www.DSPRelated.com
Reply by Jerry Avins August 15, 20052005-08-15
mariya wrote:
> Hello > > Thanks a lot for your reply, as matter of fact when i was trying to > implement the FIR filter algorithm it became harder than i thought. The > filters coeff. are float and it has been also a problem to get them > converted to integer, do u think there is a better way to convert these > filters coefficients to integer. I will implement this filter using C > language, so if i remember well when we allocate memory using c , we use > malloc is that correct of course i will certainly have a look on those in > my C programming book! > thanks again!
Integer probably won't do. You almost certainly need to deal with fractions. You will likely have to deal with fixed point, which requires adjusting (shifting) the results of multiplications when using integer multipliers. Maybe you can find a C++ fixed-point math class. That's one more thing to understand, so for now it is probably simpler to work in float if you can afford the time. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;