Thank You for you time and reading this post.
We are using C6727B DSP Processor with DSP/BIOS Os.
We are looking for 60 Hz Notch Filter alogrithm and baseline wander filter algorithm.
I had seen the following URL and downloaded DSPLIB from here: http://processors.wiki.ti.com/index.php/Software_libraries
Can someone please point me to the library where I can find the 60 Hz notch filter algorithm and baseline wander filter algorithm?
or else these libraries are not available directly from TI? Do we have to write on our own using the existing libraries?
Thank You & Regards,
I’m not sure of whether a notch or wander filter implementation is available. However, you might want to look at our medical imaging software toolkit which has a wall filter implementation on c64x+ and c66x. You can download it from http://www.ti.com/tool/s2meddus and could use it as a reference.
Perhaps someone from the single core team can provide some further information.
--- If you need more help, please reply. If this answers your question, please Verify Answer below this post ---
We do not have a ready to use notch filter implementation in our C6000 DSP software libraries but there is source code for notch filters in the ECG kit on C5515 low power DSP that can be ported on C6000 DSPs. You can find this source code archived on the following url:
Download the package ADS1298 ECG MDK mentioned under C5515. The 60 Hz Notch filter co-efficients can be found in the file ECG_Filter_Co-efficients.c. The data filtering process is implemented in C55x assembly but appears to simple convolution of fir filter coefficients with the input data. You can find optimized implmentation for FIR filter of order in the c674x DSPLIB. The C55x ECG kit implements a notch filter of order 531 so you may need to pad some zeros to make it work with the FIR implementation in DSPLIB. I did not find the baseline wander filter in that package but I will check internally if I can find that for you.
---------------------------------------------------------------------------------Please click the Verify Answer button on this post if it answers your question.---------------------------------------------------------------------------------
On the same url that I shared, you can download the MDK_Stethoscope_C5515EVM package. In that package. You can find a simple implementation of a baseline wander filter using moving average FIR filter in that package.
Look for the filter implementation under the path MDK_Stethoscope_C5515EVM\StethSystem_v_0_12\projects\STETHSystem\src. Let us know if this suffices your requirements?
Thanks for the reply.
While looking at the src folder we see one function FIR_PROCESSING.
Is this function responsible for baseline wander filtering?
The FIR_PROCESSING function is a general function written in the application to convolve any FIR filter co-efficients with the input data. However the baseline wander filter implemented in the application is a Simple moving average(SMA) implementation which only requires computing the average of neighborhood samples of the input. If you look for average filter in the source files, you will see the details of the 5th order moving average filter, where the sum of the neighborhood pixels is computed after applying the bandpass filter. The functionality is controlled by the muteflag in the application.
Thanks for your suggestion. I will look for baseline wander filter as per your instructions.
We have used a sample file to validate the notch filter algorithm. We have attached some files for reference.
The description of the attachments is filter.c which contains the source code being used to port from ADS1298 to C6727B processor.
One question regarding the ECG_ProcessCurrSample function which is present in filter.c file.
The size of the workingbuff array is 8 * 351 * 2. But, in the ECG_ProcessCurrSample function it is cleared for 8 * 351 times only. Do you suggest that the entire workingbuff array shall be cleared?
Is it mandatory to provide Int16 format to the function ECG_ProcessCurrSample or else can we supply a unsigned int values also?
If you have any sample input file and output file can you share with us for validating the Notch filter?
Thanks for your time and the reply.
We have ported the ECG_ProcessCurrSample to C6727B Processor.
We observed two initialization issues
I have modified the code to initialize entire WorkingBuff array to zero and acc in ECG_FilterProcess_C function also set to zero.
Can you please confirm if these changes are requried or not?
ECG_ProcessCurrSample is expecting a Signed 16-Bit data, can we provide a unsigned 16-Bit data to it or else is it mandatory to supply the 16-Bit Signed only?
The Input file that we have used I am attachign here with the name 402S_1Ch_Data.h and the filtered output data is available in 2012_may_30_filterout_012.h. Filter.c contains the source code being ported to C6727B Processor. The file 402S_1Ch_Data.h contains the data in the form of single channel, 0 – 200 Hz data file. The data is at 1 kHz sample rate.
any suggestions or inputs?
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.