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_biquad() API usage.

Other Parts Discussed in Thread: TMS320C6727

Hi,

This is the chain of mail between me and TI. As per Gagan's request , I'm posting it here. Please give your suggestions...(Note: Please read firm below!)

Sudheendra, optimization flags shouldn’t affect the accuracy. Can you include the source of the filter in your project and see if the output is correct?

Also, can you please post your further queries on Forum? It is better to share the knowledge with the community

 

Cheers,

Gagan

 

--------------------------------------------------------------------------------------------------------------------------------
Subject: FW: DSPF_sp_biquad() API usage.

 

Hi Joe,

I have tried lots combination , finally I found that, if I use the same piece of code in my code itself, it is working as expected. This confirms that logic is working fine But if I use it as a library it is giving the problem. I believe optimization is making the problem. Did you observe this behavior during development. ?

 

_____________

Thanks,

Sudheendra M S 

--------------------------------------------------------------------------------------------------------------------------------
Subject: RE: DSPF_sp_biquad() API usage.

 

Hi Joe,

Thank you for the response.

Yes, There is huge difference in the responses. I can expect a little difference b/n single and double precision because of round of or truncation .

 

My filter is 6 order Band pass filter, using 3 biquad filter, passpannd ranges from 44hz to 56hz (fstop2) .

Lets say for some input signal of 45Hz, double precision gives out put  which is equal to 1 (jus for refer), single precision gives 8(it is 8 times higher). So this is huge.

 

Please refer the below chain of mails, how I’m using single precision filter for 672x plat form. Is the method is correct? Or any discrepancy is there?.

_____________

Thanks,

Sudheendra M S

 --------------------------------------------------------------------------------------------------------------------------------

Subject: RE: DSPF_sp_biquad() API usage.

 

Sudheendra, 

This could be normal, depending on how different your results are.  There should be some difference due to coefficient quantization and round-off error in SP versus DP computation.  Are there differences in frequency response minor, or is there a big difference?

 

Thanks,

Joe

 

 --------------------------------------------------------------------------------------------------------------------------------


Subject: RE: DSPF_sp_biquad() API usage.

 

Hi,

I have doubt in filter We designed the required filter in matlab and we have the coeff which is of type double(matalb gives in double). We have taken this and incorporated in the DSP code. With this coeff, if we use DSPF_sp_biquad()  and DSPF_dp_biquad  (),  we are seeing different frequency response . I’m not getting why this behavior, is there anything  we need to take care here? Please suggest.

_____________

Thanks,

Sudheendra M S

 --------------------------------------------------------------------------------------------------------------------------------

Subject: FW: DSPF_sp_biquad() API usage.

 

Hi Joseph,

We found the Problem in the following method and fixed it. We able to use DSPF_sp_biquad() successfully. If you think below mentioned method is not good and may lead to a problem in  future, please inform us. We will come back if we have any problem once againJ.

 

Thank you very much for the response.

_____________

Thanks,

Sudheendra M S

 --------------------------------------------------------------------------------------------------------------------------------

 

Subject: RE: DSPF_sp_biquad() API usage.

 

Hi Joseph,

 

Thanks for the input. I will try the method you mentioned below.

 

I did some experiment after I mailed you yesterday. Here is the steps I followed. Please let me know if I’m wrong.

 

As suggested, I downloaded the C674x libraries and installed. I could find the one project named ‘dsplib674x.pjt’. I recompiled for C67+ and generated a library ‘dsplib674x_rebuild’. This library I added to the application with header included in the .c file. It compiled successfully(Earlier when I added the original library, it failing because of target mismatch). So DSPF_sp_biquad() function worked without crash and number of cycles required for 128 sample is ~3300 which will results in good time save.

 

But still there is  a problem for me!. Output of filter is not desired one. Output of filter is always less than 0.0099 that means very low value. It is not expected. Here my doubt is, is there any difference b/n DSPF_sp_biquad() and DSPF_dp_biquad() function other than precision related?. Because I retained implementation same but only changed the function name and data type. As far as my understanding from the code of DSPF_sp_biquad() and algorithm mentioned in the document, there is no difference and hence it should work straight away with above change.

_____________

Thanks,

Sudheendra M S

---------------------------------------------------------------------------------------------------------------------------------------- 


Subject: RE: DSPF_sp_biquad() API usage.

 

Sudheendra,

 

I’m sorry that you’ve been having trouble with the DSPF_sp_biquad() function.  I have a few suggestions that may help you get better performance:

 

1.       When rebuilding your application using the biquad C source file, please make sure you are using a release profile (i.e. –o3 and no –g option for the compiler).

2.       If the performance is still unacceptable, please find attached an alternative filter library for C67+.  This library has not been released for general download, but it is used by some other TI software products, such as the C6EZFlo graphical development tool.  You should be able to use any of the APIs listed in the included header file.

 

I hope that this will be helpful to you.  Please let me know if you have any questions about either of the above items.

 

Thanks,

Joe

 

 

----------------------------------------------------------------------------------------------------------------------------------------
Subject: DSPF_sp_biquad() API usage.

 

Hi,

 

Ref:  http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/p/12368/470537.aspx#470537 ,

 

I’m using TMS320C6727 DSP for my time critical application, where I need to apply filter on 128 samples . We want to use DSPF_sp_biquad()  function , but it crashes as number of sample is not a multiple of 6(which is disgusting since DSP mainly deal with 2  power!) and hence currently we are using DSPF_dp_biquad() which requires conversion from ‘float to double’ and ‘double to float’. Here each conversion takes 23cycles which is very huge. We had to drop this now.

 

So as suggest by Rahul(Pls refer the link), I downloaded the C674x libraries and installed. I could find the source file for DSPF_sp_biquad() function , I added the .c file and .h file to c67x project and compiled. It compiled successfully and even when I run it was successful. I mean it is not crashing as earlier. But now the problem is it is taking large number of cycles. Here is the data.

 

For 128 samples- Number of cycles it took was 21742. 

 

It is very much greater than using ‘ DSPF_dp_biquad() with conversions’. I would expect here less than 300cycles. Because DSPF_sp_biquad() function which crashes, I tried with multiple of 6, ie 126 samples, number of cylcle it took was around 1930.

 

I strongly believe I did something wrong.  Please suggest me how I can use DSPF_sp_biquad() with less number of cycles and without crash.

 

Awaiting for the reply

 

Thanks & Regards,

Sudheendra MS