Simulating Sawtooth Wave in Excel: Tips & Tricks

  • Thread starter Thread starter BiGyElLoWhAt
  • Start date Start date
  • Tags Tags
    Excel
Click For Summary
SUMMARY

This discussion focuses on simulating a sawtooth wave using Excel, specifically through the application of Fourier series. The user successfully created a sawtooth wave graph by summing multiple frequencies but faced challenges with the low pass filter and the tedious process of entering formulas. A solution was proposed to simplify the formula entry by using Excel's column function, allowing users to copy formulas across both rows and columns efficiently, thus reducing the need for repetitive manual input.

PREREQUISITES
  • Understanding of Fourier series and their application in wave simulation
  • Familiarity with Excel functions, particularly SIN and PI
  • Basic knowledge of Excel's formula copying techniques
  • Experience with graphing in Excel to visualize waveforms
NEXT STEPS
  • Research Excel's array formulas for more efficient calculations
  • Learn about advanced graphing techniques in Excel for better waveform visualization
  • Explore low pass filter implementations in Excel for signal processing
  • Study the half-range cosine function and its effects on Fourier series approximations
USEFUL FOR

Mathematicians, engineers, data analysts, and anyone interested in signal processing or waveform simulation using Excel.

BiGyElLoWhAt
Gold Member
Messages
1,637
Reaction score
138
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
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
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 =]
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
2
Views
11K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 27 ·
Replies
27
Views
5K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 1 ·
Replies
1
Views
1K