Simulating Sawtooth Wave in Excel: Tips & Tricks

  • Thread starter BiGyElLoWhAt
  • Start date
  • Tags
    Excel
In summary, you need to sum a good amount of frequencies for each point and you need A LOT of points to demonstrate its "sawtoothiness"; also you seem to have misplaced your file.
  • #1
BiGyElLoWhAt
Gold Member
1,622
131
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.
 
Physics news on Phys.org
  • #2
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.
 
  • Like
Likes 1 person
  • #3
LCKurtz said:
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.

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

LCKurtz said:
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.

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

1. How can I create a sawtooth wave in Excel?

To create a sawtooth wave in Excel, you can use the SLOPE function to generate a series of sequential numbers, and then use the MOD function to create a repeating pattern. You can then plot these values on a graph to visualize the sawtooth wave.

2. Can I adjust the frequency and amplitude of the sawtooth wave in Excel?

Yes, you can adjust the frequency and amplitude of the sawtooth wave by changing the input values for the SLOPE and MOD functions. Increasing the slope value will increase the frequency, while increasing the modulus value will increase the amplitude.

3. Is it possible to create a continuous sawtooth wave in Excel?

Yes, you can create a continuous sawtooth wave in Excel by using the REPT function to repeat the MOD function formula over a large range of cells. This will create a longer and smoother sawtooth wave.

4. Can I add additional features to my Excel sawtooth wave, such as a horizontal axis?

Yes, you can add additional features to your Excel sawtooth wave graph by customizing the chart options. You can add a horizontal axis, change the scale, and add labels and titles to make your graph more visually appealing.

5. Is there a faster way to create a sawtooth wave in Excel?

Yes, instead of using the SLOPE and MOD functions, you can use the TREND function to create a linear series of numbers and then use the IF function to modify the values based on the sawtooth wave pattern. This method may be faster and more efficient for larger datasets.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
974
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
703
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
869
  • Biology and Medical
Replies
6
Views
382
  • Calculus and Beyond Homework Help
Replies
3
Views
248
  • Computing and Technology
Replies
1
Views
948
  • Engineering and Comp Sci Homework Help
Replies
18
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
Back
Top