Saw tooth in excel

1. Jul 24, 2014

BiGyElLoWhAt

I hope this is the right place for this question.

I had to do a fourier series for a sawtooth wave f(t) = t from 0-1 and simulate it in excel, and put it through a low pass filter, also done in excel.

I've been having problems with the filter, but that's beside the point.

I have the fourier series done; once I made the spreadsheet and had a perfect sawtooth wave when I graphed my points. The problem is this: in order to get something I would consider a good sawtooth wave, you need to sum a good amount of frequencies for each point and you need A LOT of points to demonstrate its "sawtoothiness"; also I seem to have misplaced my file.

Is there a faster way to do this in excel other than plugging a bunch of functions into each cell and then dragging them down 100 or so terms? I believe in my original I went somewhere near BZ 150 square (with some graphs of course). I really don't want to have to type 100~ formula's again.

Some sample codes:

My t values
=ROW()/50 - 0.02 (C column)

my fourier transform results
=-SIN(2*ROW()*PI()*($C$2))/(ROW()*PI())
where row*pi is n*pi from my fourier series results (and this is dragged out a lot of columns)

and I guess that's about it, but I need to go through and amend that formula around 100 times to go from C2 to C* (again, my t values), 1 for each column out a lot of terms.

Is there a way to increment things via columns? I'm already using my row's for n values.

2. Jul 26, 2014

LCKurtz

You should be able to get at least a crude approximation with just 10 terms of the FS. Your graph will look better if you use the half range cosine but never mind that. Using your formulas you can still do it.

You only have to write the formula once and you can copy it both down and across. I took your example with the following cells:

A1 through A10 are then numbers n = 1 to 10.

In the cells A14 to T14 I put =(column()-1)/20 to space t values from 0 to .95.

In B1 put this formula and copy it from B1 to T10

=-(2*(-1)^$A1/($A1*PI()))*SIN($A1*PI()*A$14)

In row 12 sum the columns from B to T. These sums give the values of the first ten terms of the FS for your 20 points. When you plot them you will see a rough approximation to f(x) = x.

3. Jul 27, 2014

BiGyElLoWhAt

Awesome, In my google searching I never came across that column function. It seems to act exaclty how I need it to.

Hey thanks again LC, I'll give it a shot here and post back if I'm not getting what I'm looking for =]