Skip to content

Khayoon/ChordDetectionVisualized

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

image

Elements:

intensity vs time graph 2D plane wound up version How the winding frequency influences the center of mass

Let's show how an FFT splits up a wave into its base notes, visually

image

image

image

image

When the winding frequency matches the signal's frequency (in this case, 3 cycles per second), all peaks align on the right and all valleys on the left. This shifts the center of mass unusually far to the right.

To visualize this, we can plot the center of mass for various winding frequencies. Since the center of mass is two-dimensional, it has an x and y coordinate. However, for now, we'll only track its x-coordinate.

For example, at a winding frequency of zero, where everything is grouped on the right, the x-coordinate of the center of mass will be relatively high.

image

image

image

image

image

image

what if we combine two frequncies and input them into the winder?

image

image

Why two spikes?

image image image

When you apply this transform to a pure frequency, the result is almost zero everywhere except for a distinct spike at that specific frequency (in each) pre-combine.

image

Think of it like this: if you combine two pure frequencies, the transform will show ** two small peaks**, each corresponding to one of the original frequencies. This means our "mathematical machine" successfully extracts the original frequencies from their mixed-up sum, much like "unmixing a bucket of paint."

There's a notion of an inverse Fourier transform that tells you which signal would have produced this as its Fourier transform. We can use this to reverse engineer a signal later.

 inverse Fourier transform

But first. In mathematics, especially when dealing with two-dimensional concepts, it's often elegant to use the complex plane. In this context, the "center of mass" can be represented as a complex number, which inherently has both a real and an imaginary part.

image

The advantage of using complex numbers, instead of two coordinates, is because they are a better way to describe winding and rotation than real numbers. Complex numbers compactly combine magnitude and angle, allowing direct rotation and scaling through simple multiplication, which vectors lack natively. And if you think why not use a vector, complex numbers compactly combine magnitude and angle into a single entity, allowing rotation and scaling to be performed with simple multiplication, unlike vectors which require matrix operations.

A prime example is Euler's formula: $e^{i\theta} = \cos(\theta) + i\sin(\theta)$. This formula beautifully shows that multiplying $e$ by an imaginary number ($i$ times a real number) moves you along a circle of radius 1, counter-clockwise, starting from the positive real axis.animation

To illustrate, consider describing a rotation at a rate of one cycle per second. You could use the expression e^(2πit), where 't' represents time. The reason for 2π is that it represents the full circumference of a unit circle.

If this feels a bit fast, you can adjust the frequency. To describe a different, perhaps slower, frequency 'f', you simply multiply 't' in the exponent by 'f'. For instance, if 'f' is 0.1 (one-tenth), the vector completes one full turn every 10 seconds. This is because 't' must increase to 10 before the entire exponent becomes 2πi.

About

inspired by a 3 blue 1 brown video on fouriers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published