# Connexions

You are here: Home » Content » Matrix Implementation

### Recently Viewed

This feature requires Javascript to be enabled.

# Matrix Implementation

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 implementation for 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 y 1 y N = b 0 x 1 x N + w 1 1 w N 1
(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 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
(2)

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 O3 compiler 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 proposed procedure. 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.

## Content actions

PDF | EPUB (?)

### What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks