<< Chapter < Page Chapter >> Page >

Handling multiple channels of data at once naturally yearns for an implementation utilizing matrix operations. While filtering one channel is a purely serial process, we can attempt to compute every channel's filtered output and the intermediate filter terms for a Direct Form-II implementationfor the next output in the following two matrix operations.

y 1 y N = b 0 x 1 x N + w 1 1 w N 1
b 1 1 - a 1 1 w 1 1 b N 1 - a N 1 w N 1 b 1 2 - a 1 2 w 1 2 b N 2 - a N 2 w N 2 b 1 3 - a 1 3 w 1 3 b N 3 - a N 3 w N 3 b 1 4 - a 1 4 w 1 4 b N 4 - a N 4 w N 4 x 1 y 1 1 x N y N 1 = w ^ 1 1 w ^ 1 2 w ^ 1 3 w ^ 1 4 w ^ N 1 w ^ N 2 w ^ N 3 w ^ N 4

We implemented the above operations using the Basic Linear Algebra Subprograms (BLAS) Fortran Library due to its reputation as a very fast and stable linear albegra library.While the operations are simple mathematically, the filter implementation was the slowest taking almost 10 minutes to filter 60 million samples. The matrices and vectors are very large so they are not stored in cache resulting in the slow down. Additionally, the SSE3 intrinsics and O3compiler optimizations are rendered useless when using the Fortran library.

Here, the matrix operations should be outsourced to the GPU which is optimized for this very action. The GPU is responsible for rendering graphics which regularly involves updating many polyhedrons that really are just matrix operations at the core. However, the GPU would not directly follow the proposedprocedure. Instead, the GPU would hand off segments of the matrices to be multiplied to its shaders (modern GPU's have thousands of shaders). Each shader then tackles a very small number of multiplies and adds. This divide and conquer strategy is very fast but requires some involved programming.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Efficient real-time filter design for recording multichannel neural activity. OpenStax CNX. Dec 11, 2012 Download for free at http://cnx.org/content/col11461/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Efficient real-time filter design for recording multichannel neural activity' conversation and receive update notifications?

Ask