The Remarkable Story Behind The Most Important Algorithm Of All Time

Veritasium
3 Nov 202226:33

Summary

TLDRThe script explores the significance of the Fast Fourier Transform (FFT), a pivotal algorithm in signal processing used in technologies from WiFi to nuclear detection. It delves into the history of nuclear arms control efforts and how FFT could have influenced them. The video also highlights the discovery and application of FFT in various fields, emphasizing its importance in modern society and the potential impact of career choices on global issues.

Takeaways

  • 🌟 The Fast Fourier Transform (FFT) is a crucial algorithm used in various applications including signal processing, radar, sonar, 5G, and WiFi.
  • πŸ” FFT's significance extends to its role in potentially curbing the nuclear arms race, as it was instrumental in detecting covert nuclear weapons tests.
  • πŸ’‘ The algorithm was discovered by scientists during efforts to detect nuclear tests, and its earlier discovery could have influenced the course of nuclear disarmament.
  • πŸ•ŠοΈ Post-World War II, the U.S. proposed the Baruch Plan for international control of nuclear materials, but it was rejected by the Soviets, leading to the nuclear arms race.
  • ⏳ The Partial Test Ban Treaty of 1963 banned nuclear tests in the atmosphere, underwater, and space, but not underground, due to difficulties in verifying compliance.
  • 🌐 The challenge in detecting underground nuclear tests lies in distinguishing between seismic activity from natural earthquakes and man-made explosions.
  • πŸ“Š A Fourier transform decomposes a signal into its constituent frequencies, aiding in the analysis of seismometer signals to identify nuclear tests.
  • πŸ”’ The Fast Fourier Transform algorithm reduces the computational complexity from N squared to NlogN, making it feasible to process large datasets quickly.
  • πŸ“š Carl Friedrich Gauss had discovered a form of the FFT in 1805, but it wasn't published in a widely accessible form, delaying its impact until the 20th century.
  • πŸ›°οΈ The FFT is fundamental to modern signal processing, including image and audio compression, and has been called the most important numerical algorithm of our lifetime by mathematician Gilbert Strang.
  • πŸš€ The video also promotes the nonprofit 80,000 Hours, which helps individuals find careers that can make a significant positive impact on pressing global issues.

Q & A

  • What is the Fast Fourier Transform (FFT)?

    -The Fast Fourier Transform (FFT) is an algorithm that efficiently computes the Discrete Fourier Transform (DFT) of a sequence and its inverse. It breaks down a signal into its constituent frequencies, simplifying the analysis and processing of various signals, and is widely used in signal processing, including audio, image, and data compression.

  • Why is the FFT considered so important?

    -The FFT is considered important because it is foundational in many areas of technology and science, including signal processing, radar, sonar, 5G, WiFi, and even in the detection of nuclear tests. Its efficiency in handling large amounts of data has made it a critical tool for modern computing and communication systems.

  • What was the Baruch plan and why was it significant?

    -The Baruch Plan was a proposal by the United States after World War II to decommission all their nuclear weapons if other nations pledged never to make them. It aimed to prevent the proliferation of nuclear weapons and was significant because it showed the U.S.'s willingness to engage in disarmament discussions, although it was ultimately rejected by the Soviets.

  • How did the nuclear arms race begin?

    -The nuclear arms race began after the rejection of the Baruch Plan by the Soviet Union. They saw it as an attempt to maintain American dominance in nuclear weapons. This led to both superpowers developing and testing new nuclear weapons, escalating the arms race.

  • What was the purpose of the 1958 Geneva Conference on the Discontinuance of Nuclear Weapon Tests?

    -The purpose of the 1958 Geneva Conference was to negotiate a comprehensive test ban to prevent any state from testing nuclear weapons. It was an attempt to reduce the proliferation of nuclear weapons and the associated risks.

  • Why was it difficult to detect underground nuclear tests?

    -Underground nuclear tests are difficult to detect because their radiation is mostly contained within the earth, and the seismic activity produced is similar to natural earthquakes. Additionally, the Soviets refused onsite compliance visits, making it challenging to verify compliance with a test ban.

  • What role did the FFT play in the detection of covert nuclear tests?

    -The FFT played a crucial role in analyzing seismometer signals to distinguish between natural earthquakes and underground nuclear tests. By decomposing the signals into their frequency components, scientists could identify the unique signatures of nuclear explosions.

  • Who discovered the Fast Fourier Transform and when was it rediscovered?

    -The Fast Fourier Transform was originally discovered by Carl Friedrich Gauss in 1805, but it was not widely adopted due to its publication posthumously in a non-standard notation. It was rediscovered in the 20th century by James Cooley and John Tukey, who published the algorithm in 1965, which then gained widespread use.

  • How did the FFT contribute to the field of image compression?

    -The FFT contributes to image compression by transforming images into the frequency domain, where most natural images have a lot of high-frequency components that are close to zero. By discarding these high-frequency components and inverting the transform, a compressed version of the image can be obtained with minimal loss of quality.

  • What is the significance of the 80,000 Hours organization mentioned in the script?

    -80,000 Hours is a nonprofit organization that helps people find fulfilling careers that make a positive impact on the world. They provide resources such as research-backed guides, a job board, and a podcast to assist individuals in making career choices that align with their desire to do good.

