I put a demo in Source and had some posts in Programming, but have a question that maybe will get better exposure here. My filter is a weighted moving average filter implemented with a loop through an array. The intent is to use it with wav files. Two questions-

1) Did it make sense to do this with indexed pointers like I did?

2) Can anybody show this mathphobe how it can be done using MAT, assuming that's a reasonable way to go about it?

example filter-

Thanks!

1) Did it make sense to do this with indexed pointers like I did?

2) Can anybody show this mathphobe how it can be done using MAT, assuming that's a reasonable way to go about it?

example filter-

Code:

SUB SG_Smooth15(nSamples AS LONG, dLen1 AS LONG) 'Savitzky-Golay filter, # of points = 15 LOCAL i AS LONG FOR i = 7 TO nSamples - 7 @sData[i] = (-78 * @pData[i - 7] -13 * @pData[i - 6] + 42 * @pData[i - 5] + 87 * @pData[i - 4] _ + 122 * @pData[i - 3] + 147 * @pData[i - 2] + 162 * @pData[i - 1] + 167 * @pData[i] _ + 162 * @pData[i + 1] + 147 * @pData[i + 2] + 122 * @pData[i + 3] + 87 * @pData[i + 4] _ + 42 * @pData[i + 5] - 13 * @pData[i + 6] -78 * @pData[i + 7]) / 1105 NEXT MEMORY COPY sData, pData, dLen1 'copy filtered data to reference array for next run END SUB

## Comment