The frequency domain and the periodogram
Today let's understand the frequency domain and the periodogram, using ten weeks of a real restaurant's lunch covers as the running example.
Northside Diner is a lunch restaurant. Every day for ten weeks, seventy days in all, it logged how many covers it served, covers being the restaurant term for parties served a meal. Here is the whole seventy days, in the order they happened.
The line rises and falls, and it does that roughly once a week. That rise and fall is what this lesson is about: not just noticing that a series repeats, but naming the frequency it repeats at, and finding that frequency directly from the data with a tool called a periodogram.
Meet Northside Diner's ten weeks of lunch covers
Before anything else, build that series and look at its numbers directly, since every step from here on works with this same data.
The covers range from 68 on the slowest day to 178 on the busiest, averaging 119.2 a day with a standard deviation of 25.4. That's a lot of day-to-day swing for a restaurant that plans its staff and its prep roughly the same way every week.
Group those seventy days by weekday and average each group, and the swing turns out not to be random at all.
Wednesday is the slowest day, 97.1 covers on average. Friday is the busiest by far, 162.1, with Saturday close behind at 137.7. That's a real, repeating weekly pattern, the same shape week after week, not just a few Fridays that happened to be busy.
Saying "there's a weekly pattern" is a start, but it isn't precise. The next step gives that pattern a name that can actually be measured.