Outlines

00:00

🌟 The Importance of FFT in Modern Technology

This paragraph introduces the Fast Fourier Transform (FFT) as a crucial algorithm with widespread applications in technology, including video streaming, radar, sonar, 5G, and WiFi. It also delves into the historical context of the FFT's discovery, linking it to the efforts of scientists trying to detect covert nuclear weapons tests. The narrative suggests that had the FFT been discovered earlier, it might have influenced the course of the nuclear arms race, potentially preventing it. The paragraph also touches on the aftermath of the atomic bombings of Hiroshima and Nagasaki, the subsequent nuclear arms race, and the attempts by the U.S. and other nations to control nuclear proliferation through international agreements like the Baruch Plan.

05:02

🌐 Challenges in Detecting Nuclear Tests and the Role of Seismometers

The second paragraph discusses the difficulties in detecting underground nuclear tests, as opposed to atmospheric or underwater tests, which are easier to identify due to the dispersal of radioactive isotopes or sound waves. It highlights the 1963 Partial Test Ban Treaty that prohibited testing in the atmosphere, underwater, and in space but not underground, due to the inability to verify compliance. The paragraph introduces the idea of using seismometers to detect the ground vibrations caused by nuclear explosions and the challenge of distinguishing these signals from natural seismic activity. It sets the stage for the necessity of a method to analyze these signals, leading to the importance of Fourier transforms in signal processing.

10:03

πŸ“Š Understanding Fourier Transforms and Their Application in Signal Analysis

Paragraph three provides an in-depth explanation of Fourier transforms, which are essential for breaking down complex signals into their constituent sine waves. It describes the process of determining the presence and amplitude of different frequencies in a signal, which is crucial for distinguishing between seismic events and nuclear tests. The paragraph also touches on the historical development of the Fourier transform and its application in various fields, including the analysis of seismometer signals. It introduces the concept of the Discrete Fourier Transform (DFT), which is necessary for processing real-world, finite signals, and discusses the limitations of DFT in terms of computational requirements, setting the stage for the introduction of the Fast Fourier Transform (FFT).

15:05

πŸš€ The Discovery and Impact of the Fast Fourier Transform (FFT)

The fourth paragraph narrates the discovery of the Fast Fourier Transform (FFT) by John Tukey, which significantly reduced the computational complexity of performing Fourier transforms. It details how FFT was kept secret for its initial application in detecting underground nuclear tests during the Cold War. The paragraph also discusses the implications of FFT's late adoption in potentially preventing the escalation of the nuclear arms race. It highlights the broader applications of FFT in various fields, emphasizing its importance as a foundational algorithm for signal processing.

20:08

🌍 The Legacy and Potential of FFT in Global Security and Technology

The fifth paragraph reflects on the historical significance of the FFT, discussing how its earlier discovery by Carl Friedrich Gauss, but subsequent obscurity, may have impacted the trajectory of global events, including the nuclear arms race. It contemplates the 'what if' scenario of a comprehensive test ban treaty had the FFT been available earlier. The paragraph also underscores the transformative impact of FFT on modern technology, including data compression and signal processing, and recognizes its importance in various scientific and technological advancements.

25:10

πŸ’Ό The Value of Career Impact and the Role of 80,000 Hours

The final paragraph transitions from the technical discussion of FFT to the broader theme of career impact, introducing the nonprofit organization 80,000 Hours. It discusses the importance of choosing a career that aligns with one's desire to make a positive difference in the world. The paragraph highlights the resources provided by 80,000 Hours, such as career guides, a job board, and a podcast, aimed at helping individuals find fulfilling careers that address global challenges. It concludes with an encouragement for viewers to explore these resources and make informed decisions about their career paths.

Mindmap

Keywords

πŸ’‘Fast Fourier Transform (FFT)

The Fast Fourier Transform (FFT) is a highly efficient algorithm for computing the discrete Fourier transform (DFT) of a sequence and its inverse. It's fundamental to the video's theme as it's used in various applications like signal processing, including the detection of nuclear tests and compression algorithms for media. The script mentions FFT's role in analyzing signals, such as those from seismometers to detect underground nuclear detonations and in the compression of images and videos for digital transmission.

πŸ’‘Nuclear Arms Race

The term 'nuclear arms race' refers to the competitive development and accumulation of nuclear weapons by different nations, primarily during the Cold War era. In the script, it is discussed in the context of the post-World War II era, where the U.S.'s atomic bombings of Hiroshima and Nagasaki led to other nations seeking to develop their own nuclear capabilities. The narrative explores how the FFT might have influenced the arms race if discovered earlier.

πŸ’‘Seismometer

A seismometer is an instrument that measures and records the motion of the ground during an earthquake or other seismic event. In the video script, seismometers are highlighted for their role in detecting the faint ground vibrations caused by underground nuclear explosions, which is essential for verifying compliance with nuclear test ban treaties.

πŸ’‘Signal Processing

Signal processing involves the analysis, interpretation, and manipulation of signals. The script emphasizes the importance of signal processing in the context of the FFT, which is used to decompose signals into their constituent frequencies, a process crucial for various applications, including the detection of nuclear tests and the compression of digital media.

