I am trying to calculate the output of a low pass filter using excel. I currently have the specifications of the filter (cutoff frequency of 200 hz, -6 dB/OCT). I am by no means a dsp expert, however I do recall using a spreadsheet way back when I was in undergrad to take an input signal and using a calculation to generate the output signal after the LPF.If I recall it required the calculation of several coefficients (B's I think) and performing an operation on the values of the signal. I vaguely remember their being several spreadsheet examples which were available but I can no longer find them available on the web. If anyone can offer some help regarding this, it would be greatly appreciated. Thank you in advance, Shaun
How to calculate a filter in excel
Started by ●September 28, 2008
Reply by ●September 28, 20082008-09-28
On 28 Sep, 19:26, "skildare" <shaunkild...@hotmail.com> wrote:> I am trying to calculate the output of a low pass filter using excel. I > currently have the specifications of the filter (cutoff frequency of 200 > hz, -6 dB/OCT). > > I am by no means a dsp expert, however I do recall using a spreadsheet way > back when I was in undergrad to take an input signal and using a > calculation to generate the output signal after the LPF.If I recall it > required the calculation of several coefficients (B's I think) and > performing an operation on the values of the signal. > > I vaguely remember their being several spreadsheet examples which were > available but I can no longer find them available on the web. > > If anyone can offer some help regarding this, it would be greatly > appreciated.Unless Excel has a lot of DSP functionality implemented (which I doubt), you might want to look up filter design and filter implementations as such. DSP is nothing more than a sequence of mathematical operations that can be done just as well in Excel as in C or assembler. So if you are willing to implement stuff yourself you might want to look for basis material. If you want canned solutions you might have to look for alternatives to Excel. Scilab and Octave come to mind. Rune
Reply by ●September 28, 20082008-09-28
Rune Allnor wrote:> Unless Excel has a lot of DSP functionality implemented (which I > doubt),Surprisingly enough, the built in math of Excel is quite sophisticated. It calculates Bessels and special functions, operates with matrices, complex numbers and does a lot of other advanced stuff. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by ●September 28, 20082008-09-28
Rune, What I am looking for is exactly what the mathematical operation is I would be doing in excel, for example if my data is in columns A and B, rows 1 through 100 (say A is time and B is the signal), how would I calculate a low pass filter of a certain cutoff frequency. For example, if I recall (and vaguely I admit) I need to go to say timestep 3 and use the values from the original data (Column B) in the previous timestep along with some calculated coefficients to calculate the output (filtered signal) at timestep 3. Maybe that is the "basis" material you were mentioning, that algorithm? Shaun
Reply by ●September 28, 20082008-09-28
On Sep 29, 6:26 am, "skildare" <shaunkild...@hotmail.com> wrote:> I am trying to calculate the output of a low pass filter using excel. I > currently have the specifications of the filter (cutoff frequency of 200 > hz, -6 dB/OCT). > > I am by no means a dsp expert, however I do recall using a spreadsheet way > back when I was in undergrad to take an input signal and using a > calculation to generate the output signal after the LPF.If I recall it > required the calculation of several coefficients (B's I think) and > performing an operation on the values of the signal. > > I vaguely remember their being several spreadsheet examples which were > available but I can no longer find them available on the web. > > If anyone can offer some help regarding this, it would be greatly > appreciated. > > Thank you in advance, > > ShaunYes you certainly could use Excel if you are desperate. I would use Matlab or similar but you don't have to. Hardy
Reply by ●September 28, 20082008-09-28
Vladimir Vassilevsky wrote: (snip)> Surprisingly enough, the built in math of Excel is quite sophisticated. > It calculates Bessels and special functions, operates with matrices, > complex numbers and does a lot of other advanced stuff.and then there are the mistakes. Last I knew, it wouldn't do erf() for negative arguments. No reason at all. Also, it doesn't to the proper weighting for transformed least squares fits. (Not that it is unusual, but in the Excel case you have plenty of memory and it specifically allows for weighting.) -- glen
Reply by ●September 29, 20082008-09-29
skildare wrote:> Rune, > > What I am looking for is exactly what the mathematical operation is I > would be doing in excel, for example if my data is in columns A and > B, rows 1 through 100 (say A is time and B is the signal), how would > I calculate a low pass filter of a certain cutoff frequency. For > example, if I recall (and vaguely I admit) I need to go to say > timestep 3 and use the values from the original data (Column B) in > the previous timestep along with some calculated coefficients to > calculate the output (filtered signal) at timestep 3. > > Maybe that is the "basis" material you were mentioning, that > algorithm? > > ShaunI do it all the time for things like data analysis. A - time of any length B - data of same length as time C - filter unit sample response of length N Dx - output of filter coefficients C17 = +C$9*B17+C$8*B16+C$7*B15+C$6*B14+C$5*B13+C$4*B12+C$3*B11+C$2*B10+C$1*B9 for a length 9 filter It's a little tedious to write for a long filter but that's a way to do it. Or, you can pad C with zeros, FFT both B and C, multiply the results and IFFT the product. Fred
Reply by ●September 29, 20082008-09-29
On Sun, 28 Sep 2008 12:26:07 -0500, "skildare" <shaunkildare@hotmail.com> wrote:>I am trying to calculate the output of a low pass filter using excel. I >currently have the specifications of the filter (cutoff frequency of 200 >hz, -6 dB/OCT). > >I am by no means a dsp expert, however I do recall using a spreadsheet way >back when I was in undergrad to take an input signal and using a >calculation to generate the output signal after the LPF.If I recall it >required the calculation of several coefficients (B's I think) and >performing an operation on the values of the signal. > >I vaguely remember their being several spreadsheet examples which were >available but I can no longer find them available on the web. > >If anyone can offer some help regarding this, it would be greatly >appreciated. > >Thank you in advance, > >ShaunHi Shaun, If you have not yet solved your problem, and you want an Excel spreadsheet that performs convolution (a kind of digital filtering), send me a personal E-mail. I may be able to help you out. [-Rick-]
Reply by ●September 29, 20082008-09-29
On 28 sep, 19:55, Rune Allnor <all...@tele.ntnu.no> wrote:> On 28 Sep, 19:26, "skildare" <shaunkild...@hotmail.com> wrote: > > > I am trying to calculate the output of a low pass filter using excel. I > > currently have the specifications of the filter (cutoff frequency of 200 > > hz, -6 dB/OCT). > > > I am by no means a dsp expert, however I do recall using a spreadsheet way > > back when I was in undergrad to take an input signal and using a > > calculation to generate the output signal after the LPF.If I recall it > > required the calculation of several coefficients (B's I think) and > > performing an operation on the values of the signal. > > > I vaguely remember their being several spreadsheet examples which were > > available but I can no longer find them available on the web. > > > If anyone can offer some help regarding this, it would be greatly > > appreciated. > > Unless Excel has a lot of DSP functionality implemented (which I > doubt), > you might want to look up filter design and filter implementations > as such. DSP is nothing more than a sequence of mathematical > operations > that can be done just as well in Excel as in C or assembler. > > So if you are willing to implement stuff yourself you might want to > look for basis material. If you want canned solutions you might have > to look for alternatives to Excel. Scilab and Octave come to mind. > > RuneSciLab is a good alternative to MatLab. FreeMat, a free version of MatLab, but very limited compared to MatLab, might be interesting too. In our company we are using Python a lot for exploring DSP algorithms and DSP applications which are not time-critical. Together with the open source packages NumPy, SciPy and MatPlotLib. Regards, Harayasu
Reply by ●September 29, 20082008-09-29
On Sep 28, 11:56�pm, "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote:> skildare wrote: > > Rune, > > > What I am looking for is exactly what the mathematical operation is I > > would be doing in excel, for example if my data is in columns A and > > B, rows 1 through 100 (say A is time and B is the signal), how would > > I calculate a low pass filter of a certain cutoff frequency. For > > example, if I recall (and vaguely I admit) I need to go to say > > timestep 3 and use the values from the original data (Column B) in > > the previous timestep along with some calculated coefficients to > > calculate the output (filtered signal) at timestep 3. > > > Maybe that is the "basis" material you were mentioning, that > > algorithm? > > > Shaun > > I do it all the time for things like data analysis. > A - time of any length > B - data of same length as time > C - filter unit sample response of length N > Dx - output of filter coefficients > C17 = > +C$9*B17+C$8*B16+C$7*B15+C$6*B14+C$5*B13+C$4*B12+C$3*B11+C$2*B10+C$1*B9 > for a length 9 filter > It's a little tedious to write for a long filter but that's a way to do it. > > Or, you can pad C with zeros, FFT both B and C, multiply the results and > IFFT the product. > > FredI use this approach all the time too, but find the SUMPRODUCT function is a nice abbreviation (especially for long filters) -- it's just your dot product, which is exactly what you want. - Kenn






