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.

DSPF_sp_fircirc Function

Other Parts Discussed in Thread: TMS320VC33

I wanted to inquire more about this function.

I worked with a TMS320VC33 processor in the past and assembly coded an FIR filter which spit out one point at a time, it was done during an ISR and was basically real time.  Is it intended that this function is not a real time type of function, but will take a batch of samples process them at one shot within the algorithm and spit an output array of filtered data to the size you wish?

For example, if I take and store 1000 samples of a waveform and have a 200 Coefficients, I can implement the function and recieve a filtered waveform of 100 output points.

and I would call the function as follows: DSPF_sp_fircirc(*x, *h, *r, 0, 1000, 200, 100)

where *x is the pointer to the input waveform of 1000 samples,

*h is the pointer to COEFs,

*r is the pointer to the filtered output points,

0 is index starting from sample 1(0),

1000 is circular buffer size of x the input

200 is the # of COEFs,

and 100 is how many filtered output samples I want?

Also, must you handle the Circular addressing bits in the AMR or is this done automatically within the routine?

  • dan kantorski said:

    I wanted to inquire more about this function.

    I worked with a TMS320VC33 processor in the past and assembly coded an FIR filter which spit out one point at a time, it was done during an ISR and was basically real time.  Is it intended that this function is not a real time type of function, but will take a batch of samples process them at one shot within the algorithm and spit an output array of filtered data to the size you wish?

    I think you're using the wrong terms.  What you are describing is "sample by sample processing" compared to "block processing".  Those are independent of real-time (whether the processing can keep up with the inputs).

    There are significant advantages to block processing:

    • Interrupt overhead gets spread across the entire block making you more efficient.
    • Devices with deeper pipelines (like c6000) can be much more efficient when processing a block of data

    The "downside" to block processing is latency.  In a double-buffered system your latency will be 2*buff_size.  So in general I recommend people to use block processing and ot choose their buffer size so as to satisfy the latency criteria.  Occassionally that can be buff_size=1 (sample by sample) but the majority of the time people can tolerate much more latency.  FYI, if you can buffer 8 or 16 samples you will get significantly increased performance on c6000 compared to sample by sample.

    dan kantorski said:

    For example, if I take and store 1000 samples of a waveform and have a 200 Coefficients, I can implement the function and recieve a filtered waveform of 100 output points.

    and I would call the function as follows: DSPF_sp_fircirc(*x, *h, *r, 0, 1000, 200, 100)

    where *x is the pointer to the input waveform of 1000 samples,

    *h is the pointer to COEFs,

    *r is the pointer to the filtered output points,

    0 is index starting from sample 1(0),

    1000 is circular buffer size of x the input

    200 is the # of COEFs,

    and 100 is how many filtered output samples I want?

    Also, must you handle the Circular addressing bits in the AMR or is this done automatically within the routine?

    You don't have all of your arguments correct.  Please see the DSPLIB documentation spru657.  In particular csize should be between 2 and 31 resulting in a circular buffer size of 2^(csize+1), i.e. your circular buffer also needs to have a size which is a power of 2 and it must be aligned to the corresponding bit boundary.

    Brad

  • So this is block processing - I can deal with the latency.  My final application is not a real time situation.

    I think I understand the CSIZE variable, but a couple of questions:

    I started defining the input samples or the circular buffer as so:

                .bss    _FIR_IN,4000,0x2000       
                .global _FIR_IN

    Does the input array need to completely fill the (csize+1) limits of the buffer, meaning if I want to process 1000 points, I should actually process 1024 points and fill a csize boundry like 1024, then choosing csize=9 and define my data space like this:

                .bss    _FIR_IN,4096,0x1000       
                .global _FIR_IN

     

  • Since it's circular it will need to fill the whole thing or else the wrap-around will be on invalid data.