πŸ’‘Discrete Fourier Transform (DFT)

The Discrete Fourier Transform is a specific way to analyze a signal made up of a finite number of samples. The script explains that the DFT is used to transform a time-domain signal into the frequency domain, which is essential for identifying the presence of different frequencies in a signal, such as those from seismometers detecting nuclear tests.

πŸ’‘Nuclear Test Ban Treaty

The Nuclear Test Ban Treaty is an international agreement aimed at stopping the testing of nuclear weapons. The script discusses the Partial Test Ban Treaty of 1963, which prohibited nuclear tests in the atmosphere, in outer space, and underwater, but not underground, due to the difficulty in verifying compliance.

πŸ’‘Radar and Sonar

Radar and sonar are technologies that use the reflection of radio waves and sound waves, respectively, to detect objects. The script mentions these technologies as applications of the FFT, which processes the signals received by radar and sonar systems to determine the location and characteristics of objects.

πŸ’‘5G and WiFi

5G and WiFi are wireless communication technologies that use radio waves to transmit data. The script notes that the FFT is used in these technologies for processing signals to enable high-speed data transmission and efficient use of the radio spectrum.

πŸ’‘Compression Algorithms

Compression algorithms are used to reduce the size of data files, such as images and videos, for efficient storage and transmission. The script explains how the FFT is applied in compression algorithms by transforming the data into the frequency domain, where most of the energy is concentrated in a few low-frequency components, allowing for significant data reduction.

πŸ’‘Richard Garwin

Richard Garwin is a physicist mentioned in the script for his involvement in the development and application of the FFT. He is known for his work in simulating the responses of seismometers and for his role in the discussions that led to the realization of the FFT's importance in detecting underground nuclear tests.

πŸ’‘Carl Friedrich Gauss

Carl Friedrich Gauss was a mathematician who, as the script reveals, had actually discovered the principles of the FFT over a century before its modern rediscovery. His work on the FFT was not published until after his death, and due to its presentation in a complex form, it did not gain immediate recognition or use.

Highlights

The Fast Fourier Transform (FFT) is considered the most important algorithm of all time due to its widespread use in signal processing.

FFT is utilized in technologies such as radar, sonar, 5G, and WiFi, and is fundamental in processing any type of signal.

The algorithm was originally discovered by scientists attempting to detect covert nuclear weapons tests, potentially impacting the nuclear arms race.

Post-World War II discussions led to the Baruch Plan, proposing international control over nuclear materials, but it was rejected by the Soviets.

Nuclear testing, especially in remote locations, resulted in significant environmental and health impacts, prompting public outcry and calls for a test ban.

The 1958 Geneva Conference on the Discontinuance of Nuclear Weapon Tests marked a pause in nuclear testing during negotiations.

Detecting underground nuclear tests is challenging due to the containment of radiation and the difficulty in verifying compliance.

Seismometers and Fourier transforms were considered as methods to detect underground detonations by analyzing ground vibrations.

A Fourier transform decomposes a signal into sine waves, revealing the presence of different frequencies and their amplitudes.

The Discrete Fourier Transform (DFT) is used for real-world signals composed of finite data points, resulting in a discreet frequency spectrum.

The Fast Fourier Transform algorithm reduces the computational complexity from N squared to N log N, making it practical for large data sets.

The FFT was independently discovered by Carl Friedrich Gauss in 1805 but was not published until after his death, delaying its impact.

James Cooley and John Tukey's 1965 publication of the FFT algorithm revolutionized signal processing and had various applications.

The FFT is fundamental in data compression algorithms, facilitating the storage and transmission of images and videos.

Gauss's potential earlier publication of the FFT could have influenced the nuclear arms race and the adoption of a comprehensive test ban.

The FFT's applications extend to solving differential equations, studying crystal structures, and enabling technologies like WiFi and 5G.

Gilbert Strang, a mathematician, regards the FFT as the most important numerical algorithm of our lifetime due to its extensive use.

The video is sponsored by 80,000 Hours, a nonprofit organization helping individuals find impactful careers.

Transcripts

play00:00

This is a video about the most important algorithm of all time,

play00:04

the Fast Fourier Transform or FFT.

play00:07

I mean, you use it all the time

play00:09

including right now to watch this video

play00:11

and it's used in radar and sonar, 5G and WiFi.

play00:15

Basically, anytime a signal is processed,

play00:17

there's a good chance that a Fast Fourier Transform

play00:20

is involved.

play00:21

But on top of all this, the FFT was discovered by scientists

play00:25

trying to detect covert nuclear weapons tests.

play00:28

And if they had discovered it sooner,

play00:30

it may have put a stop to the nuclear arms race.

play00:36

You know I always assumed that the nuclear arms race

play00:39

was inevitable, that once the U.S. dropped atomic bombs

play00:41

on Hiroshima and Nagasaki,

play00:43

it was just unavoidable that all the other major powers

play00:45

would develop nukes.

play00:47

But maybe it wasn't because it was clear to everyone

play00:51

that nuclear weapons were game changing.

play00:54

The bomb dropped on Hiroshima released a thousand times

play00:56

more energy than the biggest conventional explosive

play00:59

so other countries were rightfully concerned.

play01:03

At the end of the war, Canada and the U.K.

