Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

How to Fourier Transform?

Name: Anonymous 2017-06-04 17:29

So how does one break a windows wav file into the component sine waves, together with phase and amplitude? People say one has to use DFT, but wikipedia article on DFT contains just some opaque formula, containing e with a complex superscript. How can it be used to produce C/C++-compilar uint32_t array of sine-wave frequencies? C/C++'s exp() cant even exponentiate e to a complex number.

Name: Anonymous 2017-06-04 17:39

And C99 doesn't support complex numbers at all.

Name: Anonymous 2017-06-04 20:11

You have to get a DSP chip in order to do it.

Name: Anonymous 2017-06-04 20:36

You can implement a complex exponential in three lines, why do you want to write a DFT yourself if you don't know the basics of complex numbers?

Name: Anonymous 2017-06-04 20:43

>>4

You can implement a complex exponential in three lines
That is a bad excuse for library functions to not support complex numbers.

why do you want to write a DFT yourself if you don't know the basics of complex numbers?
To learn how stuff works of course. Same way writing your own OS is the best way to learn how operating systems work.

Name: Anonymous 2017-06-04 20:55

>>5
You won't understand the mathematics behind the Fourier transform just because you badly translated an opaque formula to C. Similarly, the only thing you will get if you make an OS from scratch without any prior knowledge is a badly written OS. It's a godawful way to learn, and if you think about it this should be obvious: You deliberately ignored everything the people before you painfully figured out over decades.

If you want to learn how to make an OS, read a simple OS like Xv6.
If you want to learn how Fourier transforms work, get a book on complex analysis.
If you want to fuck around with sound files, just use a library that implements the transform for you; every major numerics library should have one.

Name: Anonymous 2017-06-04 21:11

>>6
Actually, making something from scratch with basic knowledge is a good way to learn. But yeah, it will be badly written.

Name: Anonymous 2017-06-04 21:22

>>7
Sure, if you have sufficient knowledge to begin with. OP would be better off starting with Matlab or IDL until they can at least grasp wtf is going on.

Name: Anonymous 2017-06-05 9:08

>>6
only thing you will get if you make an OS from scratch without any prior knowledge is a badly written OS.

Now tell that to Linus Torvalds.

Name: Anonymous 2017-06-05 9:52

C source code for DFT and FFT: http://paulbourke.net/miscellaneous/dft/

He also has an article on using fourier transform for video game terrain generation: http://paulbourke.net/fractals/noise/

Name: Anonymous 2017-06-05 10:49

>>9
Linux is pretty bad compared to BSD or Plan 9. The only thing it has over these two is a collection of drivers, which isn't an accomplishment of the OS. Linux is very messy and ad hoc, which is typical for things that grow out of hobby projects.

Name: Anonymous 2017-06-05 11:23

>>11
Linux is pretty bad compared to BSD or Plan 9.
Then why everyone is using Linux?

Name: Anonymous 2017-06-05 11:32

>>12
Features like accessibility, ease-of-use and software ecosystems make systems popular, not their internals.

Name: Anonymous 2017-06-05 12:21

>>12
Because that's where the drivers are, good luck getting a graphics card from this decade to run under Plan 9. Linux distros have also been going the Windows way for years, which sucks for competent users but increases user count.

Name: Anonymous 2017-06-05 13:41

>>14
New hardware doesn't have any standards. This was already a problem for sound cards in the 90s. If the architecture was cleaner, OSes would be much smaller and easier to create. Today's web scripts are more complicated than 80s operating systems.

Name: Anonymous 2017-06-05 14:03

Name: Anonymous 2017-06-05 14:30

Name: Anonymous 2017-06-05 15:40

>>17
That is not fourier transform.

Name: Anonymous 2017-06-05 15:58

>>18
Nor is it a credible information source.

Name: Anonymous 2017-06-05 19:59

Name: Anonymous 2017-06-06 1:58

It still seems a bit over-complicated

Couldn't you run a few layers of smoothing / residual type thingos in realtime?

Name: Anonymous 2017-06-06 2:34


function wave(freq, phas, amp, t)
phas2 = (phas*2*pi) / freq;
w = amp .* sin(freq .* (t .+ phas2));
return(w);
end;

Name: Anonymous 2017-06-06 2:41

>>21
You could but since convolution in the time domain is equivalent to multiplication in the frequency domain, it's actually often less computationally intensive to go the FFT->filter->IFFT route for realtime processing.

Name: Anonymous 2017-06-06 3:10

bbbaa99887665543322111100000001112233445667889aabbcccddddddddddcccbbaa9988
87766555444443333334444445555666677777888888888888888888888887777777766666
6666666666666667777788889999aaaaaaaaaaaaaaa9998877665

4bit 100Hz of three tones (probably inaudible 7-13hz)

Name: Anonymous 2017-06-06 3:54

Name: Anonymous 2017-06-06 10:30

>>22
.*
.+
is that ML?

Don't change these.
Name: Email:
Entire Thread Thread List