4 ms·
Your first point is spot on, but the second is not: for the signal to be real valued in the time domain, the negative and positive frequencies have to be redund
by anon_123g987 5y ago
Your first point is spot on, but the second is not: for the signal to be real valued in the time domain, the negative and positive frequencies have to be redundant in the complex valued frequency domain.
Edited to add a link to a simple Matlab solution of this problem: https://www.mathworks.com/matlabcentral/fileexchange/42919-pink-red-blue-and-violet-noise-generation-with-matlab https://www.mathworks.com/matlabcentral/fileexchange/42919-p... (click on the Functions tab to see the source code)
- omegalulw 5y agoI'm confused about the first point. Is it simply restating that Fourier coefficients are complex numbers?
- anon_123g987 5y agoBasically yes, but his statement is mixing up things a bit. The Discrete Fourier Transform transforms a complex vector of length N to another complex vector of length N. In the latter, each of the N elements corresponds to a frequency "bin" and, like complex numbers in general, can be represented either by a real and an imaginary part (like Cartesian coordinates), or by a phase (==atan(Im/Re)) and a magnitude (==sqrt(Re^2+Im^2)) (like polar coordinates). Obviously, whichever you choose, you need both components for unambiguous representation.
- nitrogen 5y agoI made a video about the FFT a few months ago that I hope might offer another perspective to help understand these concepts: https://www.youtube.com/watch?v=iyjIVSnrPSo&t=271s https://www.youtube.com/watch?v=iyjIVSnrPSo&t=271s The FFT segment starts at 4:30 (linked), the specific part about phase and magnitude is at 5:45, and the part about negative vs. positive frequencies starts at 6:35.
- ByThyGrace 5y agoMaking quality animations drive the point home is not so easy to pull off, so thanks for sharing. Both interesting and impressive.
- nitrogen 5y agoThanks for taking a look!
- erwincoumans 5y agoVery nice video, the 3d animations and colors make it look very professional. What tool(s) did you use to create the video? Ruby? OpenGL? A custom synthesizer?
- nitrogen 5y agoAll of the above. I have a custom animation system written in Ruby that talks to some visualization software I wrote using C and OpenGL. The synthesizer is also in Ruby, and the core audio code for that is on GitHub. I use Inkscape for overlay graphics, and reboot into Windows for VEGAS for editing and compositing.
- nitrogen 5y ago...and thanks for checking out the video!
- erwincoumans 5y agoI've never tried Ruby, but would love to try out that synth and its visualizations. Do you plan on making them available?
- nitrogen 5y agoYou can try the synthesizer and other audio code if you're using Linux. Here's an earlier version of the synthesizer (licensed under AGPL3). The MIDI CCs for controlling different parameters are listed in the source code. You'd want to clone the repo, run through the installation instructions in the mb-sound repo, do a bundle update mb-sound, then run bundle exec bin/complex_synth.rb. https://github.com/mike-bourgeous/mb-surround/blob/3823de44a55f083c6cc914621c9c93a49f57b710/bin/complex_synth.rb https://github.com/mike-bourgeous/mb-surround/blob/3823de44a... Here's the core sound repo (licensed under BSD) with some examples for getting started: https://github.com/mike-bourgeous/mb-sound https://github.com/mike-bourgeous/mb-sound I don't plan on making the visualizations available, in part because the system is too convoluted and they probably only work in my specific environment.
- Lichtso 5y agoYou are right, let me rephrase it: You would loose half of the remaining potential to encode entropy. Of course, if you start with a real valued signal, then you already lost that before even getting to the transform part. Or in other words you have to transform a signal twice as long as it needs to be, because half of it is mirrored and then discarded (I assume).
- omegalulw 5y agoThe goal is to produce real valued noise - you won't get that if the spectrum is not mirrored.
- ssfrr 5y agoThe goal is to generate a random spectrum that corresponds to a real-valued signal. If the positive and negative frequencies aren’t conjugate-symmetric then the resulting signal after the IDFT will be complex-valued. You can think of it in terms of degrees of freedom. A real-valued length-N signal has N degrees of freedom. A length-N spectrum is complex-valued, meaning 2 degrees of freedom per frequency bin. When you constrain it to be conjugate-symmetric you bring the degrees of freedom back to N, which matches the real-valued signal.