play01:05

requested a meeting to discuss what would be done

play01:08

about nuclear weapons.

play01:09

And contrary to what I expected,

play01:12

the U.S. was actually open to these discussions.

play01:15

They realized that they wouldn't be the only nation

play01:18

with nukes for long.

play01:19

So they offered to decommission all their nuclear weapons

play01:22

if other nations would pledge never to make them.

play01:28

This was known as the Baruch plan

play01:31

and it proposed that an international body would control

play01:34

all radioactive materials on earth,

play01:36

from mining to refining to using these materials

play01:39

for peaceful purposes as a nuclear power generation.

play01:43

But the Soviets rejected the proposal.

play01:45

They saw it as just another ploy to maintain

play01:48

American nuclear dominance

play01:49

and so the global nuclear arms race began.

play01:55

To develop new nuclear weapons required extensive testing

play01:59

and most of it was done in remote places like the Arctic

play02:02

or the South Pacific Islands.

play02:04

The U.S. also created a nuclear testing site in Nevada,

play02:07

the radioactive products of which blew across the country

play02:10

so that outside of Japan, the people most adversely affected

play02:14

by American nuclear weapons were Americans themselves.

play02:18

The U.S. soon graduated from fission weapons

play02:21

to thermonuclear bombs which combined fission and fusion

play02:24

to release even more energy.

play02:28

They were as big leap from the first atomic bombs

play02:31

as those devices were from conventional explosives,

play02:34

a thousand times again more powerful.

play02:37

- Annihilation of any life on earth has being brought

play02:41

within the range of technical possibility.

play02:48

- [Narrator] In 1954 at Bikini Atoll in the South Pacific,

play02:51

the U.S. tested a new thermonuclear design

play02:54

that used lithium deuteride as a fuel

play02:56

and they expected the device code named Shrimp

play02:58

to release the energy equivalent of six million tons of TNT

play03:03

but they were wrong.

play03:04

(bomb blasts)

play03:09

It released two and a half times that

play03:11

due to unanticipated reactions with lithium-7.

play03:15

And as a result, more radioactive material was created

play03:18

and it rained down over a much larger area than planned.

play03:22

Residents of neighboring atolls were only evacuated

play03:24

three days later suffering from radiation sickness.

play03:28

And further east, the 23 crew of a Japanese fishing boat

play03:31

were caught in a flurry of radioactive white ash.

play03:34

And by that evening,

play03:35

they were suffering from acute radiation syndrome.

play03:39

One of the crew died from ensuing complications

play03:41

six months later.

play03:42

- [Reporter] As a result of the extended illness

play03:44

brought about by his exposure to the radiation fallout.

play03:48

- These events triggered public outcry

play03:51

against nuclear testing.

play03:52

The modern peace sign was designed in the 1950s

play03:55

by combining the semaphore letters for N and D

play03:59

standing for nuclear disarmament.

play04:01

A number of world leaders called for a comprehensive

play04:04

test ban, no more testing of nuclear weapons by any state

play04:09

and this call was actually taken seriously

play04:11

by the world's nuclear powers.

play04:13

They entered into negotiations at meetings

play04:15

with very literal names like

play04:17

the Conference on the Discontinuance of Nuclear Weapon Tests

play04:20

held in Geneva in 1958.

play04:24

And to show just how serious they were,

play04:26

they even stopped all testing during the negotiations

play04:29

which is why 1959 is the only year in a long stretch

play04:33

when no nuclear weapons were detonated.

play04:36

But there was a big problem with negotiating

play04:39

a comprehensive test ban which is how do you know

play04:42

that the other side will hold up their end of the bargain?

play04:46

The U.S. worried that the Soviets would continue

play04:48

testing covertly and leapfrog them technologically

play04:51

and the Soviets similarly distrusted the U.S..

play04:55

So to address these concerns,

play04:56

they convened the Conference of Experts to Study

play04:59

the Possibility of Detecting Violations

play05:02

of a Possible Agreement on Suspension of Nuclear Tests.

play05:06

Seriously, that was the name, I am not making this up.

play05:13

Now detecting atmospheric tests was fairly straightforward.

play05:16

The radioactive isotopes they produced disperse

play05:19

in the atmosphere and can be detected

play05:21

thousands of kilometers away.

play05:23

Underwater tests produce distinctive sounds

play05:26

that travel efficiently around a kilometer below the surface

play05:29

of the ocean and these can be picked up by hydrophones.

play05:33

But underground tests are much harder to detect from afar

play05:37

because their radiation is mostly contained

play05:40

and the Soviets refused to allow onsite compliance visits

play05:43

which they regarded as espionage.

play05:46

And this is ultimately why when a test ban treaty was signed

play05:49

in 1963, it was only a partial ban.

play05:53

It banned testing underwater,

play05:55

in the atmosphere and in space,

play05:57

places where compliance could be verified,

play05:59

but it didn't ban testing underground for the simple reason

play06:03

that it was almost impossible to verify compliance.

play06:06

But scientists had been trying to find a way

play06:08

to reliably detect underground detonations.

play06:11

Following the Geneva meeting, American and Soviet scientists

play06:14

formed a working group to discuss the issue

play06:17

and their idea was to use seismometers located

play06:20

