Fourier Series in the K-12 classroom

Admittedly, Fourier analysis goes a bit beyond a high school STEM curriculum, but after pitching it to the teacher as an explanation of how an MP3 player works, he thought it was a great idea.

I recently had the opportunity to travel back to my old high school to give a demonstration about “computational science” as a stand-in for the day’s physics lesson. I do computational science every day for my full time research work, but it’s definitely a humongous field and definitely not something your average high school student will have had much exposure to — and I had to make a talk that high school students found interesting and accessible that also fit within a fifty-five minute lecture period! Feeling a little overwhelmed with possibilities, I devised three criteria that I wanted my talk to meet:

1. It had to be relevant. To keep students engaged, I really wanted to tie my talk to things students already knew. They certainly knew about “programs” in the context of downloading apps and playing games, but I wanted to demonstrate how they themselves can use software to model or analyze an everyday system they may have seen in class.

2. It had to be interactive. I needed to give students a way to jump in and tinker with real honest-to-goodness code (1) to ground me to the students so I could see exactly where they excelled or struggled, (2) to engage the students so they couldn’t (and hopefully didn’t want to!) zone out for another boring class, and (3) so the students could take something home with them to explore later.

3. It had to have cool graphics. It’s one thing to make the machine crunch numbers for you; it’s quite another to make the machine crunch numbers and dump out loads of cool pictures. As any science educator knows, the “Wow!” factor plays a crucial part in building excitement, so I needed to give a demo with a cool visualization that kids could show their friends or parents at the end of the day.

There are tons of physical systems that fit the bill — solving differential equations (waves on a string), generating fractals, any sort of optimization — so I settled on giving the kids a gentle introduction to Fourier series.

Admittedly, Fourier analysis goes a bit beyond a high school STEM curriculum, but after pitching it to the teacher as an explanation of how an MP3 player works, he thought it was a great idea and my “What will I talk about” questions became a whole lot more manageable.

Enter Mathematica

A lot of introductory computational science programs turn to something like Python or Matlab, citing ease-of-use. These platforms have loads of well-developed packages to introduce students to any number of computational domains, but even they fall short when you only have an hour to teach students code and math. Instead I turned to the Wolfram Cloud & Mathematica Online. To give the talk with a language like Python, I would have to explain variables and loops and discretization and…well, you get the point. Mathematica has a lot of that complexity, too, but at first blush you can make your problem look a lot less like the instructions you need to give the machine to do the math for you and a lot more like the math itself — your students will thank you for giving them something familiar to grab on to.

I quickly assembled a couple of explanatory resources to introduce the mathematics of Fourier series and a four-line explanatory notebook (dangling at the end of a Wolfram Cloud URL) and I was off. Here’s what I learned.

A function (blue) and its eight-term harmonic expansion. By making the number of terms an “easy” knob to turn, kids could investigate the convergence rates for different kinds of functions (dis/continuous, smooth, kinked, etc.)

Be patient

I came to realize that everything requires explanation — the things programmers take for granted every day doubly so.

Throughout the notebook I gave to the students, I placed comments with notes and tips about what some code was doing or how to interact with a result. Very quickly after I turned the students loose. I received loads of questions: “What does the grey text do,” “Do I need to enter it,” “How do I run it?” The kids had never seen anything like code commentary before, so they had no idea how to interact with it! Their math homework doesn’t have “comments” or, if it does, they’re very obviously not part of the solution. However, a lot of programming syntax tries to feel like a real sentence (indeed, Mathematica will happily tie into Wolfram Alpha’s natural language parser to try and do what you mean with words).

I came to realize that everything requires explanation — the things programmers take for granted every day doubly so — and that’s okay! We didn’t have a set amount of material to cover in our limited time, so I was happy to slow down and explain these sorts of things, but I definitely had not planned on it at the outset.

Be bold

The kids had never seen things like Fourier series before, but they had a pretty decent understanding of vectors from their physics classes and at least an introduction to integral calculus through their math class.

With the addition of a programming component, you can scaffold a lot of these “basic” tools together into some pretty sophisticated mathematical ideas. Sure, it might be a bit much to ask students to code up an entirely new concept, but by putting together a couple of examples and some leading questions, you’ll have everything you need for some really great exploratory activities.

Be amazed

I honestly had no idea how far the students would get with the actual Fourier activity. I was fully ready to bail and talk about print statements all day, if that’s what they wanted, but they totally rocked it. Everybody completed the exercise and the handful of students with a heavier computer background literally jumped out of their chairs to help me out — something I greatly appreciated with the time constraint! Several students asked me if they could continue using their notebook to try and work through some of their math problems (I happily said yes!) and I overheard several others excitedly talking about how they could extend their investigation.

Without the pressure of meeting a deadline or assigning homework, students really felt free to explore what they found interesting. Give them that freedom and I’m sure they’ll blow you away with their enthusiasm!

Discussion questions

• How many harmonics (sines) do you need for a “good” representation if the function is smooth? If it’s discontinuous? What happens near a discontinuity?

• What do you see if you plot g(x) (your favorite “simple” function) from 1 x 2? What do you think happens to the coefficients for aperiodic expansions?

• How can we use what we’ve done here — expanding in harmonic functions — to store and compress audio?

• Define v = 1 and

and plot for 0≤ x ≤ 1 and several values of t where ∆t v. This works best for a tall, narrow function near one edge of the box. What does the resulting motion look like?

About the blogger:

Connor Glosser

Connor Glosser earned his B.S and M.S. degrees in physics at Michigan State University and is currently working to develop a simulation of interacting quantum dots for his Ph.D work at the same institution. He also serves as a Wolfram Student Ambassador to showcase Wolfram technologies at and around the MSU campus. When not working, Connor often relaxes with a long bike ride, board games with friends, or by musing over the latest news in tech and software with his geeky friends. Reach him on Twitter with his handle @RoguePhysicist

--

--

Tech-Based Teaching Editor
Tech-Based Teaching: Computational Thinking in the Classroom

Tech-Based Teaching is all about computational thinking, edtech, and the ways that tech enriches learning. Want to contribute? Reach out to edutech@wolfram.com.