This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320C5535: 32 Bit Filters

Part Number: TMS320C5535
Other Parts Discussed in Thread: ADS1299

Tool/software: Code Composer Studio

Hi,

Looking at TMS320C55x DSP Library Programmer’s Reference, it's not clear to me this piece of info: Are there 32 bit filters? I want to use the C5535 with the ADS1299 and I want to use two filters, a notch and a butterworth filter, but all of the IIR filter routines show DATA as the input. How can I use IIR filters with this DSP?

Thanks,

Luis

  • Hi Luis,

    I've notified the software team. Their feedback will be posted here.

    Best Regards,
    Yordan
  • Luis,
    Please see e2e.ti.com/.../309799
    Also, have you checked out the DSPLIB package for C55x? there are a bunch of various filters in the package. http://www.ti.com/tool/sprc100

    Lali
  • Hi there,

    We've been working with these filters and the bit quantity issue is not an issue anymore. Right now, we're trying to get some filters working but, at the moment, we still haven't figured it out. Our problem now is with coefficient scaling or sample scaling. We have the following code:

    /******************** IIR FILTER **********************************************/
     
        for (i = 0; i < NX; i++) {
            xaux[i] = (x50hz[i] / (1024 ));
        }
     
        errorcode = fltoq15(xaux, xaux1, NX);
     
        for (j = 0; j < NX; j++) {
            haux[j] = (h5[j] / 2);
        }
     
        errorcode2 = fltoq15(haux, haux1, 5);
        q15tofl(haux1, haux2, 5);
     
     
        // clear
        for (j = 0; j < NX; j++)
            r[j] = 0;                     // clear output buffer (optional)
     
        for (i = 0; i < (2 * NBIQ) + 1; i++)
            dbuffer[i] = 0;  // clear delay buffer (a must)
     
        // compute
          success = iircas5(xaux1, haux1, r, dp, NBIQ, NX);

    Both xaux1 and haux1 are values between +1 and -1, which shouldn't raise any problems, but the filter is overflowing. Our input is a 50hz sine wave with amplitude between 1024 and -1024 and the first for scales it down to 1/-1. The coefficients were calculated using matlab and are values between -2 and 2, which are a problem. In this implementation we decided to just divide them by 2, being fully aware that's not the right way to do it. Still, the iircas5 overflows.

    The iircas5 routine only stops overflowing when we change the first for to:

     for (i = 0; i < NX; i++) {
            xaux[i] = (x50hz[i] / (1024*128 ));
     }

    So, my question is: how can we solve this ? Since the coefficients and data are both in the +1/-1 range, shouldn't that avoid overflowing? If not, how can we scale the coefficients in order to stop overflowing the filter?

    Thanks