outside the countries where nukes were being tested

play06:22

to detect the faint ground vibrations caused by explosions.

play06:27

The problem was how do you distinguish a nuclear test

play06:30

from an earthquake?

play06:32

Every day around the world,

play06:33

there are close to 300 earthquakes

play06:35

with a magnitude of three or greater.

play06:39

In addition, part of the purpose of detecting

play06:41

your adversaries tests is to spy on them,

play06:44

to know how big of an explosion they can make.

play06:47

But the seismometer signal depends not only on the yield

play06:50

of the device but also on how deep it was buried.

play06:54

For a given yield, deeper explosions appear smaller.

play06:58

So scientists wanted a method to reliably determine

play07:01

whether a given signal was a bomb or an earthquake

play07:04

and if it was a bomb, how big it was

play07:06

and how deep it was buried.

play07:09

They knew that all this information was contained

play07:11

in the seismometer signal but it couldn't just be read off

play07:15

by looking at the squiggles.

play07:16

They needed to know how much of different frequencies

play07:19

were present which meant they needed to take

play07:22

a Fourier transform.

play07:25

A Fourier transform is a way of decomposing a signal

play07:28

into pure sine waves, each with its own amplitude

play07:32

and frequency that add to make it up.

play07:35

This seems a bit like magic since the sum

play07:38

of a set of sine waves can look arbitrarily complicated

play07:40

and nothing like its component parts.

play07:44

There are some elegant ways to understand

play07:46

how Fourier transforms work,

play07:47

shout out to the awesome video by 3Blue1Brown.

play07:50

But I wanna take more of a brute force approach.

play07:53

If you wanna know how much of a particular sine wave

play07:56

is in a signal, just multiply the signal by the sine wave

play08:00

at each point and then add up the area under the curve.

play08:05

As a simple example, say our signal is just a sine wave

play08:08

with a certain frequency but pretend we don't know that

play08:11

and we're trying to figure out

play08:12

which sine waves add to make it up.

play08:15

Well, if you multiply this signal by a sine wave

play08:17

of an arbitrary frequency, the two waves are uncorrelated.

play08:22

You're just as likely to find places where they have

play08:23

the same sign, both positive or both negative

play08:26

as where they have opposite signs and therefore

play08:29

when you multiply them together, the area above the x-axis

play08:32

is equal to the area below the x-axis.

play08:35

So these areas add up to zero which means

play08:38

that frequency sine wave is not a part of your signal

play08:42

and this will be true for almost all frequencies

play08:45

you could try assuming you're looking over

play08:46

a long enough timeframe.

play08:48

The only exception is if the frequency of the sine wave

play08:51

exactly matches that of the signal,

play08:55

now these waves are correlated

play08:57

so their product is always positive and so is the area

play09:01

under the curve that indicates

play09:02

that this sine wave is part of our signal.

play09:06

And this trick works even if the signal is composed

play09:08

of a bunch of different frequencies.

play09:10

If the sine waves frequency is one of the components

play09:13

of the signal it will correlate with the signal

play09:15

producing a non-zero area.

play09:17

And the size of this area tells you the relative amplitude

play09:20

of that frequency sine wave in the signal.

play09:24

Repeat this process for all frequencies of sine waves

play09:27

and you get the frequency spectrum.

play09:29

Essentially which frequencies are present

play09:31

and in what proportions.

play09:35

Now so far I've only talked about sine waves

play09:38

but if the signal is a cosine wave,

play09:40

then even if you multiply it by a sine wave

play09:42

of the exact same frequency,

play09:44

the area under the curve will be zero.

play09:47

So for each frequency,

play09:48

we actually need to multiply by a sine wave

play09:51

and a cosine wave and find the amplitudes for each.

play09:55

The ratio of these amplitudes indicates the phase

play09:58

of the signal that is how much it's shifted

play10:01

to the left or to the right.

play10:03

You can calculate these sine and cosine amplitudes

play10:05

separately or you can use Euler's formula

play10:09

so you only need to multiply your signal

play10:11

by one exponential term.

play10:13

Then the real part of the sum is the cosine amplitude

play10:16

and the imaginary part is the sine amplitude.

play10:20

In the American delegation at the Geneva meeting,

play10:22

there was a physicist, Richard Garwin

play10:24

and a mathematician John Tukey.

play10:27

They got into a debate with the Soviet delegation

play10:29

over which nation's seismometers were superior.

play10:32

So Garwin simulated the responses of both countries' devices

play10:36

on a computer at CERN.

play10:39

The next day, everyone agreed there wasn't much difference.

play10:43

The real obstacle to detecting underground explosions

play10:46

wasn't the accuracy of the seismometers,

play10:49

it was the vast amounts of computation required

play10:51

to Fourier transform the seismometer signals.

play10:56

Here's an example seismometer signal

play10:58

and its Fourier transform.

play11:00

Thus far I've been thinking about signals

play11:02

as infinite continuous waves

play11:04

and when you take their Fourier transform,

play11:06

you get an infinite continuous frequency spectrum.

play11:09

But real world signals are not like that.

play11:12

They are finite and made up of individual samples

play11:14

or data points.

play11:16

Even though a seismometer signal looks smooth

play11:19

and continuous, it doesn't record ground motion

