Stories
Slash Boxes
Comments

SoylentNews is people

posted by Fnord666 on Tuesday June 11 2019, @02:18PM   Printer-friendly
from the transformational-idea dept.

Submitted via IRC for Bytram

The Math Trick Behind MP3s, JPEGs, and Homer Simpson's Face

Over a decade ago, I was sitting in a college math physics course and my professor spelt out an idea that kind of blew my mind. I think it isn't a stretch to say that this is one of the most widely applicable mathematical discoveries, with applications ranging from optics to quantum physics, radio astronomy, MP3 and JPEG compression, X-ray crystallography, voice recognition, and PET or MRI scans. This mathematical tool—named the Fourier transform, after 18th-century French physicist and mathematician Joseph Fourier—was even used by James Watson and Francis Crick to decode the double helix structure of DNA from the X-ray patterns produced by Rosalind Franklin. (Crick was an expert in Fourier transforms, and joked about writing a paper called, "Fourier Transforms for birdwatchers," to explain the math to Watson, an avid birder.)

You probably use a descendant of Fourier's idea every day, whether you're playing an MP3, viewing an image on the web, asking Siri a question, or tuning in to a radio station. (Fourier, by the way, was no slacker. In addition to his work in theoretical physics and math, he was also the first to discover the greenhouse effect.)

So what was Fourier's discovery, and why is it useful?

The story provides great visual examples of how even complex waves can be approximated by a series of sine waves summed together. Further, the parameters to the sine waves and a much more concise description of the approximated item. Examples are given of a roughly-square wave. Another example uses circles instead of sine waves. A great YouTube video shows these in action.

Wish I had this available to me before I was taught FT and FFT in college!


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 3, Interesting) by ikanreed on Tuesday June 11 2019, @03:17PM (6 children)

    by ikanreed (3164) Subscriber Badge on Tuesday June 11 2019, @03:17PM (#854220) Journal

    Take classes literally any other kind of engineering besides the software kind. I remember when I was just out of college and still excited enough to almost finish all my side projects. And I wanted to make a visualization for a music player that did lightning strikes in time with the music, and did internet research and discovered forrier transforms.

    I told my electrical engineer friend, and he'd learned all about them in undergrad signal processing, because it was incredibly basic stuff. Same with a mechanical engineer who'd learned it for analytics. Hell, there's algorithms I've learned from casual conversations with engineers that were more useful than a red-black tree ever will be. PID loops are hella useful.

    Starting Score:    1  point
    Moderation   +1  
       Interesting=1, Total=1
    Extra 'Interesting' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   3  
  • (Score: 3, Interesting) by RS3 on Tuesday June 11 2019, @05:05PM (2 children)

    by RS3 (6367) on Tuesday June 11 2019, @05:05PM (#854265)

    You sound like a perfect candidate for an EE degree, but only if you can read. A reed won't help you. Unless you want to do a Fourier analysis of reed motion and the sound they produce.

    Fourier transform is a special type of LaPlace transform. Those mathematicians figured this stuff out long before electronics. It's amazing how it all came together.

    Fourier transform is a linear integration, and by definition is lossless, but would be very difficult to compute. An integration can be done computationally by a summation, (Greek capital Sigma), and becomes an approximation, only limited by how many data points you can reasonably sample and compute.

    Signal analysis classes are often called: "discrete-time systems", which simply means that to calculate and process signals, we have to sample them- rather than infinitesimal time, it's defined discrete samples, so therefore Analog to Digital converters. Then we might do a discrete-time Fourier transform, which ends up being a somewhat recursive summation, do some processing, or display the results, for example: a spectral display- shows frequency components and their amplitudes.

    The discrete-time Fourier transform (DFT) is horribly computationally intensive, so again the mathematicians figured out the FFT- Fast Fourier Transform, by doing linear and set algebra, finding redundancy in the calculations, and coming up with FFT computer algorithms which are used extensively every day. Again, you're a shoe-in!

    Years ago I wrote some code to do DFT and it was stunningly slow. The FFT algorithm is a bit complicated, especially difficult to optimize, but over the many years it's been refined and widely available.

    One way to do signal processing is to use FFT to convert a signal into frequency components, then do very simple math on them to increase some frequencies, decrease or totally cut some, then do an inverse FFT to get your now-modified signal back. For example an audio EQ (tone controls). However, signal processing with FFT and inverse FFT is computationally intensive, and even if a CPU can keep up, causes delays which are sometimes intolerable (because you have to accumulate samples before you can process). For that reason the mathematicians came up with FIR and IIR filters. I'll let you look that up if you're really that into self-hate! Then you can look up Butterworth, Chebyshev, Linkwitz-Reilly (spelling?), and other filter topologies.

    And for you algorithm guys, look at DSP chips and "butterfly" https://en.wikipedia.org/wiki/Butterfly_diagram [wikipedia.org]

    Oh, and sampling, Nyquist rate, and "windowing" (Hamm, Hanning, Blackman, triangle, rectangle...). If you like what you see, seriously look into some MSEE courses on signal processing. You'd need a couple of undergrad courses, but I think you'd excel.

    If it's not obvious, it's what I mostly pursued in BS and MS EE courses. Of course, the job market wanted 3-5 years experience, so I did and do lots of other things, but knowing that stuff was foundational and comes in handy frequently.

    • (Score: 2) by ikanreed on Tuesday June 11 2019, @06:11PM (1 child)

      by ikanreed (3164) Subscriber Badge on Tuesday June 11 2019, @06:11PM (#854300) Journal

      Well, know, Hamm and Hanning I learned in advanced abstract algebra, which was a computer science class.

      • (Score: 2) by RS3 on Tuesday June 11 2019, @06:57PM

        by RS3 (6367) on Tuesday June 11 2019, @06:57PM (#854316)

        That's cool. Many of our EE classes were exactly the same as CompSci classes, like you could take EE421 or CompSci421. I never looked into the rest of the CompSci curriculum. It's good that they taught you that stuff- good practical real-world stuff. How many bubble-sorts can one person do in a lifetime!

  • (Score: 1) by Ethanol-fueled on Tuesday June 11 2019, @07:59PM

    by Ethanol-fueled (2792) on Tuesday June 11 2019, @07:59PM (#854351) Homepage

    I was fortunate to get a textbook for a Signals and Systems class, for free from a friend. If there is any one textbook you want to grab for this, grab one of those. A single textbook not only covers transforms but also things like transfer functions of basic electronic circuits. I probably wouldn't qualify for such a class in that I have all the prerequisites, but the book makes perfect sense with a little knowledge of discrete math, complex numbers, and programming -- and after you read one you could probably do some basic DSP stuff and not have it all read like Chinese.

    Hell, i still think finding the closed form to anything recursive is fucking awesome.

  • (Score: 2) by istartedi on Tuesday June 11 2019, @11:53PM (1 child)

    by istartedi (123) on Tuesday June 11 2019, @11:53PM (#854444) Journal

    I have a BSEE, and those courses were hard, but not as hard for me as differential equations or statistics. YMMV based on what gives your brain trouble. I absolutely crushed digital logic, and others struggled with that and not diff eq. Go figure. Pun intended.

    --
    Appended to the end of comments you post. Max: 120 chars.
    • (Score: 0) by Anonymous Coward on Wednesday June 12 2019, @07:30AM

      by Anonymous Coward on Wednesday June 12 2019, @07:30AM (#854557)

      I excelled at puns - and that, Sir, was not a pun. Intended.