have searched high and low for a practical guide to implement a simple 50Hz low pass filter on a signal.I understand the theory but its the practical but that's missing. If I was using MATLAB it would be trivial because there are so many examples but I am coding this by code.
This is where I am at:
1: I have a series of 8192 bytes sampled at 1000Hz in an array (0-256)
2: I have generated the frequency domain representation of a simple step filter in a symmetric array (+/-F, Ire, Iim) :
0,1,0 0.1220703125,1,0 0.244140625,1,0 0.3662109375,1,0 0.48828125,1,0 0.6103515625,1,0 ..... -0.6103515625,1,0 -0.48828125,1,0 -0.3662109375,1,0 -0.244140625,1,0 -0.1220703125,1,0
3: I have used Inverse FFT of the filter to obtain the time representations of the filter as (t, Ire, Iim) [as expected the im parts are ~0 and the filter gives the expected decaying ringing]:
0.000,819,0 0.001,805.600848087199,4.11892742135933E-12 0.002,766.191083986647,7.80009390410896E-12 0.003,703.07869137741,1.07704956064936E-11 0.004,619.930866652693,1.26768595620774E-11 0.005,521.519198753447,1.32877042702262E-11 0.006,413.390428478234,1.26576527037514E-11 0.007,301.48763797423,1.08400510789863E-11 8,0.008,191.750273447113,7.79765141345479E-12 .... 8.186,413.390428478235,7.79385628257856E-09 8.187,521.519198753448,9.84392145575441E-09 8.188,619.930866652693,1.17116023545805E-08 8.189,703.07869137741,1.32913150485692E-08 8.19,766.191083986645,1.44921696865197E-08 8.191,805.600848087196,1.52439926792702E-08
OK so what do I do with this data???
From what I have read in the literature the thoery is that in the freq domain you multiply the spectra but because this is the DFT the usual course is to convolve in the time domain but the question remains:
1: Do I simply multiply the two time series together (doesn't feel right)?
2: If not how is the weighting applied?
3: How do I normalise any output back to 0-256 values?
I realise this is a pretty basic question but there doesn't seem to be a really basic answer or example out there :-(