play11:22

with infinite precision.

play11:24

There is some fundamental graininess to the data

play11:27

so what you have is discreet finite data.

play11:30

So you can't use the idealized Fourier transform.

play11:34

Instead, you have to perform something

play11:37

called a Discreet Fourier Transform.

play11:40

And one of the distinguishing features

play11:42

of a Discreet Fourier Transform

play11:43

is that the frequency spectrum is also discreet and finite.

play11:48

You can think of the frequencies

play11:49

as falling into a finite number of bins.

play11:53

And what determines the number and size of these bins

play11:56

is the number of samples in the signal

play11:58

and how closely spaced they are.

play12:00

For example, the more spaced out the samples are,

play12:03

the lower the maximum frequency you can measure.

play12:06

Because the samples aren't close enough together

play12:08

to capture high frequency oscillations,

play12:12

the shorter the duration of the signal,

play12:14

the harder it is to tell similar frequencies apart.

play12:17

So this lowers the frequency resolution.

play12:20

The shorter the signal, the wider each frequency bin is.

play12:25

The lowest non-zero frequency you can effectively measure

play12:28

is one whose period is equal to the duration of the signal.

play12:32

And the higher frequency bins are just integer multiples

play12:35

of this frequency.

play12:36

So they fit two, three, four, and so on periods

play12:40

in the duration of the signal.

play12:42

The total number of frequency bins is equal

play12:46

to the number of samples in the signal.

play12:48

So if the signal is made up of eight samples,

play12:51

then the transform has eight frequency bins

play12:53

going from zero up to seven times the fundamental frequency.

play12:58

So let's do an example.

play13:00

Say we have a signal made up of eight samples.

play13:03

Well, then the discrete Fourier transform

play13:05

will have eight frequency bins.

play13:08

The first bin corresponds to a frequency of zero.

play13:11

Essentially this measures if the signal

play13:13

is systematically shifted off the x-axis.

play13:17

You can think of it as measuring the DC offset.

play13:20

You multiply each data point by one

play13:23

and add them all together, in this case, they add to zero.

play13:28

The second frequency bin corresponds to the frequency

play13:31

that fits one period in the duration of the signal.

play13:34

So in this case that corresponds to one hertz.

play13:37

You multiply each point by a sine wave of this frequency

play13:41

and a cosine wave of this frequency

play13:44

and separately add them up.

play13:46

For sine, they add to zero.

play13:48

For cosine, they add to four

play13:51

and then repeat the process for two hertz, three hertz,

play13:54

and so on, up to seven hertz.

play13:57

And you have the discreet Fourier transform

play14:00

of this really simple signal.

play14:02

Now this process works fine in principle

play14:05

and you could use it to calculate

play14:07

all discrete Fourier transforms.

play14:09

But the problem is it requires way too many calculations.

play14:14

To complete one discrete Fourier transform

play14:16

requires multiplying N data points

play14:18

by N different frequency waves.

play14:21

So N squared complex multiplications.

play14:24

Now this is doable for eight samples

play14:27

but if you had say a million samples,

play14:30

that would require a million squared

play14:32

or one trillion calculations.

play14:37

At the speed of 1960s computers,

play14:39

that would take over three years to complete,

play14:42

all for a single transform.

play14:44

Now a million samples is admittedly more than you would need

play14:47

for a single seismic event but to analyze tens of events

play14:50

per day from hundreds of seismometers,

play14:53

it would just be far too time consuming

play14:55

and that's what gave scientists the impetus

play14:57

to look for a better way.

play14:59

And the breakthrough came in 1963 at a meeting

play15:02

of the President's Science Advisory Committee.

play15:04

President John F. Kennedy was there,

play15:06

as were Garwin and Tukey,

play15:08

the physicist and mathematician from the Geneva meeting.

play15:11

Although they were discussing issues of national importance

play15:14

like the Apollo program and nuclear fallout shelters,

play15:17

the meeting was apparently pretty boring.

play15:19

Garwin observed Tukey doodling throughout

play15:23

but what he was actually doing

play15:25

was working on discreet Fourier transforms.

play15:28

At the end of the meeting, Garwin asked Tukey

play15:30

what he had worked out and he was shocked to learn

play15:33

that Tukey knew a way to compute discreet Fourier transforms

play15:36

with many fewer computations.

play15:39

It would mean that the calculation that would've taken

play15:40

over three years could be done in just 35 minutes.

play15:45

This has aptly become known as the Fast Fourier Transform.

play15:49

So here is how it works.

play15:53

Consider the example from before with eight samples.

play15:56

Each of those data points must be multiplied

play15:58

by the eight different frequency waves.

play16:00

Here I'm only showing cosines for simplicity.

play16:04

So you would expect this to require eight times eight

play16:06

or 64 complex multiplication.

play16:10

But due to the periodic nature of sinusoids,

play16:13

these waves of different frequencies

play16:15

overlap in a predictable way.

play16:17

For example, at the middle data point,

play16:20

all of the four odd frequencies have the same value

play16:23

and all of the four even frequencies

play16:25

have the same value as well.

play16:27

So instead of doing eight multiplication,

play16:29

you only need to do two.

play16:32

And this sort of duplication occurs

play16:33

at the other data points as well.

