4 ms·
Two things which seem to be overlooked here: - When working with frequencies alone and ignoring the phases you kill half of the entropy of the signal. - Furth
by Lichtso 5y ago
Two things which seem to be overlooked here:
- When working with frequencies alone and ignoring the phases you kill half of the entropy of the signal.
- Further more, when only the positive half of the frequencies is used and the negative half is mirrored with the complex conjugate, you kill half of the remaining entropy of the signal.
- sdenton4 5y agoTo add a DIFFERENT point on handling phase: Overlap-add STFT actually has phase dependencies between adjacent patches. So generating independent random phase in frequency space tends to produce incompatible phase in adjacent patches. In audio the audio domain, this leads to audible distortion. What's (often) used in the audio domain is Griffin-Lim, in which you apply the ISTFT and STFT repeatedly to 'smooth out' the phase inconsistencies. It typically takes a long time to converge and is still not quite right. The main alternatives for audio are the new neural vocoders. But they are expensive to train, and it's not terribly clear to me that it's any better than using an existing blue noise algorithm for this specific problem.
- anon_123g987 5y agoYour 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.
- 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.
- ssfrr 5y agoThe author is sampling random magnitude and also random phase for each frequency bin, so I don’t think anything is missed here.
- dahart 5y ago> When working with frequencies alone and ignoring the phases you kill half the entropy of the signal. That’s true, but why do you think this is happening in this post?