Transcript
Introduction to the Fourier Transform
Hello, everyone, and welcome to today’s white paper webinar. Today we have an interesting topic. We’re gonna talk about the Fourier transform and the time domain and the frequency domain, and this is a unique way of thinking about what the Fourier transform means. This is more of a geometric understanding of what’s happening when we do a Fourier transform.
It’s useful to understand what the Fourier transform is because understanding the frequency content of a signal can be very helpful in more advanced power quality analysis where we care about more than what’s happening at 60 hertz.
Wrapping a Function Around the Unit Circle
I wrote this paper to try to explain a geometric intuition behind how the Fourier transform is defined. This is an online graphing calculator. It’s called Desmos. Right here I have 10 cycles of a periodic function defined, and what I’m gonna do is I’m gonna wrap it around the unit circle.
The W right here is the wrapping frequency. This W number corresponds to how fast I’m wrapping this function around the unit circle. So if I change this to, let’s say, W equals 0.05, what I’m doing is I’m wrapping all 10 cycles of the function around the unit circle. And I’m also graphing this center point, an average point of all the points wrapped around the unit circle.
In the paper, that’s what I’m talking about when I’m saying wrapping around the unit circle. Taking a point T, F of T, and I’m mapping it to polar coordinates with radius given by R equals F of T and angle is given by theta is two pi omega radians, or two pi W, T radians. And then we start at theta equals zero on the positive X-axis, and then we just wrap it clockwise around the unit circle.
Constructive and Destructive Alignment
There are some particularly interesting points that happen. If I do W equals one, all of the peaks and valleys line up in such a way that the average point is pulled away from the origin. The peaks and the valleys line up constructively causing this average point to be pulled away from the origin, and that is indicative that there is this one hertz frequency content in the original signal. If there wasn’t any one hertz content, this average point would be very close to the origin.
So for example, if I make it W equals 1.5, now you see how there is no one and a half hertz content. The average point is exactly at the origin. All the peaks and valleys line up destructively in such a way that there’s no signal content remaining.
Different Values of W
In the paper, I’ve graphed five different plots of these at different values of W. This is W equals 0.02, so it’s just barely getting started. This is 0.05 where 10 periods of the circle are wrapped in such a way that all 10 periods line up one time around the circle. So that’s 10 cycles equals one wrap around the circle. I’ve got 0.5, and then I’ve also offset it a little bit so you can see all the cycles actually line up together. And then I’ve got W equals one and W equals two.
Plotting the Radius as a Function of W
Figure seven here in the paper describes plotting this radius, the distance this point is away from the origin as a function of W. So if I have W equals zero all the way up to W equals five. That is exactly what I’m plotting, this R value here, which is the distance that this is away from the origin.
You can see that at W equals zero we have a large spike. At W equals one we have a large spike. At W equals two, at two and a half, and at three we have large spikes. So that is indicative that we have a zero hertz DC offset, which we can easily see if we look at our function. If we turn on our original function, we can see that there is indeed a zero hertz DC offset because this is not centered at zero, this is centered at one, and so that’s what this spike is picking up.
We can see that if we do W equals 0.01, we’re just barely getting started wrapping, and we have a very large DC offset, and that’s indicated by this point being very, very far away from the origin, and that’s indicated in this spike on the graph.
Effects of a Finite Interval
Notice all of these little ripples here inside the graph. That’s a result of having a finite interval. I’m only defining this function from T equals zero to T equals 20. Outside of this region, it’s defined as zero. These intermediate spikes are a result of just having a finite interval. If you had a longer time interval, these spikes are shorter, it would be more clumped together. So they’d have less an effect with a larger time interval. If you have a smaller time interval, then these spikes get larger and more pronounced.
Verifying the Graph
Now I’m going to set W equals to one, and this should pull out this spike in the graph. I have my radius of this point away from the origin is 0.25, and we can come over to the graph here and see that it is on the 0.25 at your wrapping frequency of one hertz.
If we go to 1.5, you see there’s no dramatic spike right here, so we should expect very little radius at W equals 1.5. And we see exactly that. At W equals 1.5, we see a very, very small radius of this average point away from the origin, and correspondingly we see a very, very small spike at 1.5.
And now if I go to W equals two, we should see another spike again corresponding to this spike here in the graph, and that should be 0.125, and we see that’s exactly what it is in the graph.
How the Fourier Transform Captures Frequency Content
What I’m doing is I’m taking a function, I’m wrapping it around the unit circle at a frequency of W, and then I’m seeing how much the peaks and the valleys of the function line up constructively. If they line up constructively, then you get an offset away from the origin. If they interfere with each other, then you get something very close to zero.
The way the Fourier transform is defined, as I’m talking about in this paragraph here, we really want this to have a dependence on the length of the interval. Because if you do more samples in time, then you should have a greater degree of confidence of the frequency information. If you have less samples and time, you have less confidence about the frequency measurement.
Let’s say you’re measuring a click every second or something, and you only capture three seconds of that data, you don’t have very much confidence in how exact that second mark is. Whereas if you’re measuring that tick every second, and you measure it for a day, and then you have exactly that number of seconds, you can have a very high confidence in your frequency measurement.
Defining the Fourier Transform
In order to capture that, we need to multiply by the interval length, B minus A. The average point is defined by this formula here, one over time interval times integral from A to B of the function times this wrapping parameter. This returns a complex number. That is the average point exactly how I’ve defined it.
And then the Fourier transform, I’m just gonna get rid of this initial parameter here. This will give us this interval dependence that we want. And then I’m also going to take the limit as A goes to minus infinity and B goes to positive infinity.
Important Properties of the Fourier Transform
There’s some very important facts about the Fourier transform. It takes in a real valued function and it returns complex value function in terms of this wrapping frequency W.
The Fourier transform is symmetric. Let me show you what that means on the graph. This is W equals two right here. So we have an offset of 0.125. I’m gonna do W equals negative two, and that’ll flip everything. So the point should end up here, but the radius is still exactly the same. So that’s what we mean by it being symmetric, is we’re just measuring the distance this point is away from the origin. We’re not measuring an orientation of this point. That’s captured by the phase of the Fourier transform. So it’s symmetric, so F of minus W goes up to W.
This is linear. This is a very important mathematical fact that it’s linear. If it was not linear, it would make the math very, very difficult to do. And because it’s linear, we can do decomposition. We can write functions as compositions of other functions. We can decompose them into simpler functions. It makes it a lot easier.
So if you plot this function as we’ve done up here in this graph here, it shows the relative frequency and information contained in the original function. When you have a frequency contained in the original signal you’re trying to measure, when you wrap it at that frequency around the unit circle, all the peaks and the valleys will line up constructively in such a way that it’ll easily display on the graph.
Additional Properties
This is a really cool mathematical fact. It turns differential equations into polynomial equations. This is inherited from the property of the Laplace transform taken. If you put a derivative into the Fourier transform, you get out just a multiple of two pi IW times the Fourier transform. So this is very handy for solving hard math equations that change in time.
It turns convolution. If you’re interested in finding the time response of a system, you use convolution. In the Fourier transform, a convolution is just a simple multiplication. And then almost always this thing converges nicely. There might be some crazy exceptions, but in all real world signals, this thing converges nicely, and it does kind of exactly what you expect it to.
Variations of the Fourier Transform
There are a couple different variations of this Fourier transform that are really helpful, or that if you assume certain things about the original signal, then certain other properties pop out.
The Fourier Series
For example, in the Fourier series, what we’re assuming is that instead of just a finite time interval, like I’ve defined here, right now I’ve just defined this function to be between zero and 20. But if you say it’s defined on the entire real axis and it’s completely periodic over that time, then you can use the Fourier series.
Another way you can use that is just some segment like this. Define from zero to two, and then just repeat it every time interval, so it just covers the entire real line. And you can use the Fourier series, and then because you’re assuming complete periodicity, you no longer need dependence on the length of the interval. So we can reintroduce this as the average point.
This has a really cool property that if you form this sum of exponential signals, you can very closely reconstruct the original function from the coefficients here. When you have an infinitely periodic function, all of these intermediate peaks go away, and you’re just left with these spikes containing the frequency content, and they just happen every integer multiple of that. You have some frequency information.
The Discrete Time Fourier Transform
Another variation is the discrete time Fourier transform, and this happens when the original function is sampled. So as you do with most signals, you take in a function, and if I zoom in all the way here, we’ve got a sample point here, we’ve got a sample point here, we’ve got a sample point here, we’ve got a sample point here. So what I’m doing with a discrete time Fourier transform is we’re taking in sample data instead of continuous data, and what that means is that because it’s sampled, we don’t know exactly what is in between the two samples.
So we could wrap it at a frequency of W nought, but it could also wrap at two pi plus W nought or four pi plus W nought or any 2k pi plus any number of times around the circle between each point. So let’s say W nought is .1 radian. You could also wrap it at two pi plus one plus .1 radians or four pi plus .1 radians, and that would give you the exact same result.
Because I’m sampling the function at 25 hertz, the discrete-time Fourier transform repeats every 25 hertz. This signal here is exactly the same as this graph up here. I’ve just shrunk the X-axis a little bit. So you see we have a spike at zero, one, two, two and a half, and three. Down here I’ve got the same amount, spikes at zero, one, two, two and a half, and three. And because it’s sampled, I’m repeating every 25 hertz. So it repeats at 25 hertz, at 50 hertz, and 75 hertz, and 100 hertz, and it also repeats going negative. So it repeats the same at -25 hertz, and -50 hertz, -75, and so on.
Aliasing
In the discrete-time Fourier transform, because you have sampled data, you get repeated frequency content. And this repeating can lead to a problem known as aliasing, where you basically have the top frequencies of this band interfering with the bottom frequencies of this. If you sample at a much lower rate, let’s say you sample this at five hertz, then this peak moves over here to five, and then you have all of this content interfering with all of this. That’s causing a problem known as aliasing, which causes distortion when you try to reconstruct it.
An important theorem related to this is the Shannon-Nyquist sampling theorem, which says that if you know a frequency component higher than B hertz, then you can sample at two B hertz or higher.
The Discrete Fourier Transform and FFT
The last variation is where you combine both the assumption of the Fourier series and the assumption of the discrete-time Fourier transform. So you have sampled data, and you have infinitely periodic, and you replace this interval in the Fourier series with the sum. You take the sum from here because it’s sampled, and you take the assumption of periodicity from here, and you get this formula here, which you have a list of samples. You multiply it by this matrix to get the DFT or the discrete Fourier transform of the signal.
This has computational complexity O of N squared. So as you scale your number of points, let’s say you have 1,000 points here, then it’ll take roughly a million steps to compute this. This is very, very slow, and you can’t really do this in real time with a large number of data points.
So the fast Fourier transform was developed as a clever way to utilize special symmetries of the unit circle to reduce the complexity from O of N squared to O of N log N, which is a dramatic improvement in performance. You basically split it up into even sequences and odd sequences, then you recursively compute it, and then you recombine it in this special way.
Application to Power Quality
That is how the Fourier transform is used all the time when we compute harmonic data for power quality measurements. All of our power quality recorders compute harmonics, and we use essentially this algorithm, this fast Fourier transform algorithm, where we take data points and we wrap it around the unit circle, and we compute the average. And then that displays a graph similar to this, where we can show that a signal has a particular harmonic content.
Closing Remarks
Well, thanks, Landon. This is really just an intro into the world of signal processing and transforms. There’s a lot of interesting math that you could dive into. We went from continuous time to discrete time, but we didn’t talk about amplitude quantization going from discrete time to digital. There’s also some interesting effects there. But this is an interesting way of understanding what the Fourier transform is doing from a geometric perspective.
Really, this is a way to go from the time domain to what is defined to be the frequency domain here based on the fact that the basis functions for this are sine waves. If you have questions, give us a call anytime at 1-800-296-4120, or send an email to support@powermonitors.com. Thanks for attending, and have a great afternoon.