play16:35

So instead of performing 64 calculations, you need only 24.

play16:41

Now that might seem like a small improvement

play16:44

but it's the difference between a calculation

play16:46

that scales as N, the number of samples squared

play16:49

versus one that scales as Nlog base two of N

play16:52

which means the bigger the data set,

play16:54

the greater the savings.

play16:56

A signal with a thousand samples would require

play16:59

100 times fewer calculations and a million samples

play17:03

would require 50,000 times fewer calculations.

play17:08

But how do you know which calculations are redundant?

play17:12

Well, take your samples and split them

play17:15

into even and odd index points.

play17:18

You still need to multiply

play17:20

each of these by the eight different frequency waves.

play17:23

But now let's look only at the even points and compare

play17:26

the first four frequencies to the second four frequencies.

play17:31

And what you find is that in each case

play17:33

at the location of the samples,

play17:35

the values of the two sine waves are the same.

play17:39

A similar pattern can be observed for the odd index points

play17:43

except the values of one sine wave are the negative

play17:46

of the other.

play17:47

More generally, they're related by a complex number.

play17:51

But what this means is that you don't have to do

play17:54

all the multiplication for the second half

play17:57

of the frequencies.

play17:58

Once you've calculated the odd and even sums

play18:01

for the lower half the frequencies,

play18:03

you can reuse these values to find the upper half.

play18:08

So you've effectively cut the number of calculations

play18:10

required in half but that's only a factor of two,

play18:15

how do you get down to Nlog base two of N?

play18:18

Well, you repeat the same trick,

play18:20

split the samples again into even an odd points

play18:24

and then again repeatedly

play18:26

until you're down to single data points.

play18:30

At each split, you can exploit the symmetries

play18:32

of sinusoidal functions to cut the number of calculations

play18:35

in half.

play18:37

And that is how the Fast Fourier Transform reduces

play18:40

N squared calculations down to NlogN.

play18:44

And it's why today whenever anyone takes

play18:45

a Fourier transform, it's almost always done

play18:48

as a Fast Fourier Transform.

play18:52

Garwin approached an IBM researcher, James Cooley

play18:54

to program a computer to run the FFT algorithm

play18:58

but he didn't tell him the reason was to detect

play19:00

underground Soviet nuclear tests.

play19:02

He said it was to work out the spins

play19:04

in a crystal of helium-3.

play19:06

Cooley and Tukey published the algorithm

play19:08

in a seminal 1965 paper and its use immediately took off

play19:13

but it was too late to secure

play19:16

a comprehensive nuclear test ban.

play19:19

By that time, the U.K., France and China

play19:21

had joined the Soviet Union and the U.S. as nuclear powers.

play19:27

And the partial test ban treaty,

play19:28

far from deescalating the nuclear arms race

play19:31

just sent it underground.

play19:33

The thinking was if you were only allowed

play19:35

to test underground, then you better be testing extensively

play19:39

so as not to fall behind all the other nuclear states.

play19:42

So from 1963, 1,500 nuclear weapons were detonated.

play19:47

That's roughly one a week for 30 years.

play19:50

This testing facilitated the construction

play19:52

of an absurd number of nukes.

play19:55

At the peak in the mid 1980s,

play19:57

70,000 nuclear warheads were in existence.

play20:01

Total expenditure on nukes in the 20th century

play20:03

is estimated at around $10 trillion each for the U.S.

play20:08

and the Soviet Union adjusting for inflation.

play20:11

If only scientists had been confident in their ability

play20:14

to remotely detect underground tests in the early 1960s,

play20:17

then a comprehensive test ban could have been reached,

play20:20

stopping the nuclear arms race before it really got going.

play20:24

To check how realistic this is,

play20:26

I asked Richard Garwin himself.

play20:29

- Well, it's a good story.

play20:32

- It is a good story.

play20:33

- It would've helped and it might have turned the tide.

play20:37

- But that would've required an earlier discovery

play20:40

of the Fast Fourier Transform and as luck would have it,

play20:43

it was discovered earlier but then forgotten.

play20:48

All the way back in 1805, Mathematician Carl Friedrich Gauss

play20:51

was studying the newly discovered asteroids

play20:53

of Pallas, Ceres and Juno.

play20:56

To determine the orbit of Juno,

play20:57

Gauss devised a novel approach to harmonic analysis

play21:00

and he jotted it down in his notes

play21:02

but later used a different method

play21:04

and he never thought to publish that first insight.

play21:07

Today we can see that Gauss had figured out

play21:10

the discreet Fourier Transform before Joseph Fourier himself

play21:13

published it in 1807.

play21:15

And he had developed the same Fast Fourier Transform

play21:18

algorithm as Cooley and Tukey a century and a half earlier.

play21:23

The reason his breakthrough was not widely adopted

play21:25

was because it only appeared after his death in volume three

play21:29

of his collected works and it was written with non-standard

play21:32

notation in a 19th century version of Latin.

play21:36

What do you think would've happened if Gauss had realized

play21:39

the significance of his discovery and had published it

play21:41

in a way that others could understand?

play21:44

With our modern network of seismometers

play21:46

and computing and the Fast Fourier Transform,

play21:48

today, we have the ability to detect magnitude three events

play21:51

which correspond to a one kilo ton or so explosion,

play21:55

basically anywhere on earth.

play21:58

Following Cooley and Tukey's paper, the use of FFTs exploded

play22:02

and they are the basis for most compression algorithms

play22:05

like the ones that allow you to watch

play22:06

and listen to this video.

play22:09

Here's how the Fast Fourier Transform

play22:10

allows you to compress an image.

play22:13

You take the pixel brightness values for each row

play22:16

of an image and perform a Fast Fourier transform.

play22:20

So essentially, you're figuring out what frequencies

play22:23

are present in the brightness values

play22:26

of the rows of an image.

play22:27

Here, brightness represents the magnitude

play22:30

of each frequency component and the color

play22:32

represents the phase, how shifted that frequency is

play22:35

to the left or the right.

play22:37

And then you perform another FFT for the columns of pixels.

play22:42

It doesn't matter if you do the rows or columns first,

play22:45

which you need is a two dimensional FFT

play22:48

of the original image.

play22:50

For almost all real world images,

play22:53

you find that a lot of the values in the transform

play22:56

are close to zero.

play22:58

I've taken the log of the transform values

play23:00

so you can see them but if I don't, then it's clear

play23:03

most of the values, especially toward the edges

play23:05

are very small and these correspond to high frequencies.

play23:10

And what this means is that you can throw out

play23:12

a lot of the information in the transformed image

play23:15

say 99% of it.

play23:17

But when you invert that result, you still get a fairly good

play23:21

representation of the original image.

play23:24

So on your computer, most of the images will be saved

play23:27

in this form as a two dimensional Fast Fourier Transform

play23:30

and then when you wanna look at the picture again,

play23:32

the computer simply inverts the transform.

play23:36

There are so many applications for FFTs

play23:38

from solving differential equations to radar and sonar,

play23:42

studying crystal structures, WiFi and 5G.

play23:45

Basically all kinds of signal processing use FFTs

play23:49

and that's why mathematician Gilbert Strang called the FFT

play23:52

the most important numerical algorithm of our lifetime.

play23:56

If only it had become more widely adopted

play23:59

after Gauss discovered it,

play24:00

the FFT may have even more dramatically

play24:03

transformed our world.

play24:11

Now I don't think Gauss could ever have imagined

play24:13

how important the FFT would be,

play24:15

just as most people don't think about the cumulative impact

play24:18

of their life's work.

play24:19

You know in an average career, you work 40 hours a week,

play24:23

50 weeks a year for 40 years

play24:25

and that works out to 80,000 hours.

play24:28

It means that your career might be your biggest opportunity

play24:32

to make a difference in the world.

play24:33

So what do you wanna do with all that time?

play24:36

Now the name of this video sponsor is 80,000 Hours

play24:40

referencing the amount of impact you can have,

play24:42

the amount of hours you spend at work,

play24:44

and they are not selling anything.

play24:46

80,000 Hours is a nonprofit that helps people

play24:48

find fulfilling careers that make a positive impact.

play24:52

The typical advice from career centers or aptitude tests

play24:55

really just focuses on finding a job

play24:56

that fits your personal preferences.

play24:58

But what if you care more about doing good?

play25:01

Well, they won't really know what to tell you

play25:03

besides a few well known professions

play25:04

like being a doctor or a teacher.

play25:06

When I finished college, I knew I liked filmmaking, teaching

play25:10

and science and that I wanted to have a big positive impact

play25:13

but YouTube didn't exist yet and so I honestly had no idea

play25:17

what I was gonna do.

play25:18

Now I feel really fortunate to be able to do something

play25:21

every day that I both enjoy

play25:23

and which makes a positive impact on the world.

play25:25

So believe me, there are a lot of things out there

play25:28

that you can do and 80,000 Hours offers tons of resources

play25:31

to help you find those things.

play25:33

From research backed guides on how to pick a career

play25:35

that tackles pressing issues

play25:37

to a regular newsletter and podcast.

play25:39

They even have a curated job board that's kept up to date

play25:42

with hundreds of jobs they think will make an impact.

play25:45

They have done over 10 years of research alongside academics

play25:48

at Oxford University on how to find a career that is both

play25:51

fulfilling and which makes a positive difference.

play25:54

So their recommendations are accurate, specific,

play25:56

and actionable.

play25:57

If you care about what the evidence says

play25:59

about having an impactful career and you want real advice

play26:02

that goes beyond empty cliches like follow your passion,

play26:05

then check out 80,000 Hours.

play26:07

Everything they provide from their podcast

play26:09

to their job board is free forever.

play26:12

If you join the newsletter right now,

play26:13

you'll also get a free copy of their in-depth career guide

play26:16

sent right to your inbox.

play26:17

So to get started on a career that tackles

play26:19

the world's most pressing problems,

play26:21

sign up now at 80000hours.org/veritasium.

play26:25

I will put that link down in the description.

play26:27

So I wanna thank 80,000 Hours

play26:29

for sponsoring this part of the video

play26:30

and I wanna thank you for watching.

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Fast Fourier TransformNuclear Arms RaceSignal ProcessingSeismometersNuclear TestingFFT AlgorithmData CompressionNuclear DisarmamentTechnology ImpactCold War History